/* 佳码阁 DevTech — 深蓝技术手册（全站美化） */
:root {
  --brand: #165DFF;
  --brand-soft: #3b7cff;
  --brand-ink: #0a2a7a;
  --bg: #eef3fb;
  --bg-elev: #ffffff;
  --bg-alt: #e4ecf8;
  --text: #121c2e;
  --muted: #5a6b86;
  --line: #cfd9ea;
  --star: #165DFF;
  --star-empty: #d5dbe8;
  --risk: #8a6d00;
  --risk-bg: #fff7d9;
  --shadow: 0 20px 50px rgba(18, 28, 46, 0.08);
  --shadow-sm: 0 8px 24px rgba(18, 28, 46, 0.06);
  --radius: 16px;
  --radius-sm: 12px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --header-h: 72px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elev: #121b2c;
  --bg-alt: #172235;
  --text: #e8eefc;
  --muted: #97a6c0;
  --line: #243247;
  --risk-bg: #3a320f;
  --risk: #f0d56a;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
  --star-empty: #3a465c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 8% -8%, rgba(22, 93, 255, 0.16), transparent 58%),
    radial-gradient(900px 420px at 100% 0%, rgba(22, 93, 255, 0.1), transparent 52%),
    radial-gradient(700px 360px at 70% 100%, rgba(22, 93, 255, 0.06), transparent 55%),
    linear-gradient(180deg, transparent, transparent),
    radial-gradient(rgba(22, 93, 255, 0.045) 1px, transparent 1px);
  background-size: auto, auto, auto, auto, 22px 22px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--brand-soft); }
img { max-width: 100%; height: auto; display: block; }
.container { width: min(1160px, calc(100% - 2.2rem)); margin: 0 auto; }
.narrow { width: min(760px, calc(100% - 2.2rem)); margin-left: auto; margin-right: auto; }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: .55rem 1rem; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px) saturate(1.2);
  background: color-mix(in srgb, var(--bg-elev) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  transition: box-shadow .3s var(--ease), background .3s var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(18, 28, 46, 0.08);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: var(--header-h);
}
.brand {
  display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; color: inherit; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand-soft), var(--brand-ink));
  color: #fff; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 8px 18px rgba(22, 93, 255, 0.28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; }
.brand-text small { color: var(--muted); font-size: .7rem; letter-spacing: .04em; }

.site-nav {
  display: flex; flex-wrap: wrap; gap: .1rem .85rem;
  margin-left: .4rem; flex: 1;
}
.site-nav a {
  color: var(--muted); font-size: .9rem; font-weight: 500;
  padding: .3rem 0; text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.site-nav a:hover, .site-nav a.active {
  color: var(--text); border-bottom-color: var(--brand); text-decoration: none;
}

.header-actions { display: flex; align-items: center; gap: .55rem; }
.search-form input {
  width: 190px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, var(--bg-elev));
  color: var(--text); border-radius: 999px; padding: .5rem 1rem; font: inherit;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.search-form input:focus {
  outline: none; border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12);
}
.search-form-lg { display: flex; gap: .65rem; margin-bottom: 1.6rem; }
.search-form-lg input { flex: 1; border-radius: 14px; padding: .85rem 1.1rem; width: auto; }
.theme-toggle, .nav-toggle {
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--text);
  border-radius: 11px; width: 40px; height: 40px; cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.theme-toggle:hover, .nav-toggle:hover { transform: translateY(-1px); border-color: var(--brand); }
.nav-toggle { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.nav-toggle span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; }

/* Hero */
.hero {
  position: relative; min-height: calc(100vh - var(--header-h));
  display: grid; align-items: center; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(115deg, rgba(8, 14, 28, 0.72) 8%, rgba(12, 30, 70, 0.45) 48%, rgba(22, 93, 255, 0.28) 100%),
    url("/static/images/content/hero-jiamage.jpg") center/cover no-repeat;
  transform: scale(1.03);
  animation: heroDrift 20s ease-in-out infinite alternate;
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(8, 14, 28, 0.35));
}
@keyframes heroDrift {
  from { transform: scale(1.03) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.8%, 1.2%, 0); }
}
.hero-inner {
  position: relative; z-index: 1; padding: 4.5rem 0 5.5rem; color: #f5f8ff;
  animation: rise .9s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
.eyebrow {
  text-transform: uppercase; letter-spacing: .16em; font-size: .76rem;
  opacity: .88; font-weight: 500;
}
.brand-hero {
  font-family: var(--serif); font-size: clamp(3.2rem, 8.5vw, 5.8rem);
  margin: .45rem 0 .7rem; letter-spacing: .01em; font-weight: 700;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.hero-lead {
  max-width: 36rem; font-size: clamp(1.05rem, 2vw, 1.22rem);
  opacity: .94; line-height: 1.65;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.85rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .78rem 1.25rem; border-radius: 13px; font-weight: 600;
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary {
  background: #fff; color: var(--brand-ink);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.btn-primary:hover { background: #eef3ff; color: var(--brand-ink); }
.btn-ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.42); }
.btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; }

/* Sections */
.section { padding: 4rem 0; }
.section-alt {
  position: relative;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-alt) 55%, transparent), color-mix(in srgb, var(--bg-alt) 80%, transparent));
}
.section-head { margin-bottom: .4rem; }
.section-head h2, .page-head h1, .sub-title, .page-head-inner h1 {
  font-family: var(--serif); margin: 0 0 .45rem; letter-spacing: .01em; font-weight: 700;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-head p, .page-head p, .muted { color: var(--muted); }
.page-head { padding: 2.6rem 0 0; }
.hint { font-size: .9rem; color: var(--muted); }

.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* Module grid */
.module-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin-top: 1.6rem;
}
.module-link {
  display: block; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  color: inherit; text-decoration: none;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.module-link:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
}
.module-cover {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  background: var(--bg-alt);
  transition: transform .6s var(--ease);
}
.module-link:hover .module-cover { transform: scale(1.05); }
.module-copy { display: block; padding: 1.05rem 1.15rem 1.2rem; }
.module-copy strong { display: block; font-weight: 650; font-size: 1.06rem; margin-bottom: .2rem; }
.module-copy small { color: var(--muted); letter-spacing: .01em; }

/* Page cover heads */
.page-head-cover {
  position: relative; padding: 0; overflow: hidden;
  min-height: 260px; display: grid; align-items: end;
}
.page-cover {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.02);
  animation: heroDrift 22s ease-in-out infinite alternate;
}
.page-cover::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(120deg, rgba(8,14,28,.55), rgba(8,14,28,.35)),
    linear-gradient(180deg, rgba(8,14,28,.15), rgba(8,14,28,.82));
}
.page-head-inner { position: relative; z-index: 1; padding: 3.4rem 0 1.8rem; color: #f5f8ff; }
.page-head-inner h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-head-inner p { color: rgba(245,248,255,.88); max-width: 46rem; }

/* Article cards */
.article-list { list-style: none; padding: 0; margin: 1.1rem 0; }
.article-list-cards { display: grid; gap: 1rem; }
.article-list-cards > li { border-bottom: 0; padding: 0; }
.article-card {
  display: grid; grid-template-columns: 180px 1fr; gap: 1rem;
  padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-elev); color: inherit; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.article-card:hover {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; color: inherit;
}
.article-card img {
  width: 100%; height: 118px; object-fit: cover; border-radius: 12px; background: var(--bg-alt);
}
.article-card-body { display: flex; flex-direction: column; gap: .28rem; min-width: 0; padding: .15rem .2rem .15rem 0; }
.article-card-body strong { font-size: 1.04rem; line-height: 1.4; }
.article-card-body em { font-style: normal; color: var(--muted); font-size: .8rem; }
.article-card-body p {
  margin: 0; color: var(--muted); font-size: .9rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.article-cover {
  margin: 1.25rem 0 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.article-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.split { display: grid; grid-template-columns: 1.35fr .9fr; gap: 2.6rem; align-items: start; }
.article-list li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.article-list a { display: flex; justify-content: space-between; gap: 1rem; color: inherit; text-decoration: none; }
.article-list a strong { font-size: 1.05rem; }
.article-list a span { color: var(--muted); white-space: nowrap; font-size: .85rem; }
.article-list p { margin: .35rem 0 0; color: var(--muted); }
.text-link {
  font-weight: 650; display: inline-flex; align-items: center; gap: .25rem;
  margin-top: .4rem; white-space: nowrap;
}
.text-link:hover { gap: .45rem; }

.section-head-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.4rem;
}
.section-head-row .text-link { margin-top: 0; margin-bottom: .35rem; }

/* 首页：最新文章 */
.home-article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
.home-article {
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease);
}
.home-article:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}
.home-article img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--bg-alt);
}
.home-article-body {
  display: flex; flex-direction: column; gap: .4rem;
  padding: 1rem 1.05rem 1.15rem;
  flex: 1;
}
.home-article-body em {
  font-style: normal; color: var(--muted); font-size: .78rem; letter-spacing: .02em;
}
.home-article-body strong {
  font-size: 1.05rem; line-height: 1.4; font-weight: 650;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.home-article-body p {
  margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 首页：工具速览 */
.home-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .85rem;
}
.home-tool {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.home-tool:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}
.home-tool-rank {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 1rem;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--bg-alt));
}
.home-tool:nth-child(1) .home-tool-rank {
  color: #fff; background: linear-gradient(145deg, var(--brand-soft), var(--brand-ink));
}
.home-tool:nth-child(2) .home-tool-rank,
.home-tool:nth-child(3) .home-tool-rank {
  background: color-mix(in srgb, var(--brand) 18%, var(--bg-alt));
}
.home-tool-main { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.home-tool-main strong {
  font-size: 1.02rem; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-tool-main small { color: var(--muted); font-size: .8rem; }
.home-tool-score {
  text-align: right; display: flex; flex-direction: column; gap: .1rem; line-height: 1.1;
}
.home-tool-score b {
  font-family: var(--mono); font-size: 1.25rem; color: var(--brand); font-weight: 700;
}
.home-tool-score i {
  font-style: normal; font-size: .72rem; color: var(--muted); letter-spacing: .02em;
}

.tool-mini-list {
  list-style: none; padding: .2rem; margin: 1rem 0;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.tool-mini-list li { padding: .95rem 1rem; border-bottom: 1px solid var(--line); }
.tool-mini-list li:last-child { border-bottom: 0; }
.tool-mini-list a { display: flex; justify-content: space-between; color: inherit; text-decoration: none; gap: .6rem; }
.tool-mini-list a:hover { color: var(--brand); }
.tool-mini-list em {
  font-style: normal; background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand); padding: .12rem .5rem; border-radius: 8px; font-weight: 700; font-family: var(--mono); font-size: .85rem;
}
.tool-mini-list small { display: block; color: var(--muted); margin-top: .3rem; }

/* Module layout */
.module-layout { display: grid; grid-template-columns: 230px 1fr; gap: 2rem; }
.side-nav {
  display: flex; flex-direction: column; gap: .3rem;
  position: sticky; top: calc(var(--header-h) + 1rem); align-self: start;
  padding: .55rem; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.side-nav a {
  padding: .6rem .8rem; border-radius: 10px; color: var(--muted); text-decoration: none;
  font-size: .92rem; transition: background .2s var(--ease), color .2s var(--ease);
}
.side-nav a.active, .side-nav a:hover { background: color-mix(in srgb, var(--brand) 10%, var(--bg-alt)); color: var(--text); }
.sub-title { font-size: 1.45rem; margin-top: .2rem; }

.filter-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.4rem 0 1.3rem; }
.chip {
  padding: .42rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); background: var(--bg-elev); text-decoration: none; font-size: .88rem; font-weight: 500;
  transition: all .2s var(--ease);
}
.chip.active, .chip:hover {
  color: #fff; background: var(--brand); border-color: var(--brand); text-decoration: none;
  box-shadow: 0 8px 18px rgba(22, 93, 255, 0.25);
}

.table-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-elev); box-shadow: var(--shadow-sm);
}
.data-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.data-table th, .data-table td { padding: .95rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th {
  position: sticky; top: 0; background: color-mix(in srgb, var(--bg-alt) 90%, var(--bg-elev));
  font-size: .82rem; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); font-weight: 650;
}
.data-table tbody tr { transition: background .2s var(--ease); }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.data-table td small { display: block; color: var(--muted); margin-top: .25rem; }
.data-table .num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .9rem; }

.star-rater { display: inline-flex; gap: 1px; }
.star-rater button {
  border: 0; background: transparent; color: var(--star-empty);
  font-size: 17px; cursor: pointer; padding: 0 1px; line-height: 1;
  transition: color .15s var(--ease), transform .15s var(--ease);
}
.star-rater:not(.disabled) button:hover { transform: scale(1.12); }
.star-rater button:hover,
.star-rater button.is-on,
.star-rater:not(.disabled) button:hover ~ button { color: var(--star-empty); }
.star-rater:not(.disabled) button:hover,
.star-rater:not(.disabled):hover button.is-preview { color: var(--star); }
.star-rater.disabled button { color: var(--star-empty); cursor: not-allowed; opacity: .55; }
.score-cell .avg { font-weight: 700; font-family: var(--mono); }
.score-cell .cnt { color: var(--muted); font-size: .85rem; }

.recommend-box { margin-top: 2.2rem; display: grid; gap: .9rem; }
.recommend-item {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm);
}
.recommend-item h3 { margin: 0 0 .55rem; font-family: var(--serif); font-size: 1.2rem; }
.recommend-item p { margin: .35rem 0; color: var(--muted); }
.recommend-item strong { color: var(--text); }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 2.2rem; padding: 2.2rem 0 3.2rem; }
.article-head h1 {
  font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.65rem);
  margin: .35rem 0 .7rem; line-height: 1.25;
}
.article-meta { display: flex; flex-wrap: wrap; gap: .75rem 1.1rem; color: var(--muted); font-size: .88rem; }
.article-summary {
  margin-top: 1.1rem; padding: 1rem 1.1rem; border-left: 3px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--bg-alt)); border-radius: 0 12px 12px 0;
}
.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.tag {
  font-size: .76rem; padding: .18rem .6rem; border-radius: 999px; font-weight: 500;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
}
.toc-panel {
  position: sticky; top: calc(var(--header-h) + 1rem); align-self: start;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.1rem;
  background: var(--bg-elev); max-height: calc(100vh - var(--header-h) - 2rem); overflow: auto;
  box-shadow: var(--shadow-sm);
}
.toc-title { margin: 0 0 .65rem; font-weight: 700; font-size: .88rem; letter-spacing: .02em; }
#toc a {
  display: block; color: var(--muted); font-size: .86rem; padding: .32rem 0;
  text-decoration: none; border-left: 2px solid transparent; padding-left: .55rem;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
#toc a:hover, #toc a.active { color: var(--brand); border-left-color: var(--brand); }

.prose { font-size: 1.02rem; }
.prose h2, .prose h3 {
  font-family: var(--serif); scroll-margin-top: calc(var(--header-h) + 14px);
  margin-top: 1.8rem; line-height: 1.3;
}
.prose h2 { font-size: 1.45rem; }
.prose h3 { font-size: 1.2rem; }
.prose p { margin: .85rem 0; }
.prose pre {
  position: relative; background: #0d1524; color: #e6edf7; border-radius: 14px;
  padding: 1.1rem 1.2rem; overflow-x: auto; font-family: var(--mono); font-size: .86rem;
  border: 1px solid rgba(255,255,255,.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.prose code { font-family: var(--mono); font-size: .9em; }
.prose :not(pre) > code {
  background: var(--bg-alt); padding: .12rem .4rem; border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.prose table { width: 100%; border-collapse: collapse; overflow-x: auto; display: block; margin: 1rem 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: .6rem .7rem; }
.prose th { background: var(--bg-alt); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose .risk-box, .risk-box {
  background: var(--risk-bg); color: var(--risk); border-left: 3px solid #e0b000;
  padding: .95rem 1.05rem; border-radius: 0 12px 12px 0; margin: 1.1rem 0;
}
.copy-btn {
  position: absolute; top: .55rem; right: .55rem;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08);
  color: #fff; border-radius: 8px; padding: .25rem .6rem; font-size: .74rem; cursor: pointer;
  transition: background .2s var(--ease);
}
.copy-btn:hover { background: rgba(255,255,255,.16); }

/* About / index pages */
.about-grid { display: grid; gap: 1rem; }
.about-panel {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.35rem 1.4rem; box-shadow: var(--shadow-sm);
}
.about-panel h2 { font-family: var(--serif); margin: 0 0 .7rem; font-size: 1.3rem; }
.about-panel ul { margin: 0; padding-left: 1.15rem; color: var(--muted); }
.about-panel li { margin: .35rem 0; }

.index-block {
  margin-bottom: 1.4rem; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm);
}
.index-block h2 {
  font-family: var(--serif); border-bottom: 1px solid var(--line);
  padding-bottom: .55rem; margin: 0 0 .4rem; font-size: 1.25rem;
}
.index-list { list-style: none; padding: 0; margin: 0; }
.index-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .65rem 0; border-bottom: 1px dashed var(--line);
}
.index-list li:last-child { border-bottom: 0; }
.index-list a { color: inherit; font-weight: 550; text-decoration: none; }
.index-list a:hover { color: var(--brand); }
.index-list time { color: var(--muted); font-size: .84rem; white-space: nowrap; }

.empty {
  color: var(--muted); padding: 2rem 1.2rem; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
}
.meta-foot { color: var(--muted); font-size: .88rem; margin-top: 1.1rem; }
.related { margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.related h2 { font-family: var(--serif); margin: 0 0 1rem; }

/* Footer */
.site-footer {
  position: relative; margin-top: 3rem; padding: 2.4rem 0 2.6rem;
  color: var(--muted); font-size: .9rem;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg-alt) 55%, transparent)),
    radial-gradient(600px 180px at 20% 100%, rgba(22, 93, 255, 0.08), transparent 70%);
}
.footer-brand { color: var(--text); font-family: var(--serif); font-size: 1.2rem; margin: 0 0 .45rem; }
.footer-note { font-size: .82rem; }
.footer-beian {
  margin: 1rem 0 0; font-size: .85rem;
  display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center;
}
.footer-beian a { color: var(--muted); text-decoration: none; }
.footer-beian a:hover { color: var(--brand); text-decoration: underline; }
.footer-domain { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 1.6rem; transform: translateX(-50%) translateY(8px);
  background: #152033; color: #fff; padding: .75rem 1.2rem; border-radius: 999px;
  z-index: 100; box-shadow: var(--shadow); font-size: .92rem;
  opacity: 0; transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
html[data-theme="dark"] .toast { background: #e7eefc; color: #0d1420; }

.site-nav .search-form-mobile { display: none; width: 100%; margin-top: .55rem; }
.site-nav .search-form-mobile input { width: 100%; }

@media (max-width: 1100px) {
  .home-article-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .site-nav, .header-actions .search-form { display: none; }
  .site-nav.open {
    display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: var(--header-h);
    background: color-mix(in srgb, var(--bg-elev) 96%, transparent); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line); padding: 1rem 1.2rem 1.3rem; gap: .55rem;
  }
  .site-nav.open .search-form-mobile { display: block; }
  .module-grid, .split, .module-layout, .article-layout { grid-template-columns: 1fr; }
  .home-article-grid { grid-template-columns: 1fr; }
  .home-tool-grid { grid-template-columns: 1fr; }
  .section-head-row { flex-direction: column; align-items: flex-start; }
  .article-card { grid-template-columns: 1fr; }
  .article-card img { height: 170px; }
  .page-head-cover { min-height: 200px; }
  .toc-panel { position: static; max-height: none; order: -1; }
  .side-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .hero { min-height: 78vh; }
  .star-rater button { font-size: 20px; }
  .section { padding: 3rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg, .page-cover, .reveal, .hero-inner, .module-cover { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
