:root {
  color-scheme: light;
  --ink: #1f2328;
  --muted: #5d6673;
  --line: #d9dee7;
  --paper: #f7f4ec;
  --surface: #ffffff;
  --sage: #496b59;
  --brick: #9a4f3f;
  --blue: #2d5f7a;
  --gold: #b6812f;
  --shadow: 0 18px 55px rgba(31, 35, 40, .08);
}

* {
  box-sizing: border-box;
}

html[data-lang="zh"] .lang-en,
html[data-lang="en"] .lang-zh {
  display: none !important;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(247,244,236,.92)),
    var(--paper);
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.narrow {
  width: min(880px, calc(100% - 40px));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid rgba(31, 35, 40, .08);
  background: rgba(247, 244, 236, .9);
  backdrop-filter: blur(18px);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 35, 40, .08);
  font-family: ui-serif, Georgia, serif;
  color: var(--sage);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

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

.main-nav a {
  text-decoration: none;
}

.language-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.7);
}

.language-toggle button {
  min-width: 42px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

html[data-lang="zh"] [data-lang-switch="zh"],
html[data-lang="en"] [data-lang-switch="en"] {
  background: var(--ink);
  color: #fff;
}

main {
  min-height: calc(100vh - 72px);
}

.hero {
  min-height: 68vh;
  display: grid;
  align-items: center;
  padding: 84px 0 48px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--brick);
  font-size: 13px;
  font-weight: 720;
  text-transform: uppercase;
}

h1 {
  max-width: 860px;
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 8vw, 108px);
  line-height: .98;
  font-weight: 680;
  letter-spacing: 0;
}

.page-title {
  padding: 72px 0 42px;
}

.page-title h1 {
  font-size: clamp(38px, 7vw, 78px);
}

.lead {
  max-width: 760px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.5vw, 23px);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.button,
button.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 680;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  border-color: var(--line);
  background: rgba(255,255,255,.72);
  color: var(--ink);
}

.section {
  padding: 56px 0;
  border-top: 1px solid rgba(31, 35, 40, .1);
}

.section h2,
.content-block h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.grid,
.post-grid,
.tag-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

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

.panel,
.post-card,
.tag-card,
.content-block {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  min-height: 210px;
}

.panel strong,
.post-card .meta,
.tag-card .meta {
  display: block;
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 720;
  text-transform: uppercase;
}

.panel h3,
.post-card h2,
.tag-card h2,
.content-block h3 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.panel p,
.post-card p,
.tag-card p,
.content-block p,
.archive-note p,
.article-body p,
.article-body li {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  color: var(--blue);
  font-size: 13px;
  font-weight: 680;
  text-decoration: none;
}

.article-shell {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 88px;
}

.article-header {
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(31, 35, 40, .1);
}

.article-header h1 {
  font-size: clamp(38px, 7vw, 78px);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

.public-note {
  margin-top: 26px;
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  background: rgba(255,255,255,.66);
  color: var(--muted);
}

.article-body {
  display: grid;
  gap: 28px;
  margin-top: 36px;
}

.content-block {
  box-shadow: none;
}

.essay-block {
  padding: 30px;
  border-color: rgba(73, 107, 89, .38);
  background: rgba(255, 255, 255, .82);
}

.essay-copy {
  display: grid;
  gap: 15px;
  margin-top: 18px;
}

.essay-copy p {
  max-width: 760px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.82;
}

.direction-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.model-card {
  border-color: var(--ink);
  background: #fbfcf8;
}

.flow {
  margin-top: 12px;
  color: var(--sage);
  font-weight: 760;
}

.quote {
  color: var(--brick);
  font-family: ui-serif, Georgia, serif;
  font-size: 22px;
  line-height: 1.35;
}

.discussion-callout {
  border-color: rgba(45, 95, 122, .34);
  background: #f7fbfc;
}

.discussion-callout p {
  color: var(--ink);
  font-weight: 620;
}

.giscus-block {
  background: #fff;
}

.giscus-thread {
  margin-top: 18px;
}

.integration-note {
  padding: 16px 18px;
  border: 1px dashed rgba(45, 95, 122, .38);
  background: #f7fbfc;
  color: var(--muted);
  line-height: 1.6;
}

.archive-note {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 26px 0;
}

.archive-note a {
  color: var(--gold);
  font-weight: 720;
}

.site-footer {
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid rgba(31, 35, 40, .1);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.print-body {
  background: #f3f4f1;
}

.print-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: rgba(247,244,236,.96);
}

.print-toolbar .shell {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.print-sheet {
  width: min(210mm, calc(100% - 24px));
  min-height: 297mm;
  margin: 24px auto;
  padding: 16mm;
  background: #fffdfa;
  box-shadow: 0 12px 36px rgba(31, 35, 40, .12);
}

.print-sheet + .print-sheet {
  break-before: page;
}

.print-sheet h1 {
  font-size: 28pt;
}

.print-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5mm;
  margin-top: 9mm;
}

.print-card {
  padding: 5mm;
  border: 1px solid #ddd5c8;
  background: #fff;
}

.print-card h2 {
  margin: 0 0 3mm;
  font-size: 13pt;
}

.print-card p,
.print-card li {
  font-size: 10.2pt;
  line-height: 1.45;
}

@media print {
  .site-header,
  .site-footer,
  .print-toolbar,
  .no-print {
    display: none !important;
  }

  body,
  .print-body {
    background: #fff;
  }

  .print-sheet {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    page-break-after: always;
  }

  .print-sheet:last-child {
    page-break-after: auto;
  }
}

@media (max-width: 820px) {
  .shell,
  .narrow,
  .article-shell {
    width: min(100% - 28px, 1120px);
  }

  .nav,
  .nav-actions,
  .footer-inner,
  .print-toolbar .shell {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }

  .main-nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 12px;
  }

  .grid,
  .post-grid,
  .tag-grid,
  .direction-list,
  .archive-note,
  .print-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 60vh;
    padding-top: 58px;
  }
}
