:root {
  color-scheme: light;
  --ink: #18231f;
  --muted: #64706b;
  --paper: #f7f5ef;
  --panel: #fffdf8;
  --line: #d9d5c8;
  --green: #203b37;
  --mint: #d4eadf;
  --red: #b94d3c;
  --yellow: #e5b84d;
  --blue: #3d6f96;
  --shadow: 0 14px 40px rgba(37, 45, 41, 0.12);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(32, 59, 55, 0.06) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--paper);
  color: var(--ink);
}

.home-body {
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
}

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

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(61, 111, 150, 0.35);
  outline-offset: 2px;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 4vw, 32px) 48px;
}

.site-footer {
  width: min(1120px, 100%);
  margin: -28px auto 0;
  padding: 0 clamp(14px, 4vw, 32px) 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--green);
  text-decoration: underline;
}

.home-shell {
  display: grid;
  min-height: calc(100vh - 64px);
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 6vw, 72px) clamp(16px, 5vw, 40px);
  align-items: center;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr);
  gap: clamp(20px, 5vw, 56px);
  align-items: center;
}

.home-mark {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green);
  box-shadow: var(--shadow);
  color: var(--yellow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(88px, 16vw, 168px);
  line-height: 1;
}

.home-copy {
  display: grid;
  gap: 18px;
  justify-items: start;
}

.home-copy h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(44px, 9vw, 92px);
}

.home-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 3vw, 20px);
  line-height: 1.7;
}

.home-kicker {
  color: var(--green) !important;
  font-size: 13px !important;
  font-weight: 900;
  letter-spacing: 0;
}

.home-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: white;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
  background: #162b28;
  outline: 3px solid rgba(61, 111, 150, 0.35);
  outline-offset: 2px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px);
  gap: 18px;
  align-items: end;
  padding: 20px 0 10px;
}

.eyebrow,
.panel-label {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

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

h1 {
  max-width: 620px;
  margin-bottom: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 0.96;
  letter-spacing: 0;
}

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

h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.login {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.login label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.95);
  color: var(--ink);
  padding: 12px;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.primary {
  border-color: var(--green);
  background: var(--green);
  color: white;
  font-weight: 700;
}

.danger {
  border-color: rgba(185, 77, 60, 0.45);
  color: var(--red);
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
}

.tabs button {
  flex: 0 0 auto;
}

.tabs button.active,
.review-switch button.active {
  border-color: var(--green);
  background: var(--mint);
  color: var(--green);
  font-weight: 800;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.action-card {
  display: grid;
  min-height: 190px;
  align-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: left;
}

.action-card:nth-child(2) {
  border-top-color: var(--blue);
}

.action-card:nth-child(3) {
  border-top-color: var(--yellow);
}

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

.action-card strong {
  font-size: 24px;
}

.action-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.page-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 14px;
}

.page-nav button {
  flex: 0 0 auto;
}

.two-board {
  display: grid;
  gap: 18px;
}

.board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  padding: 16px;
}

.board-entry {
  border-top: 5px solid var(--green);
}

.board-review {
  border-top: 5px solid var(--blue);
}

.board-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.board-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.board-head strong {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--green);
}

.board-index {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.section-heading,
.mistake-head,
.weakness-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.section-heading {
  margin: 18px 0 14px;
}

.section-heading span,
.mistake-head span {
  color: var(--muted);
  font-size: 13px;
}

.weakness-list,
.mistake-list,
.practice-list,
.bank-list {
  display: grid;
  gap: 10px;
}

.weakness-card,
.mistake-card,
.practice-card,
.bank-card,
.empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.weakness-card p,
.mistake-card p,
.practice-card p,
.bank-card p,
.empty p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.weakness-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  white-space: nowrap;
}

.priority {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.priority.高 {
  background: var(--red);
}

.priority.中 {
  background: var(--yellow);
  color: #3a2b00;
}

.priority.低 {
  background: var(--blue);
}

.mistake-card details {
  margin-top: 10px;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.answer-box {
  margin: 12px 0;
  padding: 12px;
  border-left: 4px solid var(--blue);
  background: #eef4f6;
  border-radius: 6px;
}

.practice-card span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.practice-card ol {
  margin: 8px 0;
  padding-left: 22px;
  color: var(--muted);
}

.option-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.option-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  text-align: left;
}

.option-button strong {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
}

.option-button.selected {
  border-color: var(--green);
  background: var(--mint);
}

.practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.secondary-actions button {
  min-height: 38px;
}

.hidden-answer {
  display: none;
  margin-top: 10px;
}

.hidden-answer.visible {
  display: block;
}

.entry-form {
  display: grid;
  gap: 12px;
}

.edit-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 12px;
}

.practice-setup {
  display: grid;
  gap: 12px;
}

.practice-setup label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.practice-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-choice {
  display: grid;
  gap: 10px;
  border: 0;
  margin: 0;
  padding: 0;
}

.mode-choice legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}

.mode-choice label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.mode-choice label.active {
  border-color: var(--green);
  background: var(--mint);
}

.mode-choice input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--green);
}

.mode-choice span {
  display: grid;
  gap: 4px;
}

.mode-choice small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.45;
}

.entry-form label,
.edit-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.entry-form .model-consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f6;
  padding: 12px;
  color: var(--ink);
}

.notice {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.5;
  font-weight: 700;
}

.notice.success {
  border-color: rgba(32, 59, 55, 0.35);
  background: var(--mint);
  color: var(--green);
}

.notice.warning {
  border-color: rgba(229, 184, 77, 0.65);
  background: #fff6da;
  color: #6a4c00;
}

.notice.info {
  border-color: rgba(61, 111, 150, 0.35);
  background: #eef4f6;
  color: var(--blue);
}

.model-consent input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.model-consent span {
  display: grid;
  gap: 4px;
}

.model-consent small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.45;
}

.classification {
  margin-top: 18px;
}

.bank-panel {
  margin-top: 18px;
}

.bank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.bank-card {
  display: grid;
  gap: 8px;
}

.bank-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.bank-card span,
.bank-card small {
  color: var(--muted);
  font-size: 13px;
}

.session-preview {
  margin-top: 18px;
}

.result-line {
  margin-top: 10px;
  font-weight: 800;
}

.result-line.correct {
  color: var(--green);
}

.result-line.wrong {
  color: var(--red);
}

.source-mistake {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #f6faf7;
  padding: 12px;
}

.source-mistake p {
  margin: 8px 0;
}

.source-mistake small {
  color: var(--muted);
  line-height: 1.5;
}

.review-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

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

  .topbar,
  .two-board,
  .home-grid,
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-shell {
    align-items: start;
  }

  .home-mark {
    width: min(160px, 48vw);
  }

  .board-head {
    flex-direction: column;
  }

  .section-heading,
  .mistake-head,
  .weakness-card {
    align-items: stretch;
  }

  .weakness-card {
    flex-direction: column;
  }

  .weakness-meta {
    grid-template-columns: repeat(3, max-content);
    justify-content: start;
    justify-items: start;
  }

  .review-switch {
    grid-template-columns: 1fr;
  }

  .bank-actions {
    display: grid;
  }

  .practice-setup-actions {
    display: grid;
  }

  .bank-card div {
    display: grid;
  }
}
