/* ══════════════════════════════════════════
   反应速度测试 - 自定义样式
   ══════════════════════════════════════════ */
:root {
  --bg: #FAFAF9; --bg-alt: #F5F5F4; --surface: #FFFFFF; --border: #E7E5E4; --border-strong: #D6D3D1;
  --text: #1E293B; --text-secondary: #52525B; --text-muted: #71717A;
  --primary: #4F46E5; --primary-hover: #4338CA; --primary-light: rgba(79,70,229,0.08);
  --secondary: #F97316; --accent: #EC4899; --success: #059669;
  --radius: 10px; --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04); --shadow: 0 4px 12px rgba(0,0,0,0.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family:'Inter','Noto Sans SC',system-ui,sans-serif; background:var(--bg); color:var(--text); line-height:1.6; min-height:100vh; -webkit-font-smoothing:antialiased; }
.toast { position:fixed; top:24px; right:24px; background:var(--text); color:var(--bg); padding:10px 18px; border-radius:100px; font-size:14px; font-weight:500; display:flex; align-items:center; gap:8px; z-index:1000; transform:translateX(calc(100% + 40px)); transition:transform 0.3s cubic-bezier(0.34,1.56,0.64,1); box-shadow:0 4px 16px rgba(0,0,0,0.12); }
.toast.show { transform:translateX(0); }
.toast-dot { width:8px; height:8px; background:var(--success); border-radius:50%; }
.page { max-width:960px; margin:0 auto; padding:0 32px; }
::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{background:#f1f5f9}::-webkit-scrollbar-thumb{background:#A5B4FC;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#4F46E5}
::selection { background:rgba(79,70,229,0.2); color:#1E293B; }

/* 测试区域 */
.test-area-wrap { margin:16px 0; }
.test-area {
  width:100%; min-height:320px;
  border-radius:var(--radius-lg);
  cursor:pointer; user-select:none;
  display:flex; align-items:center; justify-content:center;
  transition:background-color 0.15s ease;
  box-shadow:var(--shadow);
}
.test-area.state-idle { background: #dc2626; }
.test-area.state-waiting { background: #dc2626; }
.test-area.state-ready { background: #16a34a; }
.test-area.state-result { background: #2563eb; }
.test-area.state-false-start { background: #f59e0b; }
.test-area.state-cooldown { background: #6b7280; }

.test-inner { text-align:center; display:flex; flex-direction:column; align-items:center; gap:10px; }
.test-text { font-size:24px; font-weight:700; color:white; text-shadow:0 2px 4px rgba(0,0,0,0.2); }
.test-ms { font-size:48px; font-weight:800; color:white; text-shadow:0 2px 4px rgba(0,0,0,0.3); font-family:'SF Mono','Cascadia Code','Fira Code',monospace; }
.test-hint { font-size:14px; color:rgba(255,255,255,0.75); }
.test-area.state-cooldown { cursor:not-allowed; }
.test-area.state-cooldown .test-text { font-size:16px; }

/* 成绩面板 */
.score-panel { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; margin-bottom:16px; }
.score-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 10px; text-align:center; box-shadow:var(--shadow-sm); }
.score-label { display:block; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); margin-bottom:4px; }
.score-value { display:block; font-size:22px; font-weight:700; color:var(--text); font-family:'SF Mono','Cascadia Code','Fira Code',monospace; }
.score-card--rate .score-value { color:var(--primary); }

/* 历史 */
.history-panel { margin-bottom:32px; }
.history-title { display:block; font-size:13px; font-weight:600; color:var(--text-secondary); margin-bottom:8px; }
.history-list { display:flex; flex-wrap:wrap; gap:6px; }
.history-list .history-empty { font-size:13px; color:var(--text-muted); }
.history-chip { display:inline-block; padding:4px 10px; border-radius:100px; font-family:'SF Mono','Cascadia Code','Fira Code',monospace; font-size:12px; font-weight:500; border:1px solid var(--border); background:var(--bg-alt); color:var(--text-secondary); }
.history-chip.fast { background:rgba(34,197,94,0.1); border-color:rgba(34,197,94,0.3); color:#16a34a; }
.history-chip.god { background:rgba(99,102,241,0.1); border-color:rgba(99,102,241,0.3); color:var(--primary); }
.history-chip.slow { background:rgba(251,146,60,0.1); border-color:rgba(251,146,60,0.3); color:#ea580c; }

.guide-section { margin-top:16px; margin-bottom:64px; background:#ffffff; border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.guide-toggle { display:flex; align-items:center; justify-content:space-between; width:100%; padding:14px 20px; background:none; border:none; cursor:pointer; transition:background 0.15s ease; }
.guide-toggle:hover { background:var(--bg-alt); }
.guide-toggle-title { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:600; color:#1E293B; }
.guide-toggle.open .toggle-arrow { transform:rotate(180deg); }
.toggle-arrow { transition:transform 0.2s ease; color:var(--text-muted); }
.guide-list { padding:0 20px 20px; }
.guide-list.hidden { display:none; }
.guide-item { padding:16px 0; border-top:1px solid var(--border); }
.guide-item:first-child { border-top:1px solid var(--border); }
.guide-item-title { font-size:14px; font-weight:600; color:#1E293B; margin-bottom:6px; }
.guide-item-body { font-size:13px; color:var(--text-secondary); line-height:1.8; }

@media (max-width:768px) {
  .page { padding:0 16px; }
  .score-panel { grid-template-columns:repeat(3,1fr); }
  .test-area { min-height:240px; }
  .test-text { font-size:18px; }
  .test-ms { font-size:36px; }
}
