:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f7f9fc;
  --surface-strong: #eef4fb;
  --text: #111820;
  --muted: #65707c;
  --line: #dbe2ea;
  --line-strong: #b9c5d2;
  --accent: #087cf0;
  --accent-soft: #e9f3ff;
  --code-bg: #f4f7fa;
  --header-bg: rgba(255, 255, 255, .92);
  --focus: #087cf0;
  --shell: 1440px;
  --reading: 760px;
  --shadow: 0 18px 50px rgba(28, 45, 66, .08);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080c10;
  --surface: #0d1319;
  --surface-strong: #121b24;
  --text: #f3f6f9;
  --muted: #98a4af;
  --line: #27313a;
  --line-strong: #3d4a55;
  --accent: #55a9ff;
  --accent-soft: #102b43;
  --code-bg: #0b1117;
  --header-bg: rgba(8, 12, 16, .9);
  --focus: #68b4ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.7; transition: background-color .2s ease, color .2s ease; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 38%, transparent); outline-offset: 3px; }
.shell { width: min(calc(100% - 72px), var(--shell)); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 8px 14px; background: var(--text); color: var(--bg); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(18px); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { font-size: 24px; line-height: 1; font-weight: 700; letter-spacing: -.04em; }
.site-nav { display: flex; align-items: center; gap: 42px; }
.site-nav > a { position: relative; padding: 23px 0 20px; color: var(--muted); font-weight: 600; }
.site-nav > a:hover, .site-nav > a[aria-current="page"] { color: var(--text); }
.site-nav > a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.theme-toggle { width: 50px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--accent); border-radius: 12px; color: var(--accent); background: transparent; cursor: pointer; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: block; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 0; background: transparent; padding: 10px; }
.nav-toggle span { display: block; height: 1px; margin: 5px 0; background: var(--text); }

.featured { min-height: 470px; display: grid; grid-template-columns: minmax(440px, .82fr) minmax(580px, 1.18fr); gap: clamp(40px, 5vw, 76px); align-items: center; padding-block: 46px 34px; }
.featured-copy { padding-left: clamp(0px, 4.5vw, 70px); }
.intro-line { margin: 0 0 18px; color: var(--muted); font-size: 18px; letter-spacing: .05em; }
.featured h1 { max-width: 630px; margin: 0; font-size: clamp(32px, 3.8vw, 42px); line-height: 1.2; letter-spacing: -.055em; }
.featured-summary { max-width: 560px; margin: 24px 0 28px; color: var(--muted); font-size: 18px; }
.read-link { display: inline-flex; align-items: center; gap: 30px; min-height: 52px; padding: 10px 22px; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; font-weight: 650; }
.read-link:hover { background: var(--accent); color: #fff; }
.featured-media { display: block; overflow: hidden; aspect-ratio: 16 / 7.25; background: var(--surface); box-shadow: var(--shadow); }
.featured-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.featured-media:hover img { transform: scale(1.015); }
.empty-hero { padding-block: 110px; }
.empty-hero h1 { margin: 0; font-size: clamp(42px, 6vw, 76px); letter-spacing: -.05em; }

.circuit-rule { height: 50px; position: relative; }
.circuit-rule::before { content: ""; position: absolute; top: 16px; left: 0; width: 36%; height: 1px; background: var(--accent); opacity: .38; }
.circuit-rule::after { content: ""; position: absolute; top: 16px; left: 36%; right: 0; height: 1px; background: var(--line); }
.circuit-rule span::before { content: ""; position: absolute; left: 36%; top: 16px; width: 26px; height: 1px; background: var(--accent); transform: rotate(45deg); transform-origin: left; opacity: .55; }
.circuit-rule span::after { content: ""; position: absolute; left: 67.1%; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.content-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(230px, 1.05fr); gap: 40px; padding: 4px clamp(0px, 4.5vw, 70px) 70px; }
.section-title, .info-rail h2 { margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line-strong); font-size: 22px; letter-spacing: .04em; }
.article-stream { border-left: 1px solid var(--line-strong); margin-left: 10px; }
.article-row { position: relative; display: grid; grid-template-columns: 145px minmax(0, 1fr) 28px; gap: 0 22px; align-items: center; min-height: 142px; padding: 23px 20px 23px 40px; border-bottom: 1px solid var(--line); }
.article-row::before { content: ""; position: absolute; left: -5px; top: 34px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.article-row time { align-self: start; padding-top: 7px; color: var(--muted); font: 14px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.article-row h3 { margin: 0 0 6px; font-size: clamp(21px, 2vw, 28px); line-height: 1.35; letter-spacing: -.025em; }
.article-row h3 a:hover { color: var(--accent); }
.article-row p { margin: 0; color: var(--muted); }
.row-meta { display: flex; gap: 8px; margin-top: 9px; color: var(--muted); font-size: 13px; }
.row-meta a { color: var(--accent); }
.row-arrow { color: var(--accent); font-size: 25px; }
.info-rail { padding-left: 10px; border-left: 1px solid var(--line); }
.info-rail section { margin-bottom: 25px; }
.info-rail h2 { font-size: 20px; }
.info-rail p { color: var(--muted); }
.info-rail section > a { display: block; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.info-rail section > a:hover { color: var(--accent); padding-left: 4px; }
.empty-state { padding: 60px 38px; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 32px; }
.pagination a, .pagination span { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 13px; border: 1px solid var(--line); color: var(--muted); }
.pagination a:hover, .pagination .current { color: var(--accent); border-color: var(--accent); }
.pagination span[aria-disabled="true"] { opacity: .45; }

.article-page { padding: 40px 0 80px; }
.article-header { max-width: 1040px; margin: 0 auto 42px; }
.breadcrumb { display: flex; gap: 9px; margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.breadcrumb a:first-child, .article-meta a { color: var(--accent); }
.article-header h1 { max-width: 900px; margin: 0; font-size: clamp(32px, 5vw, 42px); line-height: 1.16; letter-spacing: -.055em; }
.article-deck { max-width: 780px; margin: 20px 0 14px; color: var(--muted); font-size: 20px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.article-cover { width: 100%; max-height: 500px; margin-top: 30px; object-fit: cover; aspect-ratio: 16 / 7; box-shadow: var(--shadow); }
.article-layout { display: grid; grid-template-columns: 190px minmax(0, var(--reading)); gap: 48px; justify-content: center; align-items: start; }
.toc-rail { position: sticky; top: 104px; padding-right: 22px; border-right: 1px solid var(--line); }
.toc-rail h2 { margin: 0 0 14px; font-size: 14px; }
.toc-rail a, .mobile-toc a { display: block; padding: 7px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.toc-rail a[data-level="3"] { padding-left: 13px; }
.toc-rail a.is-active { color: var(--accent); border-left: 2px solid var(--accent); padding-left: 9px; }
.mobile-toc { display: none; }
.rich-content { font-family: "Noto Serif SC", "Songti SC", SimSun, serif; color: var(--text); font-size: 18px; line-height: 1.95; overflow-wrap: anywhere; }
.rich-content h2, .rich-content h3, .rich-content h4 { scroll-margin-top: 100px; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.35; letter-spacing: -.025em; }
.rich-content h2 { margin: 2.3em 0 .75em; padding-top: .45em; border-top: 1px solid var(--line); font-size: 30px; }
.rich-content h3 { margin: 1.8em 0 .65em; font-size: 23px; }
.rich-content p { margin: 1em 0; }
.rich-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.rich-content blockquote { margin: 1.6em 0; padding: 14px 20px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--muted); }
.rich-content figure { margin: 2em 0; }
.rich-content figure img, .rich-content > img { width: 100%; height: auto; }
.rich-content figcaption { margin-top: 9px; color: var(--muted); text-align: center; font-size: 13px; }
.rich-content pre { position: relative; overflow: auto; margin: 1.6em 0; padding: 22px; border: 1px solid var(--line); border-radius: 5px; background: var(--code-bg); color: var(--text); font: 14px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.copy-code { position: absolute; top: 9px; right: 9px; padding: 4px 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 12px; cursor: pointer; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-family: Inter, "PingFang SC", sans-serif; font-size: 14px; }
.rich-content th, .rich-content td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.rich-content th { background: var(--surface); }
.article-end { margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--line); }
.article-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.article-tags a { padding: 5px 12px; background: var(--accent-soft); color: var(--accent); border-radius: 99px; font-size: 13px; }
.article-nav { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 26px; border: 1px solid var(--line); }
.article-nav a { min-height: 94px; padding: 17px; }
.article-nav a + a { border-left: 1px solid var(--line); text-align: right; }
.article-nav span { display: block; color: var(--muted); font-size: 12px; }

.archive-page, .taxonomy-page, .about-page { max-width: 1020px; padding-block: 70px 90px; }
.archive-page > header, .taxonomy-page > header, .about-page > header { margin-bottom: 42px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.archive-page > header p { margin: 0; color: var(--accent); }
.archive-page h1, .taxonomy-page h1, .about-page h1 { margin: 0; font-size: clamp(28px, 6vw, 32px); letter-spacing: -.05em; }
.taxonomy-page header p, .about-page header p { color: var(--muted); font-size: 18px; }
.taxonomy-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 30px; }
.taxonomy-list a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 20px; }
.taxonomy-list a:hover { color: var(--accent); }
.taxonomy-label { display: flex; min-width: 0; align-items: center; gap: 12px; }
.taxonomy-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-soft); color: var(--accent); transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease; }
.taxonomy-icon svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.taxonomy-arrow { color: var(--muted); transition: transform .2s ease, color .2s ease; }
.taxonomy-list a:hover .taxonomy-icon { transform: translateY(-1px); border-color: var(--accent); background: var(--accent); color: #fff; }
.taxonomy-list a:hover .taxonomy-arrow { transform: translateX(3px); color: var(--accent); }
.about-page .rich-content { max-width: var(--reading); }
.error-page { min-height: 60vh; display: grid; place-content: center; text-align: center; }
.error-page > p { margin: 0; color: var(--accent); font: 72px/1 ui-monospace, monospace; }
.error-page h1 { font-size: 40px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { min-height: 76px; display: flex; justify-content: center; align-items: center; text-align: center; }
.footer-inner p { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; margin: 0; font-size: 13px; }
.footer-inner a:hover { color: var(--accent); }
.beian-icon { display: inline-block; width: 16px; height: 16px; object-fit: contain; }

@media (max-width: 1120px) {
  .shell { width: min(calc(100% - 42px), var(--shell)); }
  .featured { grid-template-columns: 1fr; min-height: 0; gap: 34px; padding-top: 56px; }
  .featured-copy { padding-left: 0; }
  .featured-media { aspect-ratio: 16/8; }
  .content-grid { grid-template-columns: 1fr; padding-inline: 0; }
  .info-rail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; padding: 26px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .article-layout { grid-template-columns: 160px minmax(0, 1fr); gap: 32px; }
}

@media (max-width: 720px) {
  .shell { width: min(calc(100% - 32px), var(--shell)); }
  .header-inner { min-height: 64px; }
  .brand { font-size: 20px; }
  .nav-toggle { display: block; margin-left: auto; cursor: pointer; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; align-items: stretch; gap: 0; padding: 10px 16px 18px; border-bottom: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow); }
  .site-nav.is-open { display: grid; }
  .site-nav > a { padding: 12px; }
  .site-nav > a[aria-current="page"]::after { left: 12px; right: auto; width: 30px; }
  .theme-toggle { margin: 10px 12px 0; }
  .featured { padding-block: 38px 26px; }
  .featured h1 { font-size: clamp(38px, 11vw, 42px); }
  .featured-summary { font-size: 16px; }
  .featured-media { aspect-ratio: 16/9; }
  .circuit-rule { height: 38px; }
  .circuit-rule span::after { left: 68%; }
  .content-grid { gap: 42px; padding-bottom: 50px; }
  .article-row { grid-template-columns: 1fr 24px; gap: 8px; min-height: 0; padding: 25px 10px 25px 24px; }
  .article-row time { grid-column: 1; padding: 0 0 7px; }
  .article-row > div { grid-column: 1; }
  .article-row .row-arrow { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .article-row p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .info-rail { grid-template-columns: 1fr; }
  .article-page { padding-top: 28px; }
  .article-header h1 { font-size: clamp(32px, 8.8vw, 40px); }
  .article-deck { font-size: 17px; }
  .article-cover { aspect-ratio: 16/9; }
  .article-layout { display: block; }
  .toc-rail { display: none; }
  .mobile-toc { display: block; margin: 0 0 28px; padding: 12px 15px; border: 1px solid var(--line); background: var(--surface); }
  .mobile-toc summary { cursor: pointer; font-weight: 650; }
  .mobile-toc nav { padding-top: 8px; }
  .rich-content { font-size: 17px; line-height: 1.88; }
  .rich-content h2 { font-size: 26px; }
  .rich-content pre { margin-inline: -8px; padding: 18px 14px; font-size: 12px; }
  .rich-content table { display: block; overflow-x: auto; white-space: nowrap; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav a + a { border-top: 1px solid var(--line); border-left: 0; }
  .archive-page, .taxonomy-page, .about-page { padding-block: 48px 64px; }
  .taxonomy-list { grid-template-columns: 1fr; }
  .footer-inner { padding-block: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
