:root {
  color-scheme: light;
  --bg: #f7f3ea;
  --surface: #fffaf0;
  --surface-2: #ffffff;
  --text: #1f2933;
  --muted: #65717c;
  --line: #e5dccb;
  --accent: #c74f2f;
  --accent-2: #246b5f;
  --accent-3: #b68b2e;
  --shadow: 0 16px 42px rgba(62, 44, 24, 0.12);
}

body.dark {
  color-scheme: dark;
  --bg: #111417;
  --surface: #1a1f24;
  --surface-2: #20272d;
  --text: #eef2f3;
  --muted: #aeb8bf;
  --line: #34404a;
  --accent: #ff8a62;
  --accent-2: #72d1bf;
  --accent-3: #f0c267;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 16px 14px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(10px, env(safe-area-inset-top)) 0 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
}

.eyebrow,
.section-kicker {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.icon-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 14px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}

.tab-button.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.tab-button.soon {
  opacity: 0.62;
}

.hero-panel,
.search-panel,
.content-card,
.model-card,
.check-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 18px;
}

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

#distillSubhead {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.stat {
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-3) 12%, var(--surface-2));
  padding: 10px;
}

.stat strong {
  display: block;
  font-size: 19px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.search-panel {
  position: sticky;
  top: 72px;
  z-index: 12;
  margin: 14px 0 22px;
  padding: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
}

.search-box {
  display: grid;
  gap: 6px;
}

.search-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent-2);
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 10px;
  scrollbar-width: none;
}

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

.filter-chip {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 12px;
  font-weight: 800;
}

.filter-chip.active {
  border-color: var(--accent);
  color: var(--accent);
}

.quick-section {
  margin-top: 26px;
}

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

.sticky-heading {
  position: sticky;
  top: 170px;
  z-index: 8;
  padding: 6px 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
}

.result-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.model-grid,
.check-list,
.chapter-list {
  display: grid;
  gap: 10px;
}

.model-card,
.check-item {
  padding: 14px;
}

.model-card p,
.check-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.model-card .use {
  color: var(--text);
}

.chapter-block {
  display: grid;
  gap: 10px;
}

.chapter-title {
  padding: 14px 4px 4px;
}

.chapter-title p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.content-card {
  overflow: hidden;
}

.card-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 14px;
}

.card-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.card-arrow {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 900;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-2) 12%, var(--surface-2));
  color: var(--accent-2);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.card-body {
  display: none;
  border-top: 1px solid var(--line);
  padding: 0 14px 14px;
}

.content-card.open .card-body {
  display: block;
}

.card-body ul {
  margin: 12px 0;
  padding-left: 20px;
}

.card-body li {
  margin: 8px 0;
  line-height: 1.65;
}

.excerpt {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 26px 14px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 720px) {
  .app-shell {
    padding-inline: 22px;
  }

  .model-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chapter-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .chapter-block {
    align-content: start;
  }
}
