:root {
  color-scheme: light;
  --radius: 0.45rem;
  --background: oklch(0.985 0.013 226);
  --foreground: oklch(0.22 0.035 255);
  --card: oklch(0.997 0.006 205);
  --primary: oklch(0.57 0.16 242);
  --primary-foreground: oklch(0.99 0.01 210);
  --secondary: oklch(0.94 0.045 210);
  --secondary-foreground: oklch(0.34 0.08 240);
  --muted: oklch(0.95 0.024 220);
  --muted-foreground: oklch(0.5 0.045 245);
  --accent: oklch(0.91 0.08 178);
  --warning: oklch(0.82 0.15 80);
  --border: oklch(0.88 0.038 220);
  --surface-blue: oklch(0.95 0.05 225);
  --surface-teal: oklch(0.94 0.065 178);
  --shadow-color: 218 74% 42%;
  --shadow: 0 18px 46px hsl(var(--shadow-color) / 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--foreground);
  background:
    radial-gradient(circle at 8% 2%, color-mix(in oklch, var(--primary) 18%, transparent) 0, transparent 23rem),
    radial-gradient(circle at 88% 8%, color-mix(in oklch, var(--accent) 24%, transparent) 0, transparent 20rem),
    radial-gradient(circle at 55% 96%, color-mix(in oklch, var(--warning) 16%, transparent) 0, transparent 24rem),
    linear-gradient(180deg, var(--background) 0%, color-mix(in oklch, var(--background) 92%, var(--surface-blue)) 100%);
  font-family: "Avenir Next", "Nunito Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

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

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

h1,
h2,
p {
  text-wrap: pretty;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in oklch, var(--border) 70%, transparent);
  background: color-mix(in oklch, var(--background) 82%, transparent);
  backdrop-filter: blur(18px);
}

.nav {
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--primary-foreground);
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px hsl(var(--shadow-color) / 0.16);
  font-size: 19px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted-foreground);
  font-size: 14px;
}

.nav-links a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  border-color: var(--primary);
}

.nav-action,
.button {
  min-height: 44px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-foreground);
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-weight: 700;
  box-shadow: 0 8px 22px hsl(var(--shadow-color) / 0.14);
  transition: transform 160ms ease, background 160ms ease;
}

.nav-action:hover,
.button:hover {
  transform: translateY(-1px);
  background: color-mix(in oklch, var(--primary) 90%, black);
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 88px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-x: auto;
  color: var(--muted-foreground);
  font-size: 14px;
  white-space: nowrap;
  scrollbar-width: none;
}

.breadcrumbs > * {
  flex: 0 0 auto;
}

.breadcrumbs a {
  min-height: 44px;
  padding: 0 8px;
  margin-left: -8px;
  display: inline-flex;
  align-items: center;
}

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

.hero {
  margin-top: 20px;
  padding: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 54px;
  align-items: end;
  background: color-mix(in oklch, var(--card) 84%, transparent);
  border: 1px solid color-mix(in oklch, var(--border) 80%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow,
.category-kicker,
.status-label {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0;
  text-wrap: balance;
}

h1 {
  max-width: 760px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.08;
}

.lead {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--muted-foreground);
  font-size: 18px;
}

.page-updated {
  margin: 24px 0 0;
  color: var(--secondary-foreground);
  font-size: 14px;
  font-weight: 700;
}

.hero-note {
  padding: 24px;
  background: color-mix(in oklch, var(--secondary) 72%, var(--card));
  border: 1px solid color-mix(in oklch, var(--primary) 18%, var(--border));
  border-radius: var(--radius);
}

.hero-note strong {
  font-size: 20px;
}

.hero-note p {
  margin: 10px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
}

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

.category-nav a {
  min-height: 52px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-foreground);
  background: color-mix(in oklch, var(--card) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.category-nav a:hover {
  transform: translateY(-1px);
  background: var(--secondary);
  border-color: color-mix(in oklch, var(--primary) 42%, var(--border));
}

.catalog {
  margin-top: 70px;
  display: grid;
  gap: 82px;
}

.category {
  scroll-margin-top: 94px;
}

.category-head {
  display: grid;
  grid-template-columns: minmax(280px, 0.58fr) minmax(0, 0.72fr);
  gap: 52px;
  align-items: end;
  margin-bottom: 28px;
}

.category-head h2 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
}

.category-head p {
  margin: 0;
  color: var(--muted-foreground);
}

.chapter-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.chapter {
  min-height: 112px;
  padding: 22px 24px;
  display: grid;
  align-content: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  transition: background 160ms ease, color 160ms ease;
}

.chapter:nth-child(odd) {
  border-right: 1px solid var(--border);
}

.chapter:hover {
  color: var(--primary);
  background: color-mix(in oklch, var(--secondary) 56%, transparent);
}

.chapter-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-foreground);
  font-size: 13px;
}

.chapter-action {
  color: var(--primary);
  font-weight: 700;
}

.empty-state,
.status-panel {
  padding: 38px;
  background: color-mix(in oklch, var(--card) 86%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.empty-state p,
.status-panel p {
  margin: 8px 0 0;
  color: var(--muted-foreground);
}

.status-panel {
  margin-top: 30px;
}

.status-panel h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.status-panel .button {
  margin-top: 24px;
}

.footer {
  padding: 36px 0;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 13px;
}

.footer-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

@media (max-width: 900px) {
  .nav,
  .page,
  .footer-inner {
    width: min(100% - 28px, 760px);
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 38px;
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .category-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .nav {
    min-height: 64px;
    gap: 12px;
  }

  .brand > span:last-child {
    display: none;
  }

  .nav-action {
    padding-inline: 14px;
    font-size: 14px;
  }

  .page {
    padding-top: 18px;
  }

  .hero {
    margin-top: 10px;
    padding: 28px 22px;
  }

  h1 {
    font-size: 38px;
  }

  .lead {
    font-size: 16px;
  }

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

  .catalog {
    margin-top: 54px;
    gap: 64px;
  }

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

  .chapter:nth-child(odd) {
    border-right: 0;
  }

  .chapter {
    padding-inline: 16px;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

.detail-page {
  padding-bottom: 64px;
}

.detail-hero {
  padding: 54px 0 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.48fr);
  gap: 64px;
  align-items: end;
  border-bottom: 1px solid var(--border);
}

.detail-hero h1,
.question-header h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.12;
  word-break: break-word;
}

.chapter-overview {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.chapter-overview div {
  min-width: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.chapter-overview div:nth-child(even) {
  padding-left: 18px;
}

.chapter-overview dt {
  color: var(--muted-foreground);
  font-size: 13px;
}

.chapter-overview dd {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 800;
}

.chapter-overview .overview-total dd {
  color: var(--primary);
  font-size: 28px;
  line-height: 1.2;
}

.detail-layout {
  padding: 64px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 48px;
  align-items: start;
}

.content-heading {
  margin-bottom: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.48fr);
  gap: 36px;
  align-items: end;
}

.content-heading h2,
.practice-panel h2,
.option-section h2,
.answer-section h2,
.analysis-section h2,
.related-question-panel h2 {
  margin: 0;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.18;
  text-wrap: balance;
}

.content-heading > p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 14px;
}

.featured-list {
  border-top: 1px solid var(--border);
}

.featured-question {
  min-height: 126px;
  padding: 22px 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: color 160ms ease, background 160ms ease;
}

.featured-question:hover {
  color: var(--primary);
  background: color-mix(in oklch, var(--secondary) 50%, transparent);
}

.question-index {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--secondary);
  border: 1px solid color-mix(in oklch, var(--primary) 20%, var(--border));
  border-radius: var(--radius);
  font-weight: 800;
}

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

.question-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 700;
}

.featured-copy strong {
  display: block;
  color: var(--foreground);
  font-size: 17px;
  line-height: 1.6;
  word-break: break-word;
}

.text-link,
.panel-text-link,
.secondary-link {
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
}

.practice-panel {
  position: sticky;
  top: 96px;
  padding: 30px;
  color: var(--foreground);
  background: color-mix(in oklch, var(--card) 86%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.practice-panel h2 {
  font-size: 29px;
}

.practice-panel > p:not(.panel-label) {
  margin: 16px 0 0;
  color: var(--muted-foreground);
}

.practice-panel .button {
  width: 100%;
  margin-top: 24px;
}

.panel-text-link {
  min-height: 44px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-section {
  padding: 58px 0 18px;
  border-top: 1px solid var(--border);
}

.compact-heading {
  grid-template-columns: 1fr;
}

.related-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.related-links a {
  min-height: 108px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-weight: 800;
}

.related-links a:last-child {
  border-right: 0;
}

.related-links a:hover {
  color: var(--primary);
  background: color-mix(in oklch, var(--secondary) 52%, transparent);
}

.related-links span {
  color: var(--primary);
  font-size: 13px;
}

.compliance-note {
  margin: 42px 0 0;
  padding-top: 22px;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.detail-status {
  min-height: 420px;
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.detail-status h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.12;
}

.question-layout {
  padding: 52px 0 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.38fr);
  gap: 58px;
  align-items: start;
}

.question-article {
  min-width: 0;
}

.question-header {
  padding-bottom: 42px;
  border-bottom: 1px solid var(--border);
}

.question-meta {
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.question-meta span {
  padding: 6px 10px;
  color: var(--secondary-foreground);
  background: var(--secondary);
  border: 1px solid color-mix(in oklch, var(--primary) 16%, var(--border));
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
}

.question-header h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.42;
}

.option-section,
.answer-section,
.analysis-section {
  padding: 42px 0;
  border-bottom: 1px solid var(--border);
}

.option-section h2,
.answer-section h2,
.analysis-section h2 {
  font-size: 28px;
}

.option-list {
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
  counter-reset: option;
}

.option-list li {
  min-height: 58px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  background: color-mix(in oklch, var(--card) 76%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.65;
  word-break: break-word;
}

.answer-section {
  padding: 36px;
  background: color-mix(in oklch, var(--surface-teal) 58%, var(--card));
  border: 1px solid color-mix(in oklch, var(--accent) 55%, var(--border));
  border-radius: var(--radius);
}

.answer-value {
  margin: 18px 0 0;
  color: var(--accent-foreground, var(--foreground));
  font-size: 25px;
  font-weight: 800;
  line-height: 1.5;
}

.analysis-section > p:not(.category-kicker) {
  margin: 22px 0 0;
  color: var(--muted-foreground);
  font-size: 17px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.analysis-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.question-sidebar {
  display: grid;
  gap: 28px;
}

.compact-panel {
  position: static;
}

.related-question-panel {
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.related-question-panel h2 {
  font-size: 23px;
}

.sidebar-links {
  margin-top: 14px;
  display: grid;
}

.sidebar-links a {
  min-width: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-links a:hover strong {
  color: var(--primary);
}

.sidebar-links span {
  display: block;
  color: var(--muted-foreground);
  font-size: 12px;
}

.sidebar-links strong {
  display: block;
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

@media (max-width: 900px) {
  .detail-hero,
  .detail-layout,
  .question-layout {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    gap: 32px;
  }

  .practice-panel {
    position: static;
  }

  .content-heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .detail-hero {
    padding: 38px 0 34px;
  }

  .detail-hero h1 {
    font-size: 38px;
  }

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

  .chapter-overview div:nth-child(even) {
    padding-left: 0;
  }

  .detail-layout,
  .question-layout {
    padding: 42px 0;
    gap: 38px;
  }

  .featured-question {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .featured-question .text-link {
    grid-column: 2;
  }

  .practice-panel,
  .answer-section {
    padding: 24px 20px;
  }

  .related-links {
    grid-template-columns: 1fr;
  }

  .related-links a {
    border-right: 0;
  }

  .question-header h1 {
    font-size: 29px;
  }

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

  .analysis-actions .button,
  .analysis-actions .secondary-link {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
}
