:root {
  color-scheme: light;
  --paper: #f5efe4;
  --paper-deep: #ead8bf;
  --panel: rgba(255, 252, 245, 0.92);
  --panel-strong: #fff9ef;
  --ink: #15110d;
  --muted: #6e6257;
  --line: rgba(58, 43, 28, 0.16);
  --line-strong: rgba(58, 43, 28, 0.28);
  --red: #cf2f24;
  --red-dark: #9f1f17;
  --indigo: #203a5f;
  --gold: #b97a23;
  --green: #39705d;
  --shadow: 0 22px 70px rgba(46, 28, 10, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 8%, rgba(207, 47, 36, 0.18), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(32, 58, 95, 0.18), transparent 30%),
    linear-gradient(135deg, #fbf1df 0%, var(--paper) 48%, #efe0ca 100%);
  color: var(--ink);
  font-family: "Songti SC", "Noto Serif CJK SC", "Hiragino Mincho ProN",
    "Yu Mincho", serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(21, 17, 13, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 17, 13, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  position: relative;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 32px 24px 56px;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  min-height: 330px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 249, 239, 0.96), rgba(255, 252, 246, 0.82)),
    radial-gradient(circle at 100% 0%, rgba(207, 47, 36, 0.16), transparent 36%);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  right: -82px;
  bottom: -118px;
  width: 330px;
  height: 330px;
  border: 42px solid rgba(207, 47, 36, 0.12);
  border-radius: 50%;
  content: "";
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--red-dark);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 34px;
  height: 2px;
  background: var(--red);
  content: "";
}

h1 {
  max-width: 760px;
  margin: 0;
  color: #1d1510;
  font-size: clamp(42px, 7vw, 84px);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: -0.08em;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.subtitle {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.primary-action {
  background: var(--red);
  color: #fff9ef;
  box-shadow: 0 12px 32px rgba(207, 47, 36, 0.24);
}

.ghost-action {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
}

.hero-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 250px;
  padding: 24px;
  border: 1px solid rgba(32, 58, 95, 0.22);
  border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(32, 58, 95, 0.94), rgba(18, 29, 46, 0.96)),
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.22), transparent 32%);
  color: #fff9ef;
}

.hero-card small {
  color: rgba(255, 249, 239, 0.7);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-card strong {
  display: block;
  margin-top: 18px;
  font-size: 52px;
  line-height: 0.9;
}

.hero-card p {
  margin: 18px 0 0;
  color: rgba(255, 249, 239, 0.78);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(46, 28, 10, 0.08);
  backdrop-filter: blur(16px);
}

.route h2 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.rail-title,
.section-kicker,
.metric-label,
.task-meta,
.route-year,
.mini-label,
.task-link,
.task-output,
.stage-desc,
.subtitle {
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.quick-stages {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
}

.quick-stage {
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 245, 0.78);
  color: var(--ink);
  text-align: left;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.quick-stage:hover,
.quick-stage.is-active {
  transform: translateY(-2px);
  border-color: rgba(207, 47, 36, 0.48);
  background: #fff9ef;
}

.quick-stage span {
  display: block;
  color: var(--red-dark);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.quick-stage strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
  line-height: 1.1;
}

.workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 320px;
  gap: 20px;
  margin-top: 22px;
  align-items: start;
}

.stage-rail,
.side-panel {
  position: sticky;
  top: 20px;
}

.stage-rail {
  padding: 14px;
}

.rail-title {
  margin: 6px 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stage-button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 78px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.stage-button.is-active {
  border-color: rgba(207, 47, 36, 0.42);
  background: #fff7ea;
  box-shadow: inset 4px 0 0 var(--red);
}

.stage-code {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #1f2d43;
  color: #fff9ef;
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 900;
}

.stage-button.is-active .stage-code {
  background: var(--red);
}

.stage-name {
  display: block;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.stage-desc {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.main-panel {
  overflow: hidden;
}

.stage-head {
  position: relative;
  min-height: 228px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(255, 249, 239, 0.96), rgba(241, 223, 193, 0.66)),
    radial-gradient(circle at 88% 18%, rgba(207, 47, 36, 0.14), transparent 30%);
}

.stage-head::after {
  position: absolute;
  right: 22px;
  top: 22px;
  width: 110px;
  height: 110px;
  border: 22px solid rgba(207, 47, 36, 0.09);
  border-radius: 50%;
  content: "";
}

.stage-head-content,
.task-card > * {
  position: relative;
  z-index: 1;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stage-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.stage-title-row h2 {
  margin: 0;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.stage-badge {
  padding: 8px 12px;
  border: 1px solid rgba(32, 58, 95, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--indigo);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 900;
}

.stage-intro {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.8;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 252, 245, 0.72);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.metric-value {
  display: block;
  margin-top: 7px;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}

.task-zone,
.module-panel {
  padding: 24px;
}

.zone-head,
.module-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.zone-head h3,
.module-panel-head h3 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.zone-head p,
.module-panel-head p {
  max-width: 520px;
  margin: 10px 0 0;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.7;
}

.zone-head p {
  max-width: 420px;
  margin: 0;
  text-align: right;
}

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

.task-card {
  position: relative;
  overflow: hidden;
  min-height: 244px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 252, 245, 0.96), rgba(255, 249, 239, 0.82)),
    radial-gradient(circle at 100% 0%, rgba(185, 122, 35, 0.14), transparent 38%);
}

.task-card::before {
  position: absolute;
  right: -36px;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(207, 47, 36, 0.08);
  content: "";
}

.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.task-status {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(57, 112, 93, 0.12);
  color: var(--green);
  white-space: nowrap;
}

.task-card h4 {
  margin: 18px 0 0;
  font-size: 25px;
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.task-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.72;
}

.task-output {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed rgba(32, 58, 95, 0.22);
  border-radius: 14px;
  background: rgba(32, 58, 95, 0.05);
  color: var(--indigo);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.task-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-top: 16px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff9ef;
  font-size: 13px;
  font-weight: 900;
}

.task-link.is-muted {
  background: rgba(21, 17, 13, 0.08);
  color: var(--muted);
  pointer-events: none;
}

.side-panel {
  padding: 18px;
}

.side-block + .side-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.side-block h3 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.side-block p,
.side-list,
.mini-plan {
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

.side-block p {
  margin: 0;
}

.side-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
}

.side-list li::before {
  width: 8px;
  height: 8px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--red);
  content: "";
}

.mini-plan {
  display: grid;
  gap: 10px;
}

.mini-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.mini-label {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(207, 47, 36, 0.1);
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.route {
  margin-top: 22px;
  padding: 24px;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.route-card {
  min-height: 156px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 245, 0.72);
}

.route-year {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.route-card strong {
  display: block;
  margin-top: 10px;
  font-size: 21px;
  line-height: 1.18;
}

.route-card p,
.app-note {
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.65;
}

.route-card p {
  margin: 10px 0 0;
}

.app-note {
  margin: 18px 0 0;
}

.module-panel {
  border-top: 1px solid var(--line);
  background: rgba(255, 249, 239, 0.44);
}

.score-box {
  min-width: 86px;
  padding: 11px 13px;
  border: 1px solid rgba(207, 47, 36, 0.22);
  border-radius: 16px;
  background: rgba(255, 249, 239, 0.9);
  text-align: right;
}

#correctCount {
  color: var(--red);
  font-size: 28px;
  font-weight: 900;
}

#answeredCount {
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.kana-shell {
  width: min(100%, 1180px);
}

.kana-page {
  border-radius: var(--radius-xl);
}

.kana-page h1 {
  font-size: clamp(36px, 6vw, 68px);
}

.kana-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cache-status {
  max-width: 210px;
  margin: 0;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-align: right;
}

.script-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(70px, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
}

.script-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 900;
}

.script-button.is-active {
  background: var(--indigo);
  color: #fff9ef;
}

.kana-section-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
}

.section-tab {
  min-height: 48px;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  font-weight: 900;
}

.section-tab.is-active {
  background: var(--red);
  color: #fff9ef;
  box-shadow: 0 12px 24px rgba(207, 47, 36, 0.18);
}

.kana-sections {
  position: relative;
}

.is-hidden {
  display: none !important;
}

.section-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-panel-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
}

.section-panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.practice-panel,
.kana-table {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 252, 245, 0.88);
}

.practice-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.46);
}

.mode-tab {
  min-height: 42px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.mode-tab.is-active {
  background: var(--ink);
  color: #fff9ef;
}

.filter-scroll {
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-scroll.is-hidden {
  display: none;
}

.filter-track {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.filter-chip {
  min-width: 62px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.filter-chip.is-active {
  border-color: rgba(207, 47, 36, 0.52);
  background: rgba(207, 47, 36, 0.09);
  color: var(--red-dark);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

#scopeLabel {
  color: var(--ink);
}

.auto-next-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 900;
}

.auto-next-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--red);
}

.prompt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: center;
  gap: 16px;
  min-height: 142px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(32, 58, 95, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
}

.prompt-label,
.sound-mark {
  display: block;
}

.prompt-label {
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.sound-mark {
  margin-top: 4px;
  color: var(--text);
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
}

.play-button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--red);
  color: #fff9ef;
  font-size: 24px;
  line-height: 72px;
  box-shadow: 0 14px 30px rgba(207, 47, 36, 0.24);
}

.play-button span {
  display: inline-block;
  padding-left: 4px;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.answer {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.answer:hover:not(:disabled),
.answer:focus-visible:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(32, 58, 95, 0.35);
  box-shadow: 0 12px 26px rgba(46, 28, 10, 0.1);
  outline: none;
}

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

.answer.is-correct {
  border-color: var(--green);
  background: rgba(57, 112, 93, 0.12);
  box-shadow: inset 0 0 0 2px rgba(57, 112, 93, 0.18);
}

.answer.is-wrong {
  border-color: var(--red);
  background: rgba(207, 47, 36, 0.1);
  animation: wrongShake 0.38s ease;
}

.answer-effect {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
}

.answer-effect.correct {
  z-index: 8;
  color: #fffdf8;
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(88px, 16vw, 180px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 12px 34px rgba(24, 70, 54, 0.38);
  transform-origin: center;
  animation: checkPop 0.72s cubic-bezier(0.2, 0.9, 0.22, 1);
  isolation: isolate;
}

.answer-effect.correct::before {
  position: absolute;
  width: min(38vw, 250px);
  height: min(38vw, 250px);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(57, 112, 93, 0.82), rgba(57, 112, 93, 0.56) 44%, transparent 68%);
  content: "";
  animation: checkHalo 0.72s ease;
}

.answer-effect.correct::after {
  position: absolute;
  width: min(50vw, 330px);
  height: min(50vw, 330px);
  border: 2px solid rgba(57, 112, 93, 0.4);
  border-radius: 50%;
  content: "";
  animation: rippleOut 0.72s ease;
}

.feedback {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 800;
}

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

.feedback.wrong,
.feedback.notice {
  color: var(--red-dark);
}

@keyframes checkPop {
  0% {
    opacity: 0;
    transform: scale(0.36) rotate(-18deg);
  }
  38% {
    opacity: 1;
    transform: scale(1.08) rotate(2deg);
  }
  72% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.16) rotate(0);
  }
}

@keyframes checkHalo {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  42% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes rippleOut {
  0% {
    opacity: 0.8;
    transform: scale(0.35);
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

@keyframes wrongShake {
  0%,
  100% {
    transform: translateX(0);
  }
  18% {
    transform: translateX(-9px);
  }
  36% {
    transform: translateX(8px);
  }
  54% {
    transform: translateX(-6px);
  }
  72% {
    transform: translateX(4px);
  }
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.secondary-button,
.primary-button {
  min-height: 46px;
  border-radius: 999px;
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 900;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  color: var(--ink);
}

.primary-button {
  background: var(--ink);
  color: #fff9ef;
}

.primary-button:disabled {
  background: rgba(21, 17, 13, 0.18);
  color: rgba(21, 17, 13, 0.48);
}

.kana-table {
  overflow: hidden;
  align-self: start;
  font-family: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.table-row {
  display: grid;
  grid-template-columns: 72px repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row span,
.table-row button {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px 4px;
  border-right: 1px solid var(--line);
  font-size: 17px;
  font-weight: 900;
}

.table-row span:last-child,
.table-row button:last-child {
  border-right: 0;
}

.table-header span,
.table-header button,
.table-row button:first-child {
  background: rgba(32, 58, 95, 0.06);
  color: var(--muted);
  font-size: 12px;
}

.table-action,
.kana-cell {
  background: transparent;
  color: var(--ink);
  font-family: inherit;
}

.table-action {
  color: var(--muted);
}

.kana-cell {
  font-size: 20px;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.kana-cell:not(:disabled):hover,
.kana-cell:not(:disabled):focus-visible,
.table-action:hover,
.table-action:focus-visible {
  background: rgba(207, 47, 36, 0.1);
  color: var(--red-dark);
  outline: none;
}

.kana-cell:not(:disabled):active,
.table-action:active {
  transform: scale(0.96);
}

.kana-cell:disabled {
  cursor: default;
}

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

  .side-panel {
    position: static;
    grid-column: 1 / -1;
  }

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

}

@media (max-width: 900px) {
  .shell {
    padding: 18px 14px 40px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 24px;
  }

  .hero-card {
    min-height: 190px;
  }

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

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

  .stage-rail {
    position: static;
    overflow-x: auto;
    display: flex;
    gap: 10px;
    padding: 12px;
    scrollbar-width: none;
  }

  .stage-rail::-webkit-scrollbar {
    display: none;
  }

  .rail-title {
    display: none;
  }

  .stage-button {
    grid-template-columns: 42px 150px;
    min-width: 238px;
    margin-top: 0;
  }

  .metrics,
  .task-grid,
  .route-grid {
    grid-template-columns: 1fr;
  }

  .zone-head,
  .module-panel-head {
    display: block;
  }

  .zone-head p {
    margin-top: 10px;
    text-align: left;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 46px;
  }

  .hero {
    padding: 20px;
    border-radius: 22px;
  }

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

  .stage-head,
  .task-zone,
  .module-panel,
  .route {
    padding: 18px;
  }

  .stage-title-row h2 {
    font-size: 44px;
  }

  .task-card {
    min-height: 0;
  }

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

  .kana-top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .play-button {
    width: 100%;
    border-radius: 18px;
  }

  .table-row {
    grid-template-columns: 56px repeat(5, 1fr);
  }

  .table-row span {
    min-height: 38px;
    font-size: 15px;
  }
}
