:root {
  color-scheme: light;
  --paper: #f2eee3;
  --paper-deep: #e7e0d2;
  --sheet: #fbf8ef;
  --ink: #102a29;
  --ink-soft: #53645f;
  --muted: #8a928a;
  --rule: #cbc5b7;
  --red: #e94f37;
  --teal: #146a63;
  --yellow: #f0dc66;
  --shell: 1180px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #091817;
  --paper-deep: #0d211f;
  --sheet: #122825;
  --ink: #f1ebdd;
  --ink-soft: #afbbb3;
  --muted: #74877f;
  --rule: #29423d;
  --red: #ff684f;
  --teal: #73ccbf;
  --yellow: #d5c354;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 49.9%, rgba(16,42,41,.025) 50%, transparent 50.1%),
    var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }
.shell { width: min(calc(100% - 48px), var(--shell)); margin-inline: auto; }
.reading-progress { position: fixed; z-index: 100; top: 0; left: 0; width: 0; height: 3px; background: var(--red); }

.guide-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  padding-inline: max(24px, calc((100vw - var(--shell)) / 2));
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}
.guide-brand { display: flex; align-items: center; gap: 10px; justify-self: start; }
.guide-brand__seal { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font-family: Georgia, serif; font-size: 12px; font-weight: 800; }
.guide-brand strong { display: block; font-size: 17px; letter-spacing: .08em; }
.guide-brand small { display: block; margin-top: 3px; color: var(--muted); font-family: monospace; font-size: 13px; }
.guide-breadcrumb { color: var(--muted); font-family: monospace; font-size: 14px; }
.guide-breadcrumb b { color: var(--red); font-weight: 500; }
.guide-actions { display: flex; align-items: center; gap: 9px; justify-self: end; }
.back-link, .guide-theme { display: flex; height: 36px; align-items: center; border: 1px solid var(--rule); background: transparent; }
.back-link { padding: 0 14px; font-size: 14px; }
.back-link:hover { color: var(--paper); border-color: var(--ink); background: var(--ink); }
.guide-theme { position: relative; width: 36px; justify-content: center; }
.guide-theme svg { position: absolute; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; transition: .2s; }
.guide-theme .moon, [data-theme="dark"] .guide-theme .sun { opacity: 0; transform: rotate(80deg) scale(.6); }
[data-theme="dark"] .guide-theme .moon { opacity: 1; transform: none; }

.guide-hero { padding-block: 78px 62px; border-bottom: 1px solid var(--ink); }
.guide-hero__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 27px; font-family: monospace; font-size: 13px; letter-spacing: .08em; }
.guide-hero__number { padding: 8px 10px; color: var(--paper); background: var(--ink); }
.guide-hero__category { color: var(--red); }
.guide-hero h1 { max-width: 980px; margin: 0; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: clamp(45px, 5.3vw, 76px); font-weight: 500; line-height: 1.18; letter-spacing: -.055em; }
.guide-hero__title-note { margin-left: .2em; color: var(--red); font-size: .5em; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.guide-hero__summary { max-width: 980px; margin: 30px 0 0; color: var(--ink-soft); font-size: 22px; line-height: 1.9; }
.guide-hero__notice { max-width: 980px; margin: 22px 0 0; padding: 16px 20px; border-left: 5px solid var(--red); background: color-mix(in srgb, var(--red) 10%, var(--sheet)); color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.8; }
.guide-hero__notice::before { content: "⚠ 注意："; color: var(--red); font-weight: 800; }
.guide-hero__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 31px; padding-top: 19px; border-top: 1px dashed var(--rule); color: var(--muted); font-family: monospace; font-size: 13px; }
.guide-hero__foot b { color: var(--ink); font-weight: 600; }
.guide-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.guide-tags span { padding: 5px 8px; border: 1px solid var(--rule); color: var(--ink); }

.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 72px; align-items: start; padding-block: 70px 110px; }
.article { min-width: 0; }
.article-section { scroll-margin-top: 100px; padding: 0 0 68px; margin: 0 0 68px; border-bottom: 1px solid var(--rule); }
.article-section:last-child { margin-bottom: 0; border-bottom: 0; }
.article-section__label { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.article-section__label span { color: var(--red); font-family: Georgia, serif; font-size: 18px; }
.article-section__label small { color: var(--muted); font-family: monospace; font-size: 13px; letter-spacing: .1em; }
.article-section h2 { margin: 0 0 32px; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: 46px; font-weight: 500; letter-spacing: -.045em; }
.article-section h2.article-section__title--highlight { color: var(--red); }
.article-section__title-note { margin-left: .3em; color: var(--red); font-size: .5em; font-weight: 700; letter-spacing: 0; }
.article-paragraph { margin: 0 0 25px; color: var(--ink-soft); font-size: 22px; line-height: 2; }
.article-paragraph--danger { color: var(--red); }
.article-paragraph--large { font-size: 28px; font-weight: 700; line-height: 1.8; }
.article-inline-emphasis { font-weight: 750; }
.article-inline-emphasis--danger { color: var(--red); }
.article-inline-link { color: var(--red); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.article-inline-link:hover { color: var(--teal); }
.article-list { display: grid; gap: 0; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--rule); list-style: none; }
.article-list li { position: relative; padding: 19px 20px 19px 40px; border-bottom: 1px solid var(--rule); color: var(--ink-soft); font-size: 20px; line-height: 1.9; }
.article-list li::before { position: absolute; top: 23px; left: 9px; width: 7px; height: 7px; border: 1px solid var(--red); border-radius: 50%; content: ""; }
.article-steps { display: grid; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.article-steps li { display: grid; grid-template-columns: 54px 1fr; border: 1px solid var(--rule); background: var(--sheet); }
.article-steps li > span { display: grid; place-items: center; color: var(--red); border-right: 1px solid var(--rule); font-family: Georgia, serif; font-size: 18px; }
.article-steps li > div { padding: 17px 20px; }
.article-steps strong { display: block; margin-bottom: 8px; font-size: 20px; }
.article-steps p { margin: 0; color: var(--ink-soft); font-size: 19px; line-height: 1.85; }
.article-callout { margin-top: 30px; padding: 23px 25px; border-left: 4px solid var(--teal); background: var(--paper-deep); }
.article-callout--warning { border-color: #bf9423; background: color-mix(in srgb, var(--yellow) 32%, var(--sheet)); }
.article-callout--danger { border-color: var(--red); background: color-mix(in srgb, var(--red) 10%, var(--sheet)); }
.article-callout strong { display: block; margin-bottom: 10px; font-family: Georgia, "Songti SC", serif; font-size: 24px; }
.article-callout p { margin: 0; color: var(--ink-soft); font-size: 20px; line-height: 1.9; }
.table-wrap { overflow-x: auto; margin-top: 28px; border: 1px solid var(--ink); background: var(--sheet); }
.table-wrap + .article-paragraph { margin-top: 28px; }
table { width: 100%; min-width: 680px; border-collapse: collapse; }
th, td { padding: 15px 17px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); text-align: left; }
th:last-child, td:last-child { border-right: 0; }
tr:last-child td { border-bottom: 0; }
th { color: var(--paper); background: var(--ink); font-family: monospace; font-size: 13px; letter-spacing: .08em; }
td { color: var(--ink-soft); font-size: 18px; line-height: 1.75; }
td:first-child { color: var(--ink); font-weight: 700; }
td.table-cell--recommended { color: var(--red); }
.table-link { color: var(--red); font-weight: 750; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.table-link:hover { color: var(--teal); }
.table-note { display: block; margin-top: 8px; color: var(--red); font-size: 14px; font-weight: 600; line-height: 1.6; }
.article-gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; gap: 24px; margin-top: 32px; }
.article-figure { grid-column: 1 / -1; margin: 0; padding: 10px; border: 1px solid var(--rule); background: var(--sheet); }
.article-figure--wide { grid-column: 1 / -1; }
.article-figure--medium { grid-column: 2 / -2; }
.article-figure--portrait { grid-column: 4 / -4; }
.article-figure--half { grid-column: span 6; }
.article-figure--third { grid-column: span 4; }
.article-figure__link { display: block; overflow: hidden; background: #fff; cursor: zoom-in; }
.article-figure img { display: block; width: 100%; height: auto; max-height: 760px; object-fit: contain; transition: transform .25s ease; }
.article-figure__link:hover img { transform: scale(1.008); }
.article-figure figcaption { padding: 13px 5px 4px; color: var(--ink-soft); font-size: 17px; line-height: 1.75; }
.resource-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 28px; }
.resource-list:not(:last-child) { margin-bottom: 28px; }
.article-code { margin-top: 28px; border: 1px solid var(--ink); background: var(--ink); }
.article-code__title { display: block; padding: 14px 18px; border-bottom: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); color: var(--paper); font-family: monospace; font-size: 14px; letter-spacing: .06em; }
.article-code pre { margin: 0; padding: 22px; overflow-x: auto; color: #eef7f4; font: 14px/1.75 Consolas, "Courier New", monospace; white-space: pre; tab-size: 2; }
.article-code code { font: inherit; }
.resource-link { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 17px; border: 1px solid var(--rule); background: var(--sheet); transition: .2s; }
.resource-link:hover { color: var(--paper); border-color: var(--ink); background: var(--ink); transform: translateY(-2px); }
.resource-link strong, .resource-link small { display: block; }
.resource-link strong { font-size: 18px; line-height: 1.6; }
.resource-link--highlight strong { color: var(--red); font-size: 21px; font-weight: 800; }
.resource-link small { margin-top: 5px; color: var(--muted); font-family: monospace; font-size: 16px; }
.resource-link b { color: var(--red); font-size: 17px; }

.guide-aside { position: sticky; top: 98px; display: grid; gap: 18px; }
.toc-card, .source-card { border-top: 3px solid var(--ink); background: var(--sheet); box-shadow: 10px 10px 0 var(--paper-deep); }
.toc-card h2, .source-card h2 { margin: 0; padding: 19px 19px 14px; border-bottom: 1px solid var(--rule); font-family: Georgia, "Songti SC", serif; font-size: 21px; font-weight: 500; }
.toc-links { display: grid; }
.toc-links a { padding: 15px 18px; border-bottom: 1px solid var(--rule); color: var(--ink-soft); font-size: 17px; line-height: 1.6; }
.toc-links a:hover, .toc-links a.is-active { color: var(--red); background: var(--paper); }
.source-card { padding-bottom: 18px; }
.source-card p { margin: 17px 18px; color: var(--ink-soft); font-size: 17px; line-height: 1.85; }
.source-card a { display: block; margin: 0 18px; padding: 11px 12px; color: var(--paper); background: var(--red); font-size: 14px; text-align: center; }

.guide-footer { color: var(--paper); background: var(--ink); }
.guide-footer__inner { display: flex; min-height: 108px; align-items: center; justify-content: space-between; gap: 20px; }
.guide-footer b { font-size: 15px; letter-spacing: .08em; }
.guide-footer p { margin: 0; color: color-mix(in srgb, var(--paper) 65%, transparent); font-size: 14px; }
.guide-footer a { padding: 9px 12px; border: 1px solid color-mix(in srgb, var(--paper) 30%, transparent); font-size: 14px; }

@media (max-width: 840px) {
  .guide-topbar { grid-template-columns: 1fr auto; padding-inline: 16px; }
  .guide-breadcrumb { display: none; }
  .guide-layout { grid-template-columns: 1fr; gap: 40px; }
  .guide-aside { position: static; grid-row: 1; grid-template-columns: 1fr 1fr; }
  .toc-card, .source-card { box-shadow: none; }
}

@media (max-width: 560px) {
  .shell { width: min(calc(100% - 28px), var(--shell)); }
  .guide-topbar { min-height: 64px; }
  .guide-brand small, .back-link { display: none; }
  .guide-hero { padding-block: 54px 44px; }
  .guide-hero h1 { font-size: 42px; }
  .guide-hero__summary { font-size: 19px; }
  .guide-hero__notice { padding: 13px 15px; font-size: 17px; }
  .guide-tags { width: 100%; margin-left: 0; }
  .guide-layout { padding-block: 45px 75px; }
  .guide-aside { grid-template-columns: 1fr; }
  .article-section { padding-bottom: 47px; margin-bottom: 47px; }
  .article-section h2 { font-size: 37px; }
  .article-paragraph { font-size: 19px; }
  .article-paragraph--large { font-size: 24px; }
  .article-figure--wide, .article-figure--medium, .article-figure--portrait, .article-figure--half, .article-figure--third { grid-column: 1 / -1; }
  .article-gallery { gap: 17px; margin-top: 25px; }
  .article-figure { padding: 6px; }
  .article-figure figcaption { padding: 11px 4px 4px; font-size: 16px; }
  .article-steps li { grid-template-columns: 44px 1fr; }
  .resource-list { grid-template-columns: 1fr; }
  .guide-footer__inner { align-items: flex-start; flex-direction: column; padding-block: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
