/* ============================================================================
   AXP Saccade Pro｜視動命名系統 — Optical Instrument UI/UX Stylesheet
   File 2/5 (V2.4 Root-Cause Geometry & Adaptive Posture Layout): style.css
   Last Optimized: 2026-11-24 12:43:00 CST (Asia/Taipei, YYYY-MM-DD HH:mm:ss)
   ============================================================================ */

:root {
  --bg-stage: #000000;
  --bg-deep: #070d18;
  --bg-glass: rgba(11, 19, 35, 0.90);
  --bg-card: rgba(17, 29, 51, 0.92);
  --bg-card-solid: #0f1a2e;
  --border-subtle: rgba(148, 163, 184, 0.20);
  --border-focus: rgba(56, 189, 248, 0.65);

  --txt-primary: #f8fafc;
  --txt-secondary: #cbd5e1;
  --txt-muted: #94a3b8;

  --accent-sky: #38bdf8;
  --accent-blue: #2563eb;
  --accent-gold: #eab308;
  --accent-emerald: #22c55e;
  --accent-amber: #f97316;
  --accent-rose: #ef4444;

  /* 舞台垂直安全區常數：頂部避開 #live-status-pill，底部避開周邊融像鎖底框 */
  --safe-stage-top: 62px;
  --safe-stage-bottom: 26px;

  /* 專業版紅藍眼鏡預設輸出色（由 JS 即時依色偏、亮度與強勢眼退火動態覆寫） */
  --opt-red: rgb(245, 15, 0);
  --opt-blue: rgb(0, 107, 255);
  --opt-red-border: rgba(245, 15, 0, 0.85);
  --opt-blue-border: rgba(0, 107, 255, 0.85);

  /* 嚴守原生蘋方體渲染鐵則，英文與西元時間數字採用等寬對齊之 Montserrat */
  --font-zh: -apple-system, BlinkMacSystemFont, "PingFang TC", "Hiragino Sans CNS", "Microsoft JhengHei", sans-serif;
  --font-num: "Montserrat", -apple-system, BlinkMacSystemFont, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-stage);
  color: var(--txt-primary);
  font-family: var(--font-zh);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 嚴格防白屏外層保護（僅作用於最外層容器本身，絕不使用萬用字元 *） */
.axp-sp-wrapper {
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-stage);
}

kbd {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e2e8f0;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.eyebrow-tag {
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-sky);
  margin-bottom: 6px;
}

.eyebrow-row .eyebrow-tag {
  margin-bottom: 0;
}

/* 全站統一台灣標準西元時間膠囊（YYYY-MM-DD HH:mm:ss 等寬不跳動） */
.tw-clock-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #93c5fd;
  white-space: nowrap;
}

/* 硬體即時狀態指示燈（麥克風 ／ 視訊鏡頭） */
.hw-led-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.hw-led-badge .hw-led-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  font-style: normal;
}

.hw-led-badge.is-off {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.22);
  color: #64748b;
}

.hw-led-badge.is-off .hw-led-dot {
  background: #475569;
  box-shadow: none;
}

.hw-led-badge.is-on {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.55);
  color: #86efac;
}

.hw-led-badge.is-on .hw-led-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

/* ============================================================================
   1. 手機攔截與安全通行碼登入層
   ============================================================================ */
.fullscreen-guard {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: radial-gradient(circle at 50% 18%, #132342 0%, #060b16 64%, #000000 100%);
}

.guard-card, .auth-panel {
  width: 100%;
  max-width: 468px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 34px 32px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.72);
}

.guard-card h1, .auth-heading {
  margin: 0 0 10px;
  font-size: 23px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.guard-card p, .auth-sub {
  margin: 0 0 24px;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--txt-muted);
}

.guard-hint {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.28);
  font-size: 13px;
  color: #bae6fd;
  text-align: center;
}

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--txt-secondary);
  margin-bottom: 6px;
}

.ui-input, .ui-select, .ui-select-sm {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #060b14;
  color: #ffffff;
  font-family: var(--font-zh);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease;
}

.ui-select-sm {
  padding: 7px 9px;
  font-size: 12.5px;
}

.ui-input-compact {
  width: 228px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(6, 11, 20, 0.92);
  color: #f8fafc;
  font-family: var(--font-zh);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.18s ease;
}

.ui-input:focus, .ui-select:focus, .ui-select-sm:focus, .ui-input-compact:focus {
  border-color: var(--border-focus);
}

/* 確保深色主題下原生日期選擇器日曆圖示清晰可見 */
input[type="date"].ui-input {
  font-family: var(--font-num);
  color-scheme: dark;
}

.chk-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--txt-muted);
  margin: 4px 0 20px;
  cursor: pointer;
}

.btn-main, .btn-launch {
  padding: 11px 22px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.34);
  transition: opacity 0.16s ease, transform 0.1s ease;
}

.btn-main { width: 100%; }
.btn-main:hover, .btn-launch:hover { opacity: 0.92; }
.btn-main:active, .btn-launch:active { transform: scale(0.99); }
.btn-main:disabled, .btn-launch:disabled { opacity: 0.5; cursor: not-allowed; }

.feedback-msg {
  margin-top: 12px;
  min-height: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #fca5a5;
}

/* ============================================================================
   2. 頂部極簡狀態列與懸浮毛玻璃光學控制抽屜 (按 E 鍵收折・支援矮螢幕捲動)
   ============================================================================ */
#main-workspace {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-stage);
}

.topbar {
  min-height: 54px;
  padding: 6px 18px;
  background: rgba(7, 13, 24, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-en {
  font-family: var(--font-num);
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ffffff;
}

.brand-zh {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-sky);
}

.topbar-shortcuts {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--txt-muted);
}

@media (max-width: 1340px) {
  .topbar-shortcuts { display: none; }
}

.topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.30);
  color: #bae6fd;
  white-space: nowrap;
}

.pill-subtle {
  font-family: var(--font-num);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  white-space: nowrap;
}

.btn-ghost, .btn-ghost-sm, .btn-mini {
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(17, 29, 51, 0.85);
  color: var(--txt-secondary);
  font-family: var(--font-zh);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s;
}

.btn-ghost { padding: 7px 12px; font-size: 13px; }
.btn-ghost-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-mini { padding: 5px 9px; font-size: 12px; white-space: nowrap; }

.btn-ghost:hover, .btn-ghost-sm:hover, .btn-mini:hover {
  border-color: var(--accent-sky);
  color: #ffffff;
}

.btn-gold {
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid rgba(234, 179, 8, 0.50);
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  font-family: var(--font-zh);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease;
}

.btn-gold:hover {
  background: rgba(234, 179, 8, 0.24);
}

.btn-audit-sync {
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.58);
  background: rgba(14, 165, 233, 0.18);
  color: #bae6fd;
  font-family: var(--font-zh);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.btn-audit-sync:hover {
  background: rgba(14, 165, 233, 0.30);
  border-color: #38bdf8;
  color: #ffffff;
}

.btn-audit-sync:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-danger-outline {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-family: var(--font-zh);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* 懸浮毛玻璃工具面板：加入 max-height 與內部捲動，徹底根除 13 吋筆電底部裁切 */
.glass-drawer {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 1440px;
  max-height: calc(100vh - 78px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.78);
  z-index: 35;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.glass-drawer::-webkit-scrollbar {
  width: 6px;
}

.glass-drawer::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.30);
  border-radius: 99px;
}

.glass-drawer.is-collapsed {
  display: none;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.drawer-header h2 {
  margin: 0;
  font-size: 17px;
  color: #ffffff;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1240px) {
  .drawer-grid { grid-template-columns: repeat(2, 1fr); }
}

.param-card {
  background: rgba(10, 18, 34, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 13px 14px;
}

.param-card h3 {
  margin: 0 0 11px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-sky);
  letter-spacing: 0.03em;
}

.ctrl-item {
  margin-bottom: 10px;
}

.ctrl-item:last-child {
  margin-bottom: 0;
}

.ctrl-item label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--txt-secondary);
  margin-bottom: 4px;
}

.ctrl-item label strong {
  font-family: var(--font-num);
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
}

.ctrl-item input[type="range"] {
  width: 100%;
  accent-color: var(--accent-sky);
  cursor: pointer;
}

.inline-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-pair > * {
  flex: 1;
}

.inline-pair > .btn-mini {
  flex: 0 0 auto;
}

.micro-warn {
  margin-top: 4px;
  font-size: 11.5px;
  color: #93c5fd;
}

.sensor-bar {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mic-meter {
  flex: 1;
  height: 7px;
  border-radius: 99px;
  background: #040811;
  border: 1px solid rgba(148, 163, 184, 0.24);
  overflow: hidden;
}

.mic-meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 70%, #ef4444 100%);
  transition: width 0.05s linear;
}

.sensor-txt {
  font-size: 11.5px;
  color: var(--txt-muted);
  white-space: nowrap;
}

/* ============================================================================
   3. 純黑雙眼分視舞台、周邊融像鎖與 2~12 排手風琴安全區矩陣
   ============================================================================ */
.stage-canvas {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: calc(100vh - 54px);
  background-color: #000000;
  overflow: hidden;
  user-select: none;
}

/* 全螢幕或實測進行中舞台填滿 100vh */
body.is-running .topbar {
  display: none !important;
}

body.is-running .stage-canvas {
  min-height: 100vh;
}

/* 雙眼周邊融像鎖定錨框（深灰中性色，透過紅片與藍片雙眼皆可見以穩定周邊融像） */
.fusion-lock-frame {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  pointer-events: none;
  z-index: 4;
}

.fl-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: rgba(203, 213, 225, 0.34);
  border-style: solid;
}

.fl-corner.tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.fl-corner.tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.fl-corner.bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.fl-corner.br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* 僅參數調整時淡顯之中央比例線（測驗開始瞬間 JS 強制 display:none） */
.config-guide-line {
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 50%;
  width: 1px;
  border-left: 1px dashed rgba(148, 163, 184, 0.18);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
}

/* 4 拍預備倒數中央對位錨點 */
.countdown-box {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 25;
  pointer-events: none;
}

.fixation-ring {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.65);
  margin-bottom: 14px;
  position: relative;
}

.fixation-ring::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
}

.countdown-digit {
  font-family: var(--font-num);
  font-size: 68px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.countdown-caption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--txt-muted);
}

/* 暫停遮罩 */
.pause-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 28;
}

.pause-title {
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.pause-sub {
  font-size: 14px;
  color: var(--txt-secondary);
}

.pause-btn-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 測驗進行中極簡頂部微光狀態膠囊（保留滑鼠／觸控點擊控制能力） */
.live-hud-pill {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(7, 13, 24, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.20);
  font-size: 12px;
  color: rgba(203, 213, 225, 0.90);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 50;
  white-space: nowrap;
}

.rec-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-rose);
  margin-right: 6px;
}

.hud-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 6px;
  border-left: 1px solid rgba(148, 163, 184, 0.22);
}

.hud-action-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.92);
  color: #cbd5e1;
  font-family: var(--font-zh);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.hud-action-btn:hover {
  border-color: var(--accent-sky);
  color: #ffffff;
}

.hud-action-btn.is-finish {
  border-color: rgba(234, 179, 8, 0.48);
  color: #fde047;
}

.hud-action-btn.is-finish:hover {
  background: rgba(234, 179, 8, 0.18);
}

/* 2 ~ 12 排視標容器：嚴格鎖定在 [top: 62px ~ bottom: 26px] 安全帶內，絕不與頂部狀態膠囊重疊 */
.columns-layer {
  position: absolute;
  top: var(--safe-stage-top);
  bottom: var(--safe-stage-bottom);
  left: 0;
  right: 0;
  height: auto;
  z-index: 10;
}

.saccade-col {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stim-token {
  font-family: var(--font-num);
  font-weight: 800;
  line-height: 1.04;
  padding: 2px 6px;
  border-radius: 5px;
  transition: opacity 0.04s linear;
}

.stim-token.ch-red {
  color: var(--opt-red);
}

.stim-token.ch-blue {
  color: var(--opt-blue);
}

.stim-token.ch-white {
  color: #f8fafc;
}

/* 紅藍異色擁擠干擾框：紅字外包藍細框、藍字外包紅細框 */
.stim-token.crowd-red-on-blue {
  outline: 1.5px solid var(--opt-red-border);
  outline-offset: 2px;
}

.stim-token.crowd-blue-on-red {
  outline: 1.5px solid var(--opt-blue-border);
  outline-offset: 2px;
}

.stim-token.is-preview-dim {
  opacity: 0.28;
}

.stim-token.is-unlit {
  opacity: 0;
}

/* ============================================================================
   4. 雙軌報告區（客戶客觀減壓視角 ⟷ 驗光師臨床數據視角）
   ============================================================================ */
.report-wrapper {
  background: var(--bg-deep);
  border-top: 1px solid var(--border-subtle);
  padding: 34px 24px 64px;
  min-height: 100vh;
}

.report-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.report-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.report-topbar h2 {
  margin: 0 0 6px;
  font-size: 24px;
  color: #ffffff;
}

.report-meta {
  font-size: 13.5px;
  color: var(--txt-muted);
  font-variant-numeric: tabular-nums;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented-switch {
  display: inline-flex;
  background: #060b14;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
}

.seg-btn {
  padding: 6px 13px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--txt-muted);
  font-family: var(--font-zh);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.seg-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
}

.sync-tag {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.36);
  color: #86efac;
  white-space: nowrap;
}

/* 客戶客觀解析視角卡片網格：當右側出現雙圖對照時自動分配更充裕寬度 */
.client-hero-grid, .vector-stamina-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 18px;
  margin-bottom: 18px;
}

.client-hero-grid.has-wide-pair {
  grid-template-columns: 0.96fr 1.04fr;
}

@media (max-width: 1040px) {
  .client-hero-grid, .client-hero-grid.has-wide-pair, .vector-stamina-grid {
    grid-template-columns: 1fr;
  }
}

.empathy-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 22px 24px;
}

.empathy-card.primary {
  background: linear-gradient(155deg, #112240 0%, #0c172b 100%);
  border-color: rgba(56, 189, 248, 0.32);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-sky);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.zoom-hint-tag {
  font-size: 11px;
  color: var(--txt-muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

.empathy-card h3 {
  margin: 0 0 10px;
  font-size: 21px;
  color: #ffffff;
}

.empathy-prose {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--txt-secondary);
}

.client-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.client-stat-strip span {
  display: block;
  font-size: 12px;
  color: var(--txt-muted);
  margin-bottom: 4px;
}

.client-stat-strip strong {
  font-family: var(--font-num);
  font-size: 22px;
  color: #ffffff;
}

/* 頭位基準照卡片：預設為「單張 4:3 左圖右文並排」；若為「>=3.0° 雙格對照」自動轉為上下滿寬高清晰排版 */
.head-evidence-body {
  display: flex;
  gap: 16px;
  align-items: center;
}

.head-photo-box {
  width: 192px;
  aspect-ratio: 4 / 3;
  height: auto;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #060b14;
  border: 1px solid rgba(148, 163, 184, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  transition: border-color 0.16s ease;
}

.head-photo-box:hover {
  border-color: var(--accent-sky);
}

.head-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 雙格對照橫圖模式（980×412）：100% 滿寬展開，十字基準線與西元時間一目了然 */
.head-evidence-card.is-comparison-pair .head-evidence-body {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.head-evidence-card.is-comparison-pair .head-photo-box {
  width: 100%;
  aspect-ratio: 980 / 412;
}

.head-steady-badge {
  padding: 12px;
  font-size: 12.5px;
  color: #86efac;
  text-align: center;
  line-height: 1.5;
}

.head-count-line {
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 6px;
}

.head-prose-box p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--txt-secondary);
}

.head-card-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vector-canvas {
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #050a14;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.empathy-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--txt-secondary);
}

.empathy-list li {
  margin-bottom: 8px;
}

/* 驗光師臨床精密數據視角 */
.clinician-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 980px) {
  .clinician-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

.kpi-box {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px 18px;
}

.kpi-box span {
  display: block;
  font-size: 12px;
  color: var(--txt-muted);
  margin-bottom: 6px;
}

.kpi-box strong {
  display: block;
  font-family: var(--font-num);
  font-size: 25px;
  color: #ffffff;
  margin-bottom: 4px;
}

.kpi-box small {
  font-size: 12px;
  color: var(--txt-secondary);
}

.pro-table-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.pro-table-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--accent-sky);
}

.pro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pro-table th, .pro-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  text-align: left;
}

.pro-table th {
  color: var(--txt-muted);
  font-weight: 600;
}

.audit-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.audit-header-bar h3 { margin: 0 0 4px; }
.audit-hint { font-size: 12px; color: var(--txt-muted); }

.audit-cells-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}

.audit-item {
  background: #070e1b;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 9px;
  padding: 8px 9px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.audit-item:hover {
  border-color: var(--accent-sky);
  transform: translateY(-1px);
}

.audit-item.flag-slow {
  border-color: rgba(249, 115, 22, 0.78);
  background: rgba(249, 115, 22, 0.10);
}

.audit-item.flag-err {
  border-color: rgba(239, 68, 68, 0.85);
  background: rgba(239, 68, 68, 0.15);
}

.audit-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--txt-muted);
}

.audit-char {
  font-family: var(--font-num);
  font-size: 19px;
  font-weight: 800;
  margin: 3px 0;
}

.audit-rt {
  font-family: var(--font-num);
  font-size: 11.5px;
  color: #e2e8f0;
}

/* 法定標準範圍聲明與品牌頁尾 */
.report-legal-footer {
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--txt-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================================
   5. Admin 最高管理中心與高解析照片檢視彈窗
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 95;
}

.modal-window {
  width: 100%;
  max-width: 1120px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0b1527;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 24px 26px;
}

.modal-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-topbar h2 {
  margin: 0;
  font-size: 19px;
  color: #ffffff;
}

.modal-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-form-box {
  background: #101d35;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.admin-form-box h3 {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--accent-sky);
}

.admin-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.admin-inputs-grid label {
  display: block;
  font-size: 12px;
  color: var(--txt-secondary);
  margin-bottom: 4px;
}

.admin-submit-bar, .history-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.table-scroll {
  overflow-x: auto;
}
