:root {
  color-scheme: light;
  --ink: #142e35;
  --ink-2: #34535a;
  --paper: #f4efe4;
  --paper-2: #fffaf0;
  --teal: #176f72;
  --teal-dark: #102f35;
  --coral: #ef6a52;
  --coral-dark: #bd4938;
  --mustard: #eab34c;
  --green: #3f8a67;
  --red: #c94e45;
  --line: rgba(20, 46, 53, 0.16);
  --shadow: 0 12px 34px rgba(16, 47, 53, 0.13);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--teal-dark);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(239, 106, 82, 0.36);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 900px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.18);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: calc(70px + var(--safe-top));
  padding: var(--safe-top) 12px 0;
  color: #fffaf0;
  background: var(--teal-dark);
  border-bottom: 3px solid var(--coral);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px;
  color: inherit;
  border: 0;
  background: transparent;
}

.brand img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 250, 240, 0.72);
  border-radius: 10px;
  object-fit: cover;
}

.brand span {
  min-width: 0;
  text-align: left;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 19px;
  letter-spacing: 0.08em;
}

.brand small {
  overflow: hidden;
  margin-top: 2px;
  color: rgba(255, 250, 240, 0.66);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: inherit;
  border: 1px solid rgba(255, 250, 240, 0.3);
  border-radius: 50%;
  background: transparent;
  font-size: 20px;
  font-weight: 900;
}

.icon-button:active {
  transform: translateY(1px);
}

.back-button {
  font-size: 24px;
}

.is-hidden {
  visibility: hidden !important;
  pointer-events: none !important;
}

.main-content {
  min-height: calc(100vh - 150px);
  padding-bottom: calc(92px + var(--safe-bottom));
}

.page {
  animation: page-in 240ms ease-out both;
}

.resume-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 0 0 24px;
  padding: 18px 20px;
  color: var(--paper-2);
  background: var(--coral-dark);
  border-radius: 2px 18px 18px 2px;
  box-shadow: 8px 10px 0 color-mix(in oklch, var(--mustard) 48%, transparent);
}

.resume-mark {
  display: flex;
  width: 62px;
  height: 62px;
  align-items: baseline;
  justify-content: center;
  padding-top: 13px;
  color: var(--teal-dark);
  background: var(--mustard);
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}

.resume-mark span {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 27px;
  font-weight: 900;
}

.resume-mark small {
  font-size: 11px;
}

.resume-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.resume-copy small,
.resume-copy span {
  color: color-mix(in oklch, var(--paper-2) 78%, var(--coral-dark));
  font-size: 12px;
}

.resume-copy strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resume-button {
  min-height: 46px;
  padding: 0 16px;
  color: var(--teal-dark);
  border: 0;
  border-radius: 999px;
  background: var(--paper-2);
  font-weight: 900;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 34px 22px 26px;
  color: #fffaf0;
  background: var(--teal-dark);
}

.hero::after {
  position: absolute;
  right: -34px;
  bottom: -50px;
  width: 170px;
  height: 170px;
  border: 28px solid rgba(234, 179, 76, 0.14);
  border-radius: 50%;
  content: "";
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--mustard);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.hero h1,
.section-title h2,
.question-card h1,
.result-hero h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  line-height: 1.24;
}

.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 600px;
  font-size: clamp(32px, 8vw, 48px);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 13px 0 0;
  color: rgba(255, 250, 240, 0.76);
  font-size: 14px;
  line-height: 1.8;
}

.stat-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.stat-cell {
  padding: 12px 8px;
  border-top: 1px solid rgba(255, 250, 240, 0.26);
}

.stat-cell strong,
.stat-cell span {
  display: block;
}

.stat-cell strong {
  font-size: 22px;
}

.stat-cell span {
  margin-top: 3px;
  color: rgba(255, 250, 240, 0.58);
  font-size: 11px;
}

.content-pad {
  padding: 20px 16px 10px;
}

.study-starter,
.paper-panel,
.wrong-row,
.category-row,
.knowledge-card,
.progress-panel {
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
}

.study-starter {
  margin-top: -2px;
  padding: 20px 16px 16px;
  border-top: 5px solid var(--coral);
}

.section-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-kicker h2,
.section-kicker h3 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 24px;
}

.section-kicker small {
  color: var(--ink-2);
}

.mode-segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
}

.mode-segment button {
  min-height: 46px;
  padding: 8px 4px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.mode-segment button:last-child {
  border-right: 0;
}

.mode-segment button.is-active {
  color: #fff;
  background: var(--teal);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
}

.field select,
.field input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fffdf7;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  min-height: 48px;
  border: 0;
  font-weight: 900;
}

.primary-button {
  color: #fff;
  background: var(--coral);
  box-shadow: 0 6px 0 var(--coral-dark);
}

.primary-button:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--coral-dark);
}

.secondary-button {
  color: #fff;
  background: var(--teal);
}

.danger-button {
  color: #fff;
  background: var(--red);
}

.text-button {
  min-height: 40px;
  padding: 0 10px;
  color: var(--teal);
  background: transparent;
}

.start-button {
  width: 100%;
  margin-top: 16px;
}

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

.quick-action {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 16px 14px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.quick-action::after {
  position: absolute;
  right: -18px;
  bottom: -28px;
  color: rgba(20, 46, 53, 0.08);
  font-size: 82px;
  font-weight: 900;
  content: attr(data-ghost);
}

.quick-action b,
.quick-action small {
  position: relative;
  z-index: 1;
  display: block;
}

.quick-action b {
  margin-top: 18px;
  font-size: 16px;
}

.quick-action small {
  margin-top: 6px;
  color: var(--ink-2);
  line-height: 1.5;
}

.quick-icon {
  position: relative;
  z-index: 1;
  color: var(--coral);
  font-size: 25px;
  font-weight: 900;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
}

.section-title h2 {
  font-size: 25px;
}

.section-title span {
  color: var(--ink-2);
  font-size: 11px;
}

.category-list,
.wrong-list,
.knowledge-list {
  display: grid;
  gap: 10px;
}

.category-row,
.wrong-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  box-shadow: none;
}

.category-row button,
.wrong-row button {
  min-height: 42px;
}

.row-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-title strong {
  font-size: 15px;
}

.row-title .count-mark {
  color: var(--coral);
  font-size: 12px;
  font-weight: 900;
}

.micro-progress {
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  background: rgba(20, 46, 53, 0.1);
}

.micro-progress i {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: var(--teal);
}

.row-meta {
  display: flex;
  gap: 10px;
  margin-top: 7px;
  color: var(--ink-2);
  font-size: 11px;
}

.small-arrow {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 18px;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  width: min(100%, 900px);
  min-height: calc(70px + var(--safe-bottom));
  margin: 0 auto;
  padding-bottom: var(--safe-bottom);
  grid-template-columns: repeat(4, 1fr);
  color: rgba(255, 250, 240, 0.65);
  background: var(--teal-dark);
  border-top: 2px solid var(--coral);
}

.nav-item {
  display: grid;
  min-height: 68px;
  place-content: center;
  gap: 2px;
  border: 0;
  color: inherit;
  background: transparent;
}

.nav-item span {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
}

.nav-item b {
  font-size: 10px;
}

.nav-item.is-active {
  color: var(--mustard);
}

.page-header {
  padding: 26px 18px 20px;
  color: #fffaf0;
  background: var(--teal-dark);
}

.page-header h1 {
  margin: 5px 0 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 34px;
}

.page-header p {
  margin: 8px 0 0;
  color: rgba(255, 250, 240, 0.7);
  font-size: 13px;
  line-height: 1.7;
}

.empty-state {
  padding: 42px 22px;
  text-align: center;
  border: 1px dashed var(--line);
  background: rgba(255, 250, 240, 0.72);
}

.empty-state .empty-icon {
  display: block;
  color: var(--coral);
  font-size: 48px;
}

.empty-state h2 {
  margin: 14px 0 8px;
  font-family: "STKaiti", "KaiTi", serif;
}

.empty-state p {
  margin: 0 auto 18px;
  max-width: 430px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.7;
}

.wrong-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.wrong-summary div {
  padding: 12px 8px;
  text-align: center;
  background: var(--teal);
}

.wrong-summary strong,
.wrong-summary span {
  display: block;
}

.wrong-summary strong {
  font-size: 23px;
}

.wrong-summary span {
  margin-top: 3px;
  font-size: 10px;
  opacity: 0.74;
}

.wrong-row .stem-preview {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 7px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wrong-badge {
  display: inline-block;
  padding: 3px 7px;
  color: var(--red);
  border: 1px solid rgba(201, 78, 69, 0.32);
  font-size: 10px;
  font-weight: 900;
}

.knowledge-card {
  padding: 16px;
  box-shadow: none;
  border-left: 5px solid var(--teal);
}

.knowledge-card h3 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 21px;
}

.knowledge-card p {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.7;
}

.knowledge-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.knowledge-card li {
  margin: 5px 0;
  font-size: 12px;
  line-height: 1.6;
}

.knowledge-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.knowledge-card footer span {
  color: var(--ink-2);
  font-size: 11px;
}

.progress-panel {
  margin-bottom: 12px;
  padding: 17px;
  box-shadow: none;
}

.progress-panel h3 {
  margin: 0 0 8px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 21px;
}

.progress-panel p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.7;
}

.button-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.quiz-page {
  min-height: calc(100vh - 70px);
  padding-bottom: calc(88px + var(--safe-bottom));
  background: #e9e3d7;
  touch-action: pan-y;
  overscroll-behavior-x: contain;
  transform: translateX(var(--swipe-offset, 0));
  transition: transform 140ms cubic-bezier(0.25, 1, 0.5, 1);
}

.quiz-page.is-swiping {
  transition: none;
}

.quiz-hud {
  position: sticky;
  z-index: 20;
  top: calc(70px + var(--safe-top));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 8px 12px;
  color: #fff;
  background: var(--teal);
}

.hud-copy {
  min-width: 0;
}

.hud-copy div {
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-progress {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.25);
}

.quiz-progress i {
  display: block;
  width: var(--quiz-progress, 0%);
  height: 100%;
  background: var(--mustard);
  transition: width 220ms ease;
}

.timer {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 900;
}

.timer.is-urgent {
  color: #fff;
  border-color: #fff;
  background: var(--red);
  animation: pulse 600ms ease-in-out infinite alternate;
}

@keyframes pulse {
  to {
    transform: scale(1.06);
  }
}

.quiz-wrap {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 10px 12px;
}

.question-navigator {
  position: fixed;
  z-index: 40;
  right: 14px;
  bottom: calc(16px + var(--safe-bottom));
  display: grid;
  min-width: 92px;
  min-height: 52px;
  gap: 1px;
  padding: 8px 11px;
  color: #fff;
  border: 0;
  border-radius: 16px;
  background: var(--teal);
  box-shadow: 0 8px 20px rgba(20, 46, 53, 0.24);
  text-align: left;
}

.question-navigator:active {
  transform: translateY(2px);
}

.question-navigator span {
  font-size: 11px;
  font-weight: 800;
}

.question-navigator b {
  font-size: 17px;
}

.question-navigator small {
  color: rgba(255, 250, 240, 0.76);
  font-size: 10px;
}

.question-card {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--mustard);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-bottom: 8px;
}

.label {
  display: inline-block;
  padding: 3px 6px;
  color: var(--teal);
  border: 1px solid rgba(23, 111, 114, 0.28);
  font-size: 9px;
  font-weight: 900;
}

.label.is-critical {
  color: var(--red);
  border-color: rgba(201, 78, 69, 0.32);
}

.question-number {
  margin-left: auto;
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 800;
}

.question-card h1 {
  font-family: inherit;
  font-size: clamp(16px, 4.15vw, 18px);
  line-height: 1.52;
}

.hint-box {
  display: none;
  margin-top: 9px;
  padding: 9px 10px;
  color: #70482b;
  border-left: 4px solid var(--mustard);
  background: #fff2c9;
  font-size: 11px;
  line-height: 1.55;
}

.hint-box.is-visible {
  display: block;
  animation: page-in 180ms ease-out both;
}

.question-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.question-tools small {
  color: var(--ink-2);
  font-size: 9px;
}

.options {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.option-button {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  text-align: left;
  border: 2px solid rgba(20, 46, 53, 0.15);
  background: #fffdf8;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.option-button:not(:disabled):active {
  transform: scale(0.988);
}

.option-key {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-weight: 900;
}

.option-text {
  font-size: 13px;
  line-height: 1.48;
}

.option-button.is-selected {
  border-color: var(--teal);
  background: #e4f2ef;
}

.option-button.is-selected .option-key {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.option-button.is-correct {
  border-color: var(--green);
  background: #e5f2e8;
}

.option-button.is-correct .option-key {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.option-button.is-wrong {
  border-color: var(--red);
  background: #f7e4df;
}

.option-button.is-wrong .option-key {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.answer-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 15px;
}

.answer-actions.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.analysis-area {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.answer-banner {
  padding: 14px;
  color: #fff;
  background: var(--green);
  border-left: 6px solid #245f45;
}

.answer-banner.is-wrong {
  background: var(--red);
  border-left-color: #8e322c;
}

.answer-banner strong {
  display: block;
  font-size: 17px;
}

.answer-banner span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.65;
  opacity: 0.9;
}

.analysis-card {
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.analysis-card summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
}

.analysis-card summary::-webkit-details-marker {
  display: none;
}

.analysis-card summary::after {
  margin-left: auto;
  color: var(--teal);
  content: "＋";
}

.analysis-card[open] summary::after {
  content: "−";
}

.analysis-icon {
  color: var(--coral);
  font-size: 19px;
}

.analysis-body {
  padding: 0 14px 15px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.8;
}

.analysis-body p {
  margin: 0 0 10px;
}

.analysis-body p:last-child {
  margin-bottom: 0;
}

.analysis-body ul {
  margin: 0;
  padding-left: 19px;
}

.analysis-body li {
  margin: 5px 0;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.keyword-list span {
  padding: 5px 8px;
  color: var(--teal);
  border: 1px solid rgba(23, 111, 114, 0.26);
  background: #eef7f3;
  font-size: 11px;
  font-weight: 800;
}

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

.related-item {
  padding: 10px;
  border-left: 3px solid var(--mustard);
  background: #f4eddf;
}

.related-item b {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.related-item span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.6;
}

.form-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 11px;
  color: var(--ink-2);
  border-left: 3px solid var(--teal);
  background: #eef7f3;
  font-size: 11px;
  line-height: 1.55;
}

.knowledge-expansion {
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  background: var(--paper-2);
}

.knowledge-expansion-kicker {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.knowledge-expansion h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 19px;
  line-height: 1.45;
}

.knowledge-expansion ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.65;
}

.knowledge-expansion li + li {
  margin-top: 5px;
}

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

.completion-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.completion-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 11px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.completion-record:active {
  transform: scale(0.992);
}

.completion-record span,
.completion-record small,
.completion-record strong,
.completion-record em {
  display: block;
}

.completion-record b {
  font-size: 13px;
}

.completion-record small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completion-record strong {
  color: var(--teal);
  font-size: 15px;
}

.completion-record em {
  color: var(--ink-2);
  font-size: 10px;
  font-style: normal;
}

.completion-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--ink-2);
  font-size: 11px;
}

.completion-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.completion-legend i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.completion-legend .is-correct,
.completion-dot.is-correct {
  background: var(--green);
}

.completion-legend .is-wrong,
.completion-dot.is-wrong {
  background: var(--red);
}

.completion-legend .is-skipped,
.completion-dot.is-skipped,
.completion-dot.is-unanswered {
  background: #9ca5a2;
}

.completion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 8px;
}

.completion-dot {
  aspect-ratio: 1;
  min-height: 34px;
  padding: 0;
  color: #fff;
  border: 0;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}

.completion-dot:active {
  transform: scale(0.93);
}

.completion-note,
.empty-copy {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.55;
}

.question-nav-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--ink-2);
  font-size: 11px;
}

.question-nav-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.question-nav-summary i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.question-nav-summary .is-correct {
  background: var(--green);
}

.question-nav-summary .is-wrong {
  background: var(--red);
}

.question-nav-summary .is-skipped {
  background: #9ca5a2;
}

.question-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 10px;
}

.question-nav-dot {
  aspect-ratio: 1;
  min-height: 44px;
  padding: 0;
  color: var(--ink);
  border: 1px solid rgba(20, 46, 53, 0.2);
  border-radius: 50%;
  background: #fffdf8;
  font-size: 12px;
  font-weight: 900;
}

.question-nav-dot.is-correct {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.question-nav-dot.is-wrong {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.question-nav-dot.is-skipped {
  color: #fff;
  border-color: #9ca5a2;
  background: #9ca5a2;
}

.question-nav-dot.is-current {
  outline: 3px solid var(--mustard);
  outline-offset: 2px;
}

.question-nav-note {
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.55;
}

.result-hero {
  padding: 34px 22px;
  color: #fffaf0;
  background: var(--teal-dark);
  text-align: center;
}

.result-score {
  display: grid;
  width: 140px;
  height: 140px;
  margin: 0 auto 18px;
  place-content: center;
  border: 8px solid var(--mustard);
  border-radius: 50%;
}

.result-score strong {
  font-size: 42px;
  line-height: 1;
}

.result-score span {
  margin-top: 5px;
  color: rgba(255, 250, 240, 0.7);
  font-size: 11px;
}

.result-hero h1 {
  font-size: 32px;
}

.result-hero p {
  margin: 8px 0 0;
  color: rgba(255, 250, 240, 0.7);
  font-size: 13px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 16px 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.result-grid div {
  padding: 14px 8px;
  text-align: center;
  background: var(--paper-2);
}

.result-grid strong,
.result-grid span {
  display: block;
}

.result-grid strong {
  font-size: 21px;
}

.result-grid span {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 10px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 18px 12px calc(18px + var(--safe-bottom));
  background: rgba(8, 28, 32, 0.72);
  animation: fade-in 160ms ease-out both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal-sheet {
  width: min(100%, 620px);
  max-height: min(84vh, 720px);
  overflow: auto;
  padding: 20px 16px;
  background: var(--paper-2);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.modal-head h2 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 26px;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.5;
}

.modal-close {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
}

.modal-content {
  margin-top: 16px;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px;
  gap: 12px;
  align-items: center;
}

.range-row input[type="range"] {
  min-height: 42px;
  padding: 0;
  accent-color: var(--coral);
}

.range-value {
  display: grid;
  min-height: 44px;
  place-items: center;
  color: #fff;
  background: var(--teal);
  font-weight: 900;
}

.notice {
  margin: 12px 0;
  padding: 12px;
  color: #70482b;
  border-left: 4px solid var(--mustard);
  background: #fff2c9;
  font-size: 11px;
  line-height: 1.7;
}

.regulation-card {
  margin-top: 16px;
  padding: clamp(20px, 4vw, 30px);
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid color-mix(in oklch, var(--teal) 28%, var(--paper-2));
  border-radius: 22px 6px 22px 6px;
  box-shadow: var(--shadow);
}

.regulation-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.regulation-card h2 {
  margin: 4px 0 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(23px, 5vw, 32px);
}

.source-page {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--paper-2);
  background: var(--teal-dark);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.regulation-card blockquote {
  position: relative;
  margin: 22px 0;
  padding: 18px 20px 18px 48px;
  color: var(--teal-dark);
  background: color-mix(in oklch, var(--mustard) 15%, var(--paper-2));
  border: 0;
  line-height: 1.85;
}

.regulation-card blockquote::before {
  position: absolute;
  top: 4px;
  left: 14px;
  color: var(--coral);
  content: "“";
  font-family: Georgia, serif;
  font-size: 48px;
  line-height: 1;
}

.reasoning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.reasoning-grid p {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 16px;
  background: var(--paper-2);
  line-height: 1.65;
}

.reasoning-grid b {
  color: var(--coral-dark);
  font-size: 13px;
}

.reasoning-grid span,
.regulation-card.is-fallback p {
  color: var(--ink-2);
  font-size: 14px;
}

.regulation-card.is-fallback {
  border-style: dashed;
  box-shadow: none;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: calc(88px + var(--safe-bottom));
  left: 18px;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

@media (min-width: 720px) {
  .content-pad {
    padding-right: 28px;
    padding-left: 28px;
  }

  .home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 18px;
    align-items: start;
  }

  .quick-grid {
    margin-top: 0;
  }

  .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .knowledge-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .resume-strip {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .resume-button {
    grid-column: 1 / -1;
    width: 100%;
  }

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

  .regulation-card header {
    display: grid;
  }

  .source-page {
    justify-self: start;
  }

  .question-number {
    display: none;
  }

  .question-tools .text-button {
    min-height: 34px;
    padding: 0 7px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* v2.3.1 · refined study interface */
:root {
  --ink: oklch(24% 0.025 245);
  --ink-2: oklch(48% 0.025 245);
  --paper: oklch(98% 0.008 78);
  --paper-2: oklch(99.4% 0.005 78);
  --teal: oklch(57% 0.16 248);
  --teal-dark: oklch(30% 0.055 245);
  --coral: oklch(57% 0.16 248);
  --coral-dark: oklch(45% 0.14 248);
  --mustard: oklch(83% 0.13 86);
  --green: oklch(56% 0.115 155);
  --red: oklch(56% 0.17 28);
  --line: oklch(88% 0.018 245);
  --shadow: 0 10px 30px oklch(24% 0.025 245 / 0.08);
}

html,
body,
.app-shell {
  background: var(--paper);
}

.app-shell {
  box-shadow: none;
}

.topbar {
  min-height: calc(62px + var(--safe-top));
  padding-inline: 10px;
  color: var(--ink);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.brand {
  justify-content: flex-start;
  gap: 9px;
}

.brand img {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
}

.brand strong {
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0;
}

.brand small {
  color: var(--ink-2);
  font-size: 0.65rem;
}

.icon-button {
  color: var(--ink);
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.hero {
  padding: 32px 20px 24px;
  color: var(--ink);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.hero::after {
  display: none;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.hero h1 {
  font-family: inherit;
  font-size: clamp(1.8rem, 7vw, 2.5rem);
  letter-spacing: -0.04em;
}

.stat-strip {
  gap: 0;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.stat-cell {
  padding: 14px 8px 0 0;
  border: 0;
}

.stat-cell strong {
  color: var(--ink);
  font-size: 1.3rem;
}

.stat-cell span {
  color: var(--ink-2);
  font-size: 0.68rem;
}

.resume-strip {
  padding: 16px;
  color: var(--ink);
  background: oklch(94% 0.035 248);
  border: 1px solid oklch(84% 0.055 248);
  border-radius: 16px;
  box-shadow: none;
}

.resume-mark {
  width: 52px;
  height: 52px;
  padding-top: 10px;
  color: var(--paper-2);
  background: var(--teal);
}

.resume-copy small,
.resume-copy span {
  color: var(--ink-2);
}

.resume-button {
  color: var(--paper-2);
  background: var(--teal);
  border-radius: 12px;
}

.study-starter,
.category-row,
.wrong-row,
.progress-panel {
  border-color: var(--line);
  background: var(--paper-2);
  box-shadow: none;
}

.mode-segment {
  gap: 4px;
  padding: 4px;
  background: oklch(94.5% 0.012 245);
  border: 0;
  border-radius: 12px;
}

.mode-segment button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
}

.mode-segment button.is-active {
  color: var(--ink);
  background: var(--paper-2);
  box-shadow: 0 2px 8px oklch(24% 0.025 245 / 0.08);
}

.field select,
.field input {
  min-height: 48px;
  background: var(--paper-2);
  border-color: var(--line);
  border-radius: 12px;
}

.primary-button,
.secondary-button,
.danger-button {
  border-radius: 12px;
}

.primary-button {
  background: var(--teal);
  box-shadow: none;
}

.primary-button:active {
  transform: scale(0.985);
  box-shadow: none;
}

.secondary-button {
  color: var(--ink);
  background: oklch(93.5% 0.018 245);
}

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

.quick-action {
  display: grid;
  min-height: 64px;
  place-content: center;
  gap: 5px;
  padding: 10px 6px;
  text-align: center;
  background: var(--paper-2);
  border-color: var(--line);
  border-radius: 12px;
}

.quick-action::after {
  display: none;
}

.quick-action b {
  margin: 0;
  font-size: 0.75rem;
}

.quick-icon {
  color: var(--teal);
  font-size: 1.15rem;
}

.bottom-nav {
  min-height: calc(64px + var(--safe-bottom));
  grid-template-columns: repeat(3, 1fr);
  color: var(--ink-2);
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

.nav-item {
  min-height: 62px;
}

.nav-item.is-active {
  color: var(--teal);
}

.page-header {
  padding: 26px 20px 18px;
  color: var(--ink);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  font-family: inherit;
  font-size: 1.8rem;
}

.page-header p {
  color: var(--ink-2);
}

.quiz-hud {
  top: calc(62px + var(--safe-top));
  padding: 9px 14px;
  color: var(--ink-2);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.quiz-progress {
  height: 3px;
  background: oklch(91% 0.018 245);
}

.quiz-progress i {
  background: var(--teal);
}

.timer {
  width: 40px;
  height: 40px;
  color: var(--teal);
  border-color: var(--teal);
}

.quiz-view-switch {
  position: sticky;
  z-index: 19;
  top: calc(105px + var(--safe-top));
  display: grid;
  width: 174px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  margin: 12px auto 4px;
  padding: 3px;
  background: oklch(92.5% 0.014 245);
  border-radius: 10px;
}

.quiz-view-switch button {
  min-height: 38px;
  color: var(--ink-2);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 800;
}

.quiz-view-switch button.is-active {
  color: var(--ink);
  background: var(--paper-2);
  box-shadow: 0 2px 8px oklch(24% 0.025 245 / 0.09);
}

.quiz-wrap {
  padding: 10px 16px 88px;
}

.question-card {
  padding: 18px 0 12px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.label {
  padding: 4px 7px;
  color: var(--teal);
  background: oklch(94% 0.035 248);
  border: 0;
  border-radius: 5px;
}

.question-card h1 {
  margin-top: 14px;
  font-size: clamp(1.08rem, 4.6vw, 1.32rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.options {
  gap: 10px;
  margin-top: 12px;
}

.option-button {
  min-height: 60px;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.option-button:disabled {
  color: var(--ink);
  opacity: 1;
}

.option-key {
  width: 32px;
  height: 32px;
  color: var(--ink-2);
  border: 1.5px solid oklch(72% 0.025 245);
}

.option-text {
  font-size: 0.97rem;
  line-height: 1.6;
}

.option-button.is-selected {
  background: oklch(94% 0.035 248);
  border-color: var(--teal);
}

.option-button.is-correct {
  background: oklch(94% 0.045 155);
  border-color: var(--green);
}

.option-button.is-wrong {
  background: oklch(94% 0.045 28);
  border-color: var(--red);
}

.answer-banner,
.study-answer {
  padding: 16px;
  color: var(--ink);
  background: oklch(94% 0.045 155);
  border: 1px solid oklch(78% 0.08 155);
  border-radius: 14px;
}

.answer-banner.is-wrong {
  color: var(--ink);
  background: oklch(94% 0.045 28);
  border: 1px solid oklch(78% 0.09 28);
}

.study-reveal {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.study-answer {
  display: grid;
  gap: 6px;
}

.study-answer span {
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 800;
}

.study-answer strong {
  color: var(--green);
  font-size: 1rem;
  line-height: 1.65;
}

.explanation-card {
  padding: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.explanation-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.explanation-card h2 {
  margin: 0;
  font-size: 1rem;
}

.explanation-card header span {
  color: var(--ink-2);
  font-size: 0.68rem;
}

.explanation-card p {
  margin: 14px 0 12px;
  font-size: 0.95rem;
  line-height: 1.8;
}

.explanation-card small {
  display: block;
  padding-top: 10px;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  line-height: 1.6;
}

.study-actions button:disabled {
  opacity: 0.45;
}

.question-navigator {
  min-width: 82px;
  min-height: 48px;
  color: var(--paper-2);
  background: var(--ink);
  border-radius: 14px;
  box-shadow: 0 8px 24px oklch(24% 0.025 245 / 0.16);
}

@media (min-width: 720px) {
  .home-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  }
}
