:root {
  color-scheme: dark;
  --bg: #07111d;
  --panel: rgba(15, 30, 47, 0.92);
  --panel-2: #13283d;
  --panel-3: #19334b;
  --line: rgba(148, 184, 214, 0.2);
  --text: #f5f9fc;
  --muted: #a9bfd0;
  --primary: #54d6c5;
  --primary-strong: #20bba6;
  --accent: #ffbf4b;
  --danger: #ff657a;
  --success: #71e69b;
  --info: #67aefc;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  font-family:
    "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(24, 113, 131, 0.34), transparent 30%),
    radial-gradient(circle at 100% 15%, rgba(50, 91, 154, 0.28), transparent 28%),
    linear-gradient(155deg, #07111d 0%, #091a29 50%, #06101a 100%);
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
  touch-action: manipulation;
}

.app-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 22px 22px 8px 8px;
  background:
    linear-gradient(120deg, rgba(24, 54, 77, 0.96), rgba(11, 28, 43, 0.96)),
    var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(27px, 4vw, 44px);
  line-height: 1.1;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(23px, 3vw, 34px);
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.timer-card {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px 16px;
  min-width: 250px;
  padding: 14px 16px;
  border: 1px solid rgba(84, 214, 197, 0.28);
  border-radius: 16px;
  background: rgba(4, 16, 27, 0.56);
}

.timer-card span {
  color: var(--muted);
  font-size: 12px;
}

.timer-card strong {
  color: var(--accent);
  font-family: Consolas, monospace;
  font-size: 25px;
  letter-spacing: 0.06em;
}

.timer-card .button {
  grid-column: 1 / -1;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 18px 18px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.summary-strip > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(12, 29, 44, 0.95);
}

.summary-strip span {
  color: var(--muted);
  font-size: 13px;
}

.summary-strip strong {
  color: var(--text);
  font-size: 15px;
  text-align: right;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  min-height: calc(100vh - 220px);
}

.sidebar,
.main-content {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 12px;
  border-radius: 18px;
}

.nav-home,
.scenario-nav button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.nav-home {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 14px;
  margin-bottom: 8px;
}

.nav-home small {
  color: var(--muted);
}

.nav-home:hover,
.nav-home.active,
.scenario-nav button:hover,
.scenario-nav button.active {
  border-color: rgba(84, 214, 197, 0.38);
  background: rgba(84, 214, 197, 0.1);
}

.scenario-nav button:active,
.button:active,
.answer-button:active {
  transform: translateY(1px);
}

.scenario-nav {
  display: grid;
  gap: 6px;
}

.scenario-nav button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
}

.question-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(103, 174, 252, 0.35);
  border-radius: 10px;
  color: var(--info);
  background: rgba(103, 174, 252, 0.08);
  font-weight: 800;
}

.nav-copy {
  overflow: hidden;
}

.nav-copy strong,
.nav-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-copy strong {
  font-size: 13px;
}

.nav-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.nav-score {
  min-width: 34px;
  color: var(--accent);
  font-family: Consolas, monospace;
  font-size: 12px;
  text-align: right;
}

.sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition:
    filter 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.button:hover {
  filter: brightness(1.08);
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.55;
}

.button-primary {
  color: #03221e;
  background: var(--primary);
}

.button-accent {
  color: #2b1a00;
  background: var(--accent);
}

.button-danger {
  color: white;
  background: var(--danger);
}

.button-ghost {
  border-color: rgba(103, 174, 252, 0.45);
  background: rgba(103, 174, 252, 0.09);
}

.button-quiet {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}

.main-content {
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
  border-radius: 18px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
  margin-bottom: 24px;
}

.hero-card,
.panel,
.scene-card,
.question-card,
.result-card,
.schedule-item {
  border: 1px solid var(--line);
  background: rgba(13, 31, 47, 0.75);
}

.hero-card {
  padding: clamp(22px, 4vw, 38px);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(24, 73, 88, 0.62), rgba(13, 31, 47, 0.78)),
    var(--panel-2);
}

.hero-card p {
  max-width: 760px;
  color: #d5e2eb;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.mantra {
  padding: 22px;
  border: 1px solid rgba(255, 191, 75, 0.3);
  border-radius: 20px;
  background: rgba(255, 191, 75, 0.07);
}

.mantra ol {
  display: grid;
  gap: 9px;
  padding-left: 22px;
  margin: 14px 0 0;
  color: #ffe2a8;
  line-height: 1.6;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 12px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.schedule {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  cursor: pointer;
}

.schedule-item:hover {
  border-color: rgba(84, 214, 197, 0.45);
}

.schedule-time {
  color: var(--accent);
  font-family: Consolas, monospace;
  font-weight: 800;
}

.schedule-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.tag,
.priority,
.mode-badge,
.critical-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tag {
  color: var(--primary);
  background: rgba(84, 214, 197, 0.1);
}

.priority {
  color: var(--accent);
  background: rgba(255, 191, 75, 0.1);
}

.scenario-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.scenario-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.scenario-header p {
  max-width: 850px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.scenario-clock {
  min-width: 124px;
  align-self: start;
  padding: 12px;
  border: 1px solid rgba(84, 214, 197, 0.25);
  border-radius: 14px;
  text-align: center;
  background: rgba(84, 214, 197, 0.07);
}

.scenario-clock span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.scenario-clock strong {
  display: block;
  margin-top: 4px;
  color: var(--primary);
  font-family: Consolas, monospace;
  font-size: 22px;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.scene-card {
  padding: 14px;
  border-radius: 12px;
}

.scene-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.scene-card strong {
  line-height: 1.5;
}

.panel {
  padding: 18px;
  border-radius: 14px;
}

.panel + .panel {
  margin-top: 12px;
}

.veto-panel {
  border-color: rgba(255, 101, 122, 0.32);
  background: rgba(255, 101, 122, 0.07);
}

.veto-list,
.check-list,
.oral-list {
  display: grid;
  gap: 8px;
  padding-left: 21px;
  margin: 10px 0 0;
  line-height: 1.6;
}

.veto-list {
  color: #ffc2cb;
}

.training-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.progress-track {
  flex: 1 1 260px;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-strong), var(--accent));
  transition: width 0.2s ease;
}

.training-status {
  color: var(--muted);
  font-size: 13px;
}

.question-card {
  padding: clamp(18px, 3vw, 28px);
  border-radius: 18px;
}

.question-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.mode-badge {
  color: var(--info);
  background: rgba(103, 174, 252, 0.1);
}

.critical-badge {
  color: #ffc2cb;
  background: rgba(255, 101, 122, 0.12);
}

.question-card h3 {
  margin-bottom: 18px;
  font-size: clamp(19px, 2.2vw, 25px);
  line-height: 1.55;
}

.answer-grid {
  display: grid;
  gap: 10px;
}

.answer-button,
.multi-option {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  line-height: 1.55;
  text-align: left;
}

.answer-button:hover,
.multi-option:hover,
.multi-option.selected {
  border-color: rgba(84, 214, 197, 0.5);
  background: rgba(84, 214, 197, 0.09);
}

.multi-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.multi-option input {
  margin-top: 5px;
  accent-color: var(--primary);
}

.answer-button.correct,
.multi-option.correct {
  border-color: rgba(113, 230, 155, 0.7);
  background: rgba(113, 230, 155, 0.12);
}

.answer-button.wrong,
.multi-option.wrong {
  border-color: rgba(255, 101, 122, 0.68);
  background: rgba(255, 101, 122, 0.12);
}

.text-answer {
  width: 100%;
  min-height: 130px;
  padding: 14px;
  resize: vertical;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(2, 10, 17, 0.55);
  line-height: 1.7;
}

.text-answer:focus {
  border-color: rgba(84, 214, 197, 0.6);
  box-shadow: 0 0 0 3px rgba(84, 214, 197, 0.08);
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.feedback {
  display: none;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  line-height: 1.7;
}

.feedback.show {
  display: block;
}

.feedback.success {
  border-color: rgba(113, 230, 155, 0.45);
  background: rgba(113, 230, 155, 0.08);
}

.feedback.warning {
  border-color: rgba(255, 191, 75, 0.45);
  background: rgba(255, 191, 75, 0.08);
}

.feedback.danger {
  border-color: rgba(255, 101, 122, 0.48);
  background: rgba(255, 101, 122, 0.09);
}

.feedback strong {
  display: block;
  margin-bottom: 6px;
}

.keyword-result {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.keyword-result span {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.keyword-hit {
  color: #bff6d0;
  background: rgba(113, 230, 155, 0.12);
}

.keyword-miss {
  color: #ffd1d8;
  background: rgba(255, 101, 122, 0.12);
}

.result-card {
  padding: clamp(24px, 4vw, 42px);
  border-radius: 20px;
  text-align: center;
}

.result-score {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin: 20px auto;
  border: 10px solid rgba(84, 214, 197, 0.16);
  border-radius: 50%;
  color: var(--primary);
  background: rgba(84, 214, 197, 0.07);
  font-family: Consolas, monospace;
  font-size: 38px;
  font-weight: 800;
}

.result-card.pass .result-score {
  border-color: rgba(113, 230, 155, 0.27);
  color: var(--success);
}

.result-card.fail .result-score {
  border-color: rgba(255, 101, 122, 0.25);
  color: var(--danger);
}

.result-card p {
  color: var(--muted);
  line-height: 1.7;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.oral-panel summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 800;
}

.source-note {
  margin-top: 14px;
  color: #7f9aae;
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 1px solid rgba(84, 214, 197, 0.35);
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  background: #102b3c;
  box-shadow: var(--shadow);
  transform: translateY(14px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.print-sheet {
  display: none;
}

@media (max-width: 1050px) {
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .scene-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .timer-card {
    min-width: 0;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: hidden;
    margin-bottom: 10px;
  }

  .scenario-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 7px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .scenario-nav button {
    flex: 0 0 min(260px, 78vw);
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 62px;
    scroll-snap-align: start;
  }

  .nav-score {
    display: none;
  }

  .schedule {
    grid-template-columns: 1fr;
  }

  .scenario-header {
    flex-direction: column;
  }

  .scenario-clock {
    width: 100%;
  }

  .main-content {
    padding: 16px;
  }

  .button,
  .answer-button,
  .multi-option {
    min-height: 44px;
  }

  .text-answer,
  textarea,
  input,
  select {
    font-size: 16px;
  }

  .question-actions .button,
  .result-actions .button {
    flex: 1 1 160px;
  }
}

@media (max-width: 470px) {
  .schedule-item {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .schedule-item .tag {
    display: none;
  }
}

@media print {
  :root {
    color-scheme: light;
  }

  body {
    color: #111;
    background: white;
  }

  .app-shell,
  .toast {
    display: none !important;
  }

  .print-sheet {
    display: block;
    padding: 0;
    color: #111;
  }

  .print-sheet h1 {
    margin-bottom: 12px;
    font-size: 24px;
  }

  .print-sheet article {
    break-inside: avoid;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #999;
  }

  .print-sheet h2 {
    margin-bottom: 6px;
    font-size: 17px;
  }

  .print-sheet ol,
  .print-sheet ul {
    margin: 5px 0;
    padding-left: 22px;
  }

  .print-sheet li {
    margin-bottom: 3px;
    line-height: 1.45;
  }
}
