/* ────────────────────────────────────────────────
   NBTI — 全局样式（移动端优先）
   ──────────────────────────────────────────────── */

:root {
  --bg:         #ffffff;
  --surface:    #f5f5f5;
  --border:     #e0e0e0;
  --text:       #0e0e0e;
  --muted:      #888;
  --accent:     #e0ff60;
  --accent-fg:  #4d7300;
  --radius:     12px;
  --font:       'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}

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

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── 进度条 ── */
.progress-wrap {
  width: 100%;
  max-width: 480px;
  padding: 16px 20px 0;
}
.progress-bar-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
#progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
}
#progress-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  text-align: right;
}

/* ── 答题区 ── */
#question-container {
  width: 100%;
  max-width: 480px;
  padding: 24px 20px;
  flex: 1;
}

.question-card { animation: fadeIn 0.25s ease; }

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

.question-id {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.question-text {
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ── 选项按钮 ── */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  width: 100%;
}

.option-btn:hover {
  border-color: var(--accent-fg);
  background: var(--surface);
}

.option-btn.selected {
  border-color: var(--accent-fg);
  background: #f0ffd0;
  color: var(--accent-fg);
}

.option-id {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  min-width: 18px;
}

.option-btn.selected .option-id {
  color: var(--accent-fg);
}

/* ── 错误提示 ── */
#quiz-error {
  display: none;
  padding: 20px;
  color: #ff6b6b;
  text-align: center;
}

/* ══════════════════════════════════════════════
   结果页
   ══════════════════════════════════════════════ */

.result-body {
  align-items: stretch;
}

/* ── 最外层网格容器 ── */
.result-layout {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 56px;
  display: grid;
  gap: 18px;
}

/* ── 顶部单列堆叠 ── */
.result-top {
  display: grid;
  gap: 18px;
}

/* ── 所有卡片共用 ── */
.poster-box,
.type-box,
.analysis-box,
.dim-box,
.note-box,
.author-box {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: var(--surface);
}

/* ── 图片卡 ── */
.poster-box {
  overflow: hidden;
  padding: 0;
}

.poster-image {
  width: 100%;
  min-height: 220px;
  max-height: 360px;
  object-fit: contain;
  display: block;
}

/* ── 类型卡 ── */
.type-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-label-small {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.type-name-display {
  font-size: clamp(28px, 8vw, 44px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--accent-fg);
  line-height: 1;
}

.type-name-cn {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.match-badge {
  display: inline-block;
  background: var(--accent);
  color: #0e0e0e;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  line-height: 1.3;
}

.match-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 2px;
}

.type-tagline {
  font-size: 16px;
  color: #494A49;
  line-height: 1.8;
  white-space: pre-wrap;
  background: white;
  width: 100%;
  padding: 16px 32px;
  
}

/* ── 解读卡 / 维度卡 / 提示卡 —— 标题 ── */
.analysis-box h3,
.dim-box h3,
.note-box h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
}

/* ── 解读卡正文 ── */
.analysis-box p {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  line-height: 1.9;
  white-space: pre-wrap;
}

/* ── 维度列表 ── */
.dim-list {
  display: grid;
  gap: 10px;
}

.dim-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.dim-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.dim-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.dim-item-score {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-fg);
  white-space: nowrap;
}

.dim-item-score--unknown {
  color: var(--muted);
}

.dim-item p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

/* ── 友情提示 ── */
.note-box p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

/* ── 作者的话（可折叠） ── */
.author-box {
  padding: 0;
  overflow: hidden;
}

.author-box summary {
  list-style: none;
  cursor: pointer;
  padding: 18px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.author-box summary::-webkit-details-marker { display: none; }

.author-box summary::after {
  content: '展开';
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.author-box[open] summary::after {
  content: '收起';
}

.author-content {
  padding: 0 18px 18px;
}

.author-content p + p {
  margin-top: 12px;
}

.author-content p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

/* ── 操作按钮 ── */
.result-actions {
  display: flex;
  gap: 12px;
}

.action-btn {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.action-btn--primary {
  background: var(--accent);
  color: #0e0e0e;
}

.action-btn--secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.action-btn:hover { opacity: 0.85; }

/* ── WIFI 信号元素 ── */
.wifi-signal {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 32px;
  margin-top: 10px;
}
.wifi-signal .bar {
  display: block;
  width: 8px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  animation: signalPulse 1.2s ease-in-out infinite alternate;
}
.wifi-signal .b1 { height: 8px;  animation-delay: 0s; }
.wifi-signal .b2 { height: 16px; animation-delay: 0.15s; }
.wifi-signal .b3 { height: 24px; animation-delay: 0.3s; }
.wifi-signal .b4 { height: 32px; animation-delay: 0.45s; }

@keyframes signalPulse {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}

/* ── 404 / 403 HTTP 报错风格 ── */
body[data-type="404"] .type-name-display,
body[data-type="403"] .type-name-display {
  font-family: 'Courier New', monospace;
  color: #ff6b6b;
}

/* ── 主页 ── */
.index-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 24px;
  padding: 40px 24px;
}
.index-page h1 {
  font-size: 48px;
  font-weight: 900;
  color: var(--accent-fg);
  letter-spacing: -0.02em;
  text-align: center;
}
.index-page p {
  font-size: 16px;
  color: var(--muted);
  text-align: center;
  max-width: 300px;
  line-height: 1.6;
}
.start-btn {
  background: var(--accent);
  color: #0e0e0e;
  border: none;
  border-radius: var(--radius);
  padding: 16px 40px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.15s;
}
.start-btn:hover { opacity: 0.85; }

/* ── 答题页返回上一题按钮 ── */
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.back-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ── 结果页返回链接 ── */
.back-link {
  display: block;
  text-align: center;
  margin-top: 32px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.back-link:hover { color: var(--text); }

/* ── 结果页合并卡（card-preview 同款） ── */
.result-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.result-card-header {
  width: 100%;
  padding: 32px 32px 16px;
  text-align: center;
}

.rc-label-top {
  font-size: 34px;
  font-weight: 400;
  color: #494A49;
  letter-spacing: normal;
  margin-bottom: 10px;
}

.rc-name-cn {
  font-size: 46px;
  font-weight: 700;
  color: #3E4040;
  letter-spacing: normal;
  margin-bottom: 8px;
}

.rc-label {
  font-size: 43px;
  font-weight: 700;
  color: #4298B4;
  letter-spacing: normal;
}
