:root {
  --ink: #17202a;
  --muted: #637083;
  --line: #d9e0e8;
  --paper: #fbfcfd;
  --panel: #ffffff;
  --green: #1f8a5b;
  --blue: #2864b8;
  --red: #c03d3d;
  --amber: #b36b00;
  --violet: #6750a4;
  --shadow: 0 18px 45px rgba(26, 38, 56, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(40, 100, 184, 0.08), transparent 28%),
    linear-gradient(315deg, rgba(31, 138, 91, 0.1), transparent 32%),
    #eef3f6;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.date-panel,
.status-tile,
.training-panel,
.wrong-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(217, 224, 232, 0.9);
  box-shadow: var(--shadow);
}

.date-panel {
  display: grid;
  gap: 8px;
  min-width: 190px;
  padding: 14px;
  border-radius: 8px;
}

.date-panel label {
  color: var(--muted);
  font-size: 13px;
}

.date-panel input,
.answer-input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.status-tile {
  min-height: 82px;
  padding: 16px;
  border-radius: 8px;
}

.status-tile span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-tile strong {
  font-size: 24px;
  line-height: 1.12;
}

.workspace {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.session-rail {
  display: grid;
  gap: 10px;
}

.session-tab {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 15px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(26, 38, 56, 0.06);
}

.session-tab.active {
  color: #fff;
  background: #214d7d;
  border-color: #214d7d;
}

.session-tab span,
.session-tab small {
  color: currentColor;
  opacity: 0.76;
}

.session-tab strong {
  font-size: 18px;
}

.training-panel,
.wrong-panel {
  border-radius: 8px;
}

.training-panel {
  min-height: 620px;
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.timer-box {
  display: grid;
  justify-items: center;
  min-width: 132px;
  padding: 12px 14px;
  color: #fff;
  background: #1f8a5b;
  border-radius: 8px;
}

.timer-box span {
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer-box small {
  margin-top: 6px;
  opacity: 0.82;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 42px;
  border-radius: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-btn {
  color: #fff;
  background: var(--blue);
}

.secondary-btn {
  color: #fff;
  background: var(--green);
}

.ghost-btn {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.question-list {
  display: grid;
  gap: 10px;
}

.question-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(140px, 180px);
  gap: 12px;
  align-items: center;
  padding: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.question-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  font-weight: 800;
  background: #26384d;
  border-radius: 50%;
}

.question-body {
  min-width: 0;
}

.question-type {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 3px 7px;
  color: #385168;
  font-size: 12px;
  background: #e8eef4;
  border-radius: 6px;
}

.question-prompt {
  font-size: 19px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.answer-input {
  width: 100%;
  text-align: center;
}

.question-card.correct {
  border-color: rgba(31, 138, 91, 0.45);
  background: #edf8f2;
}

.question-card.wrong {
  border-color: rgba(192, 61, 61, 0.45);
  background: #fff0f0;
}

.feedback {
  grid-column: 2 / 4;
  color: var(--muted);
  font-size: 14px;
}

.feedback strong {
  color: var(--ink);
}

.empty-state {
  padding: 32px 20px;
  color: var(--muted);
  text-align: center;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.wrong-panel {
  padding: 15px;
}

.wrong-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.icon-btn {
  width: 34px;
  height: 34px;
  color: var(--red);
  font-size: 24px;
  line-height: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.wrong-list {
  display: grid;
  gap: 10px;
  max-height: 560px;
  padding-top: 12px;
  overflow: auto;
}

.wrong-item {
  padding: 10px;
  background: #fff8ec;
  border: 1px solid #f1d49f;
  border-radius: 8px;
}

.wrong-item p {
  margin-bottom: 7px;
  font-size: 14px;
  line-height: 1.45;
}

.wrong-item small {
  color: var(--muted);
}

@media (max-width: 1060px) {
  .workspace {
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .wrong-panel {
    grid-column: 1 / -1;
  }

  .wrong-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 14px;
  }

  .topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .status-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .session-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .session-tab {
    padding: 11px;
  }

  .session-tab strong {
    font-size: 15px;
  }

  .question-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .answer-input {
    grid-column: 1 / -1;
    text-align: left;
  }

  .feedback {
    grid-column: 1 / -1;
  }

  .wrong-list {
    grid-template-columns: 1fr;
  }
}
