/* allisai.cn 全站样式表
 *
 * 三条自我约束，改之前先看一眼：
 *   1. 没有一个第三方请求 —— 字体走系统栈，图标与示意图都是内联 SVG，
 *      没有 CDN、没有字体下载、没有统计脚本。
 *   2. 交互脚本只有本站手写的 /assets/site.js，主题偏好只写本机 localStorage，
 *      不上传任何数据；脚本失效时页面内容仍然完整可读。
 *   3. 不引入任何构建工具 —— 这就是最终产物，改完直接刷新页面。
 */

/* ── 变量 ─────────────────────────────────────────── */

:root {
  color-scheme: light;
  --bg:           #f4f0e6;
  --bg-2:         #ece5d6;
  --surface:      #faf7f0;
  --surface-2:    #efe9dc;
  --ink:          #1a1916;
  --ink-soft:     #45413a;
  --muted:        #6d675c;
  --rule:         rgba(26, 25, 22, 0.14);
  --rule-strong:  rgba(26, 25, 22, 0.28);
  --accent:       #1d4ed8;
  --accent-2:     #b8431f;
  --accent-ink:   #ffffff;
  --mark:         rgba(242, 214, 117, 0.55);
  --code-bg:      #1b1916;
  --code-fg:      #f1ebde;
  --code-rule:    rgba(255, 255, 255, 0.12);
  --code-inline-bg: rgba(26, 25, 22, 0.07);
  --code-inline-fg: #171512;
  --wash-1:       rgba(184, 67, 31, 0.08);
  --wash-2:       rgba(29, 78, 216, 0.07);
  --band:         #1a1916;
  --band-ink:     #f4f0e6;
  --band-muted:   #b7b0a2;
  --band-rule:    rgba(244, 240, 230, 0.18);
  --band-accent:  #9db3ff;
  --bg-glass:     rgba(244, 240, 230, 0.82);
  --shadow:       0 30px 70px -45px rgba(26, 25, 22, 0.55);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               "Noto Sans CJK SC", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
                "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC",
                "STSong", "SimSun", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
               "Liberation Mono", monospace;
  --measure: 44rem;
  --wide: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:           #12110f;
    --bg-2:         #0b0a09;
    --surface:      #1a1815;
    --surface-2:    #211e1a;
    --ink:          #f0ece2;
    --ink-soft:     #cdc6b8;
    --muted:        #a39b8c;
    --rule:         rgba(240, 236, 226, 0.14);
    --rule-strong:  rgba(240, 236, 226, 0.28);
    --accent:       #8ea8ff;
    --accent-2:     #ff9a70;
    --accent-ink:   #12110f;
    --mark:         rgba(142, 168, 255, 0.24);
    --code-bg:      #0c0b0a;
    --code-fg:      #f0ece2;
    --code-rule:    rgba(240, 236, 226, 0.12);
    --code-inline-bg: rgba(240, 236, 226, 0.10);
    --code-inline-fg: #f0ece2;
    --wash-1:       rgba(255, 154, 112, 0.06);
    --wash-2:       rgba(142, 168, 255, 0.07);
    --band:         #1c1916;
    --band-ink:     #f0ece2;
    --band-muted:   #a39b8c;
    --band-rule:    rgba(240, 236, 226, 0.14);
    --band-accent:  #8ea8ff;
    --bg-glass:     rgba(18, 17, 15, 0.82);
    --shadow:       0 30px 70px -40px rgba(0, 0, 0, 0.8);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:           #12110f;
  --bg-2:         #0b0a09;
  --surface:      #1a1815;
  --surface-2:    #211e1a;
  --ink:          #f0ece2;
  --ink-soft:     #cdc6b8;
  --muted:        #a39b8c;
  --rule:         rgba(240, 236, 226, 0.14);
  --rule-strong:  rgba(240, 236, 226, 0.28);
  --accent:       #8ea8ff;
  --accent-2:     #ff9a70;
  --accent-ink:   #12110f;
  --mark:         rgba(142, 168, 255, 0.24);
  --code-bg:      #0c0b0a;
  --code-fg:      #f0ece2;
  --code-rule:    rgba(240, 236, 226, 0.12);
  --code-inline-bg: rgba(240, 236, 226, 0.10);
  --code-inline-fg: #f0ece2;
  --wash-1:       rgba(255, 154, 112, 0.06);
  --wash-2:       rgba(142, 168, 255, 0.07);
  --band:         #1c1916;
  --band-ink:     #f0ece2;
  --band-muted:   #a39b8c;
  --band-rule:    rgba(240, 236, 226, 0.14);
  --band-accent:  #8ea8ff;
  --bg-glass:     rgba(18, 17, 15, 0.82);
  --shadow:       0 30px 70px -40px rgba(0, 0, 0, 0.8);
}

/* ── 基础 ─────────────────────────────────────────── */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(70rem 45rem at 92% -12%, var(--wash-1), transparent 62%),
    radial-gradient(55rem 38rem at -18% 22%, var(--wash-2), transparent 58%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--rule-strong);
}
a:hover { text-decoration-color: currentColor; }

img, svg { max-width: 100%; }

/* ── 布局 ─────────────────────────────────────────── */

.wrap,
.wrap-wide {
  width: 100%;
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 1.6rem);
}
.wrap { max-width: var(--measure); }
.wrap-wide { max-width: var(--wide); }
.site-head .wrap,
.site-foot .wrap { max-width: var(--wide); }

/* ── 页头 ─────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.site-head.is-scrolled {
  border-color: var(--rule-strong);
  box-shadow: 0 12px 32px -26px rgba(0, 0, 0, 0.55);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 1rem 1.6rem;
  min-height: 4.35rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.brand::before {
  content: "";
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.38rem;
  background: linear-gradient(135deg, var(--ink) 0 56%, var(--accent) 56% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.brand:hover { text-decoration: none; }

.site-head nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(0.8rem, 2vw, 1.35rem);
}
.site-head nav a {
  position: relative;
  padding: 0.3rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}
.site-head nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0.02rem;
  height: 1px;
  background: var(--accent);
  transition: right 0.25s ease;
}
.site-head nav a:hover,
.site-head nav a[aria-current="page"] { color: var(--ink); }
.site-head nav a:hover::after,
.site-head nav a[aria-current="page"]::after { right: 0; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.theme-toggle:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.theme-toggle svg { width: 0.95rem; height: 0.95rem; display: block; }
.theme-toggle .icon-sun { display: none; }

:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.55rem 0.95rem;
  border-radius: 0.5rem;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  transform: translateY(-220%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: none; }

/* ── 正文基础 ─────────────────────────────────────── */

main { padding-bottom: 3.5rem; }

h1, h2, h3, h4 { color: var(--ink); }

h1 {
  margin: 0 0 1rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

h2 {
  margin: 2.7rem 0 0.8rem;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

h3 {
  margin: 1.9rem 0 0.5rem;
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.5;
}

p { margin: 0.9rem 0; }
ul, ol { padding-left: 1.35rem; }
li { margin: 0.35rem 0; }
strong { font-weight: 650; }
em { font-style: italic; }

.lede {
  max-width: 42rem;
  margin: 0 0 1.6rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1.9;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 1.4rem 0 2rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.meta time { font-variant-numeric: tabular-nums; }
.meta .meta-extra { color: var(--muted); }

main.article-page { counter-reset: section; }
main.article-page h2 {
  counter-increment: section;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}
main.article-page h2::before {
  content: counter(section, decimal-leading-zero);
  display: inline-block;
  margin-right: 0.7rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: 0.08em;
  vertical-align: 0.18em;
}

hr {
  margin: 2.8rem 0;
  border: 0;
  text-align: center;
}
hr::after {
  content: "◆ ◆ ◆";
  display: block;
  color: var(--muted);
  font-size: 0.5rem;
  letter-spacing: 0.6em;
}

/* ── 文章列表 ─────────────────────────────────────── */

.posts {
  list-style: none;
  margin: 1.8rem 0 0;
  padding: 0;
}
.posts li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.15rem 1.5rem;
  padding: 1.45rem 0;
  border-top: 1px solid var(--rule);
}
.posts li:last-child { border-bottom: 1px solid var(--rule); }
.posts .date {
  grid-column: 1;
  grid-row: 1;
  padding-top: 0.35rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.posts a {
  grid-column: 2;
  grid-row: 1;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}
.posts a:hover { color: var(--accent); }
.posts .desc {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

/* ── 代码、表格、引用 ─────────────────────────────── */

code, pre {
  font-family: var(--font-mono);
  font-size: 0.86em;
}
code {
  padding: 0.12em 0.38em;
  border-radius: 0.3em;
  background: var(--code-inline-bg);
  color: var(--code-inline-fg);
}
pre {
  position: relative;
  margin: 1.3rem 0;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--code-rule);
  border-radius: 0.85rem;
  background: var(--code-bg);
  color: var(--code-fg);
  line-height: 1.7;
}
pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: 0.92em;
}

.copy-code {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}
pre:hover .copy-code,
.copy-code:focus-visible { opacity: 1; }
.copy-code:hover { background: rgba(255, 255, 255, 0.14); }
@media (hover: none) { .copy-code { opacity: 1; } }

table {
  width: 100%;
  margin: 1.3rem 0;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
th { background: var(--surface-2); font-weight: 600; }
.table-scroll { overflow-x: auto; }

blockquote {
  margin: 1.4rem 0;
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--accent);
  border-radius: 0 0.6rem 0.6rem 0;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

/* ── 页脚 ─────────────────────────────────────────── */

.site-foot {
  margin-top: 0;
  padding: 2.6rem 0 2.4rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
}
.site-foot p { margin: 0.2rem 0; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; }

/* ── 首页：英雄区 ─────────────────────────────────── */

.home { padding-bottom: 0; }
.hero { padding: clamp(3.2rem, 8vw, 7rem) 0 clamp(2.8rem, 6vw, 5rem); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(17rem, 0.88fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero-copy { min-width: 0; }
.hero h1 {
  margin: 1.2rem 0 1.4rem;
  font-size: clamp(2.4rem, 5.2vw, 4.15rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
}
.hero .lede {
  max-width: 34rem;
  margin: 0;
  font-size: clamp(1.02rem, 1.3vw, 1.14rem);
  line-height: 1.9;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 2rem 0 0;
}

.mark {
  background: linear-gradient(transparent 58%, var(--mark) 58%, var(--mark) 94%, transparent 94%);
  padding: 0 0.08em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 1px;
  background: var(--accent);
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease,
              border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-ghost {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); }
.btn .arr { transition: transform 0.2s ease; }
.btn:hover .arr { transform: translateX(2px); }

.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 2.2rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}
.stats > div {
  padding: 0 1.4rem;
  border-right: 1px solid var(--rule);
}
.stats > div:first-child { padding-left: 0; }
.stats > div:last-child { padding-right: 0; border-right: 0; }
.stats dt {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.stats dd {
  margin: 0.25rem 0 0;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}
.stats dd small {
  margin-left: 0.25rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0;
}

/* ── 首页：索引卡片 ───────────────────────────────── */

.index-card {
  position: relative;
  max-width: 23rem;
  margin-left: auto;
  padding: 1.35rem 1.4rem 1.2rem;
  border: 1px solid var(--rule-strong);
  border-radius: 1.1rem;
  background: var(--surface);
  box-shadow:
    -8px 8px 0 -1px var(--surface-2),
    -8px 8px 0 0 var(--rule),
    var(--shadow);
  transform: rotate(2.2deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.5s ease;
}
.index-card:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow:
    -10px 10px 0 -1px var(--surface-2),
    -10px 10px 0 0 var(--rule),
    var(--shadow);
}
.index-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.index-figure {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 1.05rem 0 0.8rem;
}
.index-number {
  color: var(--ink);
  font-size: clamp(3.8rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.07em;
}
.index-unit {
  padding-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}
.index-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}
.index-list li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.82rem;
}
.index-list .n {
  width: 1.2rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}
.index-list .t { flex: 1; }
.index-list .c {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}
.index-route { margin: 0.9rem 0 0.3rem; color: var(--ink-soft); }
.index-route svg { display: block; width: 100%; height: auto; }
.index-route text {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.04em;
}
.index-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.route-line {
  animation: dashmove 2.8s linear infinite;
}
@keyframes dashmove { to { stroke-dashoffset: -16; } }

/* ── 首页：跑马灯 ─────────────────────────────────── */

.ticker {
  overflow: hidden;
  border-top: 1px solid var(--rule);
  background: var(--surface);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-group {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 0.85rem 2.5rem 0.85rem 0;
}
.ticker-item {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ticker-item::before {
  content: "◆";
  margin-right: 0.8rem;
  color: var(--accent);
  font-size: 0.5rem;
  vertical-align: 0.18em;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── 首页：区块 ───────────────────────────────────── */

.section {
  padding: clamp(3.8rem, 8vw, 7rem) 0;
  border-top: 1px solid var(--rule);
}
.section-head {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: 0.6rem 3rem;
  align-items: start;
  margin-bottom: clamp(2rem, 4vw, 3.4rem);
}
.section-head .eyebrow {
  grid-column: 1;
  grid-row: 1;
  margin-top: 0.45rem;
}
.section-head h2 {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.section-head .section-lede {
  grid-column: 2;
  grid-row: 2;
  max-width: 38rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* 方法步骤 */

.method-grid {
  display: grid;
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}
.step-list { border-bottom: 1px solid var(--rule); }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.9rem;
  width: 100%;
  margin: 0;
  padding: 1.1rem 0.25rem 1.1rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
  background: none;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
}
.step::before {
  content: "";
  position: absolute;
  top: 1.15rem;
  bottom: 1.15rem;
  left: -1.25rem;
  width: 2px;
  background: transparent;
  transition: background 0.2s ease;
}
.step[aria-selected="true"] { color: var(--ink); }
.step[aria-selected="true"]::before { background: var(--accent); }
.step-num {
  padding-top: 0.35rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}
.step[aria-selected="true"] .step-num { color: var(--accent); }
.step strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.step small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.step-panels { display: grid; gap: 1rem; min-width: 0; }
.step-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(15rem, 0.95fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.4rem, 3vw, 2.5rem);
  border: 1px solid var(--rule);
  border-radius: 1.1rem;
  background: var(--surface);
}
.step-panel[hidden] { display: none; }
.step-panel.is-entering {
  animation: panel-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
}
.step-kicker {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}
.step-panel h3 {
  margin: 0 0 0.9rem;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.3;
}
.step-panel p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.step-question {
  margin: 1.2rem 0;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 2px solid var(--accent);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.05rem;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 500;
}
.step-figure {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.9rem;
  background: var(--bg-2);
}
.step-figure svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 22rem;
  margin-inline: auto;
  overflow: visible;
}
.step-figure figcaption {
  margin-top: 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.diagram-ink { stroke: var(--ink-soft); }
.diagram-accent { stroke: var(--accent); }
.diagram-soft { stroke: var(--rule-strong); }
.diagram-fill { fill: var(--surface); }
.diagram-fill-soft { fill: var(--surface-2); }
.diagram-fill-accent { fill: var(--accent); }
.diagram-text {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}
.diagram-title {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
}
.diagram-small {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}
.diagram-check { stroke: var(--accent); }

/* 三个方向 */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: var(--surface);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.topic-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.topic-card:hover {
  transform: translateY(-5px);
  border-color: var(--rule-strong);
  box-shadow: 0 26px 55px -36px rgba(0, 0, 0, 0.4);
}
.topic-card:hover::before { transform: scaleX(1); }
.topic-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.topic-num {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}
.topic-icon { width: 2rem; height: 2rem; color: var(--accent); flex: none; }
.topic-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}
.topic-card h3 a { color: var(--ink); text-decoration: none; }
.topic-card h3 a:hover { color: var(--accent); }
.topic-card > p {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
}
.topic-links {
  margin: 0 0 1.4rem;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}
.topic-links li { margin: 0; border-bottom: 1px solid var(--rule); }
.topic-links a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-decoration: none;
}
.topic-links a:hover { color: var(--accent); }
.topic-links a span {
  flex: none;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.2s ease;
}
.topic-links a:hover span {
  color: var(--accent);
  transform: translate(2px, -2px);
}
.topic-all {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.topic-all:hover { color: var(--accent); }

/* 原则横幅 */

.band {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
  background: var(--band);
  color: var(--band-ink);
}
.band .eyebrow { color: var(--band-muted); }
.band .eyebrow::before { background: var(--band-accent); }
.band-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: 1.5rem 3rem;
  align-items: end;
  margin: 1rem 0 3rem;
}
.band h2 {
  margin: 0;
  color: var(--band-ink);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.band-head p {
  margin: 0;
  color: var(--band-muted);
  font-size: 0.92rem;
  line-height: 1.85;
}
.band-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--band-rule);
}
.band-item {
  padding: 1.2rem 1.5rem 0 0;
  border-right: 1px solid var(--band-rule);
}
.band-item:last-child { border-right: 0; padding-right: 0; }
.band-num {
  color: var(--band-accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}
.band-item h3 {
  margin: 0.6rem 0 0.4rem;
  color: var(--band-ink);
  font-size: 1rem;
}
.band-item p {
  margin: 0;
  color: var(--band-muted);
  font-size: 0.84rem;
  line-height: 1.75;
}

/* ── 文章页：步骤导航 ─────────────────────────────── */

.article-toc {
  margin: 1.7rem 0 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.toc-title {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.article-toc ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.article-toc li { margin: 0; }
.article-toc a {
  display: inline-flex;
  gap: 0.45rem;
  padding: 0.15rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}
.article-toc a:hover { color: var(--ink); }
.article-toc .toc-num {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}
.article-toc a.is-active { color: var(--accent); }
.article-toc a.is-active .toc-text { text-decoration: underline; text-underline-offset: 0.2em; }

@media (min-width: 78rem) {
  .article-toc {
    position: fixed;
    top: 7rem;
    left: max(1rem, calc(50% - 34rem));
    width: 12rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    margin: 0;
    padding: 0;
    border-top: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  .article-toc.is-out { opacity: 0; visibility: hidden; }
  .article-toc ol { display: block; }
  .article-toc li { border-top: 1px solid var(--rule); }
  .article-toc li:last-child { border-bottom: 1px solid var(--rule); }
  .article-toc a {
    display: flex;
    padding: 0.55rem 0;
    font-size: 0.8rem;
    line-height: 1.5;
  }
  .article-toc a.is-active { color: var(--accent); }
}

/* ── 进度条、回到顶部 ─────────────────────────────── */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.08s linear;
  pointer-events: none;
}

.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 70;
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.to-top svg { width: 1rem; height: 1rem; }

/* ── 入场动画 ─────────────────────────────────────── */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ── 响应式 ───────────────────────────────────────── */

@media (max-width: 68rem) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.6rem; }
  .index-card { margin: 0 auto; }
}

@media (max-width: 72rem) {
  .method-grid { grid-template-columns: 1fr; }
  .step-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 0;
  }
  .step { padding-right: 1rem; }
  .step::before { display: none; }
  .step[aria-selected="true"] { color: var(--ink); }
}

@media (max-width: 62rem) {
  .step-panel { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band-item { padding-right: 1.2rem; }
  .band-item:nth-child(2n) { border-right: 0; padding-right: 0; }
  .band-item:nth-child(n + 3) { border-top: 1px solid var(--band-rule); margin-top: 0.5rem; }
}

@media (max-width: 48rem) {
  body { background-attachment: scroll; }
  .section-head { grid-template-columns: 1fr; gap: 0.45rem; }
  .section-head .eyebrow { grid-column: 1; grid-row: 1; margin-top: 0; }
  .section-head h2 { grid-column: 1; grid-row: 2; }
  .section-head .section-lede { grid-column: 1; grid-row: 3; }
  .step-list { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
  .band-head { grid-template-columns: 1fr; gap: 1rem; }
  .band-grid { grid-template-columns: 1fr; }
  .band-item,
  .band-item:nth-child(2n) {
    padding-right: 0;
    border-right: 0;
    border-top: 1px solid var(--band-rule);
    padding-top: 1rem;
  }
  .band-item:first-child { border-top: 0; }
  .stats > div { padding: 0 1rem; }
}

@media (max-width: 34rem) {
  .site-head .wrap { flex-wrap: wrap; padding-block: 0.6rem; }
  .site-head nav {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .brand { font-size: 1.05rem; }
  .hero h1 { font-size: clamp(1.9rem, 9.5vw, 2.8rem); }
  .index-card {
    transform: none;
    box-shadow: 0 22px 50px -35px rgba(0, 0, 0, 0.45);
  }
  .index-card:hover { transform: translateY(-2px); }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .stats { gap: 0.9rem 0; }
  .stats > div { flex: 1 1 30%; border-right: 0; padding: 0; }
  .posts li { grid-template-columns: 1fr; }
  .posts .date { grid-column: 1; grid-row: 1; padding-top: 0; }
  .posts a { grid-column: 1; grid-row: 2; }
  .posts .desc { grid-column: 1; grid-row: 3; }
  .site-foot .wrap { display: block; }
}

/* ── 降低动态效果 ─────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track,
  .route-line,
  .step-panel.is-entering { animation: none; }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn,
  .topic-card,
  .index-card { transition: none; }
}

/* ── 打印 ─────────────────────────────────────────── */

@media print {
  .site-head,
  .site-foot,
  .article-toc,
  .to-top,
  .scroll-progress,
  .copy-code,
  .ticker { display: none !important; }
  body {
    background: #fff !important;
    color: #000;
  }
  a { color: #000; }
}
