:root {
  --icbc-blue: #0072CE;
  --icbc-navy: #003B71;
  --bg: #FFFFFF;
  --card: #F4F6F8;
  --text: #1A1A1A;
  --muted: #5C6770;
  --green: #2E8540;
  --red: #D8292F;
  --border: #D6DCE2;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.4;
}

.app-header {
  background: var(--icbc-navy);
  color: #fff;
  padding: 1.25rem 1rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.app-header h1 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.app-header .subtitle { margin: 0.25rem 0 0; font-size: 0.85rem; opacity: 0.8; }

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  text-align: left;
}
.back-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.9;
  flex-shrink: 0;
}
.back-link:hover { opacity: 1; }
.progress-line { font-size: 0.9rem; opacity: 0.95; flex: 1; text-align: center; padding: 0 0.5rem; color: #fff; font-weight: 600; }
.timer {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 700;
  min-width: 4rem;
  text-align: center;
  color: #fff;
  background: var(--icbc-blue);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.timer::before { content: "⏱ "; }

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 6rem;
}

.mode-btn {
  display: block;
  width: 100%;
  background: #fff;
  color: var(--icbc-navy);
  border: 2px solid var(--icbc-blue);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  min-height: 56px;
  transition: background 0.15s, transform 0.05s;
  font-family: inherit;
}
.mode-btn:hover { background: #EAF4FB; }
.mode-btn:active { transform: scale(0.99); }
.mode-btn.primary { background: var(--icbc-blue); color: #fff; }
.mode-btn.primary:hover { background: var(--icbc-navy); }

.chapter-btn {
  background: #fff;
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  min-height: 48px;
  font-family: inherit;
  color: var(--text);
}
.chapter-btn:hover { border-color: var(--icbc-blue); background: #fafcfe; }

.hidden { display: none !important; }

.question-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.chapter-tag {
  display: inline-block;
  background: var(--icbc-blue);
  color: #fff;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.question-image {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  min-height: 180px;
}
.sign-svg {
  width: 100%;
  max-width: 200px;
  height: auto;
  max-height: 200px;
}
.sign-svg.scene-svg {
  max-width: 320px;
  max-height: 320px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.wrong-item-image {
  display: flex;
  justify-content: center;
  background: #fff;
  border-radius: 4px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}
.wrong-item-image .sign-svg {
  max-width: 120px;
  max-height: 120px;
}

.question-text {
  font-size: 1.2rem;
  line-height: 1.4;
  margin: 0 0 1.25rem;
  color: var(--icbc-navy);
}
@media (min-width: 768px) {
  .question-text { font-size: 1.4rem; }
}

.choices { display: flex; flex-direction: column; gap: 0.5rem; }
.choice-btn {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  min-height: 48px;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
  color: var(--text);
}
.choice-btn:hover:not(:disabled) { border-color: var(--icbc-blue); background: #fafcfe; }
.choice-btn:disabled { cursor: default; }
.choice-btn.correct {
  border-color: var(--green);
  background: #E8F4EC;
  color: #1F5E2E;
  font-weight: 600;
}
.choice-btn.incorrect {
  border-color: var(--red);
  background: #FBEAEB;
  color: #9B1F23;
  font-weight: 600;
}

.feedback {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-left: 4px solid var(--icbc-blue);
  background: #fff;
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.45;
}
.feedback.correct-fb { border-left-color: var(--green); }
.feedback.wrong-fb { border-left-color: var(--red); }

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
  z-index: 5;
}
.next-btn {
  background: var(--icbc-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  max-width: 568px;
  min-height: 48px;
  font-family: inherit;
}
.next-btn:hover:not(:disabled) { background: var(--icbc-navy); }
.next-btn:disabled { background: #B3D4EF; cursor: not-allowed; }

.score-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.big-score {
  font-size: 4rem;
  font-weight: 700;
  color: var(--icbc-navy);
  line-height: 1;
}
.verdict {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.5rem;
  letter-spacing: 1px;
}
.verdict.pass { color: var(--green); }
.verdict.fail { color: var(--red); }
.meta { color: var(--muted); margin-top: 0.5rem; font-size: 0.9rem; }

.wrong-list { margin-bottom: 1.5rem; }
.wrong-list h2 {
  font-size: 1.1rem;
  color: var(--icbc-navy);
  margin: 0 0 0.5rem;
}
.wrong-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
}
.wrong-item .q { font-weight: 600; color: var(--icbc-navy); margin-bottom: 0.375rem; }
.wrong-item .a { color: var(--green); font-size: 0.9rem; font-weight: 600; }
.wrong-item .e { color: var(--muted); font-size: 0.85rem; margin-top: 0.375rem; }

.action-row { display: flex; flex-direction: column; gap: 0.5rem; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  background: var(--card);
  border-radius: var(--radius);
  margin-top: 1rem;
}
