/* 无障碍（官网 / 与残疾人端 /case/ 共用，配 /a11y.js；<html> 上的开关属性由 /theme-boot.js 首帧写入，之后由 a11y.js 与 shared/textSize.ts 维护）：
     data-large-text（大字）与 data-large-text="xl"（特大）、data-contrast="high"（高对比）、data-simple（简化模式）、data-voice-in / data-voice-out（话筒、喇叭）。
   颜色只用页面自己的变量（官网 --paper/--ink…，应用 --bg/--text…），没有的退到括号里的默认值；高对比只改变量，所以深色模式仍然可以叠加（深色 + 高对比 = 黑底白字）。
   选择器故意写得比 tokens.css / dark.css 高一级（:root 叠写），不依赖载入顺序。说明见 docs/HOMEPAGE_FIRST_SCREEN_2026-10-18.md。 */

/* ---------- 面板 ---------- */
.qd-a11y { --qd-fs: 17px; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 28px; background: var(--card, var(--surface, #fff)); color: var(--ink, var(--text, #141c17)); box-shadow: 0 30px 80px -20px rgba(10, 20, 14, .45); font: var(--qd-fs)/1.6 var(--sans, var(--font, system-ui, sans-serif)); overflow: auto; overscroll-behavior: contain; }
.qd-a11y::backdrop { background: rgba(10, 18, 13, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.qd-a11y[open] { animation: qd-pop .38s cubic-bezier(.16, 1, .3, 1); }
@keyframes qd-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.qd-a11y-in { position: relative; padding: 32px 28px 22px; }
.qd-a11y h2 { margin: 0; font-size: calc(var(--qd-fs) * 1.7); line-height: 1.2; font-weight: 700; letter-spacing: .02em; }
.qd-a11y h2:focus { outline: none; }
.qd-a11y-lead { margin: 10px 0 0; font-size: calc(var(--qd-fs) - 1px); color: var(--ink-2, var(--text-2, #48534c)); }
.qd-a11y-close { position: absolute; top: 14px; right: 14px; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--ink-2, var(--text-2, #48534c)); cursor: pointer; }
.qd-a11y-close:hover { background: var(--paper-2, var(--bg-muted, #eee)); color: var(--ink, var(--text, #000)); }
.qd-ico { display: inline-grid; place-items: center; line-height: 0; }
.qd-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qd-rows { display: grid; margin: 18px 0 0; padding: 0; list-style: none; }
.qd-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 14px 0; border-top: 1px solid var(--line, var(--border, rgba(0, 0, 0, .1))); }
.qd-row:first-child { border-top: 0; }
.qd-row-text { display: grid; gap: 2px; min-width: 0; }
.qd-row-text b { font-size: calc(var(--qd-fs) + 1px); font-weight: 650; }
.qd-row-text small { font-size: calc(var(--qd-fs) - 2px); line-height: 1.55; color: var(--ink-2, var(--text-2, #48534c)); }
.qd-row.off { opacity: .85; }
.qd-row.off .qd-row-text b::after { content: '（当前浏览器不支持）'; margin-left: 6px; font-size: calc(var(--qd-fs) - 3px); font-weight: 400; color: var(--ink-3, var(--text-3, #6b766f)); }
.qd-switch { position: relative; flex: none; width: 56px; height: 34px; padding: 0; border: 0; border-radius: 999px; background: var(--ink-3, var(--gray-400, #8c998b)); cursor: pointer; transition: background-color .2s; }
.qd-switch .qd-knob { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.qd-switch[aria-checked="true"] { background: var(--green, var(--primary, #245c40)); }
.qd-switch[aria-checked="true"] .qd-knob { transform: translateX(22px); }
.qd-seg { flex: none; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2, var(--bg-muted, #eee)); }
.qd-seg button { min-width: 56px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--ink-2, var(--text-2, #48534c)); font: inherit; font-size: calc(var(--qd-fs) - 1px); cursor: pointer; }
.qd-seg button[aria-checked="true"] { background: var(--green, var(--primary, #245c40)); color: var(--on-green, var(--on-primary, #fff)); font-weight: 600; }
.qd-link { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2, var(--border-strong, rgba(0, 0, 0, .2))); border-radius: 999px; color: var(--green-ink, var(--primary-text, #1f5238)); font-size: calc(var(--qd-fs) - 1px); font-weight: 600; text-decoration: none; }
.qd-link:hover { background: var(--mint, var(--primary-soft, #e2eee5)); }
.qd-a11y-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 18px; border-top: 1px solid var(--line, var(--border, rgba(0, 0, 0, .1))); }
.qd-ghost, .qd-done { min-height: 50px; padding: 0 22px; border-radius: 999px; font: inherit; font-size: calc(var(--qd-fs) + 1px); cursor: pointer; }
.qd-ghost { border: 1px solid var(--line-2, var(--border-strong, rgba(0, 0, 0, .2))); background: none; color: var(--ink-2, var(--text-2, #48534c)); }
.qd-ghost:hover { background: var(--paper-2, var(--bg-muted, #eee)); }
.qd-done { flex: 1; max-width: 220px; border: 0; background: var(--green, var(--primary, #245c40)); color: var(--on-green, var(--on-primary, #fff)); font-weight: 650; }
.qd-done:hover { background: var(--green-hover, var(--primary-hover, #1b4a33)); }
.qd-a11y :focus-visible { outline: 3px solid var(--green, var(--focus, #245c40)); outline-offset: 2px; }
:root[data-large-text] .qd-a11y { --qd-fs: 19px; }
:root[data-large-text="xl"] .qd-a11y { --qd-fs: 22px; }
@media (max-width: 640px) {
  .qd-a11y { width: 100vw; max-width: none; margin: auto 0 0; border-radius: 28px 28px 0 0; }
  .qd-a11y-in { padding: 28px 20px calc(16px + env(safe-area-inset-bottom)); }
  .qd-row { flex-wrap: wrap; }
  .qd-row-text { flex: 1 1 60%; }
}
@media (prefers-reduced-motion: reduce) { .qd-a11y[open] { animation: none; } .qd-switch, .qd-switch .qd-knob { transition: none; } }

/* ---------- 输入框旁的话筒与喇叭（a11y.js 加的）：设置里打开了才显示 ---------- */
.qd-vt { display: none; align-items: center; gap: 6px; }
:root[data-voice-in] .qd-vt .qd-mic, :root[data-voice-out] .qd-vt .qd-spk { display: inline-grid; }
:root[data-voice-in] .qd-vt, :root[data-voice-out] .qd-vt { display: inline-flex; }
.qd-vt-btn { place-items: center; display: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-2, var(--border-strong, rgba(0, 0, 0, .2))); border-radius: 999px; background: var(--card, var(--surface, #fff)); color: var(--green-ink, var(--primary-text, #1f5238)); cursor: pointer; transition: background-color .15s, color .15s; }
.qd-vt-btn:hover { background: var(--mint, var(--primary-soft, #e2eee5)); }
.qd-vt-btn[aria-pressed="true"] { background: var(--green, var(--primary, #245c40)); color: var(--on-green, var(--on-primary, #fff)); border-color: transparent; }
.qd-vt-btn[aria-pressed="true"].qd-mic { animation: qd-listen 1.2s ease-in-out infinite; }
@keyframes qd-listen { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--green, var(--primary, #245c40)) 22%, transparent); } }
.qd-vt-btn .qd-ico svg { width: 20px; height: 20px; }
.qd-vt-host { position: relative; }
.qd-vt-corner { position: absolute; top: -9px; right: 0; }
.qd-vt-corner .qd-vt-btn { width: 36px; height: 36px; }
@media (prefers-reduced-motion: reduce) { .qd-vt-btn[aria-pressed="true"].qd-mic { animation: none; } }
.qd-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 2000; width: max-content; max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 16px; background: var(--ink, var(--text, #141c17)); color: var(--paper, var(--bg, #fff)); font-size: 16px; line-height: 1.55; box-shadow: 0 12px 40px -10px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .2s, transform .2s; }
.qd-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 简化模式：只显示必填项（a11y.js 给写着“选填”的字段、折叠、分组打 data-optional） ---------- */
:root[data-simple] [data-optional] { display: none !important; }
:root[data-simple] .hp-hero-media { display: none; }

/* ---------- 特大字（data-large-text="xl"）：在“大字”那一档上再放大一档。大字一档的规则在 styles/type.css、dpf-ui-case.css，这里只补特大。 ---------- */
:root:root:root[data-large-text="xl"] {
  --t-body: 22px; --t-sec: 21px; --t-aux: 19px; --t-meta: 17px; --t-h: 25px;
  --fs-xs: 14px; --fs-sm: 16px; --fs-md: 18px; --fs-lg: 20px; --fs-xl: 23px; --fs-2xl: 28px; --fs-3xl: 34px;
  --a-body: 23px; --a-sec: 21px; --a-label: 18px; --a-title: 30px; --a-h3: 25px; --a-btn-h: 68px; --a-btn-fs: 22px; --a-row-h: 72px;
}
:root:root:root[data-large-text="xl"] :is(.card .input, .card .btn, .field > span, .auth-field input, .auth-cc, .auth-submit, .auth-send, .auth-note) { font-size: 20px; }
:root:root:root[data-large-text="xl"] .auth h1 { font-size: 32px; }
:root:root:root[data-large-text="xl"] .auth-field { height: 60px; }
:root:root:root[data-large-text="xl"] .auth-submit { height: 58px; }
:root:root:root[data-large-text="xl"] .app .composer textarea { font-size: 22px; }

/* ---------- 高对比（黑白）：只换变量。浅色 = 白底黑字黑边框，深色 = 黑底白字白边框；主按钮是黑（白）底反色字；链接加下划线；焦点环加粗。 ---------- */
:root:root:root:root[data-contrast="high"] {
  /* 应用（tokens.css） */
  --gray-0: #fff; --gray-25: #fff; --gray-50: #fff; --gray-100: #f0f0f0; --gray-150: #e0e0e0; --gray-200: #000; --gray-300: #000;
  --gray-400: #4d4d4d; --gray-500: #262626; --gray-600: #1a1a1a; --gray-700: #000; --gray-800: #000; --gray-900: #000;
  --brand-50: #fff; --brand-100: #ededed; --brand-200: #d4d4d4; --brand-300: #bdbdbd; --brand-400: #595959; --brand-500: #000; --brand-600: #000; --brand-700: #000; --brand-800: #000; --brand-900: #000;
  --rail: #000; --rail-hover: #1a1a1a; --rail-active: #333; --rail-text: #fff;
  --success: #005a1f; --success-bg: #fff; --success-line: #005a1f;
  --warning: #7a3e00; --warning-bg: #fff; --warning-line: #7a3e00;
  --danger: #a30000; --danger-bg: #fff; --danger-line: #a30000;
  --info: #0030a0; --info-bg: #fff; --info-line: #0030a0;
  --surface: #fff; --on-primary: #fff; --on-danger: #fff; --bg-clear: rgba(255, 255, 255, 0);
  --focus: #000; --ring: 0 0 0 3px #000; --hc-fg: #000; --hc-bg: #fff;
  --shadow-xs: none; --shadow-sm: none; --shadow-md: none; --shadow-lg: none; --shadow-float: none; --hairline: 1px solid #000; --hairline-strong: 2px solid #000;
  --scrim: rgba(0, 0, 0, .75);
  /* 官网（homepage/styles.css） */
  --paper: #fff; --paper-2: #f0f0f0; --card: #fff; --card-glass: rgba(255, 255, 255, .97);
  --ink: #000; --ink-2: #000; --ink-3: #262626; --line: #000; --line-2: #000;
  --green: #000; --green-hover: #333; --green-ink: #000; --on-green: #fff; --mint: #e6e6e6; --mint-2: #cfcfcf;
  --deep: #000; --deep-2: #000; --deep-ink: #fff; --deep-ink-2: #fff; --deep-line: #fff;
  --mark-bg: #000; --mark-fg: #fff; --mark-wave: #fff; --product-tile: #fff;
  --shadow: none;
  color-scheme: light;
}
:root:root:root:root[data-contrast="high"][data-scheme="dark"] {
  --gray-0: #000; --gray-25: #000; --gray-50: #000; --gray-100: #1a1a1a; --gray-150: #2b2b2b; --gray-200: #fff; --gray-300: #fff;
  --gray-400: #c4c4c4; --gray-500: #e0e0e0; --gray-600: #f0f0f0; --gray-700: #fff; --gray-800: #fff; --gray-900: #fff;
  --brand-50: #000; --brand-100: #1f1f1f; --brand-200: #333; --brand-300: #4d4d4d; --brand-400: #c4c4c4; --brand-500: #fff; --brand-600: #fff; --brand-700: #fff; --brand-800: #fff; --brand-900: #fff;
  --rail: #000; --rail-hover: #1a1a1a; --rail-active: #333; --rail-text: #fff;
  --success: #7ee8a0; --success-bg: #000; --success-line: #7ee8a0;
  --warning: #ffcc66; --warning-bg: #000; --warning-line: #ffcc66;
  --danger: #ff9a94; --danger-bg: #000; --danger-line: #ff9a94;
  --info: #9cc4ff; --info-bg: #000; --info-line: #9cc4ff;
  --surface: #000; --on-primary: #000; --on-danger: #000; --bg-clear: rgba(0, 0, 0, 0);
  --focus: #fff; --ring: 0 0 0 3px #fff; --hc-fg: #fff; --hc-bg: #000;
  --hairline: 1px solid #fff; --hairline-strong: 2px solid #fff;
  --scrim: rgba(0, 0, 0, .85);
  --paper: #000; --paper-2: #1a1a1a; --card: #000; --card-glass: rgba(0, 0, 0, .97);
  --ink: #fff; --ink-2: #fff; --ink-3: #e0e0e0; --line: #fff; --line-2: #fff;
  --green: #fff; --green-hover: #d9d9d9; --green-ink: #fff; --on-green: #000; --mint: #262626; --mint-2: #3a3a3a;
  --deep: #000; --deep-2: #000; --deep-ink: #fff; --deep-ink-2: #fff; --deep-line: #fff;
  --mark-bg: #fff; --mark-fg: #000; --mark-wave: #000; --product-tile: #000;
  color-scheme: dark;
}
:root:root[data-contrast="high"] body { background: var(--hc-bg); color: var(--hc-fg); }
:root:root[data-contrast="high"] :focus-visible { outline: 3px solid var(--hc-fg); outline-offset: 3px; }
:root:root[data-contrast="high"] :is(p, li, small, span, label, td) a:not([class]), :root:root[data-contrast="high"] .site-footer a { text-decoration: underline; text-underline-offset: 3px; }
/* 靠阴影、底色分层的卡片与输入框：补一圈实线边框 */
:root:root[data-contrast="high"] :is(.card, .hp-card, .hp-ask, .hp-entry, .hp-login-dialog, .qd-a11y, .auth-field, .input, textarea, select, .dpf-row, .agree-sheet, .hp-result, .hp-window) { border: 2px solid var(--hc-fg); box-shadow: none; }
:root:root[data-contrast="high"] .hp-ask textarea { border: 0; }
:root:root[data-contrast="high"] .qd-a11y-in, :root:root[data-contrast="high"] .hp-login-in { border: 0; }
:root:root[data-contrast="high"] img { filter: grayscale(1) contrast(1.15); }
:root:root[data-contrast="high"] .qd-switch { background: var(--hc-bg); border: 3px solid var(--hc-fg); }
:root:root[data-contrast="high"] .qd-switch .qd-knob { top: 1px; left: 1px; background: var(--hc-fg); box-shadow: none; }
:root:root[data-contrast="high"] .qd-switch[aria-checked="true"] { background: var(--hc-fg); }
:root:root[data-contrast="high"] .qd-switch[aria-checked="true"] .qd-knob { background: var(--hc-bg); transform: translateX(22px); }
:root:root[data-contrast="high"] .qd-seg { background: none; border: 2px solid var(--hc-fg); }
