/* 主题配色：暗色底 + 金色点缀，呼应周杰伦专辑气质 */
:root {
  --bg: #0b0b0c;
  --panel: #131316;
  --text: #f2f2f3;
  --muted: #a9a9b2;
  --primary: #d4af37; /* 金色 */
  --primary-weak: #6c5c1a;
  --accent: #6ea2ff;
  --danger: #ff6161;
  --success: #54d38a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 80% -20%, #1f1f23 0%, var(--bg) 60%), var(--bg);
}

#app { max-width: 980px; margin: 0 auto; padding: 24px; }

.brand { text-align: center; margin: 20px 0 10px; }
.brand h1 { font-size: 2.2rem; letter-spacing: 1px; margin: 0; }
.brand .subtitle { color: var(--muted); margin-top: 8px; }
.brand.small h2 { font-size: 1.6rem; margin: 0; }

.view { display: none; }
.view.active { display: block; }

.intro { background: var(--panel); border: 1px solid #24242a; border-radius: 14px; padding: 16px; }
.features { display: flex; gap: 16px; padding: 0; list-style: none; margin: 12px 0 0; color: var(--muted); }
.features li { background: #18181c; border: 1px solid #202027; border-radius: 999px; padding: 8px 14px; }

.home-actions { display: flex; gap: 12px; justify-content: center; margin: 20px 0 0; }

.btn {
  appearance: none;
  background: #202028;
  border: 1px solid #2a2a33;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); background: #262632; }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--primary-weak); border-color: var(--primary); color: var(--primary); }
.btn.primary:hover { background: #7a6a1f; }
.btn.ghost { background: transparent; border-color: #2a2a33; }
.btn.danger { background: #3a1f1f; border-color: var(--danger); color: #ffb1b1; }

.icon-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 8px 10px; border-radius: 8px; }
.icon-btn:hover { background: #1a1a1e; color: var(--text); }

.topbar { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 12px; }
.topbar .left { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.topbar .dot { opacity: .6; }

.timer { display: flex; justify-content: center; align-items: center; margin: 12px 0 18px; }
.timer-ring { position: relative; width: 84px; height: 84px; }
.timer-ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.timer-ring .bg { fill: none; stroke: #2a2a33; stroke-width: 3; }
.timer-ring .fg { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 100,100; stroke-dashoffset: 0; transition: stroke-dashoffset .2s linear; }
.timer-ring #timer-text { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; }

.question { background: var(--panel); border: 1px solid #24242a; border-radius: 16px; padding: 16px; }
.stem { font-size: 1.06rem; line-height: 1.6; margin-bottom: 12px; }
.media { display: grid; gap: 12px; }
.media .audio-controls { display: flex; align-items: center; gap: 8px; }
.media audio { width: 100%; background: #18181c; border-radius: 8px; }
.media img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; border: 1px solid #202027; }

.options { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.option-btn { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid #2a2a33; background: #1a1a1e; color: var(--text); cursor: pointer; }
.option-btn:hover { border-color: #3a3a45; background: #202024; }
.option-btn.selected { border-color: var(--accent); }
.option-btn.correct { border-color: var(--success); background: #1b2a22; }
.option-btn.wrong { border-color: var(--danger); background: #2a1b1b; }

.analysis-wrap { background: var(--panel); border: 1px solid #24242a; border-radius: 16px; padding: 18px; }
.analysis-wrap h2 { margin-top: 0; }
.explain { color: var(--muted); }
.countdown { color: var(--muted); }

.score-card { background: var(--panel); border: 1px solid #24242a; border-radius: 16px; padding: 18px; }
.score-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed #2a2a33; }
.score-line:last-child { border-bottom: none; }
.level-desc { color: var(--muted); }

.submit-form { margin-top: 14px; display: grid; gap: 8px; }
.submit-form input { padding: 10px 12px; border-radius: 10px; border: 1px solid #2a2a33; background: #141418; color: var(--text); }
.submit-form .actions { display: flex; gap: 10px; }

.board-wrap { background: var(--panel); border: 1px solid #24242a; border-radius: 16px; padding: 10px; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-list li { display: flex; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #202027; }
.board-list li:last-child { border-bottom: none; }

.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.45); }
.modal.show { display: flex; }
.modal-content { width: min(480px, 92%); background: var(--panel); border: 1px solid #2a2a33; border-radius: 16px; padding: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

.loading { position: fixed; bottom: 16px; right: 16px; display: flex; align-items: center; gap: 10px; background: #121216; border: 1px solid #2a2a33; padding: 10px 12px; border-radius: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid #2a2a33; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 响应式 */
@media (min-width: 640px) {
  .options { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 920px) {
  #app { padding: 40px; }
  .brand h1 { font-size: 2.6rem; }
}
