:root {
  --paper: #f8fbfa;
  --surface: #ffffff;
  --ink: #20343b;
  --muted: #667b80;
  --line: #d5e2df;
  --blue: #2c7884;
  --blue-soft: #e4f4f4;
  --red: #dd6f52;
  --red-soft: #fff0e9;
  --gold: #b87920;
  --gold-soft: #fff6dc;
  --green: #4f9270;
  --green-soft: #e8f6ed;
  --serif: "Songti SC", "Noto Serif CJK SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --shadow: 0 18px 55px rgba(38, 91, 94, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 68px;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  backdrop-filter: blur(14px);
}
.header-inner {
  width: min(1180px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 11px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .08em;
  white-space: nowrap;
}
.brand-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px var(--red-soft);
}
.top-nav { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 14px; }
.top-nav a:hover, .top-nav a:focus-visible { color: var(--ink); }
.top-nav .count { color: var(--blue); font-variant-numeric: tabular-nums; }

.page-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.masthead {
  padding: 76px 0 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 64px;
  align-items: end;
}
.eyebrow {
  margin: 0 0 22px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(50px, 7.8vw, 104px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.05em;
}
.masthead-copy { padding-bottom: 4px; }
.subtitle {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.55;
}
.explored {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.explored strong { color: var(--ink); font-size: 20px; font-weight: 650; }
.explored-line { width: 54px; height: 1px; background: var(--line); }

.section { padding: 44px 0 70px; }
.section-rule { border-top: 1px solid var(--line); }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.2;
  letter-spacing: -.025em;
}
.section-heading p { margin: 0; color: var(--muted); font-size: 14px; }

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  min-height: 510px;
  background: linear-gradient(135deg, #dff4f3 0%, #eef9f6 52%, #fff0e7 100%);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.featured-copy { padding: clamp(34px, 5vw, 68px); display: flex; flex-direction: column; }
.featured-meta, .article-meta, .card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.featured-meta { color: #58747a; }
.featured h3 {
  margin: 56px 0 18px;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 66px);
  line-height: 1.05;
  letter-spacing: -.04em;
}
.featured .lead { margin: 0 0 36px; max-width: 640px; font-family: var(--serif); font-size: 21px; line-height: 1.65; color: #405d63; }
.read-link { margin-top: auto; display: inline-flex; align-items: center; gap: 12px; width: fit-content; font-size: 14px; font-weight: 650; }
.read-link::after { content: "→"; transition: transform .2s ease; }
.read-link:hover::after { transform: translateX(5px); }
.featured-figure {
  position: relative;
  overflow: hidden;
  padding: 46px;
  background: linear-gradient(155deg, #f8e7da 0%, #fff7ea 100%);
  display: grid;
  place-items: center;
}
.featured-visual { display: block; width: min(560px, 100%); height: auto; }
.route-map { position: relative; width: min(370px, 100%); aspect-ratio: 1 / 1; }
.route-map svg { width: 100%; height: 100%; overflow: visible; }
.route-map .route { fill: none; stroke: #89a8b7; stroke-width: 2; }
.route-map .shortcut { stroke: #e18c7f; stroke-width: 3; stroke-dasharray: 6 7; }
.route-map .node { fill: #f8fbfc; }
.route-map text { fill: #dbe7eb; font-family: var(--sans); font-size: 12px; }
.figure-note { position: absolute; left: 34px; bottom: 28px; color: #6d7774; font-size: 12px; letter-spacing: .05em; }

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}
.filters { display: flex; flex-wrap: wrap; gap: 9px; }
.filter-btn {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 42px;
  cursor: pointer;
  font-size: 14px;
  transition: .18s ease;
}
.filter-btn:hover { border-color: #72aeb5; background: #f0f9f8; }
.filter-btn.active { border-color: var(--blue); background: var(--blue); color: white; }
.search-wrap { position: relative; width: min(330px, 100%); }
.search-wrap::before { content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 20px; }
.search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.result-note { min-height: 24px; margin: -10px 0 16px; color: var(--muted); font-size: 13px; }

.article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.article-card {
  position: relative;
  min-height: 310px;
  padding: 32px 34px 30px 0;
  border-bottom: 1px solid var(--line);
}
.article-card:nth-child(odd) { border-right: 1px solid var(--line); }
.article-card:nth-child(even) { padding-left: 34px; }
.article-number { color: var(--red); font-family: var(--serif); font-size: 13px; letter-spacing: .12em; }
.article-card h3 { margin: 30px 54px 12px 0; font-family: var(--serif); font-size: 31px; line-height: 1.2; }
.article-card .core { margin: 0 0 28px; max-width: 520px; color: #496268; font-size: 16px; }
.article-card .read-link { color: var(--blue); }
.bookmark {
  border: 1px solid var(--line);
  background: transparent;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: .18s ease;
}
.bookmark:hover { border-color: var(--red); color: var(--red); }
.bookmark.saved { background: var(--red-soft); color: var(--red); border-color: #e5b9b1; }
.bookmark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bookmark.saved svg { fill: currentColor; }
.article-card .bookmark { position: absolute; right: 32px; top: 26px; }
.article-card:nth-child(even) .bookmark { right: 0; }
.empty-state { display: none; padding: 54px 0; border-top: 1px solid var(--line); color: var(--muted); }

.category-rail { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.category-tile { min-height: 170px; padding: 25px 22px; background: var(--surface); display: flex; flex-direction: column; transition: background .18s ease; }
.category-tile { border: 0; text-align: left; cursor: pointer; }
.category-tile:hover { background: var(--blue-soft); }
.category-tile span:first-child { color: var(--red); font-family: var(--serif); font-size: 12px; }
.category-tile strong { margin-top: auto; font-family: var(--serif); font-size: 20px; line-height: 1.3; }
.category-tile small { margin-top: 7px; color: var(--muted); font-size: 12px; }

.knowledge-map {
  position: relative;
  min-height: 3000px;
  overflow: hidden;
  background: linear-gradient(145deg, #e3f4f3 0%, #f5fbf7 54%, #fff2e7 100%);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.map-intro { position: absolute; left: 48px; top: 42px; z-index: 2; max-width: 290px; }
.map-intro h3 { margin: 0 0 12px; font-family: var(--serif); font-size: 32px; }
.map-intro p { margin: 0; color: #567077; font-size: 14px; }
.map-canvas { position: absolute; inset: 0; }
.map-canvas svg { width: 100%; height: 100%; }
.map-line { stroke: #78b6b9; stroke-width: 1.6; fill: none; }
.map-line.accent { stroke: #eca083; stroke-dasharray: 4 5; }
.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 104px;
  padding: 10px 13px;
  border: 1px solid #add3d2;
  background: rgba(255, 255, 255, .88);
  color: #36575d;
  text-align: center;
  font-size: 13px;
  transition: .18s ease;
}
.map-node.primary { border-color: #eb997f; background: #ffd9cb; color: #7a3827; font-family: var(--serif); font-size: 15px; box-shadow: 0 8px 20px rgba(221, 111, 82, .13); }
.map-node:hover { border-color: #67aeb3; background: #f7ffff; transform: translate(-50%, -50%) scale(1.03); }
.map-node.primary:hover { border-color: #df7c60; background: #ffcbb9; }

.site-footer { padding: 34px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; }
.footer-inner strong { color: var(--ink); font-family: var(--serif); }

/* Article */
.reading-progress { position: fixed; z-index: 40; left: 0; top: 67px; height: 2px; width: 0; background: var(--red); }
.article-hero { width: min(900px, calc(100% - 48px)); margin: 0 auto; padding: 86px 0 58px; }
.article-hero .article-number { display: block; margin-bottom: 28px; }
.article-hero h1 { margin: 0 0 25px; font-family: var(--serif); font-size: clamp(46px, 7vw, 80px); line-height: 1.08; letter-spacing: -.045em; }
.article-hero .question { margin: 0 0 28px; max-width: 790px; font-family: var(--serif); font-size: clamp(21px, 2.7vw, 29px); line-height: 1.55; color: #476168; }
.article-hero-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.article-layout { width: min(1040px, calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: 200px minmax(0, 740px); gap: 70px; align-items: start; }
.article-toc { position: sticky; top: 104px; padding-top: 10px; }
.toc-title { margin-bottom: 14px; color: var(--muted); font-size: 12px; letter-spacing: .12em; }
.article-toc a { display: block; padding: 6px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.article-toc a:hover, .article-toc a.active { color: var(--red); }
.article-body { padding-bottom: 90px; }
.article-section { padding: 54px 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.section-index { color: var(--red); font-family: var(--serif); font-size: 12px; letter-spacing: .12em; }
.article-section h2 { margin: 10px 0 26px; font-family: var(--serif); font-size: clamp(28px, 4vw, 40px); line-height: 1.3; letter-spacing: -.02em; }
.article-section h3 { margin: 34px 0 12px; font-family: var(--serif); font-size: 22px; }
.article-section p { margin: 0 0 19px; font-size: 17px; line-height: 1.95; }
.article-section ul, .article-section ol { margin: 12px 0 22px; padding-left: 1.4em; }
.article-section li { margin: 9px 0; line-height: 1.8; }
.formula-card {
  margin: 30px 0;
  padding: 28px 30px;
  overflow-x: auto;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  font-family: "Times New Roman", var(--serif);
  font-size: clamp(19px, 3vw, 25px);
  line-height: 1.7;
  color: #245f69;
}
.formula-card math { font-size: 1.08em; }
.formula-caption { display: block; margin-top: 10px; font-family: var(--sans); font-size: 13px; color: #57767b; }
.math-visual {
  margin: 34px 0 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(18, 36, 45, .055);
}
.math-visual img { display: block; width: 100%; height: auto; }
.math-visual figcaption {
  display: flex;
  gap: 13px;
  align-items: baseline;
  padding: 15px 18px 17px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.math-visual figcaption span { flex: 0 0 auto; color: var(--red); font-weight: 700; letter-spacing: .08em; }
.info-card { margin: 26px 0; padding: 25px 28px; border: 1px solid var(--line); background: var(--surface); }
.info-card h3, .info-card h4 { margin: 0 0 11px; font-family: var(--serif); font-size: 19px; }
.info-card p:last-child, .info-card ul:last-child { margin-bottom: 0; }
.info-card.insight { border-color: #afd7d8; background: var(--blue-soft); }
.info-card.boundary { border-color: #ecd49b; background: var(--gold-soft); }
.info-card.analogy { border-color: #b9dcc7; background: var(--green-soft); }
.info-card.strict { border-color: #f0c2b4; background: var(--red-soft); }
.variable-table, .data-table { width: 100%; margin: 26px 0; border-collapse: collapse; background: var(--surface); font-size: 15px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.variable-table th, .variable-table td, .data-table th, .data-table td { padding: 14px 16px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.variable-table th, .data-table th { background: #edf7f5; font-weight: 650; }
.data-table td:not(:first-child), .data-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.step-list { counter-reset: steps; list-style: none; padding: 0 !important; }
.step-list li { position: relative; padding: 5px 0 5px 44px; }
.step-list li::before { counter-increment: steps; content: counter(steps); position: absolute; left: 0; top: 5px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-size: 12px; }
.takeaway { margin-top: 30px; padding: 34px; background: linear-gradient(135deg, #2c7884, #37898c); color: #ffffff; }
.takeaway h3 { margin: 0 0 15px; color: #ffe0d3; font-family: var(--serif); font-size: 18px; }
.takeaway p { margin: 0; font-family: var(--serif); font-size: clamp(20px, 3vw, 26px); line-height: 1.7; }
.takeaway p + p { margin-top: 10px; color: #e4f5f3; }
.article-nav { width: min(1040px, calc(100% - 48px)); margin: 0 auto 80px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.article-nav a { padding: 25px 28px; background: var(--surface); transition: background .18s ease; }
.article-nav .next { border-left: 1px solid var(--line); text-align: right; }
.article-nav a:only-child { grid-column: 1 / -1; border-left: 0; }
.article-nav a:hover { background: var(--blue-soft); }
.article-nav small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.article-nav strong { font-family: var(--serif); font-size: 18px; }

@media (max-width: 900px) {
  .masthead { grid-template-columns: 1fr; gap: 34px; padding-top: 56px; }
  .masthead-copy { max-width: 560px; }
  .featured { grid-template-columns: 1fr; }
  .featured-figure { min-height: 360px; }
  .category-rail { grid-template-columns: repeat(2, 1fr); }
  .category-tile:last-child { grid-column: span 2; }
  .article-layout { grid-template-columns: 1fr; }
  .article-toc { display: none; }
}

@media (max-width: 700px) {
  .site-header { height: 60px; }
  .header-inner, .page-shell { width: min(100% - 30px, 1180px); }
  .top-nav a:not(:last-child) { display: none; }
  .masthead { padding: 48px 0 38px; }
  .masthead h1 { font-size: clamp(52px, 17vw, 78px); line-height: 1.02; }
  .section { padding: 34px 0 54px; }
  .section-heading { align-items: start; flex-direction: column; margin-bottom: 20px; }
  .featured { min-height: 0; }
  .featured-copy { padding: 31px 25px 37px; }
  .featured h3 { margin-top: 38px; font-size: 44px; }
  .featured .lead { font-size: 19px; }
  .featured-figure { min-height: 310px; padding: 34px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .search-wrap { width: 100%; }
  .filters { flex-wrap: nowrap; margin-right: -15px; padding-right: 15px; overflow-x: auto; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter-btn { white-space: nowrap; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card, .article-card:nth-child(even) { min-height: 0; padding: 27px 0 30px; border-right: 0; }
  .article-card .bookmark, .article-card:nth-child(even) .bookmark { right: 0; top: 22px; }
  .article-card h3 { font-size: 28px; }
  .category-rail { grid-template-columns: 1fr; }
  .category-tile, .category-tile:last-child { min-height: 126px; grid-column: auto; }
  .knowledge-map { min-height: auto; padding: 32px 22px; }
  .map-intro { position: static; max-width: none; margin-bottom: 25px; }
  .map-canvas { position: static; display: grid; gap: 10px; }
  .map-canvas svg { display: none; }
  .map-node { position: static !important; transform: none; text-align: left; }
  .map-node:hover { transform: none; }
  .footer-inner { flex-direction: column; }
  .reading-progress { top: 59px; }
  .article-hero { width: min(100% - 30px, 900px); padding: 54px 0 42px; }
  .article-hero .question { font-size: 20px; }
  .article-layout, .article-nav { width: min(100% - 30px, 1040px); }
  .article-section { padding: 42px 0; }
  .article-section p { font-size: 16.5px; line-height: 1.9; }
  .formula-card, .info-card { margin-left: -7px; margin-right: -7px; padding: 22px 19px; }
  .math-visual { margin-left: -7px; margin-right: -7px; }
  .math-visual figcaption { align-items: flex-start; flex-direction: column; gap: 3px; }
  .variable-table, .data-table { display: block; overflow-x: auto; white-space: nowrap; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav .next { border-left: 0; border-top: 1px solid var(--line); }
  .article-nav a:only-child { border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
