* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: radial-gradient(circle at top, #1e3a8a 0%, #111827 45%, #030712 100%);
  color: #f9fafb;
  min-height: 100vh;
}
button, select { font: inherit; }
button { -webkit-tap-highlight-color: rgba(96, 165, 250, 0.25); }
button:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: 3px;
}
a { color: #93c5fd; }
header { text-align: center; padding: 34px 16px 16px; }
header h1 { margin: 0; font-size: 34px; letter-spacing: 1px; }
header p { color: #cbd5e1; margin: 10px auto 0; line-height: 1.6; max-width: 760px; }
.header-note { font-size: 14px; }
.tabs {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 16px; max-width: 1100px; margin: 0 auto;
}
.tabs button, .btn {
  border: none; border-radius: 12px; padding: 11px 15px;
  background: #374151; color: white; cursor: pointer; font-size: 15px;
  transition: 0.15s;
}
.tabs button:hover, .btn:hover { transform: translateY(-1px); background: #4b5563; }
.tabs button.active, .btn.primary { background: #2563eb; }
.btn.danger { background: #dc2626; }
.btn.good { background: #059669; }
.container { max-width: 980px; margin: 0 auto; padding: 16px; }
.card {
  background: rgba(31, 41, 55, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px; padding: 24px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.28);
  margin-bottom: 20px; backdrop-filter: blur(8px);
}
.hidden { display: none; }
.info { color: #d1d5db; margin: 10px 0 20px; line-height: 1.7; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.stat {
  background: #111827; border-radius: 12px; padding: 12px 16px;
  min-width: 140px; color: #e5e7eb; border: 1px solid rgba(255,255,255,0.06);
}
select, input {
  background: #111827; color: white; border: 1px solid #4b5563;
  border-radius: 8px; padding: 8px 12px; margin: 4px 8px 4px 0;
}
.grid { display: grid; gap: 10px; max-width: 540px; margin: 20px auto; }
.cell {
  aspect-ratio: 1; border-radius: 14px; background: #374151; color: white;
  font-size: 24px; font-weight: bold; display: flex; align-items: center;
  justify-content: center; cursor: pointer; user-select: none; transition: 0.12s;
  border: 1px solid rgba(255,255,255,0.08); padding: 0;
}
.cell:hover:not(:disabled) { background: #4b5563; transform: scale(1.03); }
.cell:disabled { opacity: 1; cursor: default; }
.cell.done { background: #059669; color: #d1fae5; }
.cell.wrong { background: #dc2626; }
.big-box {
  height: 310px; border-radius: 18px; background: #374151;
  display: flex; justify-content: center; align-items: center; text-align: center;
  cursor: pointer; font-size: 26px; font-weight: bold; user-select: none;
  margin-top: 20px; line-height: 1.6; border: 1px solid rgba(255,255,255,0.1);
  touch-action: manipulation; overflow: hidden; position: relative;
}
.big-box.ready { background: #dc2626; }
.big-box.go { background: #16a34a; }
.big-box.finished { background: #1d4ed8; }
.result-list { margin-top: 14px; color: #dbeafe; line-height: 1.8; word-break: break-word; }
.control-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
}
.sustained-stage {
  min-height: 330px; margin-top: 20px; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #111827; border: 2px solid #374151;
}
.sustained-stage p { margin: 0 0 18px; color: #94a3b8; }
.sustained-stimulus {
  width: 170px; height: 170px; border-radius: 50%;
  border: 5px solid #64748b; background: #1e293b; color: #f8fafc;
  font-size: 72px; font-weight: 800; cursor: pointer; user-select: none;
  touch-action: manipulation; transition: background 0.08s, border-color 0.08s;
}
.sustained-stimulus:disabled { opacity: 1; cursor: default; }
.sustained-stimulus.go, .sustained-stimulus.no-go { background: #1e293b; border-color: #64748b; }
.sustained-stimulus.feedback-correct { background: #047857; border-color: #6ee7b7; }
.sustained-stimulus.feedback-wrong { background: #991b1b; border-color: #fca5a5; }
.sustained-stimulus.idle { font-size: 25px; color: #94a3b8; }
.training-status {
  margin-top: 16px; padding: 11px 14px; border-radius: 10px;
  background: #172554; color: #bfdbfe; text-align: center;
}
.multi-arena { touch-action: manipulation; }
.multi-ball {
  position: absolute; left: 0; top: 0; width: 46px; height: 46px;
  padding: 0; border-radius: 50%; border: 4px solid #94a3b8;
  background: #475569; cursor: pointer; will-change: transform;
  box-shadow: 0 5px 12px rgba(0,0,0,0.28);
}
.multi-ball.preview {
  background: #2563eb; border-color: #bfdbfe;
  box-shadow: 0 0 24px rgba(59,130,246,0.9);
}
.multi-ball.selected { outline: 4px solid #facc15; outline-offset: 3px; }
.multi-ball.correct { background: #059669; border-color: #a7f3d0; }
.multi-ball.wrong { background: #dc2626; border-color: #fecaca; }
.arena {
  position: relative; height: 430px; background: #111827;
  border: 2px solid #374151; border-radius: 16px; overflow: hidden; margin-top: 20px;
}
.target, .moving-target, .distractor { position: absolute; cursor: pointer; padding: 0; }
.target {
  width: 54px; height: 54px; border-radius: 50%;
  background: #facc15; border: 4px solid #fde68a;
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.7);
}
.moving-target {
  width: 58px; height: 58px; border-radius: 50%;
  background: #38bdf8; border: 4px solid #bae6fd;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.7);
}
.distractor {
  width: 48px; height: 48px; border-radius: 50%;
  background: #ef4444; border: 3px solid #fecaca;
  box-shadow: 0 0 18px rgba(239,68,68,.45);
}
.choice-display { font-size: 64px; letter-spacing: 10px; }
.choice-controls {
  display: grid; grid-template-columns: repeat(4, minmax(60px, 1fr));
  gap: 10px; max-width: 560px; margin: 14px auto 0;
}
.choice-key {
  min-height: 58px; border: 1px solid #64748b; border-radius: 12px;
  background: #1e293b; color: white; font-size: 22px; font-weight: 700; cursor: pointer;
}
.choice-key:active { background: #2563eb; transform: translateY(1px); }
.kbd {
  display: inline-block; padding: 4px 9px; border-radius: 7px;
  background: #111827; border: 1px solid #64748b; margin: 0 3px;
  font-family: Consolas, monospace;
}
.memory-board {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  max-width: 440px; margin: 20px auto;
}
.memory-cell {
  height: 110px; border-radius: 16px; background: #334155;
  cursor: pointer; transition: 0.15s; border: 1px solid rgba(255,255,255,0.08); padding: 0;
}
.memory-cell.flash { background: #facc15; box-shadow: 0 0 28px rgba(250,204,21,.7); }
.memory-cell.ok { background: #16a34a; }
.memory-cell.bad { background: #dc2626; }
.dashboard-card { overflow: hidden; }
.section-heading {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; margin-bottom: 18px;
}
.section-heading.compact { align-items: center; }
.section-heading h2 { margin: 3px 0 6px; }
.section-heading p { margin: 0; color: #cbd5e1; line-height: 1.6; }
.eyebrow {
  color: #93c5fd; font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.plan-score {
  min-width: 96px; padding: 12px 14px; border-radius: 14px;
  background: #172554; text-align: center; border: 1px solid #1d4ed8;
}
.plan-score strong { display: block; font-size: 22px; }
.plan-score span { color: #bfdbfe; font-size: 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.summary-item {
  padding: 15px; border-radius: 14px; background: #111827;
  border: 1px solid rgba(255,255,255,0.07);
}
.summary-item strong { display: block; font-size: 24px; color: #f8fafc; }
.summary-item span { display: block; margin-top: 3px; color: #94a3b8; font-size: 13px; }
.progress-track {
  height: 8px; margin: 18px 0; border-radius: 999px;
  background: #0f172a; overflow: hidden;
}
.progress-bar {
  width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8); transition: width 0.3s ease;
}
.daily-plan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan-item {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 13px; border-radius: 13px; border: 1px solid #475569;
  background: #1e293b; color: #f8fafc; text-align: left; cursor: pointer;
}
.plan-item:hover { background: #334155; }
.plan-item.completed { border-color: #059669; background: rgba(5, 150, 105, 0.14); }
.plan-status {
  display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px;
  border-radius: 50%; background: #0f172a; color: #93c5fd; font-weight: 800;
}
.plan-item.completed .plan-status { color: #d1fae5; background: #047857; }
.plan-text { min-width: 0; }
.plan-text strong, .plan-text small { display: block; }
.plan-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-text small { margin-top: 3px; color: #94a3b8; }
.history-list { display: grid; gap: 9px; }
.history-item {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 13px 14px; border-radius: 12px; background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
}
.history-main, .history-value { min-width: 0; }
.history-main strong, .history-main span, .history-value strong, .history-value small { display: block; }
.history-main span { margin-top: 3px; color: #94a3b8; font-size: 13px; }
.history-value { text-align: right; }
.history-value strong { color: #bfdbfe; }
.history-value small { margin-top: 3px; color: #64748b; }
.empty-state { margin: 0; padding: 18px; text-align: center; color: #94a3b8; }
.leaderboard-panel {
  margin-top: 22px; padding: 18px; border-radius: 16px;
  background: rgba(15, 23, 42, 0.72); border: 1px solid #334155;
}
.leaderboard-panel h3 { margin: 3px 0 6px; font-size: 21px; }
.nickname-field { color: #cbd5e1; font-size: 13px; }
.nickname-field input { display: block; width: 190px; margin: 6px 0 0; }
.leaderboard-status {
  padding: 11px 13px; border-radius: 10px; background: #172554;
  color: #bfdbfe; font-size: 14px;
}
.leaderboard-status.error { background: rgba(127, 29, 29, 0.52); color: #fecaca; }
.leaderboard-list {
  margin: 12px 0 0; padding: 0; list-style: none; counter-reset: rank;
  display: grid; gap: 8px;
}
.leaderboard-row {
  counter-increment: rank; display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center; gap: 10px; padding: 11px 13px;
  border-radius: 10px; background: #111827; border: 1px solid rgba(255,255,255,0.06);
}
.leaderboard-row::before {
  content: counter(rank); display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%; background: #1e293b;
  color: #93c5fd; font-weight: 800;
}
.leaderboard-row:nth-child(1)::before { background: #854d0e; color: #fef3c7; }
.leaderboard-row:nth-child(2)::before { background: #475569; color: #f8fafc; }
.leaderboard-row:nth-child(3)::before { background: #7c2d12; color: #ffedd5; }
.leaderboard-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-time { color: #bfdbfe; font-weight: 800; }
.leaderboard-note { margin: 12px 0 0; color: #64748b; font-size: 12px; line-height: 1.6; }
footer { text-align: center; color: #94a3b8; padding: 28px 16px 38px; line-height: 1.8; }
footer p { margin: 4px 0; }
.legal-note { font-size: 13px; }
@media (max-width: 600px) {
  header { padding-top: 26px; }
  header h1 { font-size: 26px; }
  .tabs {
    justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto;
    position: sticky; top: 0; z-index: 10; padding: 12px 16px;
    background: rgba(3, 7, 18, 0.94); backdrop-filter: blur(10px);
  }
  .tabs button { flex: 0 0 auto; }
  .big-box { height: 250px; font-size: 22px; }
  .card { padding: 18px; }
  .cell { font-size: 18px; border-radius: 10px; }
  .choice-display { font-size: 48px; }
  .choice-controls { grid-template-columns: repeat(2, 1fr); }
  .memory-cell { height: 86px; }
  .arena { height: 360px; }
  .sustained-stage { min-height: 280px; }
  .sustained-stimulus { width: 145px; height: 145px; font-size: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
@media (max-width: 700px) {
  .section-heading { align-items: center; }
  .daily-plan { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-item { display: flex; align-items: center; justify-content: space-between; }
  .summary-item strong { font-size: 20px; }
  .history-item { align-items: flex-start; flex-direction: column; gap: 8px; }
  .history-value { text-align: left; }
  .section-heading.compact { align-items: flex-start; flex-direction: column; }
  .nickname-field, .nickname-field input { width: 100%; }
}