* { box-sizing: border-box; }
:root {
  --bg: #0a0e1a;
  --bg2: #131a2e;
  --card: #1b2440;
  --card2: #243056;
  --line: #2c3a66;
  --text: #e8ecf6;
  --dim: #95a3c4;
  --accent: #ffd84d;
  --accent2: #ff7a59;
  --green: #4ade80;
  --red: #ff6b7a;
  --blue: #60a5fa;
}
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; padding-bottom: 80px; }

.hero {
  background: linear-gradient(135deg, #0a0e1a 0%, #1a2547 60%, #2a1a47 100%);
  padding: 28px 20px 0;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.hero-inner { display: flex; align-items: center; gap: 16px; max-width: 720px; margin: 0 auto; }
.logo { font-size: 48px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(255,216,77,.3)); }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.5px; }
.sub { margin: 0; color: var(--dim); font-size: 14px; }

.tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 18px 0 14px;
  max-width: 720px; margin: 0 auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--dim); padding: 10px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #1a1300; border-color: var(--accent); box-shadow: 0 4px 14px rgba(255,216,77,.3); }

main { max-width: 720px; margin: 0 auto; padding: 24px 20px; }
.panel { display: none; animation: fade .25s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.3px; }
h3 { font-size: 15px; margin: 24px 0 10px; color: var(--accent); text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
.hint { color: var(--dim); font-size: 14px; margin: 0 0 16px; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: all .15s; user-select: none;
}
.checklist li:hover { border-color: var(--accent); transform: translateX(2px); }
.checklist li::before {
  content: ""; width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--line); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.checklist li.done { opacity: .55; }
.checklist li.done::before {
  background: var(--green); border-color: var(--green);
  content: "✓"; color: #04210d; font-weight: 900; font-size: 14px;
}
.checklist li.done span { text-decoration: line-through; }

.progress-card {
  margin-top: 28px; padding: 18px; background: var(--card2);
  border-radius: 14px; border: 1px solid var(--line);
}
.progress-text { font-weight: 600; margin-bottom: 10px; }
.progress-text span { color: var(--accent); font-size: 18px; }
.bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); width: 0%; transition: width .4s ease; }

button { font-family: inherit; cursor: pointer; }
.primary { background: var(--accent); color: #1a1300; border: none; padding: 12px 20px; border-radius: 10px; font-weight: 700; font-size: 15px; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--dim); padding: 10px 16px; border-radius: 10px; font-size: 14px; }
.ghost:hover { color: var(--text); border-color: var(--accent); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; margin-bottom: 14px;
}
.card h3 { margin-top: 0; color: var(--accent2); }
.tip { color: var(--green); font-size: 14px; margin: 8px 0 0; }
.card.warning { border-color: var(--red); background: rgba(255,107,122,.08); }
.card.success { border-color: var(--green); background: rgba(74,222,128,.08); text-align: center; padding: 24px; }

.diagram { background: #050810; padding: 14px; border-radius: 10px; overflow-x: auto; margin: 12px 0; }
.diagram pre { margin: 0; color: var(--blue); font-size: 11px; line-height: 1.4; font-family: "SF Mono", Menlo, monospace; }

.autofail { padding-left: 0; counter-reset: af; list-style: none; }
.autofail li {
  background: var(--card); border-left: 4px solid var(--red);
  padding: 14px 18px; margin-bottom: 10px; border-radius: 0 10px 10px 0;
  counter-increment: af; position: relative; padding-left: 50px;
}
.autofail li::before {
  content: counter(af); position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); background: var(--red); color: #2a000a;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}

.quiz-q {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.quiz-q .q { font-weight: 600; margin-bottom: 12px; }
.quiz-opt {
  display: block; padding: 10px 14px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 8px;
  margin-bottom: 6px; cursor: pointer; transition: all .15s;
  font-size: 14px;
}
.quiz-opt:hover { border-color: var(--accent); }
.quiz-opt.selected { background: var(--accent); color: #1a1300; border-color: var(--accent); font-weight: 600; }
.quiz-opt.correct { background: rgba(74,222,128,.2); border-color: var(--green); color: var(--green); }
.quiz-opt.wrong { background: rgba(255,107,122,.2); border-color: var(--red); color: var(--red); }
.quiz-controls { display: flex; gap: 10px; margin-top: 16px; }
#quizResult { margin-top: 18px; text-align: center; font-size: 18px; font-weight: 700; }
.explain { font-size: 13px; color: var(--dim); margin-top: 8px; padding: 8px 12px; background: rgba(255,255,255,.03); border-radius: 6px; display: none; }
.quiz-q.checked .explain { display: block; }

.route .step {
  display: flex; gap: 14px; padding: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px;
}
.step .num {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #1a1300; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.step em { color: var(--dim); font-style: normal; font-size: 14px; }

footer {
  text-align: center; color: var(--dim); font-size: 13px;
  padding: 30px 20px; max-width: 720px; margin: 0 auto;
}

@media (max-width: 480px) {
  h1 { font-size: 20px; }
  .logo { font-size: 36px; }
  main { padding: 18px 14px; }
}
