:root {
  color-scheme: light;
  --paper: #fffdf8;
  --paper-deep: #f7efe7;
  --paper-pink: #fbf3ee;
  --ink: #3d2f2a;
  --muted: #796b64;
  --line: #ddcdc2;
  --line-dark: #c79a8d;
  --brick: #914435;
  --brick-dark: #713126;
  --brick-soft: #f3e2da;
  --shadow: 0 5px 16px rgba(95, 57, 42, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}
a { color: var(--brick-dark); text-underline-offset: .18em; }
a:hover { color: var(--brick); }
:focus-visible { outline: 3px solid #d18c7b; outline-offset: 3px; }
.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  z-index: 3;
  padding: .45rem .75rem;
  border-radius: .25rem;
  background: var(--brick-dark);
  color: #fff;
}
.skip-link:focus { left: 1rem; }
.wrap { width: min(calc(100% - 2rem), 72rem); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 4.35rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid var(--brick);
  border-radius: .2rem;
  color: var(--brick);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 1.05rem;
}
.brand-copy { display: grid; gap: .05rem; }
.brand-copy strong { font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 1.05rem; font-weight: 700; letter-spacing: .08em; }
.brand-copy small { color: var(--muted); font-size: .68rem; letter-spacing: .03em; }
nav { display: flex; flex-wrap: wrap; gap: .2rem 1.05rem; }
nav a { color: var(--muted); font-size: .86rem; text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--brick-dark); }
nav a[aria-current="page"] { font-weight: 700; }

main { padding: 2rem 0 4.5rem; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 2rem;
  align-items: end;
  padding: .2rem 0 1.8rem;
  border-bottom: 1px solid var(--line);
}
.kicker, .section-label {
  margin: 0;
  color: var(--brick);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .11em;
  line-height: 1.3;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: "Songti SC", "STSong", "SimSun", Georgia, serif; line-height: 1.25; }
h1 { max-width: 38rem; margin: .45rem 0 .65rem; font-size: clamp(2rem, 3.2vw, 2.45rem); letter-spacing: .01em; }
h2 { margin: .35rem 0 .65rem; font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
h3 { margin: 0; font-size: 1.06rem; }
p { margin: 0 0 1rem; }
.lede { max-width: 43rem; margin-bottom: 0; color: var(--muted); font-size: 1rem; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-top: 1.15rem; }
.button {
  display: inline-block;
  padding: .55rem .9rem;
  border: 1px solid var(--brick);
  border-radius: .25rem;
  background: var(--brick);
  color: #fffaf5;
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--brick-dark); color: #fffaf5; }
.button span { padding-left: .2rem; }
.quiet-link { color: var(--muted); font-size: .84rem; text-decoration: none; }
.quiet-link:hover { color: var(--brick-dark); text-decoration: underline; }
.hero-note {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .55rem;
  align-items: center;
  padding: .45rem 0 .45rem .85rem;
  border-left: 2px solid var(--brick);
}
.note-rule { grid-row: 1 / span 3; width: .25rem; height: .25rem; margin-left: -.99rem; border-radius: 50%; background: var(--brick); }
.hero-note strong { color: var(--brick-dark); font-size: .82rem; }
.hero-note b { grid-column: 2; font-family: Georgia, serif; font-size: 1.2rem; font-weight: 600; }
.hero-note small { grid-column: 2; color: var(--muted); font-size: .75rem; }

.category-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
  margin: 1.2rem 0 2.15rem;
}
.category-nav a {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .65rem;
  align-items: center;
  min-width: 0;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--ink);
  text-decoration: none;
}
.category-nav a:hover { border-color: var(--line-dark); background: var(--brick-soft); }
.category-nav span { grid-row: 1 / span 2; color: var(--brick); font-family: Georgia, serif; font-size: .8rem; }
.category-nav strong, .category-nav small { display: block; }
.category-nav strong { font-family: "Songti SC", "STSong", "SimSun", Georgia, serif; font-size: .94rem; }
.category-nav small { color: var(--muted); font-size: .73rem; }

.content-layout, .guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 2.25rem;
  align-items: start;
}
.resource-section, .guide-section { scroll-margin-top: 1rem; }
.resource-section + .resource-section, .guide-section + .guide-section { margin-top: 2.7rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.section-heading h2 { margin-bottom: 0; }
.count-label { color: var(--muted); font-size: .8rem; }
.resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.resource-card {
  display: flex;
  min-width: 0;
  min-height: 14.2rem;
  flex-direction: column;
  padding: 1rem 1.05rem .9rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brick-soft);
  background: #fff;
  box-shadow: var(--shadow);
}
.resource-card:hover { border-top-color: var(--brick); }
.resource-topline { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.file-type {
  display: inline-block;
  padding: .16rem .38rem;
  border: 1px solid var(--line-dark);
  border-radius: .15rem;
  color: var(--brick-dark);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.1;
}
.type-md { background: var(--paper-pink); }
.type-csv { background: #f1f1e5; border-color: #b4b58d; color: #5c6335; }
.type-svg { background: var(--brick-soft); }
.resource-purpose { color: var(--muted); font-size: .74rem; }
.resource-card h3 a, .featured-card h3 a { color: var(--ink); text-decoration: none; }
.resource-card h3 a:hover, .featured-card h3 a:hover { color: var(--brick-dark); text-decoration: underline; }
.resource-card p, .featured-card p { min-height: 3rem; margin: .48rem 0 .9rem; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.resource-meta { display: flex; gap: 1.1rem; margin: auto 0 .8rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.resource-meta dt { color: var(--muted); font-size: .68rem; }
.resource-meta dd { margin: .08rem 0 0; color: var(--ink); font-size: .78rem; font-weight: 650; }
.download-link { color: var(--brick-dark); font-size: .82rem; font-weight: 750; text-decoration: none; }
.download-link:hover { color: var(--brick); text-decoration: underline; }
.download-link span { padding-left: .2rem; font-size: .98rem; }

.sidebar, .guide-aside { display: grid; gap: .8rem; position: sticky; top: 1rem; }
.side-card { padding: 1rem 1.05rem; border: 1px solid var(--line); background: var(--paper-deep); }
.side-card h2 { font-size: 1.18rem; }
.side-card p { color: var(--muted); font-size: .82rem; }
.update-card { border-top: 3px solid var(--brick); background: var(--paper-pink); }
.update-card h2 { color: var(--brick-dark); font-size: 1.4rem; }
.help-list, .print-tips { margin: .7rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: .81rem; }
.help-list li + li, .print-tips li + li { margin-top: .42rem; }
.help-list li::marker, .print-tips li::marker { color: var(--brick); }
.side-link { display: block; margin-top: .65rem; font-size: .81rem; font-weight: 700; text-decoration: none; }
.paper-side { background: #fbf8f1; }
.featured-card {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1.1rem;
  padding: 1rem;
  border: 1px solid var(--line-dark);
  background: var(--paper-pink);
}
.print-preview { display: flex; min-height: 11.5rem; flex-direction: column; gap: .5rem; padding: .85rem; border: 1px solid var(--line-dark); background: #fffdf8; box-shadow: 3px 3px 0 rgba(145, 68, 53, .08); }
.print-preview span { color: var(--brick-dark); font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 1.1rem; font-weight: 700; }
.print-preview i { display: block; height: 1px; margin-top: .35rem; background: var(--line); }
.featured-card p { min-height: 0; }
.small-button { margin-top: .1rem; }
.checksum-note { display: flex; gap: .75rem; align-items: flex-start; margin-top: 2.7rem; padding: .95rem 1rem; border: 1px solid var(--line); background: var(--paper-deep); }
.checksum-mark { display: grid; width: 1.5rem; height: 1.5rem; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--brick); color: #fff; font-size: .8rem; font-weight: 800; }
.checksum-note h2 { margin: 0 0 .25rem; font-size: 1rem; }
.checksum-note p { margin: 0; color: var(--muted); font-size: .8rem; }

.content { padding-top: 1.8rem; }
.back-link { display: inline-block; margin-bottom: 1.25rem; color: var(--muted); font-size: .83rem; text-decoration: none; }
.guide-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding: .2rem 0 1.8rem; border-bottom: 1px solid var(--line); }
.guide-heading h1 { margin-bottom: .65rem; }
.page-corner { display: flex; align-items: end; gap: .3rem; padding: .5rem; }
.page-corner span { display: block; width: .6rem; border-radius: .15rem .15rem 0 0; background: var(--brick); }
.page-corner span:nth-child(1) { height: 1.1rem; opacity: .45; }
.page-corner span:nth-child(2) { height: 1.8rem; opacity: .7; }
.page-corner span:nth-child(3) { height: 2.5rem; }
.guide-layout { margin-top: 2rem; }
.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 1rem; }
.step-grid article { min-width: 0; padding: .9rem; border: 1px solid var(--line); background: var(--paper-deep); }
.step-number { color: var(--brick); font-family: Georgia, serif; font-size: .76rem; font-weight: 700; }
.step-grid h3 { margin: .45rem 0 .35rem; font-size: .98rem; }
.step-grid p { margin: 0; color: var(--muted); font-size: .81rem; line-height: 1.55; }
.guide-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 1rem; }
.guide-card { min-width: 0; padding: .9rem; border: 1px solid var(--line); background: #fff; }
.guide-card h3 { margin: .65rem 0 .4rem; font-size: .95rem; }
.guide-card p { margin: 0; color: var(--muted); font-size: .81rem; line-height: 1.55; }
.table-wrap { overflow-x: auto; margin-top: 1rem; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .81rem; }
th, td { padding: .65rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: var(--paper-deep); color: var(--muted); font-size: .72rem; font-weight: 700; white-space: nowrap; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
code { padding: .08rem .22rem; border-radius: .15rem; background: var(--paper-pink); color: var(--brick-dark); font-size: .88em; }
pre { overflow-x: auto; margin: .65rem 0 1rem; padding: .75rem .85rem; border-left: 3px solid var(--brick); background: #493b35; color: #fff8f0; font-size: .78rem; line-height: 1.55; }
pre code { padding: 0; background: transparent; color: inherit; white-space: pre; }
.small-note { color: var(--muted); font-size: .8rem; }
.side-nav { display: grid; gap: .35rem; margin-top: .7rem; }
.side-nav a { padding: .3rem .45rem; border-left: 2px solid var(--line); color: var(--muted); font-size: .8rem; }
.side-nav a:hover { border-color: var(--brick); color: var(--brick-dark); }

footer { border-top: 1px solid var(--line); background: var(--paper-deep); color: var(--muted); font-size: .78rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.8rem; }
footer p { margin: 0; }
footer a { font-size: .78rem; text-decoration: none; }

@media (max-width: 900px) {
  .content-layout, .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .guide-aside { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .wrap { width: min(calc(100% - 1.5rem), 72rem); }
  .header-inner { align-items: flex-start; flex-direction: column; gap: .65rem; min-height: 0; padding: .8rem 0; }
  nav { gap: .25rem .75rem; }
  nav a { font-size: .79rem; }
  main { padding-top: 1.35rem; }
  .hero { grid-template-columns: 1fr; gap: .7rem; padding-bottom: 1.2rem; }
  h1 { font-size: clamp(1.95rem, 9vw, 2.5rem); }
  .hero-note { justify-self: start; padding-block: .2rem; }
  .hero-note b { font-size: 1rem; }
  .hero-actions { margin-top: .9rem; }
  .category-nav { gap: .4rem; margin: .9rem 0 1.5rem; }
  .category-nav a { display: block; padding: .55rem .35rem; text-align: center; }
  .category-nav span, .category-nav small { display: none; }
  .category-nav strong { font-size: .78rem; }
  .resource-grid, .step-grid, .guide-cards, .sidebar, .guide-aside { grid-template-columns: 1fr; }
  .resource-section + .resource-section, .guide-section + .guide-section { margin-top: 2.25rem; }
  .section-heading { align-items: start; flex-direction: column; gap: .2rem; }
  .resource-card { min-height: 0; }
  .featured-card { grid-template-columns: 1fr; }
  .print-preview { min-height: 7rem; }
  .guide-heading { align-items: start; flex-direction: column; gap: .8rem; }
  .page-corner { display: none; }
  .guide-layout { margin-top: 1.6rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: .75rem 0; }
}
