:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --paper: #ffffff;
  --paper-2: #eef3f7;
  --ink: #17202a;
  --muted: #667789;
  --line: #d9e2ea;
  --line-strong: #b7c5d0;
  --blue: #1d5c83;
  --blue-deep: #123f5c;
  --teal: #168070;
  --coral: #d95f4b;
  --amber: #c88719;
  --code: #101820;
  --focus: #168070;
  --shadow: 7px 7px 0 rgba(29, 92, 131, 0.10);
  --sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Microsoft YaHei UI", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --content: 920px;
  --wide: 1400px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6.5rem; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(29, 92, 131, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(29, 92, 131, 0.045) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

a { color: var(--blue); text-underline-offset: .2em; text-decoration-thickness: .08em; }
a:hover { color: var(--coral); }
button, input { font: inherit; }
button { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 72%, white); outline-offset: 3px; }

.skip-link { position: fixed; left: 1rem; top: 1rem; z-index: 100; transform: translateY(-180%); background: var(--ink); color: white; padding: .7rem .95rem; }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(246, 248, 251, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.site-header::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--blue) 0 62%, var(--teal) 62% 82%, var(--coral) 82% 100%); }
.header-inner { width: min(100%, var(--wide)); min-height: 82px; margin: 0 auto; padding: .75rem clamp(1rem, 3vw, 2rem); display: flex; align-items: center; justify-content: space-between; gap: 1.2rem 2rem; }
.brand { display: inline-flex; align-items: center; gap: .8rem; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-mark { width: 2.6rem; height: 2.6rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; box-shadow: inset -6px -8px 0 rgba(255,255,255,.12), 0 0 0 4px var(--paper); font-size: .84rem; font-weight: 850; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { color: var(--ink); font-family: var(--display); font-size: 1.28rem; line-height: 1.05; font-weight: 850; }
.brand-copy small { margin-top: .23rem; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.site-nav { display: flex; align-items: center; justify-content: flex-end; gap: .18rem .7rem; flex-wrap: wrap; }
.site-nav a { position: relative; padding: .48rem .35rem .4rem; color: var(--muted); font-size: .96rem; font-weight: 720; text-decoration: none; }
.site-nav a::after { content: ""; position: absolute; left: .35rem; right: .35rem; bottom: .16rem; height: 2px; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .18s ease; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--blue); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }

.site-main { width: min(100%, var(--wide)); margin: 0 auto; padding: clamp(2rem, 4vw, 3.6rem) clamp(1rem, 3vw, 2rem) 4.5rem; }
.eyebrow { margin: 0 0 .65rem; color: var(--blue); font-size: .78rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.button-primary, .button-quiet { min-height: 2.9rem; display: inline-flex; align-items: center; justify-content: center; padding: .64rem 1.05rem; border-radius: 7px; font-size: .94rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.button-primary { border: 1px solid var(--blue); background: var(--blue); color: white; box-shadow: 3px 3px 0 rgba(29, 92, 131, .13); }
.button-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: white; }
.button-quiet { border: 1px solid var(--line-strong); background: var(--paper); color: var(--blue); }
.button-quiet:hover { border-color: var(--blue); color: var(--blue-deep); }

.home-main { padding-top: clamp(2.2rem, 4.5vw, 4.3rem); }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); min-height: 520px; padding: 1rem 0 clamp(2.8rem, 5vw, 4.8rem); border-bottom: 1px solid var(--line-strong); }
.hero-copy { min-width: 0; }
.hero-copy h1 { max-width: 10ch; margin: 0; color: var(--ink); font-family: var(--display); font-size: clamp(3.7rem, 7vw, 6.3rem); line-height: .98; letter-spacing: -.055em; font-weight: 850; }
.hero-dek { max-width: 46rem; margin: 1.2rem 0 0; color: var(--muted); font-size: clamp(1.08rem, 1.7vw, 1.28rem); line-height: 1.78; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.45rem; }
.hero-mascot { justify-self: end; align-self: end; width: min(100%, 430px); max-height: 470px; overflow: hidden; filter: drop-shadow(0 14px 22px rgba(29, 92, 131, .10)); }
.hero-mascot img { width: 100%; height: auto; object-fit: contain; object-position: center bottom; }

.home-feed { padding-top: clamp(2.4rem, 5vw, 4.4rem); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2, .collection-header h1, .page-header h1 { margin: 0; color: var(--ink); font-family: var(--display); font-weight: 850; letter-spacing: -.045em; }
.section-head h2 { font-size: clamp(2.3rem, 4vw, 3.8rem); }
.section-head > a { font-size: .94rem; font-weight: 800; }

.entry-list { border-top: 1px solid var(--line-strong); }
.entry-card { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) 2.4rem; gap: 1rem 1.15rem; align-items: start; padding: 1.55rem .35rem 1.55rem 0; border-bottom: 1px solid var(--line); transition: background .16s ease, padding .16s ease; }
.entry-card:hover { background: rgba(255,255,255,.66); padding-left: .65rem; padding-right: .65rem; }
.entry-index { padding-top: .28rem; color: var(--coral); font: 850 .78rem/1 var(--mono); letter-spacing: .08em; }
.entry-main { min-width: 0; }
.entry-meta { display: flex; flex-wrap: wrap; gap: .3rem .5rem; margin: 0 0 .35rem; color: var(--muted); font-size: .84rem; font-weight: 700; }
.entry-meta a { color: var(--blue); }
.entry-card h3 { margin: 0; color: var(--ink); font-family: var(--display); font-size: clamp(1.38rem, 2vw, 1.82rem); line-height: 1.3; }
.entry-card h3 a { color: inherit; text-decoration: none; }
.entry-card h3 a:hover { color: var(--blue); }
.entry-excerpt { max-width: 86ch; margin: .6rem 0 0; color: var(--muted); font-size: .98rem; line-height: 1.7; }
.entry-arrow { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-top: .2rem; border: 1px solid var(--line); border-radius: 50%; color: var(--blue); background: var(--paper); text-decoration: none; transition: transform .16s ease, border-color .16s ease; }
.entry-card:hover .entry-arrow { transform: translate(2px, -2px); border-color: var(--blue); }
.tag-row { display: flex; flex-wrap: wrap; gap: .4rem .65rem; margin-top: .65rem; }
.tag-row a { color: var(--blue); font-size: .82rem; font-weight: 750; text-decoration: none; }
.empty-state { margin: 0; padding: 2rem 0; color: var(--muted); }

.article-main, .page-main { max-width: calc(var(--content) + 4rem); }
.article-shell, .page-shell { min-width: 0; }
.article-header, .page-header { position: relative; padding: clamp(2.1rem, 5vw, 4rem) 0 clamp(1.7rem, 4vw, 2.7rem); border-bottom: 1px solid var(--line-strong); }
.article-header::before, .page-header::before { content: ""; position: absolute; left: -1rem; top: clamp(2.5rem, 5vw, 4.4rem); width: .28rem; height: 4.5rem; background: var(--blue); }
.article-header h1, .page-header h1 { margin: 0; color: var(--ink); font-family: var(--display); font-size: clamp(3rem, 6vw, 5rem); line-height: 1.05; letter-spacing: -.055em; font-weight: 850; }
.article-dek { max-width: 68ch; margin: 1rem 0 0; color: var(--muted); font-size: 1.08rem; line-height: 1.72; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; margin-top: 1.1rem; color: var(--muted); font-size: .9rem; font-weight: 700; }
.article-meta .tag-row { margin: 0; }

.prose { min-width: 0; padding-top: clamp(1.8rem, 4vw, 3rem); font-size: 1.06rem; line-height: 1.82; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: .85rem 0 1.05rem; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); scroll-margin-top: 6.5rem; line-height: 1.3; overflow-wrap: anywhere; }
.prose h2 { margin: 2.4rem 0 .8rem; font-size: 1.78rem; }
.prose h3 { margin: 2rem 0 .65rem; font-size: 1.42rem; }
.prose h4 { margin: 1.6rem 0 .55rem; font-size: 1.18rem; }
.prose ul, .prose ol { padding-left: 1.45rem; }
.prose li { margin: .38rem 0; }
.prose blockquote { margin: 1.4rem 0; padding: .55rem 1rem .55rem 1.2rem; border-left: 4px solid var(--teal); background: rgba(238, 243, 247, .7); color: var(--muted); }
.prose hr { margin: 2.4rem 0; border: 0; border-top: 1px solid var(--line-strong); }
.prose img { margin: 1.4rem auto; border-radius: 8px; box-shadow: 0 8px 24px rgba(23, 32, 42, .08); }
.prose code:not(pre code) { padding: .12rem .34rem; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-2); color: var(--blue-deep); font: 650 .9em/1.4 var(--mono); }

.code-shell { margin: 1.6rem 0; border: 1px solid #263949; border-radius: 10px; overflow: hidden; background: var(--code); box-shadow: 0 10px 26px rgba(16, 24, 32, .12); }
.code-toolbar { min-height: 46px; margin: 0; padding: .55rem .7rem .55rem .9rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #172633; border-bottom: 1px solid #2d4050; }
.code-language { display: inline-flex; align-items: center; gap: .55rem; color: #d8e5ed; font: 750 .8rem/1 var(--mono); letter-spacing: .04em; }
.code-dot { width: .62rem; height: .62rem; border-radius: 50%; background: var(--teal); box-shadow: 1rem 0 0 var(--amber), 2rem 0 0 var(--coral); margin-right: 2rem; }
.code-copy { display: inline-flex; align-items: center; gap: .42rem; min-height: 32px; padding: .35rem .62rem; border: 1px solid #496173; border-radius: 7px; background: #203341; color: #eaf2f7; font-size: .8rem; font-weight: 760; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.code-copy:hover { background: #294659; border-color: #6a879a; transform: translateY(-1px); }
.code-copy svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.code-copy-icon-success { display: none; }
.code-copy[data-state="copied"] { background: #173f39; border-color: #2b8173; color: #dff8f1; }
.code-copy[data-state="copied"] .code-copy-icon-default { display: none; }
.code-copy[data-state="copied"] .code-copy-icon-success { display: inline-flex; }
.code-copy[data-state="error"] { background: #4a2828; border-color: #8b4b4b; }
.code-shell pre { margin: 0; padding: 1.1rem 1.2rem 1.25rem; overflow: auto; background: var(--code); color: #e7edf2; font: 500 .9rem/1.65 var(--mono); tab-size: 2; }
.code-shell pre code { color: inherit; background: transparent; border: 0; padding: 0; }

.table-wrap { max-width: 100%; margin: 1.5rem 0; overflow-x: auto; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); }
.table-wrap table { width: 100%; min-width: 38rem; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap th { background: var(--paper-2); color: var(--ink); }

.collection-main, .search-main { width: min(100%, var(--wide)); }
.collection-header { padding: clamp(2rem, 4vw, 3.4rem) 0 1.4rem; border-bottom: 1px solid var(--line-strong); }
.collection-header h1 { font-size: clamp(2.8rem, 5vw, 4.6rem); }
.collection-header > p:last-child { margin: .65rem 0 0; color: var(--muted); font-size: 1rem; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 10rem; gap: 1rem; align-items: baseline; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.archive-list time, .archive-list span { color: var(--muted); font-size: .9rem; }
.archive-list a { color: var(--ink); font-size: 1.08rem; font-weight: 760; text-decoration: none; }
.archive-list a:hover { color: var(--blue); }
.term-grid { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.term-grid li a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: 3px 3px 0 rgba(29,92,131,.06); }
.term-grid li a:hover { border-color: var(--blue); color: var(--blue); }
.term-grid strong { color: var(--blue); font-size: 1.05rem; }

.search-panel { margin-top: 1.4rem; max-width: 100%; }
.search-label { display: block; margin-bottom: .45rem; color: var(--ink); font-weight: 800; }
.search-control { max-width: 760px; min-height: 54px; display: flex; align-items: center; gap: .7rem; padding: 0 .9rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); }
.search-control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,92,131,.11); }
.search-control svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-control input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; }
.search-status { color: var(--muted); font-size: .92rem; }
.search-results { margin-top: 1rem; }

.site-footer { border-top: 1px solid var(--line); background: rgba(255,255,255,.72); }
.footer-inner { width: min(100%, var(--wide)); margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem) 2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.footer-brand { display: flex; flex-direction: column; gap: .15rem; }
.footer-brand strong { color: var(--ink); font-size: 1rem; }
.footer-brand span, .footer-meta { color: var(--muted); font-size: .82rem; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.footer-meta a { color: var(--blue); }
.footer-meta img { width: 1rem; height: 1rem; display: inline-block; vertical-align: middle; }
.footer-consent { border: 0; padding: 0; background: transparent; color: var(--blue); cursor: pointer; }
.footer-sep { color: var(--line-strong); }

.consent-banner { position: fixed; z-index: 80; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(920px, calc(100vw - 2rem)); padding: 1rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; background: var(--paper); border: 1px solid var(--line-strong); border-left: 4px solid var(--blue); border-radius: 8px; box-shadow: 0 16px 34px rgba(23,32,42,.15); }
.consent-banner strong { display: block; color: var(--ink); }
.consent-banner p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.consent-banner-actions, .consent-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.consent-layer { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1rem; background: rgba(23,32,42,.42); }
.consent-dialog { width: min(680px, 100%); max-height: calc(100vh - 2rem); overflow: auto; padding: 1.25rem; border-radius: 10px; background: var(--paper); border: 1px solid var(--line-strong); box-shadow: 0 20px 50px rgba(23,32,42,.2); }
.consent-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .8rem; }
.consent-dialog-head span { color: var(--blue); font-size: .74rem; font-weight: 850; letter-spacing: .12em; }
.consent-dialog-head h2 { margin: .2rem 0 0; font-size: 1.8rem; }
.consent-dialog-head > button { border: 0; background: transparent; font-size: 1.65rem; color: var(--muted); cursor: pointer; }
.consent-dialog > p { color: var(--muted); }
.consent-rows { display: grid; gap: .7rem; margin: 1rem 0; }
.consent-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 7px; background: var(--paper-2); }
.consent-row strong, .consent-row small { display: block; }
.consent-row small { margin-top: .15rem; color: var(--muted); }
.consent-row input { width: 1.1rem; height: 1.1rem; accent-color: var(--blue); }

@media (max-width: 980px) {
  body { font-size: 17px; }
  .header-inner { align-items: flex-start; flex-direction: column; }
  .site-nav { justify-content: flex-start; }
  .home-hero { grid-template-columns: minmax(0, 1fr) minmax(260px, 330px); gap: 2rem; }
  .hero-mascot { width: 320px; }
  .term-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-list li { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .archive-list li > span { grid-column: 2; }
}

@media (max-width: 720px) {
  .site-main { padding-left: 1rem; padding-right: 1rem; }
  .home-hero { grid-template-columns: 1fr; min-height: 0; padding-top: .5rem; }
  .hero-mascot { justify-self: center; width: min(86vw, 360px); max-height: 360px; }
  .hero-copy h1 { font-size: clamp(3.3rem, 18vw, 5.2rem); }
  .section-head { align-items: flex-start; flex-direction: column; }
  .entry-card { grid-template-columns: 2.3rem minmax(0, 1fr); }
  .entry-arrow { grid-column: 2; justify-self: start; }
  .article-header::before, .page-header::before { display: none; }
  .article-header h1, .page-header h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .term-grid { grid-template-columns: 1fr; }
  .archive-list li { grid-template-columns: 1fr; gap: .2rem; }
  .archive-list li > span { grid-column: auto; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .consent-banner { align-items: flex-start; flex-direction: column; }
  .consent-banner-actions { width: 100%; }
}
