:root {
  --bg: #fff9f2;
  --panel: #ffffff;
  --panel-soft: #fffef9;
  --line: #eadfce;
  --text: #2b2620;
  --muted: #6d655c;
  --brand: #f28c28;
  --brand-strong: #d96f08;
  --accent: #2aa198;
  --accent-soft: #edf8f7;
  --green-soft: #eef8e8;
  --shadow: 0 12px 32px rgba(97, 74, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fff9f2 0%, #fffcf7 46%, #f7fbf9 100%);
}

a {
  color: inherit;
}

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

.site-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 14px 0;
  margin-bottom: 22px;
  background: rgba(255, 249, 242, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(234, 223, 206, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.brand span {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
}

.nav a.is-current,
.nav a:hover {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

.page-main {
  display: grid;
  gap: 18px;
}

.hero,
.section,
.page-intro {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 24px;
  align-items: center;
  padding: 24px;
}

.hero-copy h1,
.page-intro h1,
.section-head h2,
.detail-panel h2 {
  margin: 10px 0 12px;
  line-height: 1.15;
}

.hero-copy h1 {
  font-size: clamp(28px, 3.2vw, 44px);
}

.hero-text,
.intro-text,
.section-head p,
.muted,
.source-card p,
.library-card p,
.topic-progress-item p,
.progress-row p {
  color: var(--muted);
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  min-height: 220px;
  background: linear-gradient(135deg, #fff2de 0%, #eef7f4 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero-visual img {
  width: min(100%, 260px);
  height: auto;
  display: block;
}

.eyebrow,
.section-kicker,
.question-index,
.source-role {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff1df;
  color: #8e570e;
  font-size: 12px;
  font-weight: 700;
}

.page-intro,
.section {
  padding: 20px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 16px;
}

.section-head > div,
.section-head > p {
  flex: 1 1 280px;
  min-width: 0;
}

.action-row,
.tag-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-stack {
  display: grid;
  gap: 10px;
}

.button,
.chip {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.button {
  padding: 11px 16px;
  font-weight: 700;
}

.button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.button.primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
}

.button.secondary,
.chip {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.button.secondary:hover,
.chip:hover,
.chip.is-active {
  background: #fff6ec;
  border-color: #f4c18a;
}

.stats-grid,
.stage-grid,
.source-grid,
.library-grid {
  display: grid;
  gap: 14px;
}

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

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

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

.stat-card,
.stage-card,
.source-card,
.mini-panel,
.summary-card,
.question-card,
.library-card,
.topic-progress-item,
.progress-row,
.feature-card,
.detail-panel {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-card,
.stage-card,
.source-card,
.library-card,
.summary-card,
.mini-panel {
  padding: 16px;
}

.stat-card strong {
  display: block;
  font-size: 32px;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card span {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.stage-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.stage-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 auto;
  margin-top: 6px;
  border: 1px solid rgba(43, 38, 32, 0.08);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f4f8fb;
  color: #35596b;
  font-size: 12px;
  border: 1px solid #d7e6ee;
}

.tag-soft {
  background: var(--green-soft);
  border-color: #d8eac9;
  color: #44633b;
}

.feature-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  padding: 20px;
}

.feature-card h3,
.source-card h3,
.library-card h3,
.detail-panel h2,
.progress-row h3,
.topic-progress-item h3,
.mini-panel h3 {
  margin: 0 0 8px;
}

.callout {
  margin: 0;
  padding: 14px;
  background: var(--accent-soft);
  border: 1px solid #c7ebe8;
  border-radius: 8px;
  color: #1d6661;
  line-height: 1.7;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

.study-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
}

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

.topic-list-item {
  width: 100%;
  padding: 14px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.topic-list-item.is-active {
  border-color: #f1b571;
  background: #fff7ec;
}

.topic-list-title {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.topic-list-meta,
.topic-list-progress,
.text-link {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.text-link {
  margin-top: 8px;
  color: #0f766e;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.detail-panel {
  padding: 20px;
}

.detail-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 18px;
  margin-bottom: 18px;
}

.detail-top > div {
  flex: 1 1 280px;
  min-width: 0;
}

.detail-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

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

.example-block {
  padding: 16px;
  margin-bottom: 16px;
  background: #fff8ef;
  border: 1px solid #f3d8b6;
  border-radius: 8px;
}

.question-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.question-card {
  padding: 16px;
}

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

.question-card summary {
  cursor: pointer;
  color: #0f766e;
  font-weight: 700;
}

.note-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 13px;
}

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

.practice-summary {
  margin-bottom: 16px;
}

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

.practice-card.is-good {
  background: #f4fbf1;
  border-color: #cfe7c4;
}

.practice-card.is-bad {
  background: #fff6f4;
  border-color: #f3d1cc;
}

.question-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.question-prompt {
  margin: 0;
  line-height: 1.7;
}

.progress-stack,
.topic-progress-list,
.principle-grid,
.matrix-table {
  display: grid;
  gap: 12px;
}

.progress-row,
.topic-progress-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 280px) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.meter {
  width: 100%;
  height: 10px;
  background: #f2ece3;
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #f28c28 0%, #35a79c 100%);
}

.topic-progress-meta {
  display: grid;
  gap: 4px;
  justify-items: end;
  color: var(--muted);
  font-size: 13px;
}

.matrix-row {
  display: grid;
  grid-template-columns: 180px 140px 240px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  align-items: start;
}

.matrix-head {
  background: #fff6ec;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(43, 38, 32, 0.9);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 980px) {
  .hero,
  .feature-card,
  .study-layout,
  .detail-grid,
  .stats-grid,
  .stage-grid,
  .source-grid,
  .library-grid {
    grid-template-columns: 1fr;
  }

  .progress-row,
  .topic-progress-item,
  .matrix-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100vw - 20px, 1180px);
  }

  .topbar {
    position: static;
    padding-top: 12px;
  }

  .hero,
  .page-intro,
  .section {
    padding: 16px;
  }

  .brand small {
    font-size: 10px;
  }

  .nav {
    gap: 8px;
  }

  .nav a,
  .chip,
  .button {
    width: auto;
    max-width: 100%;
  }

  .hero-copy h1,
  .page-intro h1 {
    font-size: 28px;
  }
}
