:root {
  color-scheme: light;
  --navy-950: #102a43;
  --navy-900: #143a5b;
  --navy-800: #194b72;
  --blue-600: #2563eb;
  --blue-500: #3478f6;
  --blue-100: #e8f1ff;
  --blue-50: #f3f7ff;
  --ink-900: #17212b;
  --ink-700: #3b4856;
  --ink-500: #687586;
  --ink-400: #8793a2;
  --line-200: #dce3eb;
  --line-100: #e9eef4;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --canvas: #f2f5f9;
  --green-700: #14704a;
  --green-100: #def5e9;
  --green-50: #f1fbf6;
  --red-700: #b43a43;
  --red-100: #fde5e7;
  --red-50: #fff5f5;
  --amber-800: #8a5a00;
  --amber-100: #ffedbd;
  --amber-50: #fff9e8;
  --shadow-card: 0 16px 40px rgba(26, 46, 68, 0.08);
  --shadow-float: 0 12px 32px rgba(18, 42, 67, 0.16);
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink-900);
  background: var(--canvas);
  min-width: 0;
  font-size: 15px;
  line-height: 1.65;
}

body.drawer-open { overflow: hidden; }

button, input { font: inherit; }

button { color: inherit; }

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(52, 120, 246, 0.28);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(circle at 10% -10%, rgba(81, 156, 224, 0.3), transparent 36%),
    linear-gradient(165deg, var(--navy-800), var(--navy-950));
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 28px 24px 22px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--navy-900);
  background: #ffffff;
  font-size: 22px;
  font-weight: 750;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
}

.brand-title { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }
.brand-subtitle { margin-top: 1px; color: rgba(255, 255, 255, 0.62); font-size: 12px; }

.bank-type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 12px 8px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.12);
}

.bank-type-switch a {
  min-height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 680;
  text-decoration: none;
}

.bank-type-switch a:hover { color: #ffffff; background: rgba(255, 255, 255, 0.08); }
.bank-type-switch a.active { color: var(--navy-900); background: #ffffff; }
.bank-type-switch a:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.46); outline-offset: 2px; }

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 10px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.chapter-total { letter-spacing: 0; font-variant-numeric: tabular-nums; }

.chapter-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.chapter-button {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.chapter-button:hover { color: #ffffff; background: rgba(255, 255, 255, 0.08); }
.chapter-button:active { transform: translateY(1px); }
.chapter-button.active { color: #ffffff; background: rgba(255, 255, 255, 0.14); box-shadow: inset 3px 0 0 #7ab8ff; }

.chapter-index {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chapter-button.active .chapter-index { color: var(--navy-900); background: #ffffff; }
.chapter-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 560; }
.chapter-count { color: rgba(255, 255, 255, 0.45); font-size: 11px; font-variant-numeric: tabular-nums; }
.chapter-button.active .chapter-count { color: rgba(255, 255, 255, 0.72); }

.sidebar-footer {
  margin: 0 18px 18px;
  padding: 15px 15px 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
}

.data-summary { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.summary-dot { width: 7px; height: 7px; border-radius: 50%; background: #62d59b; box-shadow: 0 0 0 4px rgba(98, 213, 155, 0.12); }
.summary-dot.preparing { background: #7ab8ff; box-shadow: 0 0 0 4px rgba(122, 184, 255, 0.13); }
.summary-dot.offline { background: #f0b64d; box-shadow: 0 0 0 4px rgba(240, 182, 77, 0.13); }
.summary-dot.unavailable { background: #9eabb9; box-shadow: 0 0 0 4px rgba(158, 171, 185, 0.12); }
.source-note { margin-top: 5px; color: rgba(255, 255, 255, 0.48); font-size: 11px; }

.install-app-button {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
  cursor: pointer;
  font-size: 12px;
  font-weight: 680;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.install-app-button:hover { border-color: rgba(255, 255, 255, 0.34); background: rgba(255, 255, 255, 0.17); }
.install-app-button:active { transform: translateY(1px); }
.install-app-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.install-help { margin: 9px 0 0; padding: 9px 10px; border-radius: 9px; color: rgba(255, 255, 255, 0.74); background: rgba(3, 18, 31, 0.2); font-size: 11px; line-height: 1.55; }

.main-area { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 32px;
  border-bottom: 1px solid rgba(213, 222, 233, 0.92);
  background: rgba(255, 255, 255, 0.91);
  backdrop-filter: blur(16px);
  z-index: 10;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.breadcrumb { max-width: min(58vw, 680px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-500); font-size: 12px; }
.page-title { margin-top: 1px; font-size: 18px; font-weight: 720; line-height: 1.25; }

.question-directory-control { position: relative; flex: 0 0 auto; }

.question-directory-trigger {
  min-width: 156px;
  min-height: 52px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line-200);
  border-radius: 13px;
  color: var(--ink-700);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 5px 16px rgba(20, 58, 91, 0.06);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.question-directory-trigger:hover,
.question-directory-trigger[aria-expanded="true"] {
  border-color: #b7c9de;
  background: #ffffff;
  box-shadow: 0 9px 24px rgba(20, 58, 91, 0.12);
}

.directory-trigger-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--blue-600);
  background: var(--blue-50);
}

.directory-trigger-icon svg,
.directory-trigger-chevron,
.directory-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.directory-trigger-copy { min-width: 0; display: grid; line-height: 1.2; }
.directory-trigger-label { color: var(--ink-500); font-size: 10px; font-weight: 650; }
.directory-trigger-chevron { color: var(--ink-400); transition: transform 160ms ease; }
.question-directory-trigger[aria-expanded="true"] .directory-trigger-chevron { transform: rotate(180deg); }

.question-position {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--ink-400);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.position-current { color: var(--navy-900); font-size: 17px; font-weight: 760; }
.position-divider { color: var(--line-200); }

.question-directory {
  position: fixed;
  top: 88px;
  right: 24px;
  width: min(460px, calc(100vw - 48px));
  max-height: min(68vh, 590px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-200);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 64px rgba(16, 42, 67, 0.22);
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 90;
}

.question-directory.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.question-directory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 15px;
  border-bottom: 1px solid var(--line-100);
}

.directory-eyebrow { color: var(--blue-600); font-size: 10px; font-weight: 760; letter-spacing: 0.14em; }
.question-directory-header h2 { margin: 2px 0 0; font-size: 18px; line-height: 1.35; }
.question-directory-header p { margin: 3px 0 0; color: var(--ink-500); font-size: 12px; }
.directory-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line-200);
  border-radius: 10px;
  color: var(--ink-500);
  background: var(--surface);
  cursor: pointer;
}
.directory-close:hover { color: var(--navy-900); background: var(--surface-soft); }

.question-directory-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 11px 20px;
  color: var(--ink-500);
  background: var(--surface-soft);
  font-size: 11px;
}

.question-directory-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line-200); background: #ffffff; }
.legend-dot.current { border-color: var(--blue-600); background: var(--blue-600); }
.legend-dot.correct { border-color: #7bc7a4; background: var(--green-100); }
.legend-dot.wrong { border-color: #eda3a8; background: var(--red-100); }
.legend-dot.viewed { border-color: #e4c56e; background: var(--amber-100); }

.question-number-grid {
  min-height: 132px;
  display: grid;
  grid-template-columns: repeat(8, minmax(40px, 1fr));
  align-content: start;
  gap: 9px;
  overflow-y: auto;
  padding: 18px 20px 22px;
  scrollbar-width: thin;
  scrollbar-color: #c5d0dc transparent;
}

.question-number-button {
  position: relative;
  min-width: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-200);
  border-radius: 10px;
  color: var(--ink-700);
  background: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.question-number-button:hover { transform: translateY(-1px); border-color: #aebed0; }
.question-number-button.status-correct { color: var(--green-700); border-color: #9bd1b5; background: var(--green-50); }
.question-number-button.status-wrong { color: var(--red-700); border-color: #efb2b7; background: var(--red-50); }
.question-number-button.status-viewed { color: var(--amber-800); border-color: #ecd386; background: var(--amber-50); }
.question-number-button.status-in-progress { color: var(--blue-600); border-color: #b8d1f4; background: var(--blue-50); }
.question-number-button.current { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); }
.question-number-button.status-unanswered.current { color: #ffffff; background: var(--blue-600); }
.question-number-mark { position: absolute; top: 2px; right: 4px; font-size: 9px; font-weight: 850; line-height: 1; }

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-200);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button svg, .button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mobile-menu { display: none; }

.content-wrap { width: min(100% - 48px, 980px); margin: 34px auto 80px; }

.question-panel {
  border: 1px solid var(--line-100);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.question-panel { padding: 30px 34px 26px; }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.meta-left { display: flex; align-items: center; gap: 10px; }

.type-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 680;
  line-height: 1;
}

.type-badge { padding: 7px 11px; color: var(--blue-600); background: var(--blue-100); }
.type-badge.multiple { color: #6d49a8; background: #f1eafe; }
.question-number { color: var(--ink-500); font-size: 13px; font-weight: 600; }
.question-id { color: var(--ink-400); font-size: 12px; font-variant-numeric: tabular-nums; }

.question-title { margin: 0; color: var(--ink-900); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.55; font-weight: 680; letter-spacing: 0.005em; }
.question-title:focus { outline: none; }
.question-hint { margin: 12px 0 23px; color: var(--ink-500); font-size: 13px; font-weight: 560; }
.question-hint.answer-correct { color: var(--green-700); }
.question-hint.answer-wrong { color: var(--red-700); }
.question-hint.answer-viewed { color: var(--blue-600); }

.options-list { display: grid; gap: 12px; }

.option-label {
  position: relative;
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border: 1px solid var(--line-200);
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.option-label:hover { border-color: #b9c9dc; background: var(--surface-soft); transform: translateY(-1px); }
.option-label:focus-within {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(52, 120, 246, 0.2);
  outline: 2px solid transparent;
}
.option-label.selected { border-color: #85afe9; background: var(--blue-50); box-shadow: 0 0 0 3px rgba(52, 120, 246, 0.08); }
.option-label.correct { border-color: #7bc7a4; background: var(--green-50); box-shadow: 0 0 0 3px rgba(20, 112, 74, 0.08); }
.option-label.wrong { border-color: #eda3a8; background: var(--red-50); box-shadow: 0 0 0 3px rgba(180, 58, 67, 0.08); }
.option-label.disabled { cursor: default; transform: none; }

.option-input { position: absolute; opacity: 0; pointer-events: none; }

.option-letter {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-200);
  border-radius: 9px;
  color: var(--ink-700);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 720;
}

.option-label.selected .option-letter { color: #ffffff; border-color: var(--blue-600); background: var(--blue-600); }
.option-label.correct .option-letter { color: #ffffff; border-color: var(--green-700); background: var(--green-700); }
.option-label.wrong .option-letter { color: #ffffff; border-color: var(--red-700); background: var(--red-700); }
.option-text { color: var(--ink-700); line-height: 1.55; }
.option-status { min-height: 28px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 740; white-space: nowrap; }
.option-status:empty { display: none; }
.option-status-icon { font-size: 13px; font-weight: 850; }
.option-label.correct .option-status { color: var(--green-700); background: var(--green-100); }
.option-label.wrong .option-status { color: var(--red-700); background: var(--red-100); }

.validation-message { margin-top: 13px; color: var(--red-700); font-size: 13px; font-weight: 600; }

.question-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-100);
}

.action-primary-group { display: flex; align-items: center; gap: 10px; }
.question-actions > .button:last-child { justify-self: end; }

.keyboard-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--ink-400);
  font-size: 11px;
}
.keycap { min-width: 23px; height: 21px; display: grid; place-items: center; border: 1px solid var(--line-200); border-bottom-color: #c5ced8; border-radius: 6px; color: var(--ink-500); background: var(--surface-soft); font-size: 11px; font-weight: 700; box-shadow: 0 1px 0 #cfd7e0; }

.button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 660;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: 0.42; cursor: not-allowed; }
.button-primary { color: #ffffff; background: var(--blue-600); box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18); }
.button-primary:hover:not(:disabled) { background: #1e57d7; box-shadow: 0 10px 22px rgba(37, 99, 235, 0.25); }
.button-secondary { color: var(--ink-700); border-color: var(--line-200); background: var(--surface); }
.button-secondary:hover:not(:disabled) { border-color: #b9c6d5; background: var(--surface-soft); }
.button-ghost { color: var(--blue-600); background: transparent; }
.button-ghost:hover:not(:disabled) { background: var(--blue-50); }

.result-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0;
  padding: 15px 18px;
  border: 1px solid #9bd1b5;
  border-radius: 14px;
  color: var(--green-700);
  background: var(--green-50);
}

.result-banner.incorrect { color: var(--red-700); border-color: #efb2b7; background: var(--red-50); }
.result-banner.neutral { color: var(--navy-800); border-color: #bed2ec; background: var(--blue-50); }
.result-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #ffffff; background: var(--green-700); font-weight: 800; }
.result-banner.incorrect .result-icon { background: var(--red-700); }
.result-banner.neutral .result-icon { background: var(--blue-600); }
.result-title { font-weight: 720; line-height: 1.35; }
.result-detail { margin-top: 2px; color: currentColor; opacity: 0.8; font-size: 12px; }

.analysis-section { margin-top: 16px; }
.eyebrow { color: var(--blue-600); font-size: 10px; font-weight: 760; letter-spacing: 0.15em; }

.analysis-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  margin-top: 0;
  padding: 20px;
  border: 1px solid var(--line-100);
  border-radius: 15px;
  background: var(--surface);
}

.analysis-card-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--amber-800); background: var(--amber-50); }
.analysis-card-icon.rationale-icon { color: var(--blue-600); background: var(--blue-50); }
.analysis-card-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.analysis-card h3 { margin: 2px 0 13px; color: var(--ink-900); font-size: 15px; }
.analysis-card > div:last-child { min-width: 0; }


.reasoning-list { display: grid; gap: 16px; margin: 0; padding: 0; }
.reasoning-item {
  margin: 0;
  color: var(--ink-700);
  font-size: 15px;
  line-height: 1.95;
  overflow-wrap: anywhere;
}

.original-analysis { margin-top: 18px; border-top: 1px solid var(--line-100); color: var(--ink-500); }
.original-analysis summary { width: fit-content; padding: 16px 0 4px; color: var(--ink-500); font-size: 13px; font-weight: 650; cursor: pointer; }
.original-analysis > div { padding: 10px 0 2px; white-space: pre-line; color: var(--ink-700); }

.mobile-nav { display: none; }
.mobile-overlay { position: fixed; inset: 0; background: rgba(16, 42, 67, 0.45); backdrop-filter: blur(2px); z-index: 15; }

.pwa-update-bar {
  position: fixed;
  right: 24px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px 10px 15px;
  border: 1px solid #bfd1e7;
  border-radius: 13px;
  color: var(--navy-900);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-float);
  font-size: 13px;
  font-weight: 680;
  z-index: 100;
}
.pwa-update-bar button { min-height: 34px; padding: 6px 11px; border: 0; border-radius: 9px; color: #ffffff; background: var(--navy-900); cursor: pointer; font-size: 12px; font-weight: 680; }
.pwa-update-bar .pwa-update-dismiss { color: var(--ink-500); background: var(--surface-soft); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 246px minmax(0, 1fr); }
  .brand { padding-inline: 18px; }
  .bank-type-switch { margin-inline: 10px; }
  .sidebar-heading { padding-inline: 18px; }
  .content-wrap { width: min(100% - 34px, 900px); }
}

@media (max-width: 720px) {
  body { background: var(--surface-soft); }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(86vw, 310px); transform: translateX(-104%); box-shadow: var(--shadow-float); transition: transform 180ms ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: grid; }
  .topbar { min-height: 68px; gap: 12px; padding: 8px 16px; }
  .topbar-left { gap: 9px; }
  .page-title { font-size: 16px; }
  .breadcrumb { max-width: 34vw; }
  .question-directory-trigger { min-width: 96px; min-height: 48px; grid-template-columns: 28px minmax(0, 1fr) 14px; gap: 7px; padding: 6px 8px; }
  .directory-trigger-icon { width: 28px; height: 28px; }
  .directory-trigger-icon svg, .directory-trigger-chevron { width: 16px; height: 16px; }
  .directory-trigger-label { display: none; }
  .position-current { font-size: 16px; }
  .question-directory {
    position: fixed;
    top: 76px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: min(70dvh, 610px);
    transform-origin: top center;
  }
  .question-number-grid { grid-template-columns: repeat(6, minmax(42px, 1fr)); }
  .question-number-button { min-height: 44px; }
  .content-wrap { width: 100%; margin: 0 auto 76px; }
  .question-panel { border-radius: 0; border-width: 0 0 1px; box-shadow: none; }
  .question-panel { padding: 22px 18px 24px; }
  .question-meta { margin-bottom: 17px; }
  .question-title { font-size: 19px; }
  .option-label { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 12px; }
  .question-actions { grid-template-columns: 1fr; }
  .question-actions > .button-secondary { display: none; }
  .action-primary-group { display: grid; grid-template-columns: 1fr; }
  .button { width: 100%; }
  .keyboard-tip { display: none; }
  .analysis-card { grid-template-columns: 1fr; padding: 17px; }
  .analysis-card-icon { width: 33px; height: 33px; }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 9px max(12px, env(safe-area-inset-left)) calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-200); background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(14px); z-index: 12; }
  .mobile-nav button { min-height: 42px; border: 0; border-radius: 9px; color: var(--navy-900); background: var(--surface-soft); font-size: 13px; font-weight: 680; cursor: pointer; }
  .mobile-nav button + button { color: #ffffff; background: var(--navy-900); }
  .install-app-button { min-height: 44px; }
  .pwa-update-bar { left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); justify-content: space-between; }
}

@media (max-width: 480px) {
  .option-status { width: 28px; padding: 3px; }
  .option-status-label { display: none; }
  .question-directory-header { padding: 17px 17px 13px; }
  .question-directory-legend { padding-inline: 17px; gap: 7px 12px; }
  .question-number-grid { padding: 15px 17px 19px; }
}

@media (max-width: 360px) {
  .question-number-grid { grid-template-columns: repeat(5, minmax(42px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
