:root {
  --ink: #173e48;
  --ink-soft: #58747a;
  --paper: #f2fbf8;
  --paper-deep: #e5f4f0;
  --surface: #fbfffd;
  --surface-strong: #ffffff;
  --navy: #246d72;
  --navy-2: #2f8b87;
  --teal: #248c80;
  --teal-soft: #dff5ef;
  --gold: #d1a057;
  --gold-soft: #fbf0db;
  --red: #c76d63;
  --red-soft: #fbe9e6;
  --blue-soft: #e1f2fb;
  --line: #d5eae4;
  --line-strong: #b8dcd4;
  --shadow: 0 22px 62px rgba(49, 120, 121, 0.11);
  --shadow-soft: 0 10px 28px rgba(49, 120, 121, 0.085);
  --radius: 22px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", Georgia, serif;
  --display: "Klee One", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 2%, rgba(116, 206, 211, 0.2), transparent 26rem),
    radial-gradient(circle at 8% 74%, rgba(157, 224, 182, 0.17), transparent 30rem),
    linear-gradient(145deg, #fbfefc 0%, #effaf7 50%, #eef7fc 100%),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 300;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  color: white;
  background: var(--navy);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 90;
  inset: 0 auto 0 0;
  display: flex;
  width: 286px;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px 22px;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 0%, rgba(255, 255, 255, 0.96), transparent 20rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(232, 248, 245, 0.97));
  border-right: 1px solid rgba(190, 224, 218, 0.88);
  box-shadow: 8px 0 30px rgba(72, 144, 140, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 2px 2px 23px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(67, 152, 143, 0.2);
  border-radius: 14px;
  color: #2d8178;
  background: linear-gradient(145deg, rgba(230, 248, 243, 0.95), rgba(225, 243, 252, 0.95));
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
}

.brand-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.08rem;
  letter-spacing: 0.08em;
}

.brand-copy span {
  display: block;
  margin-top: 1px;
  color: #89aaa8;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
}

.side-label {
  margin: 18px 10px 8px;
  color: #8dafab;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #517276;
  font-size: 0.86rem;
  text-decoration: none;
  transition: 160ms ease;
}

.side-link:hover,
.side-link:focus-visible {
  color: #176c69;
  background: rgba(255, 255, 255, 0.76);
}

.side-link.active {
  border-color: #cae9e2;
  color: #126c68;
  background: linear-gradient(135deg, #dcf5ef, #e9f7fb);
  box-shadow: 0 5px 15px rgba(67, 142, 136, 0.07);
}

.side-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: #2b877e;
  background: rgba(232, 249, 245, 0.94);
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 700;
}

.side-link small {
  margin-left: auto;
  color: #88a7a5;
  font-size: 0.68rem;
}

.sidebar-footer {
  margin-top: auto;
  padding: 22px 7px 3px;
}

.mini-progress-label {
  display: flex;
  justify-content: space-between;
  color: #688886;
  font-size: 0.72rem;
}

.mini-progress-track {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(172, 212, 206, 0.36);
}

.mini-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #43a99d, #7bc8bc);
  transition: width 280ms ease;
}

.sidebar-note {
  margin-top: 13px;
  color: #90aba8;
  font-size: 0.68rem;
  line-height: 1.55;
}

.main-area {
  min-height: 100vh;
  margin-left: 286px;
}

.topbar {
  position: sticky;
  z-index: 60;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(20px, 4vw, 62px);
  border-bottom: 1px solid rgba(195, 226, 219, 0.7);
  background: rgba(247, 253, 251, 0.84);
  backdrop-filter: blur(14px);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.crumb {
  min-width: 0;
  flex: 1;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.crumb strong {
  color: var(--ink);
  font-weight: 600;
}

.search-compact {
  position: relative;
  width: min(330px, 36vw);
}

.search-compact input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.86);
  transition: 160ms ease;
}

.search-compact input:focus {
  border-color: rgba(27, 116, 111, 0.7);
  box-shadow: 0 0 0 4px rgba(27, 116, 111, 0.09);
}

.search-symbol {
  position: absolute;
  top: 50%;
  left: 15px;
  color: #758087;
  transform: translateY(-50%);
}

.search-key {
  position: absolute;
  top: 50%;
  right: 12px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #8a938f;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.68rem;
  transform: translateY(-50%);
}

.content {
  width: min(1180px, calc(100% - clamp(38px, 8vw, 110px)));
  margin: 0 auto;
  padding: 44px 0 90px;
  outline: none;
}

.page-enter {
  animation: page-in 320ms ease both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 13px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  display: inline-block;
  width: 22px;
  height: 2px;
  background: currentColor;
  content: "";
}

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

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--display);
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.15rem, 5vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

h2 {
  margin-bottom: 13px;
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  letter-spacing: -0.025em;
  line-height: 1.28;
}

h3 {
  margin-bottom: 9px;
  font-size: 1.22rem;
  line-height: 1.4;
}

h4 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.7fr);
  gap: clamp(24px, 5vw, 68px);
  align-items: end;
  min-height: 380px;
  padding: clamp(28px, 5vw, 62px);
  overflow: hidden;
  border: 1px solid rgba(186, 224, 218, 0.8);
  border-radius: 32px;
  background:
    radial-gradient(circle at 83% 20%, rgba(255, 255, 255, 0.92), transparent 17rem),
    linear-gradient(128deg, rgba(250, 255, 253, 0.96), rgba(229, 248, 244, 0.9) 53%, rgba(229, 244, 251, 0.93)),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  width: 430px;
  height: 430px;
  right: -190px;
  bottom: -240px;
  border: 1px solid rgba(27, 116, 111, 0.2);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgba(27, 116, 111, 0.035),
    0 0 0 85px rgba(27, 116, 111, 0.025);
  content: "";
}

.hero h1 {
  max-width: 720px;
}

.hero h1 em {
  color: var(--teal);
  font-style: normal;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

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

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 17px;
  border: 1px solid var(--navy);
  border-radius: 11px;
  color: white;
  background: var(--navy);
  font-size: 0.85rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: 160ms ease;
}

.button:hover {
  background: var(--navy-2);
  transform: translateY(-1px);
}

.button.secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.button.secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: white;
}

.button.small {
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.74rem;
}

.button.ghost {
  border-color: transparent;
  color: var(--ink-soft);
  background: transparent;
}

.hero-progress {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 25px;
  border: 1px solid rgba(27, 116, 111, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.67);
  box-shadow: var(--shadow-soft);
}

.progress-orbit {
  display: grid;
  width: 142px;
  height: 142px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) var(--progress), #e3e5df 0);
}

.progress-orbit::before {
  position: absolute;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.progress-orbit strong {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: 2rem;
}

.hero-progress p {
  margin-bottom: 3px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
}

.hero-progress small {
  display: block;
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.72rem;
}

.section {
  margin-top: clamp(45px, 7vw, 82px);
}

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

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.section-heading p {
  max-width: 500px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.text-link {
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

.chapter-card {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 166px;
  padding: 23px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(40, 44, 42, 0.035);
  text-decoration: none;
  transition: 180ms ease;
}

.chapter-card:hover {
  border-color: rgba(27, 116, 111, 0.48);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.chapter-number {
  display: grid;
  width: 62px;
  height: 82px;
  place-items: center;
  border-radius: 15px;
  color: var(--teal);
  background: var(--teal-soft);
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 700;
}

.chapter-card:nth-child(2) .chapter-number {
  color: #9b681f;
  background: var(--gold-soft);
}

.chapter-card:nth-child(3) .chapter-number {
  color: #44637c;
  background: var(--blue-soft);
}

.chapter-card:nth-child(4) .chapter-number {
  color: var(--red);
  background: var(--red-soft);
}

.chapter-card h3 {
  margin-bottom: 5px;
  font-size: 1.25rem;
}

.chapter-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.79rem;
  line-height: 1.65;
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: #748078;
  font-size: 0.68rem;
}

.chapter-arrow {
  color: var(--line-strong);
  font-size: 1.25rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.panel {
  padding: clamp(22px, 3vw, 31px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(40, 44, 42, 0.035);
}

.panel.accent {
  border-color: rgba(27, 116, 111, 0.22);
  background:
    linear-gradient(145deg, rgba(220, 238, 234, 0.55), rgba(255, 253, 248, 0.9)),
    var(--surface);
}

.panel.ink {
  color: #eff6f4;
  border-color: var(--navy);
  background: var(--navy);
}

.panel.ink h2,
.panel.ink h3 {
  color: white;
}

.panel.ink p {
  color: rgba(239, 246, 244, 0.7);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 21px;
}

.stat {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.panel.ink .stat {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
}

.stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
}

.stat span {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.panel.ink .stat span {
  color: rgba(239, 246, 244, 0.58);
}

.method-mini-list {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.method-mini {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.method-mini:hover {
  background: white;
}

.method-mini b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal);
  background: var(--teal-soft);
  font-family: var(--serif);
  font-size: 0.7rem;
}

.method-mini span {
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 36px;
}

.page-head h1 {
  font-size: clamp(2.1rem, 4vw, 3.65rem);
}

.page-head p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--ink-soft);
}

.chapter-badge {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
  background: rgba(255, 253, 248, 0.7);
  font-family: var(--serif);
  font-size: 2.6rem;
}

.chapter-hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 18px;
}

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

.map-item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.map-item::before {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.formula-list {
  display: grid;
  gap: 9px;
}

.formula-chip {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.formula-chip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.73rem;
}

.formula-chip .katex-display {
  margin: 0.3em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 99px;
  color: #59685f;
  background: #edf0eb;
  font-size: 0.66rem;
  font-weight: 650;
  white-space: nowrap;
}

.tag.teal {
  color: #1b625e;
  background: var(--teal-soft);
}

.tag.gold {
  color: #8d611e;
  background: var(--gold-soft);
}

.tag.red {
  color: #914239;
  background: var(--red-soft);
}

.tag.blue {
  color: #3d6278;
  background: var(--blue-soft);
}

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

.knowledge-card {
  position: relative;
  display: flex;
  min-height: 180px;
  flex-direction: column;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: inherit;
  background: var(--surface);
  text-decoration: none;
  transition: 160ms ease;
}

.knowledge-card:hover {
  border-color: rgba(27, 116, 111, 0.52);
  transform: translateY(-2px);
}

.knowledge-index {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
}

.knowledge-card h3 {
  margin: 8px 0 7px;
  font-size: 1.05rem;
}

.knowledge-card p {
  margin-bottom: 16px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.65;
}

.knowledge-card .tag-row {
  margin-top: auto;
}

.type-list {
  display: grid;
  gap: 11px;
}

.type-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 17px;
  align-items: center;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  background: var(--surface);
  text-decoration: none;
  transition: 160ms ease;
}

.type-card:hover {
  border-color: rgba(27, 116, 111, 0.5);
  background: white;
}

.type-index {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 12px;
  color: var(--teal);
  background: var(--teal-soft);
  font-family: var(--serif);
  font-weight: 700;
}

.type-card h3 {
  margin-bottom: 3px;
  font-size: 1rem;
}

.type-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.77rem;
}

.type-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
  color: #78837b;
  font-size: 0.73rem;
}

.breadcrumbs a {
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--teal);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}

.detail-main {
  display: grid;
  gap: 17px;
}

.detail-aside {
  position: sticky;
  top: 95px;
  display: grid;
  gap: 12px;
}

.aside-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.8);
}

.aside-card h4 {
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.aside-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 17px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.content-card {
  padding: clamp(21px, 3vw, 31px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(40, 44, 42, 0.032);
}

.content-card.emphasis {
  border-left: 4px solid var(--teal);
}

.content-card.warning {
  border-color: rgba(166, 71, 60, 0.24);
  background: linear-gradient(135deg, rgba(247, 228, 223, 0.35), var(--surface));
}

.card-kicker {
  margin-bottom: 9px;
  color: var(--teal);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prose {
  color: var(--ink-soft);
  font-size: 0.87rem;
}

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

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

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 6px;
}

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

.condition-item,
.pitfall-item {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
}

.pitfall-item {
  border-color: rgba(166, 71, 60, 0.16);
  background: rgba(247, 228, 223, 0.3);
}

.method-box {
  padding: 21px;
  border: 1px solid rgba(27, 116, 111, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(220, 238, 234, 0.5), rgba(255, 253, 248, 0.8)),
    var(--surface);
}

.method-box h3 {
  margin-bottom: 13px;
}

.recognition {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  color: #365c5a;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.recognition b {
  flex: 0 0 auto;
  color: var(--teal);
}

.steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.steps li {
  position: relative;
  min-height: 35px;
  padding: 6px 0 6px 43px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  counter-increment: steps;
}

.steps li::before {
  position: absolute;
  left: 0;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  color: var(--teal);
  background: white;
  box-shadow: inset 0 0 0 1px rgba(27, 116, 111, 0.15);
  content: counter(steps, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 700;
}

.example-box {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.example-box .question-text {
  margin-bottom: 10px;
}

.example-box p:last-child {
  margin-bottom: 0;
}

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

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
}

.segmented button {
  min-height: 32px;
  padding: 4px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.72rem;
  cursor: pointer;
}

.segmented button.active {
  color: white;
  background: var(--navy);
}

.question-stack {
  display: grid;
  gap: 13px;
}

.question {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(40, 44, 42, 0.032);
}

.question.is-complete {
  border-color: rgba(27, 116, 111, 0.34);
}

.question-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 17px;
  border-bottom: 1px solid #ece7dc;
  background: rgba(249, 247, 241, 0.64);
}

.question-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.question-head-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.question-number {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.difficulty {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 0.64rem;
  font-weight: 750;
}

.difficulty.基础 {
  color: #317360;
  background: #dfeee8;
}

.difficulty.进阶 {
  color: #436379;
  background: #e2ebf1;
}

.difficulty.综合 {
  color: #8a611f;
  background: #f3e6cf;
}

.difficulty.挑战 {
  color: #93443c;
  background: #f4dfda;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #707b74;
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.icon-button.active {
  border-color: rgba(189, 135, 56, 0.35);
  color: #9a681f;
  background: var(--gold-soft);
}

.question-body {
  padding: 19px;
}

.question h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.question-text {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.9;
}

.question-text p:last-child {
  margin-bottom: 0;
}

.question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.idea-panel,
.solution-body {
  display: none;
  margin-top: 15px;
  padding: 16px;
  border-radius: 11px;
}

.idea-panel.open,
.solution-body.open {
  display: block;
  animation: reveal 200ms ease both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
}

.idea-panel {
  border: 1px solid rgba(189, 135, 56, 0.24);
  background: rgba(245, 232, 210, 0.42);
}

.idea-panel strong,
.solution-body strong {
  color: var(--ink);
}

.solution-body {
  border: 1px solid rgba(27, 116, 111, 0.2);
  background: rgba(220, 238, 234, 0.24);
}

.solution-section + .solution-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(27, 116, 111, 0.2);
}

.solution-section h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.solution-section h4::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.solution-section ol {
  margin: 0;
  padding-left: 1.3rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.solution-section li + li {
  margin-top: 6px;
}

.answer-line {
  padding: 11px 13px;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.86rem;
}

.mistake-line {
  padding: 11px 13px;
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  color: #744941;
  background: rgba(247, 228, 223, 0.44);
  font-size: 0.8rem;
}

.katex-display {
  margin: 1em 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 0;
}

.katex {
  max-width: 100%;
}

.empty-state {
  padding: 55px 25px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.58);
  text-align: center;
}

.empty-state h2 {
  font-size: 1.4rem;
}

.empty-state p {
  margin-bottom: 18px;
  font-size: 0.82rem;
}

.search-page-box {
  display: flex;
  gap: 10px;
  margin: 27px 0;
}

.search-page-box input {
  min-height: 52px;
  flex: 1;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.9rem;
}

.search-page-box input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(27, 116, 111, 0.08);
}

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

.result-item {
  display: block;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  background: var(--surface);
  text-decoration: none;
  transition: 160ms ease;
}

.result-item:hover {
  border-color: var(--teal);
  transform: translateX(2px);
}

.result-item h3 {
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.result-item p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.result-kicker {
  color: var(--teal);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

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

.method-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.method-card.chapter-wide {
  grid-column: 1 / -1;
}

.method-card h3 {
  margin-bottom: 6px;
}

.method-card > p {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.decision {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.decision-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 13px;
  border-radius: 9px;
  background: #f4f2ec;
  font-size: 0.78rem;
}

.decision-row b {
  color: var(--teal);
}

.decision-row span {
  color: var(--ink-soft);
}

.formula-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.formula-table th,
.formula-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.formula-table th {
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.formula-table td {
  color: var(--ink-soft);
}

.formula-table tr:last-child td {
  border-bottom: 0;
}

.confusion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 15px;
}

.confusion {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf9f4;
}

.confusion strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.78rem;
}

.confusion p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.progress-summary {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 25px;
  align-items: center;
}

.big-progress {
  display: grid;
  width: 168px;
  height: 168px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) var(--progress), #e6e1d7 0);
}

.big-progress-inner {
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  text-align: center;
}

.big-progress-inner strong {
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
}

.big-progress-inner span {
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.chapter-progress-list {
  display: grid;
  gap: 13px;
}

.chapter-progress-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 45px;
  gap: 11px;
  align-items: center;
  font-size: 0.77rem;
}

.chapter-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8e3d9;
}

.chapter-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

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

.review-card {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: inherit;
  background: var(--surface);
  text-decoration: none;
}

.review-card:hover {
  border-color: var(--teal);
}

.review-card h3 {
  font-size: 0.97rem;
}

.review-card p {
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.review-card .tag-row {
  margin-top: auto;
}

.toast {
  position: fixed;
  z-index: 250;
  right: 24px;
  bottom: 24px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  color: white;
  background: var(--navy);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 180ms ease;
}

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

.sidebar-scrim {
  display: none;
}

@media (max-width: 1100px) {
  .sidebar {
    width: 250px;
  }

  .main-area {
    margin-left: 250px;
  }

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

  .chapter-card {
    grid-template-columns: 54px minmax(0, 1fr) 18px;
  }

  .chapter-number {
    width: 52px;
    height: 70px;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
}

@media (max-width: 860px) {
  .sidebar {
    width: min(310px, 86vw);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(10, 25, 33, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  body.nav-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .main-area {
    margin-left: 0;
  }

  .menu-button {
    display: block;
  }

  .topbar {
    padding-inline: 18px;
  }

  .content {
    width: min(100% - 34px, 760px);
    padding-top: 28px;
  }

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

  .hero-progress {
    width: min(100%, 380px);
  }

  .chapter-grid,
  .knowledge-grid,
  .quick-grid,
  .methods-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .method-card.chapter-wide {
    grid-column: auto;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-aside {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .page-head {
    grid-template-columns: 1fr;
  }

  .chapter-badge {
    display: none;
  }
}

@media (max-width: 600px) {
  .search-compact {
    width: 43px;
  }

  .search-compact input {
    padding: 0;
    color: transparent;
    cursor: pointer;
  }

  .search-compact input::placeholder {
    color: transparent;
  }

  .search-key {
    display: none;
  }

  .crumb {
    display: none;
  }

  .topbar {
    min-height: 64px;
    justify-content: space-between;
  }

  .content {
    width: min(100% - 24px, 560px);
    padding-bottom: 65px;
  }

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

  h1 {
    font-size: 2.3rem;
  }

  .hero-copy {
    font-size: 0.9rem;
  }

  .chapter-card {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 140px;
    padding: 18px;
  }

  .chapter-arrow {
    display: none;
  }

  .chapter-number {
    width: 46px;
    height: 62px;
    font-size: 1.4rem;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }

  .knowledge-grid {
    gap: 10px;
  }

  .type-card {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 15px;
  }

  .type-card-meta {
    grid-column: 2;
  }

  .condition-grid,
  .pitfall-grid,
  .confusion-grid {
    grid-template-columns: 1fr;
  }

  .content-card,
  .panel,
  .method-card {
    padding: 18px;
  }

  .detail-aside {
    grid-template-columns: 1fr;
  }

  .question-head {
    align-items: flex-start;
    flex-flow: row wrap;
  }

  .question-head-actions {
    align-self: center;
    margin-left: auto;
  }

  .decision-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

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

  .big-progress {
    margin: 0 auto;
  }

  .chapter-progress-item {
    grid-template-columns: 72px minmax(0, 1fr) 38px;
  }

  .search-page-box {
    flex-direction: column;
  }

  .search-page-box .button {
    width: 100%;
  }

  .formula-table {
    display: block;
    overflow-x: auto;
  }
}

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

@media print {
  body {
    background: white;
  }

  .sidebar,
  .topbar,
  .sidebar-scrim,
  .question-actions,
  .toolbar,
  .button,
  .text-link {
    display: none !important;
  }

  .main-area {
    margin-left: 0;
  }

  .content {
    width: 100%;
    padding: 0;
  }

  .content-card,
  .question,
  .panel {
    break-inside: avoid;
    box-shadow: none;
  }

  .idea-panel,
  .solution-body {
    display: block !important;
  }
}

/* Blue-green Japanese study journal theme */
h1,
h2,
h3,
h4 {
  font-family: var(--display);
  letter-spacing: -0.025em;
}

.topbar {
  border-bottom-color: rgba(193, 226, 219, 0.72);
  background: rgba(249, 255, 253, 0.86);
}

.hero {
  border-color: rgba(177, 221, 213, 0.78);
  border-radius: 32px;
  background:
    radial-gradient(circle at 85% 18%, rgba(255, 255, 255, 0.95), transparent 17rem),
    linear-gradient(125deg, rgba(251, 255, 253, 0.98), rgba(227, 248, 243, 0.92) 54%, rgba(227, 244, 252, 0.94));
  box-shadow: 0 24px 70px rgba(67, 143, 145, 0.12);
}

.hero::before {
  position: absolute;
  width: 210px;
  height: 210px;
  top: -115px;
  left: 43%;
  border-radius: 48% 52% 57% 43%;
  background: rgba(255, 255, 255, 0.32);
  content: "";
  transform: rotate(18deg);
}

.hero::after {
  border-color: rgba(66, 163, 151, 0.18);
  box-shadow:
    0 0 0 38px rgba(91, 192, 174, 0.04),
    0 0 0 85px rgba(105, 184, 214, 0.035);
}

.hero h1 em {
  color: #3e9c8d;
}

.eyebrow {
  color: #328a80;
}

.chapter-card,
.knowledge-card,
.type-card,
.content-card,
.panel,
.method-card,
.question,
.aside-card,
.result-item {
  border-color: rgba(196, 226, 220, 0.9);
  background-color: rgba(255, 255, 255, 0.88);
  box-shadow: 0 9px 30px rgba(60, 132, 132, 0.055);
}

.chapter-card:hover,
.knowledge-card:hover,
.type-card:hover,
.result-item:hover {
  border-color: rgba(70, 167, 155, 0.48);
  box-shadow: 0 15px 36px rgba(60, 132, 132, 0.095);
}

.chapter-number {
  color: #2f897f;
  background: linear-gradient(145deg, #dff5ef, #e8f8f4);
}

.chapter-card:nth-child(2) .chapter-number {
  color: #4f8c71;
  background: linear-gradient(145deg, #e8f6e8, #f4f9e8);
}

.chapter-card:nth-child(3) .chapter-number {
  color: #477f9e;
  background: linear-gradient(145deg, #e1f2fb, #edf8fc);
}

.chapter-card:nth-child(4) .chapter-number {
  color: #378d89;
  background: linear-gradient(145deg, #def4f1, #e8f9f4);
}

.panel.accent,
.method-box {
  border-color: rgba(102, 190, 177, 0.28);
  background:
    linear-gradient(145deg, rgba(225, 248, 243, 0.84), rgba(239, 250, 253, 0.9)),
    var(--surface);
}

.panel.ink {
  border-color: rgba(70, 142, 143, 0.55);
  background:
    radial-gradient(circle at 92% 4%, rgba(139, 221, 208, 0.24), transparent 15rem),
    linear-gradient(145deg, #246a70, #338d84);
}

.chapter-badge {
  color: #3c988e;
  border-color: #c7e5df;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 8px rgba(225, 247, 242, 0.6);
}

.button {
  border-color: transparent;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #2c817d, #43a298);
  box-shadow: 0 6px 16px rgba(56, 142, 135, 0.16);
}

.button:hover {
  background: linear-gradient(135deg, #26746f, #38968c);
}

.button.secondary {
  border-color: #c7e5df;
  color: #315f64;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.button.secondary:hover {
  border-color: #82c8bb;
  color: #247a72;
  background: #f5fffc;
}

.segmented {
  border-color: #cfe7e2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

.segmented button {
  border-radius: 999px;
}

.segmented button.active {
  background: linear-gradient(135deg, #2f827f, #45a197);
}

.question-head {
  border-bottom-color: #e2f0ec;
  background: linear-gradient(90deg, rgba(238, 251, 247, 0.9), rgba(240, 249, 253, 0.88));
}

.idea-panel {
  border-color: rgba(210, 169, 102, 0.22);
  background: rgba(252, 245, 228, 0.63);
}

.solution-body {
  border-color: rgba(80, 172, 158, 0.22);
  background: linear-gradient(145deg, rgba(226, 247, 241, 0.45), rgba(237, 249, 252, 0.42));
}

.decision-row {
  background: linear-gradient(135deg, #f2faf8, #f4fafc);
}

.confusion {
  background: linear-gradient(135deg, #fbfffd, #f5fbfa);
}

.search-compact input,
.search-page-box input {
  border-color: #cfe7e1;
  background: rgba(255, 255, 255, 0.86);
}

.friendly-card {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 31px);
  border: 1px solid rgba(108, 194, 180, 0.3);
  border-radius: 22px;
  background:
    radial-gradient(circle at 96% 0%, rgba(152, 220, 224, 0.22), transparent 13rem),
    linear-gradient(135deg, #edfbf7, #f3fbfd);
  box-shadow: 0 12px 34px rgba(60, 138, 135, 0.07);
}

.friendly-card::after {
  position: absolute;
  right: 22px;
  bottom: -22px;
  color: rgba(72, 161, 150, 0.08);
  content: "〝";
  font-family: Georgia, serif;
  font-size: 8rem;
  line-height: 1;
}

.friendly-card h2,
.friendly-card p {
  position: relative;
  z-index: 1;
}

.friendly-card p {
  margin-bottom: 0;
  color: #486d70;
  font-size: 0.92rem;
  line-height: 1.9;
}

.friendly-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: #2b8b80;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.friendly-label::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60bcab;
  box-shadow: 0 0 0 5px rgba(96, 188, 171, 0.11);
  content: "";
}

.friendly-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(115, 193, 180, 0.22);
  border-radius: 14px;
  color: #45696c;
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
  line-height: 1.8;
}

.friendly-note b {
  flex: 0 0 auto;
  color: #2c8a80;
}

.method-card.chapter-wide {
  background:
    radial-gradient(circle at 96% 0%, rgba(143, 216, 217, 0.2), transparent 16rem),
    rgba(255, 255, 255, 0.9);
}

@media print {
  .friendly-card {
    box-shadow: none;
  }
}
