/* =========================================================
   迷雾档案 · 网页版样式
   暗色悬疑风，色值与 ArkTS 版 utils/Theme.ets 保持一致
   ========================================================= */

:root {
  --bg: #0b0e13;
  --bg-soft: #121722;
  --card: #171e2a;
  --card-active: #1e2734;
  --card-dim: #10151d;
  --line: #26313f;
  --line-soft: #1a222e;
  --text: #e8edf6;
  --text-sub: #93a1b5;
  --text-dim: #5c6a7d;
  --accent: #e4b45c;
  --accent-deep: #3a2e18;
  --danger: #d8705f;
  --ok: #5fc9a0;
  --ink: #15110a;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 11px;

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0.06, 0.68, 0.19);

  /* ---- 自适应尺寸体系 ----
     外壳最宽 1200px，内容分两档：常规阅读宽度 760px、宽屏信息页 1060px。
     左右留白随视口宽度伸缩，避免小屏挤、大屏空。 */
  --shell-max: 1200px;
  --gutter: clamp(16px, 3.4vw, 34px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: #05070a;
  background-image:
    radial-gradient(120% 80% at 50% -10%, #16202e 0%, #0a0e14 45%, #05070a 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  color: var(--text);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 细微噪点，避免大面积纯色显得平板 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- 应用外壳 ---------------- */

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--shell-max);
  height: 100vh;
  height: 100dvh; /* 跟随动态视口：移动端地址栏收起/展开都不会留白或被裁切 */
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}

/* 窗口比外壳更宽时，用发丝线标出内容边界，避免看起来像被截断 */
@media (min-width: 1240px) {
  #app {
    border-inline: 1px solid #141b26;
  }
}

#view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------------- 通用工具 ---------------- */

.screen {
  /* 每屏的内容宽度：默认按阅读舒适度收窄，信息密集页用 .wide 放宽 */
  --cw: 760px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: viewIn 0.28s var(--ease-out) both;
}

.screen.wide {
  --cw: 700px;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: var(--cw, 760px);
  margin-inline: auto;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  scrollbar-width: thin;
  scrollbar-color: #26313f transparent;
}

.scroll::-webkit-scrollbar {
  width: 6px;
}

.scroll::-webkit-scrollbar-thumb {
  background: #26313f;
  border-radius: 3px;
}

.scroll::-webkit-scrollbar-track {
  background: transparent;
}

.pad {
  width: 100%;
  max-width: var(--cw, 760px);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin: 22px 0 12px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-soft), transparent);
}

/* ---------------- 顶部栏 ---------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: var(--cw, 760px);
  margin-inline: auto;
  flex-wrap: nowrap;
  padding: calc(16px + env(safe-area-inset-top, 0px)) var(--gutter) 12px;
  flex-shrink: 0;
}

.topbar .back {
  width: 34px;
  height: 34px;
  margin-left: -8px;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s, transform 0.15s;
  font-family: inherit;
}

.topbar .back:hover {
  background: #1c2431;
}

.topbar .back:active {
  transform: scale(0.92);
}

.topbar .titles {
  flex: 1;
  min-width: 0;
}

.topbar .t1 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .t2 {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 3px;
  letter-spacing: 0.5px;
}

.topbar .t2 em {
  font-style: normal;
  color: var(--accent);
}

.chip-btn {
  font-size: 11px;
  color: var(--accent);
  padding: 7px 12px;
  border: 1px solid rgba(228, 180, 92, 0.45);
  border-radius: 10px;
  background: rgba(228, 180, 92, 0.04);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.16s, border-color 0.16s, transform 0.12s;
  white-space: nowrap;
}

.chip-btn:hover {
  background: rgba(228, 180, 92, 0.12);
  border-color: var(--accent);
}

.chip-btn:active {
  transform: scale(0.96);
}

/* ---------------- 首页 ---------------- */

.home {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  padding: clamp(18px, 4vh, 34px) clamp(20px, 6vw, 46px) clamp(18px, 3.5vh, 30px);
  justify-content: space-between;
  overflow-y: auto;
  overflow-x: hidden;
}

.home .meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.home .hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(8px, 3vh, 28px) 0;
  min-height: 0;
}

.home .brand {
  font-size: clamp(34px, 7.6vw, 58px);
  font-weight: 700;
  letter-spacing: clamp(6px, 1.7vw, 13px);
  margin: 0;
  text-indent: clamp(6px, 1.7vw, 13px);
  color: var(--text);
  text-shadow: 0 0 40px rgba(228, 180, 92, 0.12);
  white-space: nowrap;
}

.home .brand-en {
  font-size: clamp(8px, 1.6vw, 10px);
  letter-spacing: clamp(3px, 0.8vw, 5px);
  color: var(--accent);
  margin-top: clamp(10px, 2.2vh, 18px);
  opacity: 0.85;
}

.home .rule {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: clamp(14px, 3vh, 22px) 0;
  opacity: 0.7;
}

.home .tagline {
  font-size: clamp(12.5px, 2.6vw, 14px);
  line-height: 1.85;
  color: var(--text-sub);
  margin: 0;
  white-space: pre-line;
  max-width: 34em;
}

.home .actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home .footnote {
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 22px;
  letter-spacing: 0.4px;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.12s, filter 0.18s, background 0.18s, border-color 0.18s;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: linear-gradient(180deg, #eec372, var(--accent));
  color: var(--ink);
  box-shadow: 0 6px 20px -8px rgba(228, 180, 92, 0.55);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-primary:disabled,
.btn-primary.is-disabled {
  background: #1b2431;
  color: var(--text-dim);
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
}

.btn-primary.is-disabled:hover {
  filter: none;
}

.btn-ghost {
  height: 50px;
  background: var(--card);
  border-color: var(--line);
  color: var(--text);
  font-size: 15px;
}

.btn-ghost:hover {
  background: var(--card-active);
  border-color: #33414f;
}

.btn-ghost.is-disabled {
  color: var(--text-dim);
  border-color: var(--line-soft);
  cursor: not-allowed;
}

.btn-ghost.is-disabled:hover {
  background: var(--card);
  border-color: var(--line-soft);
}

.btn-text {
  background: none;
  border: 0;
  color: var(--text-sub);
  font-size: 12px;
  padding: 12px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
  text-decoration-color: var(--text-dim);
  text-underline-offset: 4px;
  transition: color 0.16s;
}

.btn-text:hover {
  color: var(--accent);
}

/* ---------------- 场景页：场景切换标签 ---------------- */

.tabs {
  display: flex;
  padding: 6px 0 14px;
  border-bottom: 1px solid var(--line-soft);
}

.tabs button {
  flex: 1;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  padding-bottom: 11px;
}

.tabs .tab-name {
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.18s;
  white-space: nowrap;
}

.tabs .tab-progress {
  font-size: 10px;
  color: var(--text-dim);
  transition: color 0.18s;
  font-variant-numeric: tabular-nums;
}

.tabs button::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 18px;
  height: 1px;
  background: var(--accent);
  transition: transform 0.22s var(--ease-out);
}

.tabs button.active .tab-name {
  color: var(--text);
  font-weight: 600;
}

.tabs button.active .tab-progress {
  color: var(--accent);
}

.tabs button.active::after {
  transform: translateX(-50%) scaleX(1);
}

.tabs button:hover .tab-name {
  color: var(--text);
}

/* ---------------- 场景卡 ---------------- */

.scene-card {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #141b25, var(--bg-soft));
  border: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}

.scene-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: 0.55;
}

.scene-sub {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.scene-desc {
  font-size: 13px;
  line-height: 23px;
  color: var(--text-sub);
  margin: 10px 0 0;
  max-width: 46em;
}

/* ---------------- 点位卡片 ---------------- */

.points {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.point {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
  position: relative;
  overflow: hidden;
}

.point:hover:not(:disabled) {
  background: var(--card-active);
  border-color: #34434f;
}

.point:active:not(:disabled) {
  transform: scale(0.99);
}

.point .body {
  flex: 1;
  min-width: 0;
}

.point .row1 {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.point .name {
  font-size: 15px;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.point .status {
  font-size: 10px;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.point .brief {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

.point .mark {
  font-size: 17px;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.18s;
}

.point:hover:not(:disabled) .mark {
  transform: translateX(3px);
}

.point.done {
  background: #11161f;
  border-color: var(--line-soft);
  cursor: default;
}

.point.done .name {
  color: var(--text-sub);
}

.point.done .status {
  color: var(--text-dim);
}

.point.done .mark {
  color: var(--ok);
}

/* ---------------- 底部操作条 ---------------- */

.bottom-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.bottom-actions .btn {
  height: 48px;
  font-size: 14px;
  flex: 1;
}

.bottom-actions .btn-ghost {
  height: 48px;
}

/* ---------------- 弹层通用 ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vh, 28px) clamp(12px, 3vw, 28px);
  padding-bottom: calc(clamp(12px, 3vh, 28px) + env(safe-area-inset-bottom, 0px));
  background: rgba(4, 6, 9, 0.78);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: overlayIn 0.2s ease both;
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.overlay.closing {
  animation: overlayOut 0.16s ease both;
}

@keyframes overlayOut {
  to {
    opacity: 0;
  }
}

.panel {
  width: 100%;
  max-width: 440px;
  max-height: min(84%, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(18px, 3vw, 24px);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #151c27, #10151e);
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  animation: panelIn 0.24s var(--ease-out) both;
  scrollbar-width: thin;
  scrollbar-color: #26313f transparent;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel.closing {
  animation: panelOut 0.16s ease both;
}

@keyframes panelOut {
  to {
    opacity: 0;
    transform: scale(0.96);
  }
}

.panel::-webkit-scrollbar {
  width: 6px;
}

.panel::-webkit-scrollbar-thumb {
  background: #26313f;
  border-radius: 3px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-kicker {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--accent);
}

.panel-kicker-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.panel-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin: 10px 0 0;
  line-height: 1.5;
}

/* ---------------- 对话 ---------------- */

.dialog-text {
  font-size: 15px;
  line-height: 25px;
  color: var(--text);
  min-height: 75px;
  white-space: pre-wrap;
  word-break: break-word;
}

.dialog-narr {
  font-size: 14px;
  line-height: 24px;
  color: var(--text-sub);
  font-style: italic;
  min-height: 72px;
  white-space: pre-wrap;
  word-break: break-word;
}

.dialog-speaker {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.caret::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.dialog-hint {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 20px;
  min-height: 16px;
}

.dialog-hint .arrow {
  animation: nudge 1.4s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.5;
  }
  50% {
    transform: translateX(4px);
    opacity: 1;
  }
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  animation: optionIn 0.26s var(--ease-out) both;
}

@keyframes optionIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.option {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 21px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}

.option:hover:not(:disabled) {
  background: var(--card-active);
  border-color: rgba(228, 180, 92, 0.55);
}

.option:active:not(:disabled) {
  transform: scale(0.99);
}

.option .tip {
  display: block;
  font-size: 11px;
  color: var(--danger);
  margin-top: 6px;
}

.option:disabled,
.option[data-locked="1"] {
  background: var(--card-dim);
  border-color: var(--line-soft);
  color: var(--text-dim);
  cursor: not-allowed;
}

/* ---------------- 线索卡 ---------------- */

.clue-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clue-grid .clue {
  margin-bottom: 0;
}

.clue {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, border-color 0.18s;
}

.clue:hover {
  background: var(--card-active);
}

.clue.locked {
  background: var(--card-dim);
  border-color: var(--line-soft);
  cursor: default;
}

.clue-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clue-badge {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  background: #1b232f;
  transition: background 0.2s, color 0.2s;
}

.clue.locked .clue-badge {
  color: #3d4a5c;
}

.clue:not(.locked) .clue-badge {
  background: var(--accent);
  color: #12161f;
}

.clue-main {
  flex: 1;
  min-width: 0;
}

.clue-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clue-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clue.locked .clue-name {
  color: var(--text-dim);
}

.badge-key {
  font-size: 10px;
  color: var(--accent);
  border: 1px solid rgba(228, 180, 92, 0.45);
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.clue.locked .badge-key {
  color: var(--text-dim);
  border-color: var(--line-soft);
}

.clue-meta {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clue.locked .clue-meta {
  color: var(--text-dim);
}

.clue-toggle {
  font-size: 11px;
  color: var(--accent);
  flex-shrink: 0;
}

.clue.locked .clue-toggle {
  color: var(--text-dim);
}

.clue-body {
  display: block;
  font-size: 13px;
  line-height: 22px;
  color: var(--text-sub);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  animation: clueOpen 0.24s var(--ease-out) both;
}

@keyframes clueOpen {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- 推理页 ---------------- */

.reason-intro {
  font-size: 13px;
  line-height: 23px;
  color: var(--text-sub);
  margin: 4px 0 4px;
}

.check-row {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.check-row.miss {
  background: var(--card-dim);
  border-color: var(--line-soft);
}

.check-mark {
  font-size: 13px;
  width: 16px;
  flex-shrink: 0;
  color: var(--ok);
  line-height: 21px;
}

.check-row.miss .check-mark {
  color: var(--danger);
}

.check-body {
  display: block;
  flex: 1;
  min-width: 0;
}

.check-name {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.check-row.miss .check-name {
  color: var(--text-dim);
}

.check-hint {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 5px;
}

.check-row.miss .check-hint {
  color: var(--accent);
}

.tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 11px;
  color: var(--text-sub);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line-soft);
}

.verdict {
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  font-size: 13px;
  line-height: 23px;
  color: var(--text-sub);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.verdict.unlocked {
  background: var(--accent-deep);
  border-color: rgba(228, 180, 92, 0.6);
  color: var(--text);
}

.choice {
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 15px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}

.choice:hover:not(:disabled) {
  background: var(--card-active);
  border-color: #34434f;
}

.choice:active:not(:disabled) {
  transform: scale(0.99);
}

.choice.selected {
  background: var(--card-active);
  border-color: var(--accent);
}

.choice:disabled,
.choice[data-locked="1"] {
  background: var(--card-dim);
  border-color: var(--line-soft);
  cursor: not-allowed;
}

.choice .radio {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 21px;
  flex-shrink: 0;
}

.choice.selected .radio {
  color: var(--accent);
}

.choice .label {
  flex: 1;
  font-size: 14px;
  line-height: 21px;
  color: var(--text);
}

.choice:disabled .label {
  color: var(--text-dim);
}

.choice .lock-tip {
  display: block;
  font-size: 11px;
  color: var(--danger);
  margin-top: 8px;
}

.submit-hint {
  font-size: 10px;
  line-height: 18px;
  color: var(--text-dim);
  margin: 4px 0 24px;
}

/* ---------------- 结局页 ---------------- */

.ending {
  padding: 0;
  align-items: center;
  text-align: center;
}

/* 结局正文：宽屏下限制阅读宽度并居中，避免长行难以扫读 */
.ending-body {
  width: 100%;
  max-width: 700px;
  margin-inline: auto;
  padding: clamp(28px, 7vh, 54px) var(--gutter) 0;
}

.ending .kicker {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--text-dim);
}

.ending .type-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-sub);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  margin-top: 16px;
}

.ending.truth .type-badge {
  color: var(--ok);
  border-color: rgba(95, 201, 160, 0.5);
}

.ending .title {
  font-size: clamp(24px, 4.6vw, 34px);
  font-weight: 700;
  letter-spacing: 2px;
  margin: clamp(12px, 2.4vh, 20px) 0 0;
  line-height: 1.35;
}

.ending .subtitle {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 10px;
  letter-spacing: 1px;
}

.ending .rule {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin: 22px 0;
  opacity: 0.7;
}

.ending .para {
  font-size: 14px;
  line-height: 26px;
  color: var(--text-sub);
  text-align: left;
  margin: 0 0 16px;
  width: 100%;
  animation: paraIn 0.5s var(--ease-out) both;
}

@keyframes paraIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stats {
  display: flex;
  width: 100%;
  padding: 18px 0;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  margin-top: 8px;
}

.stat {
  flex: 1;
  text-align: center;
}

.stat b {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat span {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
}

.ending .actions {
  width: 100%;
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------------- Toast ---------------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px);
  z-index: 90;
  max-width: min(88vw, 440px);
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(24, 31, 42, 0.96);
  border: 1px solid #2b3644;
  color: var(--text);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s var(--ease-out);
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- 线索拾取 ---------------- */

.pickup-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pickup-item {
  padding: 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  animation: pickupIn 0.34s var(--ease-out) both;
}

.pickup-item:nth-child(2) {
  animation-delay: 0.06s;
}

.pickup-item:nth-child(3) {
  animation-delay: 0.12s;
}

@keyframes pickupIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pickup-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pickup-letter {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  width: 20px;
  flex-shrink: 0;
}

.pickup-name {
  font-size: 14px;
  color: var(--text);
}

.pickup-desc {
  font-size: 12px;
  line-height: 21px;
  color: var(--text-sub);
  margin: 8px 0 0;
}

/* ---------------- 简介列表 ---------------- */

.intro-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.intro-item {
  display: flex;
  gap: 9px;
  font-size: 13px;
  line-height: 22px;
  color: var(--text-sub);
}

.intro-item i {
  font-style: normal;
  color: var(--accent);
  font-size: 11px;
  line-height: 22px;
  flex-shrink: 0;
}

/* =========================================================
   自适应布局
   小屏单列紧凑 · 宽屏两列铺开 · 矮屏压缩纵向留白
   ========================================================= */

/* 平板及以上：字号与留白随视口放大，不靠固定像素硬撑 */
@media (min-width: 720px) {
  .scene-card {
    margin-top: 20px;
    padding: 20px;
  }

  .point {
    padding: 18px;
  }

  .point .name {
    font-size: 16px;
  }

  .point .brief {
    font-size: 12px;
  }

  .tabs .tab-name {
    font-size: 14px;
  }

  .section-title {
    margin: 26px 0 14px;
  }

  .dialog-text {
    font-size: 16px;
    line-height: 27px;
  }

  .dialog-narr {
    font-size: 15px;
    line-height: 26px;
  }

  .reason-intro,
  .verdict {
    font-size: 14px;
    line-height: 24px;
  }

  .ending .para {
    font-size: 15px;
    line-height: 28px;
  }

  .home {
    max-width: 560px;
  }

  .home .actions {
    max-width: 360px;
    width: 100%;
    margin-inline: auto;
  }
}

/* 桌面 / 平板竖屏：首页不再把元素拉到上下两端，改为一个居中的视觉块 */
@media (min-width: 720px) and (min-height: 640px) {
  .home {
    position: relative;
    justify-content: center;
  }

  .home .meta-row {
    position: absolute;
    top: clamp(18px, 4vh, 34px);
    left: clamp(20px, 6vw, 46px);
    right: clamp(20px, 6vw, 46px);
  }

  .home .hero {
    flex: 0 0 auto;
  }

  .home .actions {
    margin-top: clamp(24px, 5vh, 46px);
  }

  .home .footnote {
    margin-top: clamp(16px, 3vh, 26px);
  }
}

/* 宽屏：横向空间改为双列，减少滚动距离（单列最多 700px，超过即分栏） */
@media (min-width: 780px) {
  .screen.wide {
    --cw: min(1060px, 96vw);
  }

  .points {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .clue-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
  }

  .tabs {
    padding: 8px 0 16px;
  }

  .bottom-actions {
    margin-top: 26px;
  }

  .bottom-actions .btn {
    height: 52px;
  }

  .panel {
    max-width: 480px;
  }
}

/* 桌面：正文与说明文字略微放大，避免大屏上显得过小 */
@media (min-width: 1024px) {
  .scene-desc {
    font-size: 14px;
    line-height: 25px;
  }

  .point .brief {
    font-size: 12.5px;
  }

  .topbar .t1 {
    font-size: 16px;
  }

  .topbar .t2 {
    font-size: 11px;
  }

  .ending .para {
    font-size: 15px;
    line-height: 29px;
  }
}

/* 超宽屏：内容宽度不再无限拉伸，靠外壳留白收边 */
@media (min-width: 1600px) {
  .screen {
    --cw: 820px;
  }

  .screen.wide {
    --cw: 1120px;
  }
}

/* 矮屏（横屏手机 / 小窗口）：压缩纵向间距，保证主要内容一屏可见 */
@media (max-height: 720px) {
  .home {
    padding-top: clamp(12px, 3vh, 22px);
    padding-bottom: clamp(12px, 3vh, 22px);
  }

  .home .hero {
    padding: 6px 0;
  }

  .home .brand {
    font-size: clamp(26px, 5.4vh, 42px);
  }

  .home .brand-en {
    margin-top: 8px;
  }

  .home .rule {
    margin: 12px 0;
  }

  .home .tagline {
    line-height: 1.7;
  }

  .home .footnote {
    margin-top: 12px;
  }

  .btn {
    height: 48px;
  }

  .btn-ghost {
    height: 46px;
  }

  .ending-body {
    padding-top: clamp(20px, 5vh, 36px);
  }

  .ending .rule {
    margin: 14px 0;
  }

  .ending .para {
    margin-bottom: 12px;
  }

  .dialog-hint {
    margin-top: 14px;
  }

  .dialog-text,
  .dialog-narr {
    min-height: 58px;
  }

  .dialog-text {
    line-height: 24px;
  }
}

/* 极窄屏：收紧内边距，避免文字被挤压成每行两三个字 */
@media (max-width: 360px) {
  :root {
    --gutter: 14px;
  }

  .topbar .t1 {
    font-size: 14px;
  }

  .bottom-actions {
    gap: 10px;
  }

  .bottom-actions .btn {
    font-size: 13px;
  }
}

/* ---------------- 减弱动效偏好 ---------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
