   Offline Banner
═══════════════════════════════════ */
#offline-banner {
  display: none; position: fixed; top: var(--hdr-h); left: 0; right: 0; z-index: 60;
  background: rgba(217,119,6,.95); color: #78350f;
  font-size: .78rem; font-weight: 600; text-align: center; padding: 5px 40px 5px 16px;
}
#offline-banner button { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #78350f; font-size: 1.1rem; }

/* ═══════════════════════════════════
   Scrollbar
═══════════════════════════════════ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 4px; }

/* ═══════════════════════════════════
   Desktop Sidebar Rail (≥1024px) — true rail
═══════════════════════════════════ */
@media (min-width: 1024px) {
  /* Transform #bottom-nav into a left sidebar rail */
  #bottom-nav {
    top: 0; bottom: 0; left: 0; right: auto;
    width: var(--sidebar-w); height: 100dvh;
    padding: 16px 12px 16px;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    align-content: start; gap: 2px;
    border-right: 1px solid var(--c-border); border-top: none;
    box-shadow: none;
  }
  .nav-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px 18px;
    font-size: var(--fs-15); font-weight: 700; letter-spacing: -.01em;
    color: var(--c-text);
  }
  .nav-logo-box {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--c-primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .nav-logo-box svg { width: 16px; height: 16px; stroke: #fff; }
  .nav-group-lbl {
    display: block;
    font-size: 11px; font-weight: 600; color: var(--c-muted);
    text-transform: uppercase; letter-spacing: .08em;
    padding: 12px 12px 6px;
  }
  .nav-btn {
    flex-direction: row; justify-content: flex-start;
    padding: 10px 12px; gap: 12px;
    font-size: var(--fs-14); font-weight: 500;
    border-radius: var(--r-sm);
    min-height: 40px;
  }
  .nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
  .nav-btn.active {
    color: var(--c-primary);
    background: var(--c-primary-10);
    font-weight: 600;
  }
  .nav-btn.active::after { display: none; }
  .nav-btn:hover:not(.active) { background: var(--c-surface2); color: var(--c-text); }
  /* 桌機 sidebar：練習按鈕跟其他選項視覺**完全一樣** — 不再圓形 / 朱印紅 / 突出 / 文字小
     mobile FAB 樣式全部 reset，避免 user 看到列表中一個莫名其妙染紅的 item
     2026-05-06 redesign（3 位 expert mesh 結論：sidebar 是列表掃描，強調反而干擾） */
  .nav-btn-primary {
    /* button 樣式 reset 回 .nav-btn 預設（行內 + padding + 灰字） */
    flex-direction: row; justify-content: flex-start; align-items: center;
    height: auto;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    z-index: auto;
    gap: 12px;
  }
  /* SVG 從 FAB 模式 reset 回普通 nav icon */
  .nav-btn-primary svg {
    width: 18px !important; height: 18px !important;
    padding: 0;
    background: transparent;
    color: inherit;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    box-sizing: content-box;
    stroke-width: 2 !important;
  }
  /* 文字 reset 回普通 nav 文字 */
  .nav-btn-primary span {
    display: inline;
    margin-top: 0;
    font-size: var(--fs-14);
    font-weight: 500;
    color: inherit;
    letter-spacing: normal;
    line-height: normal;
  }
  /* Hover / active 跟其他 nav-btn 一致 */
  .nav-btn-primary:hover svg,
  .nav-btn-primary:active svg { background: transparent; transform: none; }
  .nav-btn-primary:hover:not(.active) {
    background: var(--c-surface2);
  }
  .nav-btn-primary:hover:not(.active) span { color: var(--c-text); }
  .nav-btn-primary.active span {
    color: var(--c-primary);
    font-weight: 600;
  }
  .nav-btn-primary.active {
    background: var(--c-primary-10);
  }
  /* Dark mode：FAB 陰影 reset（sidebar SVG 不需要） */
  [data-theme="dark"] .nav-btn-primary svg { box-shadow: none; }

  .nav-badge {
    position: static; margin-left: auto;
    border: none; border-radius: 999px;
    padding: 0 6px; height: 18px; min-width: 18px;
    font-size: 11px;
  }
  /* Footer: theme toggle + avatar */
  .nav-footer {
    display: flex; margin-top: auto; padding: 12px 8px 4px;
    border-top: 1px solid var(--c-border);
    align-items: center; gap: 8px;
  }
  .nav-footer-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px; border-radius: var(--r-sm);
    background: transparent; border: 1px solid transparent;
    color: var(--c-muted); font-size: var(--fs-13); font-weight: 500;
    cursor: pointer; transition: background .15s, color .15s;
  }
  .nav-footer-btn:hover { background: var(--c-surface2); color: var(--c-text); }
  .nav-footer-btn svg { width: 16px; height: 16px; }

  /* Main content shifts right, header spans remaining width */
  #main {
    margin-left: var(--sidebar-w);
    padding-bottom: 0;
    min-height: 100dvh;
  }
  #app-header {
    left: var(--sidebar-w);
  }
  /* SEO link hub 跟 footer 是 <main> 兄弟、掛在 <body> 直系，沒繼承 main 的
     margin-left:240px → 桌機側欄（fixed left rail, z-index:50）會把最左欄
     col1 整片蓋掉。同步加上 sidebar offset。 */
  .seo-link-hub,
  body > footer {
    margin-left: var(--sidebar-w);
  }
  .prac-topbar, .laws-search, .law-sticky-header { top: var(--hdr-h); }
  #action-bar { left: var(--sidebar-w); bottom: 0; }
  #scroll-top-btn { bottom: 24px; }

  /* Hide mobile header redundancy: sidebar has logo, header shows breadcrumb/countdown */
  #app-header .hdr-logo { display: none; }
  /* On desktop, feedback button moves to sidebar footer — hide from header (theme stays in header for visibility) */
  #app-header #feedback-btn { display: none; }
}

/* ═══════════════════════════════════
   Reduced motion
═══════════════════════════════════ */
/* < sm (480) — 小手機特殊處理 */
@media (max-width: 479.98px) {
  .quick-jump-row { flex-wrap: wrap; }
  .qj-sel { min-width: calc(50% - 4px); flex: 0 0 calc(50% - 4px); }
  .quick-jump-row .btn { flex: 0 0 100%; margin-top: 4px; }
  /* .q-text / .opt 在 < 540px 由後面 RWD override 統一處理（避免三層衝突） */
  .essay-reveal-btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════════════════════════
   HOME — Continue / Rec / QuickJump
═══════════════════════════════════ */
.continue-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 14px 16px;
  margin: 10px 0 6px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  transition: box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow-sm); width: 100%; text-align: left;
}
.continue-card:hover { border-color: var(--c-primary); box-shadow: var(--shadow-md); }
.continue-icon {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  background: var(--c-primary-10);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.continue-icon svg { width: 20px; height: 20px; stroke: var(--c-primary); }
.continue-info { flex: 1; min-width: 0; }
.continue-info strong { font-size: .88rem; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c-text); }
.continue-info span { font-size: .74rem; color: var(--c-muted); }
.continue-arrow svg { width: 16px; height: 16px; stroke: var(--c-muted); }

.today-rec-card {
  background: linear-gradient(135deg, var(--c-primary-10), var(--c-primary-20));
  border: 1px solid var(--c-primary-20); border-radius: var(--r-lg);
  padding: 16px; margin: 6px 0; cursor: pointer;
  transition: box-shadow .15s; width: 100%; text-align: left;
}
.today-rec-card:hover { box-shadow: var(--shadow-md); }
.today-rec-label { font-size: .68rem; font-weight: 700; color: var(--c-primary); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.today-rec-name { font-size: .95rem; font-weight: 700; margin-bottom: 4px; color: var(--c-text); }
.today-rec-meta { font-size: .78rem; color: var(--c-muted); margin-bottom: 12px; }
.today-rec-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: var(--r-sm); background: var(--c-primary); color: white; font-size: .82rem; font-weight: 600; }

.quick-jump-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}
.quick-jump-label { font-size: .68rem; font-weight: 700; color: var(--c-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.quick-jump-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.qj-sel {
  flex: 1; min-width: 80px; padding: 7px 8px; border-radius: var(--r-sm);
  border: 1.5px solid var(--c-border); background: var(--c-surface2);
  color: var(--c-text); font-size: .78rem; font-family: inherit;
  transition: border-color .15s;
}
.qj-sel:focus { outline: none; border-color: var(--c-primary); }

.countdown-strip {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px; border-radius: var(--r-md);
  background: var(--c-surface); border: 2px solid var(--c-border);
  margin: 10px 0 4px; box-shadow: var(--shadow-sm);
}
.countdown-strip.urgent { border-color: #f97316; background: rgba(249,115,22,.05); }
.countdown-strip.critical { border-color: var(--c-danger); background: rgba(220,38,38,.06); animation: cd-pulse 2s ease-in-out infinite; }
@keyframes cd-pulse { 0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,.15)} 50%{box-shadow:0 0 0 6px rgba(220,38,38,0)} }
.countdown-num-wrap { display: flex; align-items: baseline; gap: 4px; flex-shrink: 0; }
.countdown-days { font-size: 3.6rem; font-weight: 900; color: var(--c-primary); line-height: 1; }
.countdown-strip.urgent .countdown-days { color: #f97316; }
.countdown-strip.critical .countdown-days { color: var(--c-danger); }
.countdown-unit { font-size: 1.1rem; font-weight: 700; color: var(--c-muted); align-self: flex-end; margin-bottom: 6px; }
.countdown-info { flex: 1; min-width: 0; }
.countdown-info strong { font-size: .95rem; font-weight: 700; display: block; }
.countdown-strip.urgent .countdown-info strong { color: #f97316; }
.countdown-strip.critical .countdown-info strong { color: var(--c-danger); }
.countdown-info small { font-size: .72rem; color: var(--c-muted); margin-top: 2px; display: block; }
.countdown-date-inp {
  font-size: .76rem; padding: 5px 8px; border-radius: var(--r-sm);
  border: 1.5px solid var(--c-border); background: var(--c-surface2);
  color: var(--c-text); font-family: inherit; flex-shrink: 0;
}
.countdown-date-inp:focus { outline: none; border-color: var(--c-primary); }

/* Section collapsible */
.section-hdr { cursor: pointer; user-select: none; }
.section-hdr .chev-toggle { width: 16px; height: 16px; flex-shrink: 0; transition: transform .2s; margin-left: auto; }
.section-hdr.collapsed .chev-toggle { transform: rotate(-90deg); }
.exam-section-body.collapsed { display: none; }

/* ═══════════════════════════════════
   PRACTICE — Simplified topbar badges
═══════════════════════════════════ */
.prac-hist-badge {
  font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 20px;
  background: var(--c-primary-10); color: var(--c-primary); flex-shrink: 0;
}
.prac-mode-badge { font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; }
.prac-mode-badge.review { background: rgba(5,150,105,.12); color: var(--c-success); }
.prac-mode-badge.exam   { background: rgba(220,38,38,.1);  color: var(--c-danger);  }

/* ═══════════════════════════════════
   BOTTOM SHEET
═══════════════════════════════════ */
.sheet-overlay {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.42);
  /* 2026-04-30 升級：glass blur，搭配 premium sheet */
  backdrop-filter: blur(6px) saturate(110%);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
}
.sheet-overlay.open { display: block; }
.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 81;
  background: var(--c-surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 0 20px calc(env(safe-area-inset-bottom,0px) + 20px);
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32,0,.67,0);
  max-height: 88vh; overflow-y: auto;
}
.bottom-sheet.open { transform: translateY(0); transition: transform .32s cubic-bezier(.22,1,.36,1); }
.sheet-handle { width: 36px; height: 4px; background: var(--c-border); border-radius: 2px; margin: 14px auto 18px; }
.sheet-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 3px; }
.sheet-subtitle { font-size: .8rem; color: var(--c-muted); margin-bottom: 20px; }
.sheet-section { margin-bottom: 18px; }
.sheet-section-lbl { font-size: .68rem; font-weight: 700; color: var(--c-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.sheet-year-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.sheet-year-scroll::-webkit-scrollbar { display: none; }
.sheet-year-row { display: flex; gap: 5px; width: max-content; }
.sheet-mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-mode-btn {
  padding: 12px 10px; border-radius: var(--r-md);
  border: 2px solid var(--c-border); background: var(--c-surface2);
  font-size: .88rem; font-weight: 600; color: var(--c-muted);
  cursor: pointer; transition: all .15s; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.sheet-mode-btn svg { width: 20px; height: 20px; }
.sheet-mode-btn.active { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-10); }
.sheet-start {
  width: 100%; padding: 14px; border-radius: var(--r-md);
  background: var(--c-primary); color: white;
  font-size: 1rem; font-weight: 700; border: none; cursor: pointer;
  margin-top: 4px; transition: background .15s; min-height: 50px;
}
.sheet-start:hover { background: var(--c-primary-h); }

/* ═══════════════════════════════════════════════════════
   PRACTICE SHEET PRO — 2026 旗艦級 editorial 設計
   特色：editorial typography、scroll-snap year rail、rich mode cards、
        live preflight、shine CTA、scroll-driven year progress、
        :has() 連動高亮、@starting-style 進場動畫、view transitions ready
   ═══════════════════════════════════════════════════════ */
.bottom-sheet.bottom-sheet-pro {
  /* 取代原本 0 20px → editorial 上下 padding 更舒展；保留水平 20px。 */
  padding: 0 22px calc(env(safe-area-inset-bottom,0px) + 24px);
  /* 紙感雙層 — 主背景上覆 noise 微紋，hover 才看得出來，不喧賓奪主。 */
  background:
    linear-gradient(180deg, var(--c-surface) 0%, var(--c-paper-2, var(--c-surface)) 100%);
  /* 印鑑紅 hairline 收口（頂部 1px 朱痕，editorial signature） */
  box-shadow:
    inset 0 1px 0 0 color-mix(in oklch, var(--c-vermilion, #B23A2B) 18%, transparent),
    0 -8px 32px -16px rgba(0,0,0,.18);
}
.bottom-sheet.bottom-sheet-pro .sheet-handle {
  width: 44px; height: 5px;
  background: linear-gradient(90deg, transparent 0%, var(--c-border) 30%, var(--c-border) 70%, transparent 100%);
  margin: 12px auto 4px;
}
.psheet-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 1px solid transparent;
  color: var(--c-muted); cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.psheet-close:hover { background: var(--c-surface2); color: var(--c-text); border-color: var(--c-border); transform: rotate(90deg); }
.psheet-close svg { width: 18px; height: 18px; }

.psheet-header {
  padding: 4px 4px 0;
  margin-bottom: 18px;
}
.psheet-eyebrow {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase;
  color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 80%, var(--c-muted));
  margin-bottom: 8px;
  font-feature-settings: "ss01" on;
}
.psheet-title {
  font-family: var(--ff-serif-cn);
  font-size: clamp(1.5rem, 4.5vw, 1.85rem);
  font-weight: 700; letter-spacing: -.012em;
  line-height: 1.2; color: var(--c-ink, var(--c-text));
  margin: 0 0 8px;
  /* editorial: 首字略加重、下圍微 hairline */
  background: linear-gradient(180deg, var(--c-text) 0%, color-mix(in oklch, var(--c-text) 88%, var(--c-vermilion, #B23A2B)) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.psheet-meta {
  display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap;
  font-size: .82rem; color: var(--c-muted);
  margin-bottom: 0;
}
.psheet-meta-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 600;
}
.psheet-meta-sep { color: var(--c-border); font-weight: 300; }

/* hairline 分隔（editorial signature） */
.psheet-rule {
  height: 1px; margin: 18px -22px;
  background: linear-gradient(90deg, transparent 0%, var(--c-border) 18%, var(--c-border) 82%, transparent 100%);
}

/* step block：number + body 的 subgrid-like 對齊 */
.psheet-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  margin-bottom: 22px;
  align-items: start;
}
.psheet-step-num {
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: .72rem; font-weight: 700;
  color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 70%, var(--c-muted));
  letter-spacing: .04em;
  padding-top: 7px; line-height: 1;
  /* 數字 + 朱印小點 */
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
}
.psheet-step-num::after {
  content: ""; width: 2px; height: 18px;
  background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 35%, transparent);
  border-radius: 1px;
}
.psheet-step-body { min-width: 0; }
.psheet-step-h {
  font-size: .82rem; font-weight: 700; letter-spacing: .04em;
  color: var(--c-text); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.psheet-step-h-aux {
  font-size: .68rem; color: var(--c-muted); font-weight: 500;
  margin-left: auto;
}
.psheet-step-hint {
  font-size: .73rem; color: var(--c-muted); margin-top: 8px;
  line-height: 1.5;
}
.psheet-step-hint strong { color: var(--c-text); font-weight: 700; }

/* year rail：scroll-snap 帶左右 fade mask，年份卡片有 subtle 質感 */
.psheet-year-rail {
  position: relative; margin: 0 -2px;
  /* 左右淡出 mask — 暗示可滑動 */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}
.psheet-year-track {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 4px 12px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.psheet-year-track::-webkit-scrollbar { display: none; }
.psheet-year-track .yr-btn {
  flex: 0 0 auto;
  scroll-snap-align: center;
  min-width: 64px; padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: var(--c-surface);
  color: var(--c-muted);
  font-family: var(--ff-mono, ui-monospace, monospace);
  font-size: 1.02rem; font-weight: 700; line-height: 1.1;
  cursor: pointer; transition: transform .18s cubic-bezier(.22,1,.36,1), border-color .15s, color .15s, background .15s, box-shadow .18s;
  display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
  position: relative;
}
.psheet-year-track .yr-btn::before {
  /* 微弱 dot indicator — 點過的年份會亮 */
  content: ""; position: absolute; top: 6px; right: 7px;
  width: 5px; height: 5px; border-radius: 50%;
  background: transparent;
  transition: background .15s;
}
.psheet-year-track .yr-btn[data-played="1"]::before {
  background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 75%, transparent);
}
.psheet-year-track .yr-btn .yr-sub {
  font-size: .58rem; font-weight: 500; letter-spacing: .03em;
  color: var(--c-muted); font-family: var(--ff-sans-cn);
  text-transform: none;
}
.psheet-year-track .yr-btn:hover:not(.empty):not(.active) {
  border-color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 40%, var(--c-border));
  color: var(--c-text);
  transform: translateY(-1px);
}
.psheet-year-track .yr-btn.active {
  background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 8%, var(--c-surface));
  border-color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 65%, var(--c-border));
  color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 100%, var(--c-text));
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--c-vermilion, #B23A2B) 35%, transparent),
    0 4px 14px -6px color-mix(in oklch, var(--c-vermilion, #B23A2B) 50%, transparent);
  transform: translateY(-2px);
}
.psheet-year-track .yr-btn.active .yr-sub { color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 80%, var(--c-muted)); font-weight: 700; }
.psheet-year-track .yr-btn.empty {
  opacity: .35; cursor: not-allowed; text-decoration: line-through;
}
.psheet-year-track .yr-btn:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--c-vermilion, #B23A2B) 70%, transparent);
  outline-offset: 2px;
}

/* mode grid：rich card with icon + name + bullets */
.psheet-mode-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.psheet-mode-card {
  position: relative; overflow: hidden;
  text-align: left; padding: 14px 14px 12px;
  border: 1.5px solid var(--c-border);
  border-radius: 16px;
  background: var(--c-surface);
  cursor: pointer; transition: transform .2s cubic-bezier(.22,1,.36,1), border-color .15s, background .18s, box-shadow .18s;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 96px;
  font-family: var(--ff-sans-cn);
}
.psheet-mode-card::before {
  /* hover 時左上斜光 — editorial 印泥光澤 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in oklch, var(--c-vermilion, #B23A2B) 8%, transparent) 0%, transparent 60%);
  opacity: 0; transition: opacity .2s;
}
.psheet-mode-card:hover { transform: translateY(-2px); border-color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 30%, var(--c-border)); }
.psheet-mode-card:hover::before { opacity: 1; }
.psheet-mode-card.active {
  border-color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 75%, var(--c-border));
  background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 6%, var(--c-surface));
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--c-vermilion, #B23A2B) 28%, transparent),
    0 6px 18px -8px color-mix(in oklch, var(--c-vermilion, #B23A2B) 35%, transparent);
}
.psheet-mode-card.active::before { opacity: 1; }
.psheet-mode-card:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--c-vermilion, #B23A2B) 70%, transparent);
  outline-offset: 2px;
}
.psheet-mode-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 10%, var(--c-surface2));
  color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 95%, transparent);
}
.psheet-mode-icon svg { width: 18px; height: 18px; }
.psheet-mode-name {
  font-family: var(--ff-serif-cn);
  font-size: 1.02rem; font-weight: 700; color: var(--c-text); letter-spacing: -.005em;
}
.psheet-mode-bullets {
  font-size: .72rem; line-height: 1.55; color: var(--c-muted);
  display: flex; flex-direction: column; gap: 2px;
}
.psheet-mode-card.active .psheet-mode-name { color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 100%, var(--c-text)); }
.psheet-mode-card.active .psheet-mode-icon { background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 18%, transparent); }

/* preflight summary：展示「即將開始」的精確內容 */
.psheet-preflight {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 4%, var(--c-surface2));
  border: 1px solid color-mix(in oklch, var(--c-vermilion, #B23A2B) 20%, var(--c-border));
}
.psheet-preflight-icon {
  flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 50%;
  background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 16%, transparent);
  color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 100%, transparent);
  display: inline-flex; align-items: center; justify-content: center;
}
.psheet-preflight-icon svg { width: 14px; height: 14px; }
.psheet-preflight-text {
  flex: 1; min-width: 0;
}
.psheet-preflight-eyebrow {
  font-size: .62rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
  color: color-mix(in oklch, var(--c-vermilion, #B23A2B) 80%, var(--c-muted));
  margin-bottom: 1px;
}
.psheet-preflight-line {
  font-size: .85rem; font-weight: 600; color: var(--c-text);
  letter-spacing: -.005em;
}

/* CTA：印泥紅 + shine sweep + magnetic hover */
.psheet-start {
  position: relative; overflow: hidden;
  width: 100%; padding: 16px;
  border-radius: 14px; border: none;
  background: linear-gradient(135deg,
      var(--c-vermilion, #B23A2B) 0%,
      color-mix(in oklch, var(--c-vermilion, #B23A2B) 88%, #000) 100%);
  color: #fff;
  font-family: var(--ff-serif-cn);
  font-size: 1.06rem; font-weight: 700; letter-spacing: .01em;
  cursor: pointer; min-height: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--c-vermilion, #B23A2B) 100%, #000) inset,
    0 6px 20px -8px color-mix(in oklch, var(--c-vermilion, #B23A2B) 70%, transparent),
    0 1px 0 0 rgba(255,255,255,.18) inset;
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s ease;
}
.psheet-start:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--c-vermilion, #B23A2B) 100%, #000) inset,
    0 12px 28px -10px color-mix(in oklch, var(--c-vermilion, #B23A2B) 80%, transparent),
    0 1px 0 0 rgba(255,255,255,.22) inset;
}
.psheet-start:active { transform: translateY(0); }
.psheet-start:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--c-vermilion, #B23A2B) 100%, #fff);
  outline-offset: 3px;
}
.psheet-start svg { width: 18px; height: 18px; transition: transform .18s ease; }
.psheet-start:hover svg { transform: translateX(3px); }
.psheet-start .cta-shine {
  position: absolute; top: 0; left: -60%; width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.32) 50%, transparent 70%);
  transform: skewX(-20deg);
  pointer-events: none;
  animation: psheet-shine 4.2s ease-in-out infinite;
}
@keyframes psheet-shine {
  0%, 60%, 100% { left: -60%; }
  75% { left: 130%; }
}
.psheet-start[disabled] {
  opacity: .55; cursor: not-allowed;
  transform: none !important;
}
.psheet-start[disabled] .cta-shine { animation: none; }

/* dark mode 微調 — 紙感換墨黑、朱印偏亮 */
[data-theme="dark"] .bottom-sheet.bottom-sheet-pro {
  background: linear-gradient(180deg, var(--c-surface) 0%, color-mix(in oklch, var(--c-surface) 80%, #000) 100%);
}
[data-theme="dark"] .psheet-mode-card { background: var(--c-surface2); }
[data-theme="dark"] .psheet-mode-card.active { background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 14%, var(--c-surface2)); }
[data-theme="dark"] .psheet-year-track .yr-btn { background: var(--c-surface2); }
[data-theme="dark"] .psheet-year-track .yr-btn.active { background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 18%, var(--c-surface2)); }
[data-theme="dark"] .psheet-preflight { background: color-mix(in oklch, var(--c-vermilion, #B23A2B) 9%, var(--c-surface2)); }

/* Reduced motion：尊重 prefers-reduced-motion，所有 transition/animation 縮成 0 */
@media (prefers-reduced-motion: reduce) {
  .psheet-start .cta-shine { animation: none; }
  .psheet-mode-card, .psheet-year-track .yr-btn, .psheet-start, .psheet-close { transition: none !important; }
  .psheet-mode-card:hover, .psheet-year-track .yr-btn:hover, .psheet-start:hover { transform: none !important; }
}

/* Mobile <380px：mode card 改 1 欄、字體不縮 */
@media (max-width: 380px) {
  .psheet-mode-grid { grid-template-columns: 1fr; }
  .psheet-step { grid-template-columns: 26px 1fr; gap: 10px; }
  .psheet-rule { margin: 14px -18px; }
}

/* Dark mode — new components */
[data-theme="dark"] .continue-card { background: var(--c-surface); border-color: var(--c-border); }
[data-theme="dark"] .continue-card:hover { border-color: var(--c-primary); }
[data-theme="dark"] .today-rec-card { background: rgba(178,58,43,.1); border-color: rgba(178,58,43,.22); }
[data-theme="dark"] .today-rec-btn { background: var(--c-primary); }
[data-theme="dark"] .quick-jump-card { background: var(--c-surface); border-color: var(--c-border); }
[data-theme="dark"] .qj-sel { background: var(--c-surface2); border-color: var(--c-border); color: var(--c-text); }
[data-theme="dark"] .countdown-strip { background: var(--c-surface); border-color: var(--c-border); }
[data-theme="dark"] .countdown-strip.urgent { background: rgba(249,115,22,.08); border-color: #f97316; }
[data-theme="dark"] .countdown-strip.critical { background: rgba(220,38,38,.1); border-color: var(--c-danger); }
[data-theme="dark"] .countdown-date-inp { background: var(--c-surface2); border-color: var(--c-border); color: var(--c-text); }
[data-theme="dark"] .bottom-sheet { background: var(--c-surface); }
[data-theme="dark"] .sheet-handle { background: var(--c-border); }
[data-theme="dark"] .sheet-mode-btn { background: var(--c-surface2); border-color: var(--c-border); color: var(--c-muted); }
[data-theme="dark"] .sheet-mode-btn.active { border-color: var(--c-primary); color: var(--c-primary); background: rgba(178,58,43,.12); }

/* Streak badge */
.streak-badge { animation: streak-pop .3s ease; }
@keyframes streak-pop { 0%{transform:scale(0)} 70%{transform:scale(1.2)} 100%{transform:scale(1)} }

/* Finish modal circles */
.fin-circle { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: .65rem; margin: 2px; color: white; }
.fin-circle.ok { background: var(--c-success); }
.fin-circle.wrong { background: var(--c-danger); }

/* Question picker */
.q-picker { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: center; justify-content: center; }
.q-picker-inner { background: var(--c-surface); border-radius: 16px; padding: 16px; max-width: 360px; width: 90%; max-height: 80vh; overflow-y: auto; }
