/* ==========================================================================
   视康 · 在线视力测试平台 —— 设计系统
   浅色 / 深色双主题 · 移动优先 · 无障碍友好
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --primary-h: 203; --primary-s: 63%; --primary-l: 47%;
  --accent-h: 160;  --accent-s: 58%;  --accent-l: 40%;

  --primary:        hsl(var(--primary-h) var(--primary-s) var(--primary-l));
  --primary-hover:  hsl(var(--primary-h) var(--primary-s) 41%);
  --primary-soft:   hsl(var(--primary-h) var(--primary-s) 47% / .10);
  --primary-softer: hsl(var(--primary-h) var(--primary-s) 47% / .055);
  --primary-ink:    hsl(var(--primary-h) 70% 28%);
  --on-primary:     #fff;

  --accent:         hsl(var(--accent-h) var(--accent-s) var(--accent-l));
  --accent-soft:    hsl(var(--accent-h) var(--accent-s) 45% / .12);

  --danger:         hsl(0 78% 52%);
  --danger-soft:    hsl(0 78% 52% / .10);
  --warn:           hsl(35 92% 45%);
  --warn-soft:      hsl(35 92% 45% / .12);
  --info:           hsl(210 85% 48%);

  --bg:             hsl(205 46% 97%);
  --bg-grad-a:      hsl(205 60% 95%);
  --bg-grad-b:      hsl(var(--primary-h) 62% 92%);
  --surface:        #fff;
  --surface-2:      hsl(205 40% 98.5%);
  --surface-3:      hsl(205 36% 96%);
  --ink:            hsl(205 52% 13%);
  --ink-2:          hsl(205 26% 32%);
  --muted:          hsl(205 18% 48%);
  --border:         hsl(205 30% 88%);
  --border-strong:  hsl(205 26% 78%);
  --ring:           hsl(var(--primary-h) var(--primary-s) 47% / .30);

  --shadow-xs: 0 1px 2px hsl(205 40% 20% / .05);
  --shadow-sm: 0 2px 8px hsl(205 40% 20% / .07);
  --shadow-md: 0 6px 20px hsl(205 40% 20% / .09);
  --shadow-lg: 0 18px 48px hsl(205 40% 22% / .14);
  --shadow-glow: 0 8px 28px hsl(var(--primary-h) var(--primary-s) 47% / .26);

  --r-xs: 6px; --r-sm: 9px; --r-md: 13px; --r-lg: 18px; --r-xl: 26px; --r-full: 999px;

  --ff: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --ff-num: "SF Mono", "JetBrains Mono", "Cascadia Mono", ui-monospace, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .22s;

  --topbar-h: 60px;
  --maxw: 1180px;
}

html[data-theme="dark"] {
  --primary:        hsl(var(--primary-h) var(--primary-s) 62%);
  --primary-hover:  hsl(var(--primary-h) var(--primary-s) 70%);
  --primary-soft:   hsl(var(--primary-h) var(--primary-s) 62% / .16);
  --primary-softer: hsl(var(--primary-h) var(--primary-s) 62% / .08);
  --primary-ink:    hsl(var(--primary-h) 80% 78%);
  --accent:         hsl(var(--accent-h) var(--accent-s) 55%);
  --accent-soft:    hsl(var(--accent-h) var(--accent-s) 55% / .16);
  --danger:         hsl(0 82% 66%);
  --danger-soft:    hsl(0 82% 66% / .15);
  --warn:           hsl(38 92% 60%);
  --warn-soft:      hsl(38 92% 60% / .15);

  --bg:             hsl(205 48% 6%);
  --bg-grad-a:      hsl(205 50% 9%);
  --bg-grad-b:      hsl(var(--primary-h) 60% 13%);
  --surface:        hsl(205 42% 10.5%);
  --surface-2:      hsl(205 40% 13%);
  --surface-3:      hsl(205 38% 16%);
  --ink:            hsl(205 40% 95%);
  --ink-2:          hsl(205 28% 80%);
  --muted:          hsl(205 20% 64%);
  --border:         hsl(205 32% 20%);
  --border-strong:  hsl(205 30% 30%);
  --ring:           hsl(var(--primary-h) var(--primary-s) 62% / .40);

  --shadow-xs: 0 1px 2px #0004;
  --shadow-sm: 0 2px 10px #0006;
  --shadow-md: 0 8px 26px #0007;
  --shadow-lg: 0 20px 56px #000a;
  --shadow-glow: 0 8px 30px hsl(var(--primary-h) var(--primary-s) 62% / .30);
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--ff);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 12% -12%, var(--bg-grad-b) 0%, transparent 62%),
    radial-gradient(900px 520px at 100% 0%, var(--bg-grad-a) 0%, transparent 58%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: clamp(28px, 4.6vw, 46px); letter-spacing: -.028em; }
h2 { font-size: clamp(21px, 2.8vw, 29px); letter-spacing: -.02em; }
h3 { font-size: 17px; }
p  { margin: 0; }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
ul, ol { margin: 0; padding-left: 1.25em; }

::selection { background: var(--primary-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* 数字等宽 */
.num, .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--ff-num); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* ---------- 3. 布局 ---------- */
.app-root { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
.page { flex: 1; padding: 28px 0 80px; animation: pageIn .34s var(--ease-out); }
.page-narrow { max-width: 760px; margin: 0 auto; }

@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.stack   { display: flex; flex-direction: column; }
.stack-2 { gap: 8px; }  .stack-3 { gap: 12px; } .stack-4 { gap: 16px; }
.stack-5 { gap: 22px; } .stack-6 { gap: 30px; } .stack-8 { gap: 44px; }
.row     { display: flex; align-items: center; }
.row-2   { gap: 8px; }  .row-3 { gap: 12px; } .row-4 { gap: 16px; } .row-6 { gap: 24px; }
.row-wrap{ flex-wrap: wrap; }
.between { justify-content: space-between; }
.center  { justify-content: center; }
.end     { justify-content: flex-end; }
.items-start { align-items: flex-start; }
.items-end   { align-items: flex-end; }
.grow    { flex: 1; min-width: 0; }
.text-center { text-align: center; }
.hidden  { display: none !important; }
.mt-2{margin-top:8px} .mt-3{margin-top:12px} .mt-4{margin-top:16px} .mt-5{margin-top:22px} .mt-6{margin-top:30px} .mt-8{margin-top:44px}
.mb-2{margin-bottom:8px} .mb-3{margin-bottom:12px} .mb-4{margin-bottom:16px} .mb-6{margin-bottom:30px}
.full { width: 100%; }

/* ---------- 4. 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--primary), hsl(var(--primary-h) var(--primary-s) 62%));
  display: grid; place-items: center;
  box-shadow: var(--shadow-glow);
}
.logo-mark svg { width: 19px; height: 19px; }
.logo-text small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: .06em; line-height: 1; }

.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav a {
  padding: 7px 13px; border-radius: var(--r-sm); font-size: 14.5px; font-weight: 500;
  color: var(--ink-2); transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav a:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 650; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent;
  color: var(--ink-2); cursor: pointer; transition: all var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.avatar {
  width: 34px; height: 34px; border-radius: var(--r-full); flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: 2px solid var(--surface); box-shadow: var(--shadow-xs);
}

.user-menu { position: relative; }
.user-menu-btn { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: all var(--dur) var(--ease); }
.user-menu-btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.user-menu-btn span { font-size: 13.5px; font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; z-index: 80;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 6px; animation: dropIn .16s var(--ease-out);
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border: none; background: none; border-radius: var(--r-sm);
  font-size: 14px; color: var(--ink-2); cursor: pointer; transition: background var(--dur) var(--ease);
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.dropdown .danger { color: var(--danger); }
.dropdown .danger:hover { background: var(--danger-soft); color: var(--danger); }
.dropdown hr { border: none; border-top: 1px solid var(--border); margin: 5px 8px; }
.dropdown .dd-head { padding: 9px 11px 7px; }
.dropdown .dd-head strong { display: block; font-size: 14px; }
.dropdown .dd-head small { color: var(--muted); font-size: 12px; }

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-md); border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; line-height: 1.2; cursor: pointer;
  transition: all var(--dur) var(--ease); white-space: nowrap; user-select: none;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-glow); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 10px 32px hsl(var(--primary-h) var(--primary-s) 47% / .34); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 24px hsl(var(--accent-h) var(--accent-s) 40% / .28); }
.btn-accent:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }

.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-softer); }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-unavailable { opacity: .6; border-style: dashed; }
.btn-unavailable .badge { font-size: 10.5px; padding: 1px 6px; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }

.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: hsl(0 78% 52% / .25); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }

.btn-lg { padding: 13px 26px; font-size: 16px; border-radius: var(--r-lg); }
.btn-sm { padding: 7px 13px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn-xs { padding: 6px 11px; font-size: 12.5px; border-radius: var(--r-xs); min-width: 34px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.btn-block { width: 100%; }

/* ---------- 6. 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-pad { padding: 22px; }
.card-pad-lg { padding: 28px; }
.card-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 22px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.card-head h3 { font-size: 15.5px; }
.card-body { padding: 22px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
.card-hover { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-accent { border-color: hsl(var(--primary-h) var(--primary-s) 47% / .35); box-shadow: 0 4px 18px hsl(var(--primary-h) var(--primary-s) 47% / .12); }

.glass {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
}

/* ---------- 7. 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.label .req { color: var(--danger); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.err  { font-size: 12.5px; color: var(--danger); }

.input, .select, textarea.input {
  width: 100%; padding: 10px 13px; border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 14.5px; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder { color: var(--muted); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring);
}
.input:disabled, .select:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7f92' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  padding-right: 34px;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 40px; }
.input-group .ig-icon { position: absolute; left: 13px; color: var(--muted); pointer-events: none; display: grid; place-items: center; }
.input-group .ig-icon svg { width: 17px; height: 17px; }
.input-group .ig-action { position: absolute; right: 6px; }
.password-toggle { position: absolute; right: 6px; width: 30px; height: 30px; display: grid; place-items: center; border: none; background: none; color: var(--muted); cursor: pointer; border-radius: var(--r-xs); }
.password-toggle:hover { color: var(--ink); background: var(--surface-3); }

.check {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  font-size: 14px; color: var(--ink-2); user-select: none;
  padding: 5px 0; min-height: 30px;
}
/* 复选框：原生控件放大到 22px 并用 accent-color，保持系统可访问性 */
.check input {
  width: 22px; height: 22px; margin: 0; flex: none; cursor: pointer;
  accent-color: var(--primary);
  /* 扩大命中区域而不改变视觉布局 */
  position: relative;
}
.check input[type="radio"] { border-radius: var(--r-full); }
@media (max-width: 760px) {
  .check { padding: 9px 0; min-height: 44px; align-items: center; }
  .check input { width: 24px; height: 24px; }
}

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--border-strong); border-radius: var(--r-full); transition: background var(--dur) var(--ease); cursor: pointer; }
.switch .track::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform var(--dur) var(--ease); box-shadow: var(--shadow-xs); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--ring); }

/* 分段选择器 */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--r-md); border: 1px solid var(--border); }
.segmented button {
  padding: 7px 15px; border: none; background: none; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow-xs); }
.segmented-wrap { display: flex; flex-wrap: wrap; }

/* 选项卡片 */
.opt-grid { display: grid; gap: 12px; }
.opt-card {
  position: relative;
  display: flex; gap: 13px; align-items: flex-start; padding: 15px 17px;
  border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  cursor: pointer; transition: all var(--dur) var(--ease); text-align: left; width: 100%;
}
.opt-card:hover { border-color: var(--primary); background: var(--primary-softer); }
.opt-card[aria-pressed="true"], .opt-card.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--ring); }
/* 选中态再加一个角标勾：光靠浅色底 + 描边，在手机上很难一眼分辨 */
.opt-card.sel::after, .opt-card[aria-pressed="true"]::after {
  content: '✓'; position: absolute; top: 9px; right: 11px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
  box-shadow: 0 2px 6px hsl(var(--primary-h) 60% 40% / .35);
}
.opt-card .opt-ico { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); flex: none; }
.opt-card .opt-ico svg { width: 20px; height: 20px; }
.opt-card .opt-ico-glyph { font-size: 14px; font-weight: 750; letter-spacing: .4px; font-family: inherit; }
.opt-card h4 { margin: 0 0 3px; font-size: 14.5px; font-weight: 650; }
.opt-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ---------- 8. 徽章 / 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 650; line-height: 1.7; white-space: nowrap;
  background: var(--surface-3); color: var(--muted);
}
.badge-primary { background: var(--primary-soft); color: var(--primary-ink); }
.badge-accent  { background: var(--accent-soft);  color: var(--accent); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-warn    { background: var(--warn-soft);    color: var(--warn); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; color: var(--ink-2); cursor: pointer; transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--primary); color: var(--primary-ink); }
.chip.sel { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }

/* ---------- 9. Hero ---------- */
.hero { position: relative; padding: 46px 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -45% -25% -25% -25%;
  background:
    radial-gradient(48% 52% at 20% 45%, hsl(var(--primary-h) var(--primary-s) 60% / .24), transparent 72%),
    radial-gradient(44% 48% at 80% 38%, hsl(var(--accent-h) var(--accent-s) 52% / .20), transparent 70%);
  pointer-events: none; z-index: 0;
}
html[data-theme="dark"] .hero::before {
  background:
    radial-gradient(46% 42% at 22% 30%, hsl(var(--primary-h) var(--primary-s) 60% / .24), transparent 68%),
    radial-gradient(42% 40% at 78% 22%, hsl(var(--accent-h) var(--accent-s) 52% / .16), transparent 66%);
}
.hero-inner { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px;
  border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.hero-eyebrow .tag { padding: 2px 8px; border-radius: var(--r-full); background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 18px; font-size: clamp(15px, 1.8vw, 17.5px); color: var(--ink-2); max-width: 56ch; line-height: 1.75; }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }

.hero-visual { position: relative; display: grid; place-items: center; min-height: 260px; }
.hero-e {
  width: 190px; height: 190px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); display: grid; place-items: center;
  animation: floaty 7s ease-in-out infinite;
}
.hero-e svg { width: 118px; height: 118px; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
.hero-chip {
  position: absolute; padding: 8px 14px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 7px;
  animation: floaty 6s ease-in-out infinite;
}
.hero-chip.c1 { top: 16%; left: -2%; animation-delay: -.9s; }
.hero-chip.c2 { bottom: 18%; right: -4%; animation-delay: -2.4s; }
.hero-chip.c3 { bottom: 4%; left: 8%; animation-delay: -4s; }
.hero-chip .v { color: var(--primary-ink); font-family: var(--ff-num); }

.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 34px; } .hero-visual { order: -1; min-height: 220px; } .hero-e { width: 150px; height: 150px; } .hero-e svg { width: 92px; height: 92px; } .hero-chip.c1{left:2%} .hero-chip.c2{right:2%} }

/* ---------- 10. 特性网格 ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }
.feature {
  padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: hsl(var(--primary-h) var(--primary-s) 47% / .4); }
.feature-ico {
  width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-soft), hsl(var(--accent-h) var(--accent-s) 50% / .12));
  color: var(--primary-ink); margin-bottom: 14px;
}
.feature-ico svg { width: 21px; height: 21px; }
.feature h3 { margin-bottom: 6px; }
.feature p { font-size: 13.5px; color: var(--muted); line-height: 1.65; }
.feature .badge { margin-top: 12px; }

/* ---------- 11. 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
@media (min-width: 1080px) {
  /* 报告页主栏宽度较窄，放宽最小列宽让统计卡成行排列 */
  .layout-main .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
.stat {
  padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary); opacity: .8; }
.stat.accent::after { background: var(--accent); }
.stat.warn::after   { background: var(--warn); }
.stat.danger::after { background: var(--danger); }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 750; letter-spacing: -.03em; line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------- 12. 视力大字 ---------- */
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.eye-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; }
/* 报告页：只有一只眼时不要把卡片拉成一整条横幅 */
.report-wrap .eye-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); justify-content: start; }

.eye-card {
  padding: 20px; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--surface); text-align: center; position: relative; overflow: hidden;
}
.eye-card.best { border-color: hsl(var(--accent-h) var(--accent-s) 45% / .45); background: linear-gradient(180deg, var(--accent-soft), transparent 70%); }
.eye-card .eye-name { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.eye-card .eye-va { font-size: 38px; font-weight: 780; letter-spacing: -.035em; line-height: 1.15; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.eye-card .eye-va .u { font-size: 17px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.eye-card .eye-alt { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.eye-card .eye-tag { position: absolute; top: 12px; right: 12px; }

/* ---------- 13. 测试台 ---------- */
.test-shell { max-width: 860px; margin: 0 auto; }
.test-bar {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.test-bar .eye-tag { font-size: 13.5px; font-weight: 700; color: var(--primary-ink); }
.progress { flex: 1; height: 7px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--primary), hsl(var(--primary-h) var(--primary-s) 62%)); transition: width .4s var(--ease-out); }
.test-meta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.stage {
  position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-md); display: grid; place-items: center;
  min-height: 380px; padding: 40px 20px; overflow: hidden;
}
html[data-theme="dark"] .stage { background: #f7fafc; }
.stage-inner { display: grid; place-items: center; width: 100%; }
.e-optotype, .opt-svg { display: block; color: var(--ink); filter: drop-shadow(0 2px 6px rgb(0 0 0 / .10)); animation: eIn .32s var(--ease-out); }
@keyframes eIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.stage-hint { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: 12.5px; color: var(--muted); padding: 0 16px; }

.dpad { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 58px); gap: 7px; justify-content: center; }
.dpad button {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-md);
  cursor: pointer; display: grid; place-items: center; color: var(--ink-2);
  transition: all .12s var(--ease); box-shadow: var(--shadow-xs);
}
.dpad button:active, .dpad button.hit { background: var(--primary); color: #fff; transform: scale(.94); border-color: var(--primary); }
.dpad button svg { width: 22px; height: 22px; }
.dpad .dpad-up    { grid-area: 1 / 2; }
.dpad .dpad-left  { grid-area: 2 / 1; }
.dpad .dpad-mid   { grid-area: 2 / 2; font-size: 11px; font-weight: 700; color: var(--muted); }
.dpad .dpad-cant {
  grid-area: 2 / 2; font-size: 11.5px; font-weight: 700; line-height: 1.2;
  background: var(--primary-soft); border-color: hsl(var(--primary-h) 55% 60% / .5);
  color: var(--primary-ink);
}
.dpad .dpad-cant:active { background: var(--primary); color: #fff; }
.dpad .dpad-right { grid-area: 2 / 3; }
.dpad .dpad-down  { grid-area: 3 / 2; }
/* 斜向 4 键：Landolt C 8 朝向时才渲染，E 字视标仍是十字形 4 键 */
.dpad .dpad-ul { grid-area: 1 / 1; }
.dpad .dpad-ur { grid-area: 1 / 3; }
.dpad .dpad-dl { grid-area: 3 / 1; }
.dpad .dpad-dr { grid-area: 3 / 3; }

/* --- 色觉检查盘 --- */
.plate-wrap { display: grid; place-items: center; }
.plate-svg { width: 100%; max-width: 460px; height: auto; border-radius: 10px; box-shadow: var(--shadow-sm); }
.plate-input { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: 3px; }
.plate-mini { display: grid; gap: 6px; justify-items: center; }
.plate-mini-sw {
  width: 84px; height: 60px; border-radius: 8px; display: grid; place-items: center;
  font-size: 26px; font-weight: 800; font-family: "Helvetica Neue", Arial, sans-serif;
  box-shadow: var(--shadow-xs);
}
.plate-mini small { color: var(--muted); font-size: 11.5px; }

/* --- 对比敏感度阶梯 --- */
.cs-meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-bottom: 22px; }
.cs-meter-fill { height: 100%; background: linear-gradient(90deg, var(--muted), var(--primary)); transition: width .3s var(--ease); }
.cs-letters { display: flex; gap: 26px; justify-content: center; padding: 18px 0 6px; }
.cs-letter { font-family: "Helvetica Neue", Arial, sans-serif; font-size: 64px; font-weight: 700; line-height: 1; }
.cs-input { text-align: center; font-size: 24px; font-weight: 700; letter-spacing: 8px; text-transform: uppercase; }
.cs-pad { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-top: 10px; }
.cs-pad-btn {
  height: 40px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: border-color .12s var(--ease), background .12s var(--ease), transform .1s var(--ease);
}
.cs-pad-btn:hover { border-color: var(--primary); background: var(--primary-softer); }
.cs-pad-btn:active { transform: scale(.92); background: var(--primary); color: #fff; }
.cs-trace { display: flex; align-items: flex-end; gap: 5px; height: 90px; padding-top: 6px; }
.cs-trace-bar { flex: 1; border-radius: 3px 3px 0 0; background: var(--muted); min-height: 4px; }
.cs-trace-bar.ok { background: var(--primary); }
.cs-trace-bar.bad { background: var(--danger); opacity: .75; }

/* --- 散光扇形图 --- */
.fan-wrap { display: grid; place-items: center; padding: 8px 0; }
.fan-svg { max-width: 100%; height: auto; cursor: crosshair; touch-action: manipulation; }
.fan-svg .fan-lines line { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.fan-svg .fan-lines line.fan-mid { stroke-width: 2.4; }
.fan-svg .fan-lines line.fan-major { stroke-width: 3.4; }
.fan-svg .fan-ring { fill: none; stroke: var(--border); stroke-width: 1.5; }
.fan-svg .fan-hub { fill: var(--border); }
.fan-svg .fan-label { fill: var(--muted); font-size: 12px; font-weight: 600; font-family: inherit; }
.fan-svg .fan-sel { stroke: var(--primary); stroke-width: 5; stroke-linecap: round; }

/* --- 字符型视标作答板（字母 / 数字 / 汉字） --- */
.charpad { display: grid; grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); gap: 8px; max-width: 560px; margin: 0 auto; }
.charpad-btn {
  min-height: 54px; padding: 4px 6px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 21px; font-weight: 650; line-height: 1;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  display: grid; place-items: center;
  transition: border-color .12s var(--ease), background .12s var(--ease), transform .1s var(--ease);
}
.charpad-btn:hover { border-color: var(--primary); background: var(--primary-softer); }
.charpad-btn:active { transform: scale(.93); background: var(--primary); color: #fff; border-color: var(--primary); }
.charpad-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.charpad[data-kind="hanzi"] .charpad-btn { font-size: 24px; }

.test-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.btn-cantsee { border-style: dashed; }

/* 手势识别浮层 */
.gesture-hud {
  position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 9px;
  padding: 8px 13px; border-radius: var(--r-full); background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 650;
}
.gesture-hud .gdot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.gesture-hud.on .gdot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.4s infinite; }
.gesture-hud .gdir { color: var(--primary-ink); }
@keyframes pulse { 50% { opacity: .45; } }

/* 阶段过场 */
.phase-card { text-align: center; padding: 20px 8px; }
.phase-ico { width: 74px; height: 74px; border-radius: var(--r-lg); background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; margin: 0 auto 18px; }
.phase-ico svg { width: 38px; height: 38px; }

/* ---------- 14. 标定卡 ---------- */
.calib-wrap { display: grid; gap: 18px; }
.calib-stage {
  position: relative; background: var(--surface-2); border: 1. dashed var(--border);
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  min-height: 260px; display: grid; place-items: center; padding: 26px; overflow: auto;
}
.calib-card {
  position: relative; border: 2px dashed var(--primary); border-radius: 9px;
  background: var(--primary-softer); display: grid; place-items: center; text-align: center;
  cursor: ew-resize; user-select: none; touch-action: none;
  box-shadow: 0 0 0 1px var(--primary-soft);
}
.calib-card .calib-txt { color: var(--primary-ink); font-size: 13px; font-weight: 600; pointer-events: none; }
.calib-card .calib-sub { color: var(--muted); font-size: 11.5px; pointer-events: none; margin-top: 2px; }
/* 把手：视觉 18px，但命中区域扩大到 32px，触摸设备也好抓 */
.calib-handle { position: absolute; right: -9px; top: 50%; transform: translateY(-50%); width: 18px; height: 46px; border-radius: 5px; background: var(--primary); box-shadow: var(--shadow-sm); display: grid; place-items: center; color: #fff; }
.calib-handle::before { content: ''; position: absolute; left: -7px; right: -7px; top: -8px; bottom: -8px; }
.calib-handle svg { width: 11px; height: 11px; }
.calib-readout { display: flex; gap: 14px; flex-wrap: center; justify-content: center; }
.readout { padding: 10px 16px; border-radius: var(--r-md); background: var(--surface-3); text-align: center; min-width: 118px; }
.readout .r-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.readout .r-value { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.readout .r-value.ok { color: var(--accent); }
.readout .r-value.off { color: var(--warn); }

/* ---------- 15. 图表 ---------- */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid line { stroke: var(--border); stroke-width: 1; }
.chart-axis text { fill: var(--muted); font-size: 11px; font-family: var(--ff); }
.chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { stroke: var(--surface); stroke-width: 2.5; }
.chart-area { opacity: .13; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; }
.chart-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

.tooltip {
  position: absolute; pointer-events: none; z-index: 30;
  background: var(--ink); color: var(--surface); padding: 7px 11px; border-radius: var(--r-sm);
  font-size: 12.5px; box-shadow: var(--shadow-md); white-space: nowrap; transform: translate(-50%, -120%);
  opacity: 0; transition: opacity .12s var(--ease);
}
.tooltip.on { opacity: 1; }

/* ---------- 16. 列表 ---------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 15px 20px;
  border-bottom: 1px solid var(--border); transition: background var(--dur) var(--ease);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface-2); }
.list-item .li-main { flex: 1; min-width: 0; }
.li-title { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.li-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.li-va { text-align: right; flex: none; }
.li-va .v { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.li-va .s { font-size: 11.5px; color: var(--muted); }

/* ---------- 17. 认证页 ---------- */
.auth-page { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-visual {
  position: relative; overflow: hidden; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, hsl(var(--primary-h) var(--primary-s) 45%), hsl(var(--primary-h) 70% 32%) 60%, hsl(var(--accent-h) 60% 30%));
  color: #fff;
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 50% at 20% 15%, #fff3, transparent 60%), radial-gradient(50% 45% at 85% 85%, #fff2, transparent 60%);
}
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual h2 { font-size: 32px; line-height: 1.28; max-width: 14ch; letter-spacing: -.01em; white-space: pre-line; }
.auth-visual p { opacity: .9; font-size: 15px; margin-top: 16px; max-width: 36ch; line-height: 1.8; }
.auth-feats { display: grid; gap: 18px; margin-top: 40px; }
.auth-feat { display: flex; gap: 13px; align-items: flex-start; font-size: 14px; }
.auth-feat .af-ico { width: 30px; height: 30px; border-radius: 9px; background: #ffffff22; display: grid; place-items: center; flex: none; }
.auth-feat .af-ico svg { width: 15px; height: 15px; }
.auth-feat .af-t { font-weight: 600; line-height: 1.4; }
.auth-feat .af-d { font-size: 13px; opacity: .82; margin-top: 3px; line-height: 1.55; }
.auth-foot { font-size: 13px; opacity: .78; }
.auth-panel { display: grid; place-items: center; align-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
/* 移动端顶部品牌条：桌面端隐藏 */
.auth-brandbar { display: none; }
.auth-heading { margin-bottom: 22px; }
.auth-box .field { margin-bottom: 16px; }
.auth-box .field:last-of-type { margin-bottom: 0; }
.auth-tabs { display: flex; gap: 3px; padding: 4px; background: var(--surface-3); border-radius: var(--r-md); margin-bottom: 24px; }
.auth-tabs button {
  flex: 1; padding: 9px; border: none; background: none; border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 650; color: var(--muted); cursor: pointer; transition: all var(--dur) var(--ease);
}
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.auth-title { font-size: 26px; margin-bottom: 8px; letter-spacing: -.01em; }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 0; line-height: 1.6; }
.auth-alt { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 20px; }
.auth-alt a { font-weight: 650; }
.auth-legal { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.6; }
.auth-error { padding: 10px 13px; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-size: 13.5px; margin-bottom: 14px; display: flex; gap: 8px; align-items: flex-start; }
.auth-error svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
/* 移动端：单列 + 顶部品牌条，消除原来的大面积空白 */
@media (max-width: 880px) {
  .auth-page { grid-template-columns: 1fr; min-height: 100vh; display: flex; flex-direction: column; }
  .auth-visual { display: none; }
  .auth-panel { flex: 1; display: flex; flex-direction: column; align-items: stretch; padding: 0; }
  .auth-brandbar {
    display: block;
    padding: 30px 24px 30px;
    color: #fff;
    background: linear-gradient(150deg, hsl(var(--primary-h) var(--primary-s) 45%), hsl(var(--primary-h) 70% 34%) 65%, hsl(var(--accent-h) 60% 32%));
  }
  .auth-brandbar .logo-mark { box-shadow: none; }
  .auth-brandbar-sub { margin-top: 12px; font-size: 13px; opacity: .85; line-height: 1.6; }
  .auth-box { flex: 1; max-width: 100%; padding: 28px 24px 24px; display: flex; flex-direction: column; }
  .auth-box .btn-block { margin-top: auto; }
  .auth-alt { margin-top: 16px; padding-bottom: 8px; }
  .auth-legal { margin-top: 10px; padding-bottom: 24px; }
}

/* ---------- 18. 空状态 / 骨架 ---------- */
.empty { text-align: center; padding: 56px 24px; }
.empty-ico { width: 76px; height: 76px; border-radius: var(--r-xl); background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 18px; color: var(--muted); }
.empty-ico svg { width: 34px; height: 34px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: 14px; max-width: 40ch; margin: 0 auto 20px; }

.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- 19. Toast / Modal ---------- */
.toast-host { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; }
.toast {
  padding: 11px 17px; border-radius: var(--r-md); background: var(--ink); color: var(--surface);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 9px;
  animation: toastIn .26s var(--ease-out); max-width: 90vw;
}
.toast.ok  { background: var(--accent); color: #fff; }
.toast.err { background: var(--danger); color: #fff; }
.toast.warn{ background: var(--warn); color: #fff; }
.toast svg { width: 17px; height: 17px; flex: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }

.modal-host { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: hsl(205 40% 12% / .5); backdrop-filter: blur(4px); animation: fadeIn .18s var(--ease); }
/* [hidden] 必须真正隐藏：.modal-host 的 display:grid 优先级高于 UA 的 [hidden]{display:none} */
.modal-host[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; animation: modalIn .24s var(--ease-out); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-body { padding: 26px; }
.modal-foot { padding: 16px 26px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }
.modal h3 { margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14px; line-height: 1.65; }

/* ---------- 20. 杂项 ---------- */
.divider { height: 1px; background: var(--border); border: none; margin: 0; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

.notice { padding: 13px 16px; border-radius: var(--r-md); font-size: 13.5px; line-height: 1.65; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; }
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.notice-info { background: var(--primary-soft); border-color: hsl(var(--primary-h) var(--primary-s) 47% / .25); color: var(--primary-ink); }
.notice-warn { background: var(--warn-soft); border-color: hsl(35 92% 45% / .25); color: var(--warn); }
.notice-danger { background: var(--danger-soft); border-color: hsl(0 78% 52% / .25); color: var(--danger); }
.notice-ok { background: var(--accent-soft); border-color: hsl(var(--accent-h) var(--accent-s) 45% / .3); color: var(--accent); }

.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 15px; position: relative; padding-bottom: 22px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--border); }
.step:last-child::before { display: none; }
.step-num { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); font-weight: 750; font-size: 14px; z-index: 1; }
.step-body h4 { margin: 3px 0 4px; font-size: 15px; }
.step-body p { font-size: 13.5px; color: var(--muted); line-height: 1.65; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  padding: 10px 16px; border: none; background: none; font-size: 14.5px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--primary-ink); border-bottom-color: var(--primary); }

.footer { border-top: 1px solid var(--border); padding: 26px 0; margin-top: auto; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

.mobile-only { display: none; }
@media (max-width: 760px) {
  .nav { display: none; }
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex; }
  .container { padding: 0 16px; }
  .page { padding: 20px 0 64px; }
  /* 测试台：内容已按一屏适配，底部不留多余空白 */
  .page:has(.test-shell) { padding-bottom: 72px; }
  .card-pad, .card-pad-lg { padding: 18px; }
  .hero { padding: 30px 0 26px; }
  .stage { min-height: 290px; border-radius: var(--r-lg); }
  .list-item { padding: 13px 15px; gap: 11px; }
  .card-head { padding: 14px 16px; }
}

.bottom-nav { display: none; }
@media (max-width: 760px) {
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(14px); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 1px; font-size: 10px; font-weight: 600; color: var(--muted); border-radius: var(--r-sm); }
  .bottom-nav a.active { color: var(--primary-ink); }
  .bottom-nav a svg { width: 20px; height: 20px; }
  .page { padding-bottom: 96px; }
}

/* ==========================================================================
   响应式布局系统（v3）
   目标：桌面端双栏并排、减少纵向长度；移动端紧凑网格、消除横向溢出、
        触控目标 ≥ 44px、关键操作常驻可达。
   ========================================================================== */

/* ---------- 22.1 布局骨架：主栏 + 侧栏 ---------- */
.layout-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
@media (min-width: 1080px) {
  .layout-split { grid-template-columns: minmax(0, 1fr) 336px; gap: 26px; }
  /* 侧栏无内容（如缺少双眼视差/年龄常模数据）时，正文占满整行 */
  .layout-split--single { grid-template-columns: minmax(0, 1fr); }
  .layout-split--single .layout-side { position: static; }
  .layout-split > .layout-main { min-width: 0; }
  .layout-split > .layout-side {
    position: sticky;
    top: calc(var(--topbar-h) + 20px);
    align-self: start;
  }
}

/* 侧栏在移动端排在主栏之后；桌面端可指定 order */
.layout-side { order: 2; }
.layout-main { order: 1; }
@media (min-width: 1080px) {
  .layout-side { order: 0; }
  .layout-main { order: 0; }
}

/* ---------- 22.1b 测试准备：步骤索引 + 内容 + 参数摘要 ----------
   桌面端三栏：左「做到第几步」、中「设置项」、右「这次要测什么」。
   平板/手机降为单栏，步骤索引变成顶部横向标签，摘要落到吸底条。 */
.prep-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.prep-main { min-width: 0; }

/* 步骤索引：窄屏是横向可滑动标签 */
.prep-steps {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 2px 6px; scrollbar-width: none;
}
.prep-steps::-webkit-scrollbar { display: none; }
.prep-step {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 10px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-2); cursor: pointer; text-align: left;
  transition: all var(--dur) var(--ease);
}
.prep-step:hover { border-color: var(--primary); color: var(--primary-ink); }
.prep-step .ps-num {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--surface-3); color: var(--muted);
}
.prep-step .ps-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.prep-step .ps-title { font-size: 13.5px; font-weight: 650; white-space: nowrap; }
.prep-step .ps-sub { font-size: 11px; color: var(--muted); white-space: nowrap; display: none; }
.prep-step.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.prep-step.active .ps-num { background: var(--primary); color: #fff; }
.prep-steps-foot { display: none; }

.prep-subhead { border-left: 3px solid hsl(var(--primary-h) var(--primary-s) 55% / .55); padding-left: 10px; }
.prep-subhead h4 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.prep-subhead p { margin: 3px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); max-width: 74ch; }
.prep-block--divided { border-top: 1px dashed var(--border); margin-top: 20px; padding-top: 18px; }
.prep-pair { display: flex; flex-direction: column; }

.sum-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* 摘要里的长值（如「5.0（1.0）至 3.8（0.06）」）在 320px 侧栏里会挤出两行，
   改成上下排：键在上、值在下，长值自然换行不挤压 */
.prep-side .kv { padding: 7px 0; font-size: 12.5px; }
.prep-side .kv .k { color: var(--muted); }
.prep-side .kv .v { font-size: 12.5px; max-width: 68%; line-height: 1.5; }
/* 校验结论：一行话，替代原来占掉大半个侧栏的提示框 */
.sum-check {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 9px 11px; border-radius: var(--r-md);
  font-size: 12.5px; line-height: 1.55;
}
.sum-check svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.sum-check.ok { background: var(--accent-soft); color: var(--accent); }
.sum-check.warn { background: var(--warn-soft); color: var(--warn); }
.sum-head h3 { margin: 0; }

@media (min-width: 760px) {
  .prep-step { padding: 10px 16px 10px 12px; }
  .prep-step .ps-sub { display: block; }
}

@media (min-width: 1080px) {
  .prep-layout { grid-template-columns: minmax(0, 1fr) 322px; gap: 22px; }
  .prep-steps { grid-column: 1 / -1; grid-row: 1; flex-wrap: nowrap; }
  .prep-main { grid-column: 1; grid-row: 2; }
  .prep-side { grid-column: 2; grid-row: 2; position: sticky; top: calc(var(--topbar-h) + 18px); }
  .prep-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (min-width: 1320px) {
  .prep-layout { grid-template-columns: 204px minmax(0, 1fr) 326px; gap: 24px; }
  .prep-steps {
    grid-column: 1; grid-row: 1 / span 2; display: block;
    position: sticky; top: calc(var(--topbar-h) + 18px);
    overflow: visible; padding: 0;
  }
  .prep-main { grid-column: 2; grid-row: 1; }
  .prep-side { grid-column: 3; grid-row: 1; }
  .prep-step {
    width: 100%; border-radius: var(--r-md); margin-bottom: 8px;
    padding: 11px 12px; align-items: flex-start;
  }
  .prep-step.active { box-shadow: 0 2px 10px hsl(var(--primary-h) var(--primary-s) 47% / .18); }
  .prep-steps-foot {
    display: block; margin-top: 14px; padding: 12px 12px;
    border-radius: var(--r-md); background: var(--surface-2);
    font-size: 12px; color: var(--ink-2); line-height: 1.7;
  }
  .prep-steps-foot .dim { color: var(--muted); }
}

/* ---------- 22.2 紧凑网格：桌面多列，移动端自动降列 ---------- */
.grid-auto {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--col-min, 230px)), 1fr));
}
@media (max-width: 760px) {
  .grid-auto { gap: 10px; }
  /* 移动端统一双列（选项卡、视标卡等），显著缩短页面长度 */
  .grid-auto.cols-2-m { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 步骤卡片在移动端改为紧凑横排 */
@media (max-width: 760px) {
  .opt-card { padding: 12px 13px; gap: 10px; }
  .opt-card .opt-ico { width: 32px; height: 32px; border-radius: 8px; }
  .opt-card .opt-ico svg { width: 17px; height: 17px; }
  .opt-card .opt-ico-glyph { font-size: 12px; }
  .opt-card h4 { font-size: 13.5px; margin-bottom: 2px; }
  .opt-card p { font-size: 12px; line-height: 1.5; }
  .opt-card p.mt-2 { margin-top: 6px !important; }
}

/* ---------- 22.3 折叠区块（详情类内容默认收起） ---------- */
.fold { border-top: 1px solid var(--border); }
.fold-body { display: none; }
.fold.is-open > .fold-body { display: block; }
.fold > .fold-head { border-top: 0; }
.fold-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 0; background: none; border: 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.fold-head .fold-title { font-weight: 650; font-size: 14.5px; }
.fold-head .fold-sub { font-size: 12.5px; color: var(--muted); }
.fold-head .fold-chev { margin-left: auto; transition: transform var(--dur) var(--ease); color: var(--muted); }
.fold[open] .fold-head .fold-chev { transform: rotate(180deg); }
.fold-body { padding-bottom: 14px; }

.page-title { font-size: 30px; font-weight: 800; letter-spacing: -.025em; }
@media (max-width: 760px) { .page-title { font-size: 23px; } }

/* ---------- 22.3b 紧凑选项卡（移动端纵向排布，隐藏次要说明） ---------- */
@media (max-width: 760px) {
  .opt-card--dense { flex-direction: column; gap: 7px; padding: 12px; }
  .opt-card--dense .opt-ico { width: 30px; height: 30px; }
  .opt-card--dense .opt-ico svg { width: 16px; height: 16px; }
  .opt-card--dense .opt-ico-glyph { font-size: 11px; }
  .opt-card--dense h4 { font-size: 13px; line-height: 1.3; }
  .opt-card--dense .oc-desc { font-size: 11.5px; line-height: 1.45; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .opt-card--dense .oc-meta { font-size: 11px; color: var(--primary-ink); margin-top: 5px !important; font-weight: 600; }
  .opt-card--dense .oc-extra { display: none; }
}

/* 移动端摘要卡：隐藏与固定 CTA 重复的开始按钮 */
@media (max-width: 760px) {
  .summary-start { display: none !important; }
  .card-accent .notice { font-size: 12.5px; padding: 11px 13px; }
}

/* ---------- 22.3c 高级选项折叠容器 ---------- */
.adv-box {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 0 18px;
}
.adv-box > .fold-head { padding: 14px 0; }
.adv-box > .fold-body { padding-bottom: 4px; }
.adv-box .fold-body > .stack { gap: 14px; }
.adv-box .card { box-shadow: none; background: var(--surface-2); border-color: var(--border); }
@media (max-width: 760px) {
  .adv-box { padding: 0 14px; }
  .adv-box > .fold-head { padding: 12px 0; }
}

/* ---------- 22.4 特性卡：移动端紧凑双列 ---------- */
@media (max-width: 760px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .feature { padding: 14px; }
  .feature-ico { width: 34px; height: 34px; margin-bottom: 9px; border-radius: 10px; }
  .feature-ico svg { width: 18px; height: 18px; }
  .feature h3 { font-size: 13.5px; margin-bottom: 4px; }
  .feature p { font-size: 12px; line-height: 1.55; }
  .feature .badge { margin-top: 8px; font-size: 11px; padding: 2px 7px; }
}

/* ---------- 22.5 步骤条：桌面两列，移动端压缩 ---------- */
@media (min-width: 1080px) {
  /* 步骤条双列仅用于宽栏；窄侧栏保持单列，避免文字过度折行 */
  .layout-main .steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
  .layout-main .step { padding-bottom: 0; }
  .layout-main .step::before { display: none; }
}
@media (max-width: 760px) {
  .step { gap: 11px; padding-bottom: 14px; }
  .step-num { width: 26px; height: 26px; font-size: 12.5px; }
  .step::before { left: 13px; top: 28px; }
  .step-body h4 { font-size: 13.5px; margin: 1px 0 2px; }
  .step-body p { font-size: 12.5px; line-height: 1.55; }
}

/* ---------- 22.6 首页：最近测试 + 专项检查 并排 ---------- */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
@media (min-width: 1080px) {
  .home-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 26px; }
}

/* 摘要参数：移动端两列，减少纵向长度 */
.kv-grid { display: grid; gap: 0 16px; }
@media (max-width: 760px) {
  .kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .kv-grid .kv { flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 0; }
  .kv-grid .kv .v { text-align: left; font-size: 13px; }
}

/* ---------- 22.7 移动端底部固定操作条（准备页 / 测试页） ---------- */
.sticky-cta {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(66px + env(safe-area-inset-bottom));
  z-index: 68;
  display: none;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
}
@media (max-width: 760px) {
  .sticky-cta { display: flex; }
}
.sticky-cta .cta-info { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.sticky-cta .cta-info b { display: block; color: var(--ink); font-size: 13.5px; font-weight: 700; }
.sticky-cta .btn { flex: none; }

/* ---------- 22.8 触控目标：移动端最小 44×44 ---------- */
@media (max-width: 760px) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .btn-xs { min-height: 36px; padding: 7px 12px; }
  .icon-btn { width: 40px; height: 40px; }
  .chip { min-height: 38px; padding: 8px 13px; }
  .password-toggle { width: 40px; height: 40px; right: 4px; }
  .check input { width: 21px; height: 21px; }
  .check { padding: 6px 0; }
  .user-menu-btn { min-height: 40px; }
  .segmented button { min-height: 38px; }
  .opt-card { min-height: 52px; }
  .dpad { grid-template-columns: repeat(3, 66px); grid-template-rows: repeat(3, 66px); gap: 9px; }
  .dpad button { min-height: 66px; }
  .charpad-btn { min-height: 58px; }
  .cs-pad-btn { height: 46px; }
}

/* ---------- 22.8a 测试台：桌面端放大舞台 + 本次条件速览 ---------- */
.test-facts { display: none; }
@media (min-width: 1080px) {
  /* 桌面端没有触摸限制，舞台可以更大，视标物理尺寸不变、但周围留白更从容 */
  .test-shell { max-width: 1000px; }
  .stage { min-height: 420px; }
  .test-facts {
    display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center;
    margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border);
  }
  .test-facts .tf { display: inline-flex; align-items: baseline; gap: 5px; font-size: 12.5px; }
  .test-facts .tf-k { color: var(--muted); }
  .test-facts .tf-v { color: var(--ink-2); font-weight: 650; }
  /* 方向盘中心已经有「看不清」，桌面端不必再摆一颗 */
  .test-shell--dpad .test-actions .btn-cantsee { display: none; }
}

/* ---------- 22.8c 测试台：平板横屏 / 桌面改为左右两栏 ----------
   此前舞台在上、方向盘在下，768px 高的平板上「舞台 380 + 盘 3 行 + 顶栏 + 底部按钮」
   合计约 1030px，必须滚动才能按到最下面一排键 —— 测量途中滚动会破坏观看距离。
   宽度 ≥900 时改成「舞台在左、作答盘在右」，纵向需求大约减半。
   注意：不要靠缩小 MAX_PX_RATIO 来解决，那会直接缩小可测范围。 */
@media (min-width: 900px) {
  .test-shell { max-width: 1080px; }
  .test-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: stretch;
  }
  .test-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    min-width: 200px;
  }
  .test-body .stage { min-height: 320px; }
  .test-side .charpad { max-width: 320px; }
}

/* ---------- 22.8b 测试台：移动端一屏内完整显示（不需滚动即可作答） ---------- */
@media (max-width: 760px) {
  .test-shell {
    display: flex;
    flex-direction: column;
    /* 用 height 而不是 min-height：内容一多就会顶出屏幕、把最下面的方向键压到导航栏下面 */
    height: calc(100dvh - var(--topbar-h) - 92px - env(safe-area-inset-bottom));
    justify-content: space-between;
    gap: 10px;
  }
  /* 手机上仍是「舞台在上、盘在下」：中间这一层透传 flex，不改变原来的高度分配 */
  .test-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 10px;
  }
  .test-side { display: flex; flex-direction: column; flex: none; }
  /* 方向盘中心已经有「看不清」，底部那行按钮就只留手势与放弃 */
  .test-shell--dpad .test-actions .btn-cantsee { display: none; }
  .test-bar { flex: none; flex-wrap: wrap; row-gap: 6px; height: auto; padding: 9px 12px; }
  .test-bar .progress { order: 3; flex-basis: 100%; }
  .stage { flex: 1 1 auto; min-height: 140px; max-height: 42vh; padding: 10px; }
  .stage-hint { font-size: 11.5px; bottom: 8px; }
  .test-actions { flex: none; margin-top: 0; gap: 8px; flex-wrap: nowrap; }
  .test-actions .btn { flex: 1 1 0; min-width: 0; justify-content: center; min-height: 44px; padding: 8px 6px; font-size: 13px; }
  .test-actions .btn svg { width: 15px; height: 15px; }
  .dpad { grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 58px); gap: 6px; }
  .dpad button { min-height: 58px; }
  .charpad { gap: 6px; }
  .charpad-btn { min-height: 50px; font-size: 19px; }
  .test-shell > .hint.text-center { flex: none; font-size: 11.5px; }
  /* 结束时/放弃按钮与提示压缩 */
  .test-shell .btn-ghost { min-height: 36px; font-size: 13px; }
  /* 摄像头/HTTPS 说明在移动端压缩为两行 */
  .test-shell .notice-info { font-size: 11px; line-height: 1.5; padding: 8px 10px; gap: 7px; }
  .test-shell .notice-info svg { width: 14px; height: 14px; margin-top: 1px; }
}

/* ---------- 22.9 移动端横向溢出防护 ---------- */
@media (max-width: 760px) {
  .container { padding: 0 14px; }
  .stack-6 { gap: 22px; }
  .stack-5 { gap: 18px; }
  .stack-4 { gap: 14px; }
  .row-6 { gap: 14px; }
  .kv { gap: 10px; font-size: 13.5px; }
  .kv .v { max-width: 62%; overflow-wrap: anywhere; }
  .page h1 { font-size: 23px; }
  .card-head, .card-body { padding: 16px; }
  .card-pad { padding: 16px; }
  .card-pad-lg { padding: 18px; }
  .hero { padding: 26px 0 22px; }
  .hero h1 { font-size: 26px; }
  .hero .lede { margin-top: 12px; font-size: 15px; line-height: 1.65; }
  .hero-actions { margin-top: 20px; gap: 10px; }
  .hero-actions .btn { flex: 1; justify-content: center; }
  .hero-visual { min-height: 168px; }
  .hero-e { width: 118px; height: 118px; }
  .hero-e svg { width: 72px; height: 72px; }
  .hero-chip { padding: 6px 11px; font-size: 11.5px; }
  .stat-value { font-size: 24px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat-label { font-size: 11.5px; }
  .stat-value { font-size: 21px; }
  .stat-sub { font-size: 11.5px; }
  .eye-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .eye-card { padding: 14px; }
  .list-item { flex-wrap: wrap; }

  /* 准备页步骤标题：描述文字收紧 */
  .layout-main .card > .row .grow > h3 { font-size: 16px; }
  .layout-main .card > .row .grow > .hint { font-size: 11.5px; line-height: 1.45; margin-top: 4px !important; }
  .layout-main .card > .row { column-gap: 9px; }

  /* 标定组件：移动端压缩 */
  .calib-wrap { gap: 12px; }
  .calib-stage { min-height: 190px; padding: 14px; }
  .calib-readout { gap: 8px; }
  .calib-readout .readout { padding: 7px 9px; }
  .calib-readout .r-value { font-size: 14px; }
  .calib-readout .r-label { font-size: 10.5px; }
  .calib-wrap .row.mt-3 { margin-top: 10px !important; }
  .calib-wrap .field .label { font-size: 12px; }
  .calib-wrap .btn-sm { min-height: 36px; }
  .li-va .v { font-size: 17px; }
  .footer { padding: 20px 0 26px; }
  .footer-inner { flex-direction: column; gap: 6px; font-size: 12px; }
  /* 固定操作条存在时，页面底部额外留白，避免遮挡最后一块内容 */
  body:has(.sticky-cta) .page { padding-bottom: 176px; }
}

/* ---------- 22.10 平板 ---------- */
@media (min-width: 761px) and (max-width: 1079px) {
  .container { padding: 0 22px; }
  /* 平板没有底部导航，操作条直接贴底 */
  .sticky-cta { display: flex; bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  body:has(.sticky-cta) .page { padding-bottom: 104px; }
  /* 摘要里的「开始测试」在平板会重复出现（吸底条已有一个） */
  .summary-start { display: none; }
  /* 方向盘中心已有「看不清」 */
  .test-shell--dpad .test-actions .btn-cantsee { display: none; }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-main .steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
  .layout-main .step { padding-bottom: 0; }
  .layout-main .step::before { display: none; }
}

/* ---------- 22.11 超宽屏 ---------- */
@media (min-width: 1500px) {
  :root { --maxw: 1320px; }
  .layout-split { grid-template-columns: minmax(0, 1fr) 360px; }
}

/* ---------- 21. 打印（报告导出） ---------- */
@media print {
  .topbar, .footer, .bottom-nav, .toast-host, .no-print { display: none !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; border-color: #ddd !important; break-inside: avoid; }
  .page { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   23. 投屏 / 演示模式（Present · Cast）
   ========================================================================== */
body.present-on { overflow: hidden; background: #05080b; }

.present-root {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 50% 12%, #0d1720 0%, #05080b 62%, #020406 100%);
  color: #eaf2f8;
  font-family: var(--ff);
}
.present-root:fullscreen { width: 100%; height: 100%; }

.present-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; flex: 0 0 auto;
  border-bottom: 1px solid rgba(255,255,255,.09);
  background: rgba(4,8,12,.55);
}
.present-tag { font-size: 14px; color: #b9cddb; letter-spacing: .02em; white-space: nowrap; }
.present-tag.dim { color: #7e95a7; }
.present-progress {
  flex: 1 1 auto; height: 6px; border-radius: 99px;
  background: rgba(255,255,255,.12); overflow: hidden;
}
.present-progress .pp-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, hsl(var(--primary-h) 70% 55%), hsl(var(--accent-h) 65% 52%));
  transition: width .25s var(--ease);
}
.present-btn {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: #d8e6f0; cursor: pointer; transition: background .18s var(--ease);
}
.present-btn:hover { background: rgba(255,255,255,.16); }

.present-stage {
  flex: 1 1 auto; position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 0; padding: 20px;
}
.present-holder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; color: #f2f8fc;
}
.present-holder svg { max-width: 78vmin; max-height: 78vmin; width: auto; height: auto; }
.present-feedback {
  position: absolute; bottom: 3vh; left: 0; right: 0; text-align: center;
  font-size: clamp(16px, 2.4vmin, 30px); font-weight: 700; opacity: 0;
  transition: opacity .18s var(--ease); pointer-events: none;
}
.present-feedback.ok { color: #4ade80; opacity: 1; }
.present-feedback.bad { color: #f87171; opacity: 1; }
.present-hint {
  flex: 0 0 auto; padding: 9px 18px; text-align: center;
  font-size: 12.5px; color: #6c8496;
  border-top: 1px solid rgba(255,255,255,.07);
}

.present-calib {
  position: absolute; inset: 0; z-index: 3;
  background: rgba(5,8,11,.97);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px; overflow: auto;
}
.present-calib.hidden { display: none; }
.present-calib .pc-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.present-calib .pc-sub { font-size: 13.5px; color: #8fa6b8; margin-bottom: 16px; max-width: 620px; text-align: center; line-height: 1.7; }
.present-calib .calib-wrap { width: 100%; max-width: 680px; }
.present-calib .readout, .present-calib .label, .present-calib .hint { color: #b9cddb; }
.present-calib .btn-outline { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); color: #dbe8f2; }
/* 标定读数：拖动过程中实时更新，让用户知道当前值 */
.present-calib .pc-now {
  font-size: 14px; color: #b9cddb; margin-bottom: 12px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.07); display: inline-block;
}
.present-calib .pc-now b { color: #eaf4fb; font-variant-numeric: tabular-nums; }

/* 标定卡拖拽中：禁止文字选中，强调可拖 */
.calib-card.dragging { cursor: ew-resize; user-select: none; }
.calib-card.dragging .calib-txt,
.calib-card.dragging .calib-sub { opacity: .75; }

.present-result { text-align: center; }
.present-result .pr-label { font-size: clamp(14px, 2vmin, 20px); color: #8fa6b8; letter-spacing: .1em; }
.present-result .pr-value { font-size: clamp(48px, 11vmin, 150px); font-weight: 800; line-height: 1.1; color: #fff; }
.present-result .pr-sub { font-size: clamp(13px, 1.8vmin, 19px); color: #9fb4c4; margin-top: 6px; }

/* 配对页 */
.cast-pair-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 26px; align-items: start; }
.cast-qr-box { display: flex; flex-direction: column; align-items: center; }
.cast-qr { background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--border); }
.cast-qr svg { display: block; }
.cast-code { font-family: var(--ff-num); font-size: clamp(30px, 6vw, 46px); font-weight: 800; letter-spacing: .18em; color: var(--primary-ink); margin: 4px 0 10px; }
.cast-url { font-family: var(--ff-num); font-size: 12px; color: var(--muted); word-break: break-all; background: var(--surface-2); padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border); }
.cast-code-box { min-width: 0; }

.remote-stage { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.dpad-remote { margin: 0 auto; }

@media (max-width: 760px) {
  .cast-pair-grid { grid-template-columns: 1fr; }
  .present-bar { padding: 9px 12px; gap: 9px; }
  .present-tag { font-size: 12.5px; }
}

/* ==========================================================================
   24. 管理后台
   ========================================================================== */
.admin-tabs { margin-bottom: 4px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .04em;
  color: var(--muted); padding: 11px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
  position: sticky; top: 0; z-index: 1;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.td-strong { font-weight: 600; }
.td-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.td-mono { font-family: var(--ff-num); font-size: 12.5px; }
.td-empty { text-align: center; color: var(--muted); padding: 26px 12px; font-size: 13px; }

.admin-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; overflow-x: auto; }
.admin-bar { flex: 1 0 26px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.admin-bar .ab-fill { width: 100%; min-height: 4px; border-radius: 6px 6px 2px 2px; background: hsl(var(--primary-h) 55% 62% / .55); }
.admin-bar.top .ab-fill { background: hsl(var(--primary-h) 62% 48%); }
.admin-bar .ab-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.li-rank {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--primary-ink);
  background: var(--primary-soft);
}

/* ==========================================================================
   25. 专业说明列表 / 专项增强
   ========================================================================== */
.pro-list { margin: 0; padding-left: 1.15em; font-size: 14px; line-height: 2; color: var(--ink-2); }
.pro-list li { margin-bottom: 6px; }
.pro-list b { color: var(--ink); }

.check-scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.check-scale .cs-item { text-align: center; padding: 10px 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.check-scale .cs-item .v { font-size: 19px; font-weight: 700; color: var(--ink); }
.check-scale .cs-item .k { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.axis-dial { display: block; margin: 0 auto; }
.axis-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 8px; }

.plate-strip { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.plate-strip .ps-item { width: 62px; height: 62px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--surface-2); }
.plate-strip .ps-item.sel { border-color: var(--primary); }
.plate-strip .ps-item canvas { display: block; width: 100%; height: 100%; }

.cs-curve { width: 100%; height: auto; display: block; }
.cs-legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.cs-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

@media (max-width: 760px) {
  .table { font-size: 12.5px; }
  .table th, .table td { padding: 9px 8px; }
  .admin-bars { height: 120px; }
}

/* ==========================================================================
   26. ETDRS 标准视力表 / CSF 频率条
   ========================================================================== */
.chart-card { overflow: hidden; }
.etdrs-chart {
  display: flex; justify-content: center; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 12px; overflow-x: auto;
}
.etdrs-line { display: flex; align-items: center; justify-content: center; gap: 0; white-space: nowrap; }
.etdrs-letter {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--ink); font-family: var(--ff); font-weight: 600;
  cursor: pointer; letter-spacing: 0;
  transition: color .15s var(--ease), transform .15s var(--ease);
  border-radius: 4px;
}
.etdrs-letter:hover:not(:disabled) { color: var(--primary); transform: scale(1.08); }
.etdrs-letter.read { color: var(--primary); }
.etdrs-letter.read::after { content: '✓'; font-size: .42em; vertical-align: super; margin-left: 1px; color: var(--accent); }
.etdrs-letter:disabled { cursor: default; }

.check-scale .cs-item.fail { border-color: var(--danger); background: var(--danger-soft); }
.check-scale .cs-item.fail .v { color: var(--danger); }

.cs-freq-bar { display: flex; gap: 8px; }
.cs-freq-item {
  flex: 1 1 0; text-align: center; padding: 8px 6px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.cs-freq-item b { display: block; font-size: 13px; color: var(--muted); }
.cs-freq-item span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.cs-freq-item.cur { border-color: var(--primary); background: var(--primary-soft); }
.cs-freq-item.cur b { color: var(--primary-ink); }
.cs-freq-item.done { border-color: var(--accent); background: var(--accent-soft); }
.cs-freq-item.done b { color: var(--accent); }
@media (max-width: 760px) {
  .cs-freq-bar { flex-wrap: wrap; }
  .cs-freq-item { flex: 1 1 30%; }
  .etdrs-chart { padding: 12px 6px; }
}

/* ==========================================================================
   27. 投屏：等待状态 / 控制端连接面板
   ========================================================================== */
.present-waiting {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px;
  background: radial-gradient(90% 70% at 50% 40%, rgba(18,32,44,.9) 0%, rgba(5,8,11,.96) 70%);
}
.present-waiting.hidden { display: none; }
.present-waiting .pw-ico { color: #5f7f95; margin-bottom: 6px; }
.present-waiting .pw-title { font-size: clamp(20px, 3vmin, 34px); font-weight: 700; color: #e8f1f7; }
.present-waiting .pw-sub { font-size: clamp(13px, 1.7vmin, 17px); color: #8ea6b8; max-width: 620px; line-height: 1.8; }
.present-waiting .pw-code {
  font-family: var(--ff-num); font-size: clamp(30px, 6vmin, 64px); font-weight: 800;
  letter-spacing: .2em; color: #7fd4ff; margin-top: 8px;
  padding: 8px 18px; border-radius: 14px; background: rgba(127,212,255,.08);
  border: 1px solid rgba(127,212,255,.22);
}
.present-waiting .pw-hint { font-size: 12.5px; color: #6c8496; }

.cast-pair-inline {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.cast-pair-inline .cast-url { margin-bottom: 10px; }
.cast-qr--sm { display: inline-block; padding: 6px; }
.cast-qr--sm svg { display: block; width: 150px; height: 150px; }

@media (max-width: 760px) {
  .cast-qr--sm svg { width: 120px; height: 120px; }
}

.remote-wait {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 34px 12px; color: var(--muted); text-align: center;
}
.remote-wait div { font-size: 15px; color: var(--ink-2); font-weight: 600; }
.remote-wait small { font-size: 12.5px; color: var(--muted); }


/* ==========================================================================
   28. 触控目标补强（移动端）
   ========================================================================== */
@media (max-width: 760px) {
  /* 登录/注册页的切换链接：文字本身只有 18px 高，扩成 44px 的可点区域 */
  .auth-alt a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
    margin: -4px -6px;
  }
  /* 设置页复选框：从 22px 提到 24px，并扩大点击区 */
  .check input[type="checkbox"] { width: 24px; height: 24px; }
  .check { min-height: 44px; }
  /* 报告页顶部操作按钮 */
  .page-title ~ .row .btn, .row.row-2.row-wrap .btn { min-height: 40px; }
}


/* 站内 404 页 */
.nf-code {
  font: 800 clamp(56px, 12vw, 96px)/1 "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .04em;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ==========================================================================
   29. 图形类视标（Kay 图形 / 几何符号）
   ========================================================================== */
.opt-svg--shape { color: var(--ink); }
.charpad--shape { grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); max-width: 640px; }
.charpad-btn--shape { padding: 6px; }
.charpad-btn--shape .opt-svg { width: 34px; height: 34px; }
.charpad-btn--shape:hover .opt-svg { color: var(--primary); }
.charpad-btn--shape:active .opt-svg { color: #fff; }
@media (max-width: 760px) {
  .charpad--shape { grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 7px; }
  .charpad-btn--shape .opt-svg { width: 30px; height: 30px; }
}


/* ==========================================================================
   30. 国际标准图表（多型式）+ Landolt 方向判定
   ========================================================================== */
.etdrs-letter--landolt {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; background: none; border: none;
}
.etdrs-letter--landolt .opt-svg { display: block; }
.etdrs-letter.read { color: var(--primary); }
.etdrs-letter.wrong { color: var(--danger); opacity: .45; }
.etdrs-letter.wrong::after { content: '✕'; font-size: .42em; vertical-align: super; margin-left: 2px; color: var(--danger); }

.landolt-picker {
  margin-top: 16px; padding: 16px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  text-align: center;
}
.landolt-picker.hidden { display: none; }
/* 8 朝向缺口选择：3×3 九宫格，中心位放提示而不是留下空洞 */
.lp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 104px));
  gap: 8px;
  justify-content: center;
  margin: 0 auto;
}
.lp-grid .btn { min-height: 46px; padding: 6px 4px; font-size: 14px; }
.lp-hub {
  display: grid; place-items: center;
  font-size: 12.5px; color: var(--muted);
  border-radius: var(--r-md);
}
@media (max-width: 420px) {
  .lp-grid { grid-template-columns: repeat(3, minmax(0, 88px)); gap: 6px; }
  .lp-grid .btn { min-height: 44px; font-size: 13px; }
}

/* ==========================================================================
   31. 视功能专项（Amsler / Worth / 立体视）
   ========================================================================== */
.amsler-stage {
  display: flex; justify-content: center; padding: 20px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
}
.amsler-stage--result { padding: 12px; background: transparent; border: none; }
.amsler-grid {
  display: block; background: #fff; border-radius: 6px;
  box-shadow: 0 2px 12px rgb(0 0 0 / .10); cursor: crosshair;
  max-width: 100%; height: auto;
}
.amsler-grid .am-grid line { stroke: #111; stroke-width: .75; }
.amsler-grid .am-dot { fill: #111; }
.amsler-grid .am-hit { fill: none; stroke: #e03131; stroke-width: 1.8; }

.worth-stage {
  display: flex; justify-content: center; padding: 24px;
  background: #000; border-radius: var(--r-md);
}
.worth-box { position: relative; width: 224px; height: 224px; }
.worth-lamp {
  position: absolute; width: 30px; height: 30px; border-radius: 50%;
  box-shadow: 0 0 18px currentColor;
}
.worth-lamp--top { left: 97px; top: 24px; }
.worth-lamp--bottom { left: 97px; bottom: 24px; }
.worth-lamp--left { left: 24px; top: 97px; }
.worth-lamp--right { right: 24px; top: 97px; }

.stereo-stage {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  padding: 16px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  overflow-x: auto;
}
.stereo-stage canvas { display: block; max-width: 100%; height: auto; }
.stereo-stage--pair canvas { border: 1px solid var(--border); border-radius: 4px; }
@media (max-width: 760px) {
  .stereo-stage { padding: 8px; gap: 4px; }
  .worth-box { width: 190px; height: 190px; }
  .worth-lamp--top { left: 80px; top: 20px; }
  .worth-lamp--bottom { left: 80px; bottom: 20px; }
  .worth-lamp--left { left: 20px; top: 80px; }
  .worth-lamp--right { right: 20px; top: 80px; }
}

/* ==========================================================================
   32. 阅读专项（MNREAD / IReST）
   ========================================================================== */
.reading-stage {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 26px 20px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  max-height: 58vh; overflow-y: auto;
}
.reading-text {
  margin: 0; color: var(--ink); text-align: justify;
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: .02em; word-break: break-all;
}
@media (max-width: 760px) {
  .reading-stage { padding: 16px 14px; max-height: 52vh; }
}

/* ==========================================================================
   视康 · 布局升级 v2 —— 工作台外壳 / 侧边功能栏 / 全局搜索 / 任务卡
   ========================================================================== */

/* ---------- 11. 工作台外壳（桌面端左侧功能栏 + 内容区） ---------- */
.ws { flex: 1; display: flex; align-items: flex-start; min-height: 0; width: 100%; }
.ws-side {
  width: 228px; flex: none;
  position: sticky; top: var(--topbar-h);
  align-self: flex-start;
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 10px 48px 18px;
  border-right: 1px solid var(--border);
}
.ws-side::-webkit-scrollbar { width: 6px; }
.ws-main { flex: 1; min-width: 0; }
.ws-main > .page { padding-top: 26px; }

/* ---------- 12. 侧边功能栏 ---------- */
/* 结构：一级项（5）+ 当前分支的子项 + 分隔线 + 工具区。
   去掉常驻的「全部功能」树后，默认高度只有 9 行，平板上不用滚动。 */
.side-nav { display: flex; flex-direction: column; gap: 0; }

.sn-main { display: flex; flex-direction: column; gap: 1px; }

.sn-item.sn-l1 {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13.5px; font-weight: 600;
  line-height: 1.35;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sn-item.sn-l1:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.sn-item.sn-l1.active {
  background: var(--primary-soft); color: var(--primary-ink); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}
.sn-item.sn-l1.active .sn-ico { color: var(--primary-ink); }

.sn-ico { display: grid; place-items: center; flex: none; color: var(--muted); }
.sn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 子项：缩进 + 左侧树线，代替原来的小圆点 */
.sn-sub-tree {
  position: relative; margin: 1px 0 7px; padding-left: 26px;
  display: flex; flex-direction: column; gap: 1px;
}
.sn-sub-tree::before {
  content: ''; position: absolute; left: 17px; top: 3px; bottom: 3px;
  width: 1px; background: var(--border-strong);
}
.sn-item.sn-sub {
  display: flex; align-items: center;
  padding: 6px 8px; border-radius: var(--r-xs);
  color: var(--ink-2); font-size: 12.8px; font-weight: 500;
  line-height: 1.4;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sn-item.sn-sub:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.sn-item.sn-sub.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 650; }

.sn-sub-group {
  padding: 7px 8px 3px; margin-left: -8px;
  font-size: 10.5px; font-weight: 750; letter-spacing: .07em;
  color: var(--muted);
}

.sn-divider { height: 1px; background: var(--border); margin: 12px 6px 10px; }
.sn-tools { display: flex; flex-direction: column; gap: 1px; }
.sn-sect {
  padding: 0 10px 6px;
  font-size: 10.5px; font-weight: 750; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase;
}

/* ---------- 13. 顶栏搜索触发器 ---------- */
.search-trigger {
  display: flex; align-items: center; gap: 9px;
  height: 36px; min-width: 260px; padding: 0 10px 0 12px;
  border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted);
  font-size: 13.5px; cursor: pointer; text-align: left;
  transition: all var(--dur) var(--ease);
}
.search-trigger:hover { border-color: var(--border-strong); background: var(--surface); color: var(--ink-2); }
.search-trigger .st-ico { display: grid; place-items: center; flex: none; }
.search-trigger .st-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-kbd {
  font-family: var(--ff-num); font-size: 11px; font-weight: 600;
  padding: 2px 6px; border-radius: var(--r-xs);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); line-height: 1.5;
}
@media (max-width: 900px) {
  .search-trigger { min-width: 0; width: 36px; padding: 0; justify-content: center; }
  .search-trigger .st-text, .search-trigger .st-kbd { display: none; }
}

/* ---------- 14. 命令面板（⌘K 全局搜索） ---------- */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: hsl(205 40% 12% / .42);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
  animation: cmdkFade .14s var(--ease-out);
}
@keyframes cmdkFade { from { opacity: 0; } to { opacity: 1; } }
.cmdk {
  width: 100%; max-width: 620px; max-height: 68vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: cmdkIn .18s var(--ease-out);
}
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-12px) scale(.985); } to { opacity: 1; transform: none; } }
.cmdk-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cmdk-ico { display: grid; place-items: center; color: var(--muted); flex: none; }
.cmdk-input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 15.5px; color: var(--ink); padding: 0;
}
.cmdk-input::placeholder { color: var(--muted); }
.cmdk-kbd {
  font-family: var(--ff-num); font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: var(--r-xs);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
}
.cmdk-list { flex: 1; overflow-y: auto; padding: 6px; min-height: 60px; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 11px; border-radius: var(--r-sm); color: var(--ink);
  transition: background var(--dur) var(--ease);
}
.cmdk-item:hover { background: var(--surface-3); text-decoration: none; }
.cmdk-item.sel { background: var(--primary-soft); }
.cmdk-item.sel .ci-label { color: var(--primary-ink); }
.ci-ico {
  width: 30px; height: 30px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2);
}
.cmdk-item.sel .ci-ico { background: var(--surface); color: var(--primary-ink); }
.ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ci-label { font-size: 14px; font-weight: 600; }
.ci-desc {
  font-size: 12.5px; color: var(--muted); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ci-group {
  font-size: 11px; color: var(--muted); flex: none;
  padding: 2px 8px; border-radius: var(--r-full); background: var(--surface-3);
}
.cmdk-empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.cmdk-empty .cmdk-ico { margin: 0 auto 12px; }
.cmdk-empty p { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.cmdk-empty small { font-size: 12.5px; }
.cmdk-foot {
  display: flex; gap: 16px; padding: 9px 16px;
  border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: 12px; color: var(--muted);
}
.cmdk-foot b { font-family: var(--ff-num); color: var(--ink-2); font-weight: 600; }

/* ---------- 15. 统一页面头 ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-head .ph-l { min-width: 0; }
.page-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -.025em; }
.page-head .ph-sub { font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; max-width: 76ch; }
.page-head .ph-r { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--primary); }
.crumb .sep { opacity: .5; }
@media (max-width: 760px) { .page-head h1 { font-size: 22px; } .page-head { margin-bottom: 18px; } }

/* ---------- 16. 标准依据标签 ---------- */
.std-chip {
  display: inline-flex; align-items: flex-start; gap: 6px;
  padding: 5px 10px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; line-height: 1.5; color: var(--ink-2);
}
.std-chip svg { width: 13px; height: 13px; flex: none; margin-top: 2px; color: var(--primary-ink); }
.std-chip b { font-weight: 650; color: var(--muted); font-weight: 600; }

/* ---------- 17. 工作台：快速开始条 ---------- */
.quickbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 22px; border-radius: var(--r-lg);
  background: linear-gradient(120deg, hsl(var(--primary-h) var(--primary-s) 50% / .10), hsl(var(--accent-h) var(--accent-s) 48% / .08));
  border: 1px solid hsl(var(--primary-h) var(--primary-s) 47% / .22);
  margin-bottom: 22px;
}
.quickbar .qb-ico {
  width: 44px; height: 44px; border-radius: var(--r-md); flex: none;
  display: grid; place-items: center; background: var(--surface); color: var(--primary-ink);
  box-shadow: var(--shadow-sm);
}
.quickbar .qb-ico svg { width: 22px; height: 22px; }
.quickbar .qb-body { flex: 1; min-width: 190px; }
.quickbar .qb-title { font-size: 16px; font-weight: 700; }
.quickbar .qb-sub { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.quickbar .qb-act { display: flex; gap: 9px; flex-wrap: wrap; }
@media (max-width: 760px) { .quickbar { padding: 15px; gap: 12px; } .quickbar .qb-act { width: 100%; } .quickbar .qb-act .btn { flex: 1; } }

/* ---------- 18. 工作台：结果总览卡 ---------- */
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.ov-card {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  padding: 14px 15px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: all var(--dur) var(--ease);
}
a.ov-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); text-decoration: none; }
.ov-top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ov-top svg { width: 14px; height: 14px; }
.ov-val { font-size: 25px; font-weight: 780; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 4px; }
.ov-val small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.ov-val.none { font-size: 17px; font-weight: 700; color: var(--muted); }
.ov-meta { font-size: 12px; color: var(--muted); }
.ov-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); flex: none; }
.ov-dot.ok { background: var(--accent); }
.ov-dot.warn { background: var(--warn); }
.ov-dot.bad { background: var(--danger); }

/* ---------- 19. 任务卡（功能入口） ---------- */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 13px; }
.task-card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 16px 17px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: all var(--dur) var(--ease);
  position: relative; overflow: hidden;
}
a.task-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); text-decoration: none; }
.task-head { display: flex; align-items: flex-start; gap: 11px; }
.task-ico {
  width: 38px; height: 38px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink);
}
.task-ico svg { width: 19px; height: 19px; }
.task-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.task-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.task-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 3px; }
.task-dur {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--muted);
  padding: 3px 9px; border-radius: var(--r-full); background: var(--surface-3);
}
.task-dur svg { width: 12px; height: 12px; }
.task-std {
  font-size: 11.5px; color: var(--ink-2); line-height: 1.5;
  padding: 4px 9px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 5px;
}
.task-std svg { width: 12px; height: 12px; flex: none; margin-top: 3px; color: var(--muted); }
.task-hot {
  /* 原来贴在卡片右上角，但卡片圆角比角标大，视觉上像被裁掉一块；
     改成浮在卡片内的胶囊标签，任何圆角下都干净 */
  position: absolute; top: 11px; right: 11px;
  padding: 2px 9px; border-radius: var(--r-full);
  background: var(--primary-soft); color: var(--primary-ink);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}

/* ---------- 20. 分组筛选 tab ---------- */
.group-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
}
/* 手机上筛选片改成一行横向滑动：7 个标签换行会占掉三行首屏 */
@media (max-width: 760px) {
  .group-tabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 4px; padding-right: 16px;
    scrollbar-width: none;
  }
  .group-tabs::-webkit-scrollbar { display: none; }
  .group-tabs button { flex: 0 0 auto; }
}
.group-tabs button {
  padding: 7px 14px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; transition: all var(--dur) var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
}
.group-tabs button:hover { border-color: var(--primary); color: var(--primary-ink); }
.group-tabs button[aria-pressed="true"] {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
}
.group-tabs .gt-n { font-size: 11px; opacity: .7; font-weight: 600; }

/* ---------- 21. 统一记录时间线 ---------- */
.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: flex; gap: 14px; padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.tl-item:last-child { border-bottom: none; }
.tl-rail { display: flex; flex-direction: column; align-items: center; flex: none; width: 30px; }
.tl-dot {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--ink-2);
}
.tl-dot svg { width: 15px; height: 15px; }
.tl-dot.ok { background: var(--accent-soft); color: var(--accent); }
.tl-dot.warn { background: var(--warn-soft); color: var(--warn); }
.tl-dot.bad { background: var(--danger-soft); color: var(--danger); }
.tl-line { flex: 1; width: 2px; background: var(--border); margin-top: 4px; min-height: 8px; }
.tl-item:last-child .tl-line { display: none; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 650; }
.tl-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.55; }
.tl-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; align-self: center; }

/* ---------- 22. 分区标题 ---------- */
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.sec-head h2 { font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
.sec-head .sh-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.55; max-width: 72ch; }
.sec-head .sh-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 23. 移动端：顶部功能抽屉入口 ---------- */
@media (max-width: 1023px) {
  .ws-side { display: none; }
}
@media (max-width: 760px) {
  /* 分区标题：标题与「全部记录」同一行，说明文字独占第二行 —— 原来 flex-wrap
     会把按钮甩到标题下方，看着像悬空的孤立链接 */
  .sec-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; }
  .sec-head > div:first-child { display: contents; }
  .sec-head h2 { grid-area: 1 / 1; }
  .sec-head .sh-sub { grid-area: 2 / 1 / 3 / 3; margin-top: 2px; }
  .sec-head .sh-r { grid-area: 1 / 2; justify-self: end; }
  .sec-head .sh-r .btn { padding: 6px 10px; }

  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ov-card { padding: 12px 13px; }
  .ov-val { font-size: 22px; min-height: 28px; }
  .ov-meta {
    font-size: 11.5px; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .task-grid { grid-template-columns: 1fr; }
  .cmdk-overlay { padding: 8vh 12px 12px; }
  .cmdk { max-height: 76vh; }
  .cmdk-foot { display: none; }
  .tl-val { align-self: flex-start; }
}

/* ---------- 24. 工作台外壳内的栅格适配 ---------- */
.ws-main .container { max-width: 1240px; }
@media (min-width: 1024px) {
  .ws .layout-split { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
  .ws .layout-main { order: 0; min-width: 0; }
  .ws .layout-side {
    order: 0; position: sticky; top: calc(var(--topbar-h) + 20px);
    align-self: start;
  }
}
@media (min-width: 1024px) and (max-width: 1219px) {
  .ws .layout-split { grid-template-columns: minmax(0, 1fr); }
  .ws .layout-main { order: 1; }
  .ws .layout-side { order: 2; position: static; }
}

/* ---------- 25. 细节修正 ---------- */
/* 纵向排列容器里的 chip 不应被拉伸成整行按钮 */
.stack > .chip { align-self: flex-start; }

/* 视标类型卡：信息密度更高，三列排布 */
.optotype-grid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
@media (max-width: 760px) { .optotype-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.optotype-card { padding: 12px 13px; gap: 10px; }
.optotype-card .oc-glyph {
  width: 34px; height: 34px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-ink);
  font-size: 13px; font-weight: 750; letter-spacing: .3px;
}
.optotype-card h4 { font-size: 14px; margin-bottom: 2px; }
.optotype-card .oc-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.optotype-card .oc-meta { font-size: 11.5px; color: var(--muted); }

/* ---------- 26. 顶栏面包屑 ---------- */
.topbar-crumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted); min-width: 0;
}
.topbar-crumb a { color: var(--muted); white-space: nowrap; }
.topbar-crumb a:hover { color: var(--primary); text-decoration: none; }
.topbar-crumb .cur { color: var(--ink); font-weight: 650; white-space: nowrap; }
.topbar-crumb .sep { opacity: .45; }
@media (max-width: 980px) { .topbar-crumb { display: none; } }

/* 搜索触发器靠右，与操作区成组 */
.search-trigger { margin-left: auto; }

/* ==========================================================================
   27. 投屏显示端：视标对比度修正 + 明暗场切换 + 受测者模式
   --------------------------------------------------------------------------
   ⚠ 关键修正：
   .opt-svg { color: var(--ink) } 是为「白底测试页」设计的（黑字白底）。
   投屏显示端是「黑底暗场」，若沿用该规则，视标会被画成深色
   （实测 rgb(16,36,50) 叠在 rgb(7,13,18) 背景上，对比度仅 1.23:1，几乎不可见）。
   暗场必须强制为高亮色；亮场则反过来用深色字。
   ========================================================================== */

/* --- 暗场（默认）：纯白视标 + 无阴影，保证最大对比度 --- */
.present-holder .opt-svg,
.present-holder .e-optotype,
.present-holder .opt-svg--shape {
  color: #ffffff;
  filter: none;
}
.present-holder .opt-svg text,
.present-holder .opt-svg tspan {
  fill: #ffffff;
  text-rendering: geometricPrecision;
}

/* --- 亮场：模拟传统照明式视力表（白底黑字），适合环境光较强的房间 --- */
.present-root.present-light {
  color: #0b1620;
  background: #f7fafc;
  background-image: radial-gradient(120% 90% at 50% 12%, #ffffff 0%, #f1f6f9 60%, #e6edf2 100%);
}
.present-root.present-light .present-holder { color: #0b1620; }
.present-root.present-light .present-holder .opt-svg,
.present-root.present-light .present-holder .e-optotype,
.present-root.present-light .present-holder .opt-svg--shape { color: #0b1620; }
.present-root.present-light .present-holder .opt-svg text,
.present-root.present-light .present-holder .opt-svg tspan { fill: #0b1620; }
.present-root.present-light .present-bar {
  background: rgba(255,255,255,.86);
  border-bottom-color: rgba(0,0,0,.1);
}
.present-root.present-light .present-tag { color: #33465a; }
.present-root.present-light .present-tag.dim { color: #64788c; }
.present-root.present-light .present-progress { background: rgba(0,0,0,.13); }
.present-root.present-light .present-btn {
  background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.13); color: #26384a;
}
.present-root.present-light .present-btn:hover { background: rgba(0,0,0,.1); }
.present-root.present-light .present-hint { color: #6b7f92; border-top-color: rgba(0,0,0,.08); }
.present-root.present-light .present-calib { background: rgba(247,250,252,.97); }
.present-root.present-light .present-calib .pc-sub { color: #56697d; }
.present-root.present-light .present-calib .calib-txt { color: #1b2c3d; }

/* --- 受测者模式：隐藏「级别 / 视标尺寸」，避免给受测者泄露答案 --- */
.present-tag.hidden-level { display: none !important; }
.present-bar .present-btn.is-on { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.34); color: #fff; }
.present-root.present-light .present-bar .present-btn.is-on {
  background: rgba(0,0,0,.12); border-color: rgba(0,0,0,.2); color: #0b1620;
}

/* ==========================================================================
   28. 全屏投屏：触控作答面板 / 净屏模式 / 显示端标定
   ========================================================================== */

/* --- 触控作答面板 --- */
.present-pad {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  gap: 18px; padding: 10px 16px 14px;
}
.pp-dpad { display: grid; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 46px); gap: 5px; }
.pp-key {
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07);
  color: #e6f0f7; border-radius: 12px; font-size: 19px; font-weight: 700;
  cursor: pointer; display: grid; place-items: center;
  transition: background .15s var(--ease);
}
.pp-key:hover { background: rgba(255,255,255,.16); }
.pp-key:active { background: var(--primary); color: #fff; }
.pp-key-up { grid-area: 1 / 2; }
.pp-key-left { grid-area: 2 / 1; }
.pp-key-right { grid-area: 2 / 3; }
.pp-key-down { grid-area: 3 / 2; }
.pp-key-ur { grid-area: 1 / 3; }
.pp-key-ul { grid-area: 1 / 1; }
.pp-key-dr { grid-area: 3 / 3; }
.pp-key-dl { grid-area: 3 / 1; }
.pp-cant {
  padding: 12px 22px; border-radius: 12px; font-size: 15px; font-weight: 650;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07);
  color: #e6f0f7; cursor: pointer; transition: background .15s var(--ease);
}
.pp-cant:hover { background: rgba(255,255,255,.16); }

/* 字符型视标的屏幕键盘 */
.pp-chars {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px;
  padding: 10px 16px 14px; align-items: center;
}
.pp-chars.hidden, .present-pad.hidden { display: none; }
.pp-char-row { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.pp-char {
  min-width: 40px; height: 40px; padding: 0 8px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07); color: #e6f0f7;
  font-size: 16px; font-weight: 650; cursor: pointer;
  transition: background .15s var(--ease);
}
.pp-char:hover { background: rgba(255,255,255,.18); }

/* --- 净屏模式：镜像到电视时只留视标 --- */
.present-root.present-clean .present-bar,
.present-root.present-clean .present-hint,
.present-root.present-clean .present-pad,
.present-root.present-clean .present-chars { display: none !important; }

/* 亮场下的触控面板配色 */
.present-root.present-light .pp-key,
.present-root.present-light .pp-cant,
.present-root.present-light .pp-char {
  background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.14); color: #26384a;
}
.present-root.present-light .pp-key:hover,
.present-root.present-light .pp-cant:hover,
.present-root.present-light .pp-char:hover { background: rgba(0,0,0,.11); }

/* --- 显示端标定提示 --- */
.calib-wrap--display .calib-card { border-color: hsl(var(--accent-h) var(--accent-s) 45% / .5); }
.calib-wrap--display .calib-card::after { border-color: hsl(var(--accent-h) var(--accent-s) 45% / .5); }

/* ==========================================================================
   29. 投屏：数据表 / 适用性标记 / CSF 投屏字母
   ========================================================================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
.data-table th {
  text-align: left; padding: 11px 14px; font-size: 12.5px; font-weight: 700;
  color: var(--muted); background: var(--surface-2); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.6; color: var(--ink-2); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td b { color: var(--ink); font-weight: 650; }

.scope-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.scope-ok { background: var(--accent); }
.scope-warn { background: var(--warn); }
.scope-bad { background: var(--danger); }

/* CSF 投屏：白底低对比度字母 */
.cs-cast-letters {
  display: flex; align-items: center; justify-content: center; gap: .28em;
  font-family: var(--ff-num); font-weight: 700; line-height: 1;
  letter-spacing: .02em; width: 100%;
}
.cs-cast-letters span { display: inline-block; }

/* 投屏显示端：纯图形区（扇形图等），去掉文本颜色继承 */
.present-holder--plain { color: #fff; }
.present-root.present-light .present-holder--plain { color: #0b1620; }
.present-holder--plain .fan-svg { width: min(72vmin, 720px); height: min(72vmin, 720px); }
.present-holder--plain .fan-ring { stroke: currentColor; opacity: .35; }
.present-holder--plain .fan-hub { fill: currentColor; opacity: .5; }
.present-holder--plain .fan-lines line { stroke: currentColor; }
.present-holder--plain .fan-label { fill: currentColor; opacity: .55; }
.present-holder--plain .fan-major { stroke-width: 2.2; }
.present-holder--plain .fan-mid { stroke-width: 1.5; }

/* ==========================================================================
   30. 电视极简模式（?tv=1）：遥控器友好
   ========================================================================== */
.tv-mode .card-pad-lg { padding: 34px; }
.tv-mode .page-title { font-size: 34px; }
.tv-mode .hint { font-size: 17px; line-height: 1.7; }
.tv-mode .label { font-size: 17px; }
.tv-mode .input {
  font-size: 38px !important; padding: 18px 12px !important;
  letter-spacing: 14px !important; text-align: center; font-weight: 800;
}
.tv-mode .btn-lg { font-size: 24px; padding: 20px 26px; }
.tv-mode .notice { font-size: 16px; padding: 18px 20px; }
.tv-kb { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.tv-key {
  padding: 14px 0; border-radius: 12px; font-size: 20px; font-weight: 700;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--ink); cursor: pointer; transition: all .15s var(--ease);
}
.tv-key:hover { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-softer); }
.tv-key:active { transform: scale(.94); }
@media (max-width: 760px) { .tv-kb { grid-template-columns: repeat(6, 1fr); } }

/* --- 呈现方式选择：竖排列表（手机上一屏三行，不挤成两列） --- */
.pick-list { display: flex; flex-direction: column; gap: 12px; }
.pick-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease);
}
.pick-item:hover { border-color: hsl(var(--primary-h) 60% 60% / .55); box-shadow: var(--shadow-md); }
.pick-item:active { transform: scale(.995); }
.pick-ico {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-ink);
}
.pick-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pick-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15.5px; font-weight: 700; }
.pick-badge {
  font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 8px; border-radius: var(--r-full);
  background: var(--primary-soft); color: var(--primary-ink);
}
.pick-desc { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.pick-meta { font-size: 12px; color: var(--muted); }
.pick-arrow { flex: 0 0 auto; color: var(--muted); display: grid; place-items: center; }

/* ==========================================================================
   31. 主动推屏（DLNA）：手机 / 平板变成「投屏遥控台」
   --------------------------------------------------------------------------
   这条链路里电视才是显示面，本机只负责出题、作答、看状态。
   所以不做「缩小的电视画面」，而是接管整屏做一张控制台：
     状态条（返回 / 眼别 / 操作 / 进度） → 电视预览 → 作答键。
   旧版把控制台塞进表单上方，390px 宽度下状态条必然挤出屏幕、被裁字。
   ========================================================================== */

/* 投屏进行中：收起 App 自身的顶栏与底部导航，避免误触和空间浪费 */
body.present-embed-on .topbar,
body.present-embed-on .bottom-nav,
body.present-embed-on .footer { display: none !important; }
body.present-embed-on .app-root { min-height: 100dvh; }
body.present-embed-on .page { padding: 0 !important; animation: none; }

.present-root.present-embed {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(120% 90% at 50% 0%, #0e1a24 0%, #070c11 55%, #04070a 100%);
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
}

/* ---------- 状态条 ---------- */
.pb-embed {
  display: block; padding: 0; gap: 0;
  background: rgba(5,9,13,.72);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.pb-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 8px;
}
.pb-back {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  height: 32px; padding: 0 12px 0 8px; border-radius: var(--r-full);
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16);
  color: #dbe8f2; font-size: 13px; font-weight: 600; cursor: pointer;
}
.pb-back svg { width: 14px; height: 14px; transform: rotate(180deg); }
.pb-back:active { background: rgba(255,255,255,.18); }

.pb-eye {
  flex: 0 0 auto; font-size: 13px; font-weight: 700; color: #cfe2f0;
  padding: 4px 10px; border-radius: var(--r-full);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
}
.pb-acts { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pb-acts .present-btn { width: 36px; height: 36px; border-radius: 10px; }

.pb-meta { display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.pb-meta .present-progress { height: 5px; }
.pb-meta .present-tag { font-size: 12px; color: #8ba3b6; font-variant-numeric: tabular-nums; }

.pb-status {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 7px 12px 9px; font-size: 12.5px; color: #7d94a7;
}
.pb-status .level-part { color: #a9c1d3; font-size: 12.5px; }
.pb-status .pb-dot { color: #4a6274; }
.pb-status .pb-sub { color: #6b8194; }

/* 受测者模式：级别与分节符一起隐藏 */
.present-root.hide-level .level-part,
.present-root.hide-level .pb-dot { display: none; }

/* ---------- 电视预览台 ---------- */
.pb-stage-cap {
  position: absolute; top: 6px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11.5px; color: #6b8194; letter-spacing: .02em;
}
.pb-stage-cap svg { width: 13px; height: 13px; }

.present-root.present-embed .present-stage {
  flex: 0 0 auto; min-height: 0; padding: 22px 16px 6px;
}
/* 预览做成 16:9 的「电视屏」：一眼看出这是电视上正在显示的画面 */
.present-root.present-embed .present-holder {
  background: #fff; border-radius: 14px;
  aspect-ratio: 16 / 9; width: 100%; height: auto; align-self: center;
  max-height: 36vh;
  box-shadow: 0 12px 30px rgb(0 0 0 / .5), inset 0 0 0 1px rgb(0 0 0 / .06);
  padding: 12px;
}
/* 电视才是精显示面，本机这块只是「电视现在显示什么」的缩略预览，
   所以按卡片高度等比放大，不追求物理尺寸（尺寸由电视端标定保证）。

   ⚠ 预览是白底（模拟电视画面），视标就必须是深色。
   全局规则 `.present-holder .opt-svg { color:#fff }` 是为暗色全屏模式写的，
   直接沿用会变成「白底白字」——用户只看到一块白板，以为没出题。
   这里把 color 和 text/tspan 的 fill 一起改掉，字符类视标（字母/数字/汉字）也一并覆盖。 */
.present-root.present-embed .present-holder svg,
.present-root.present-embed .present-holder .opt-svg {
  color: #0b1620;
  height: 62%; width: auto; max-width: 100%;
}
.present-root.present-embed .present-holder .opt-svg text,
.present-root.present-embed .present-holder .opt-svg tspan {
  fill: #0b1620;
}
/* 视标预览区的反馈：做成贴底的胶囊，不压住视标本身 */
.present-root.present-embed .present-feedback {
  bottom: 2px; font-size: 15px; font-weight: 700;
  opacity: 0; transition: opacity .16s var(--ease);
}
.present-root.present-embed .present-feedback.ok,
.present-root.present-embed .present-feedback.bad {
  opacity: 1; padding: 3px 14px; border-radius: var(--r-full);
  width: fit-content; margin: 0 auto;
  background: rgba(255,255,255,.08);
}

/* 结果页：预览卡居中，底部只留两个动作按钮 */
.present-root.present-embed.done .present-stage { flex: 1 1 auto; justify-content: center; }
.present-root.present-embed.done .pb-stage-cap { display: none; }
.present-root.present-embed.done .present-holder { max-height: 40vh; }

/* ---------- 结果卡 ---------- */
/* 预览底色是白的，结果文字必须用深色，否则整块「隐形」 */
.present-root.present-embed .present-result .pr-label { color: #64788c; font-size: 13px; letter-spacing: .06em; }
.present-root.present-embed .present-result .pr-value { color: #0b1620; font-size: 54px; line-height: 1.05; margin: 4px 0 6px; }
.present-root.present-embed .present-result .pr-sub { color: #33465a; font-size: 13.5px; margin-top: 2px; }
.present-root.present-embed .present-result .pr-sub.dim { color: #7b8ea0; }

.present-done-bar {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px;
  padding: 4px 16px calc(14px + env(safe-area-inset-bottom));
  animation: pageIn .2s var(--ease-out);
}
.present-done-bar .btn { width: 100%; }

/* ---------- 作答台 ---------- */
.present-root.present-embed .present-hint {
  flex: 0 0 auto; padding: 0 12px 2px; font-size: 12px; color: #7a90a3;
  border-top: 0; text-align: center;
}
.present-root.present-embed .present-pad {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  padding: 6px 12px calc(14px + env(safe-area-inset-bottom));
}
/* 方向盘：3×3，中心格是「看不清」—— 拇指半径内一次够到 5 个答案 */
.pp-cell { display: block; }

/* 本机直测（非投屏）在手机上的作答盘：46px 的格子装不下「看不清」三个字，
   手指也偏小，按屏幕宽度放大到 60px 并收紧文字 */
@media (max-width: 760px) {
  .present-root:not(.present-embed) .pp-dpad {
    grid-template-columns: repeat(3, minmax(0, 62px));
    grid-template-rows: repeat(3, 62px);
    gap: 7px;
  }
  .present-root:not(.present-embed) .pp-key-cant { font-size: 10.5px; padding: 0; }
  .present-root:not(.present-embed) .present-pad { gap: 10px; padding: 8px 12px 16px; }
}
.pp-key-cant {
  font-size: 12px; font-weight: 700; line-height: 1.2;
  border-radius: 14px; white-space: nowrap;
  background: hsl(var(--primary-h) 55% 50% / .26);
  border-color: hsl(var(--primary-h) 60% 60% / .45);
  color: #f0f8ff;
}
.present-root.present-embed .pp-dpad {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, 62px);
  gap: 9px; width: 100%; max-width: 360px;
}
.present-root.present-embed .pp-key { font-size: 22px; border-radius: 14px; }
.present-root.present-embed .pp-key:active { background: var(--primary); color: #fff; border-color: transparent; }

/* 字符型视标：等宽网格 + 可滚动，按钮不再被屏幕底边切掉 */
.pp-char-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px; width: 100%; max-width: 420px;
}
.present-root.present-embed .pp-chars {
  flex: 0 1 auto; max-height: 46dvh; overflow-y: auto;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  gap: 8px; -webkit-overflow-scrolling: touch;
}
.present-root.present-embed .pp-char {
  min-width: 0; height: 46px; font-size: 17px; border-radius: 12px;
}
.present-root.present-embed .pp-chars .pp-cant { width: 100%; max-width: 420px; }

.present-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }

/* 平板（竖握）：卡片与按键一起放大，纵向自然铺满，不硬塞两栏 */
@media (min-width: 760px) {
  .present-root.present-embed .present-holder { max-height: 44vh; }
  .present-root.present-embed .present-holder svg { height: 64%; }
  .present-root.present-embed .present-stage { flex: 1 1 auto; justify-content: center; }
  .present-root.present-embed .present-pad { flex: 0 0 auto; justify-content: flex-end; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .present-root.present-embed .pp-dpad { max-width: 520px; grid-template-rows: repeat(3, 80px); gap: 12px; }
  .present-root.present-embed .pp-key { font-size: 28px; }
  .present-root.present-embed .pp-key-cant { font-size: 15px; }
  .present-root.present-embed .present-hint { font-size: 13px; }
  .present-root.present-embed .pp-chars { max-height: 52vh; }
  .present-root.present-embed .pp-char-grid { max-width: 640px; }
  .present-root.present-embed .pp-char { height: 56px; font-size: 20px; }
  .present-root.present-embed .pp-chars .pp-cant { max-width: 640px; font-size: 15px; }
}

/* 横屏 / 大屏：预览与作答左右分栏 —— 此时横向空间比纵向值钱 */
@media (min-width: 760px) and (orientation: landscape), (min-width: 1000px) {
  .present-root.present-embed .present-body {
    display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
    align-items: stretch; gap: 6px;
  }
  .present-root.present-embed .present-stage { padding: 24px 10px 18px 24px; justify-content: center; }
  .present-root.present-embed .present-holder { max-height: 52vh; height: auto; align-self: center; }
  .present-root.present-embed .present-pad { padding: 10px 24px 18px 10px; }
  .present-root.present-embed .pp-dpad { max-width: 420px; grid-template-rows: repeat(3, 76px); }
  .present-root.present-embed .pp-chars { padding: 10px 24px 18px 10px; max-height: 58vh; }
  .present-root.present-embed .pp-char-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 460px; }
  .present-root.present-embed .pp-char { height: 54px; font-size: 19px; }
  .present-root.present-embed .pp-chars .pp-cant { max-width: 460px; }
}

/* ==========================================================================
   32. 桌面端信息密度修正（放在文件末尾以确保覆盖）
   ========================================================================== */
@media (min-width: 1080px) {
  /* 结果总览：6 格并排会缩成一排小字，改成 3 列两行，读数更醒目 */
  .ov-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .ov-val { font-size: 26px; }
  .ov-card { padding: 16px 17px; }
}

/* ==========================================================================
   33. 投屏同步状态（标定面板 / 测量控制台）
   --------------------------------------------------------------------------
   定尺和出题都要求「手机上的值」与「电视上正在显示的」是同一个。
   这里把一致性做成一眼可见的状态点，而不是让用户自己比对。
   ========================================================================== */
.tv-sync {
  margin-left: auto; flex: none;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 10px; border-radius: var(--r-full); white-space: nowrap;
}
.tv-sync.ok { background: var(--accent-soft); color: var(--accent); }
.tv-sync.busy { background: var(--primary-soft); color: var(--primary-ink); }
.tv-sync.warn { background: var(--warn-soft); color: var(--warn); }

.tv-sync-line { min-height: 20px; }
.tv-sync-line.ok { color: var(--accent); }
.tv-sync-line.warn { color: var(--warn); }

.pb-sync {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: #8ba3b6; font-variant-numeric: tabular-nums;
}
.pb-sync::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}
.pb-sync.ok { color: #5fd39b; }
.pb-sync.busy { color: #6fb7e8; }
.pb-sync.busy::before { animation: pbPulse 1s ease-in-out infinite; }
.pb-sync.warn { color: #f0b862; }
@keyframes pbPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
/* 单帧耗时：正常灰、偏慢橙。现场排查「慢在哪一段」用 */
.pb-perf {
  font-size: 11.5px; color: #7c93a6; font-variant-numeric: tabular-nums;
  margin-left: 6px; white-space: nowrap;
}
.pb-perf.slow { color: #f0b862; }

/* 图形视标作答键：画图形，不显示内部英文键名 */
.pp-char--shape {
  padding: 0; display: grid; place-items: center; overflow: hidden;
}
.pp-char--shape svg { width: 26px; height: 26px; color: #eaf2f8; }
.charpad-btn--shape svg { color: var(--ink); }

/* ==========================================================================
   34. 投屏配对浮层（任意页面就地完成配对）
   --------------------------------------------------------------------------
   旧版要点「屏幕与投屏」里先建配对，专项页的「投到电视」才有意义；
   用户点下去只会看到一句"需先配对"，路是断的。这里把配对搬到当前页。
   ========================================================================== */
.cast-ov {
  position: fixed; inset: 0; z-index: 10050;
  display: grid; place-items: center; padding: 16px;
  background: rgb(6 12 18 / .62); backdrop-filter: blur(3px);
  animation: pageIn .16s var(--ease-out);
}
.cast-ov-card {
  width: 100%; max-width: 420px; max-height: 88dvh; overflow-y: auto;
  background: var(--surface); border-radius: 18px;
  box-shadow: 0 24px 60px rgb(0 0 0 / .4);
  border: 1px solid var(--border);
}
.cast-ov-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 18px 8px;
}
.cast-ov-head h3 { margin: 0; font-size: 17px; }
.cast-ov-x {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2);
  cursor: pointer;
}
.cast-ov-body { padding: 4px 18px 10px; }
.cast-ov-body .hint { font-size: 12.5px; line-height: 1.7; }
.cast-ov-foot { padding: 6px 18px 16px; }
.cast-ov-note {
  display: flex; gap: 7px; align-items: flex-start; margin-top: 14px;
  padding: 9px 11px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; line-height: 1.6;
}
.cast-ov-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--primary); }

.cast-codebox {
  margin-top: 14px; padding: 14px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px dashed var(--border);
  text-align: center;
}
.cc-label { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.cc-code {
  font-size: 34px; font-weight: 800; letter-spacing: 8px;
  font-variant-numeric: tabular-nums; color: var(--primary-ink);
  margin-top: 2px; padding-left: 8px;
}
.cc-short {
  display: flex; flex-direction: column; gap: 3px; margin-top: 6px;
  padding: 9px 12px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--border);
}
.cc-short b { font-size: 14px; letter-spacing: .01em; color: var(--ink); word-break: break-all; }
.cc-short span { font-size: 11.5px; color: var(--muted); }
.cc-copy { margin-top: 2px; font-size: 12px; }
.cc-qr { display: flex; justify-content: center; margin: 12px 0 4px; }
.cc-qr svg { width: 148px; height: 148px; border-radius: 8px; background: #fff; padding: 6px; }
.cc-status {
  margin-top: 8px; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.cc-status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: pbPulse 1.1s ease-in-out infinite;
}
.cc-status.ok { color: var(--accent); font-weight: 650; }
.cc-status.ok::before { animation: none; }

/* 不支持投屏的专项：给一句明确说明，不留一个点了没反应的入口 */
.no-cast-note {
  display: flex; gap: 7px; align-items: flex-start;
  margin-top: 12px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; line-height: 1.65; color: var(--ink-2);
}
.no-cast-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--muted); }

/* 标定面板：出图分辨率切换 */
.tv-res-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 2px 0 12px;
}
.tv-res-line .hint { font-size: 12px; }
.tv-res-row { display: flex; gap: 6px; }
.tv-res-row .chip { padding: 4px 12px; font-size: 12.5px; }

/* 配对浮层：解释「为什么这台设备不能直连」+ 手机扫码直投 */
.cast-ov-why {
  padding: 11px 13px; border-radius: var(--r-md); margin-bottom: 12px;
  background: var(--warn-soft); color: var(--warn);
  font-size: 12.5px; line-height: 1.65;
}
.cast-ov-why .cow-t { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.cast-ov-why .cow-t svg { width: 16px; height: 16px; flex: none; }
.cast-ov-why .cow-b { color: var(--ink-2); }
.cast-ov-why .cow-b b { color: var(--ink); }

.cc-phone {
  display: flex; gap: 14px; align-items: center; margin-top: 10px;
  padding: 12px; border-radius: var(--r-md); background: var(--surface-2);
  border: 1px solid var(--border);
}
.cc-phone .cc-qr { margin: 0; flex: 0 0 auto; }
.cc-phone .cc-qr svg { width: 108px; height: 108px; }
.cc-phone-t { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); line-height: 1.55; }
.cc-phone-t b { font-size: 13px; color: var(--ink); }

/* 投屏适用性说明（入口页） */
.cast-eligibility {
  padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--border);
}
.cast-eligibility h3 { margin: 0 0 6px; font-size: 14.5px; }
.cast-eligibility ul { margin: 10px 0 0; padding-left: 1.1em; font-size: 12.5px; line-height: 1.85; color: var(--ink-2); }
.cast-eligibility li { margin-bottom: 4px; }
.cast-eligibility b { font-size: 11.5px; padding: 1px 7px; border-radius: var(--r-full); margin-right: 5px; }
.ce-ok { background: var(--accent-soft); color: var(--accent); }
.ce-mid { background: var(--warn-soft); color: var(--warn); }
.ce-no { background: var(--surface-3); color: var(--muted); }

/* ---------- 屏幕体检（#/cast/screencheck） ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { min-width: 48px; justify-content: center; }

.sub-head .h3 { margin: 0 0 6px; }

.kv-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border);
}
.kv-row:last-of-type { border-bottom: 0; }
.kv-k { color: var(--muted); font-size: 13px; flex: none; }
.kv-v { text-align: right; font-weight: 600; font-size: 14px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: var(--r-full);
  background: var(--surface-3); color: var(--muted);
  font-size: 11.5px; font-weight: 600; margin-left: 6px;
}
.tag-ok { background: var(--primary-soft); color: var(--primary-ink); }

.sc-grade { border-radius: var(--r-lg); padding: 18px 20px; }
.sc-grade-ok { background: var(--primary-soft); }
.sc-grade-warn { background: var(--warn-soft); }
.sc-grade-danger { background: var(--danger-soft); }
.sc-grade-label { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.sc-grade-value { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.sc-grade-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.sc-grade-ok .sc-grade-value { color: var(--primary-ink); }
.sc-grade-warn .sc-grade-value { color: var(--warn); }
.sc-grade-danger .sc-grade-value { color: var(--danger); }

.sc-table { display: flex; flex-direction: column; }
.sc-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.sc-row:last-child { border-bottom: 0; }
.sc-k { color: var(--muted); flex: 1 1 auto; min-width: 0; }
.sc-v { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; flex: 0 0 auto; max-width: 58%; }
