/* ==========================================================================
   北单·进度手账 — shared stylesheet  /assets/site.css
   01 reset · 02 tokens · 03 base · 04 layout · 05 header · 06 footer
   07 components · 08 tools · 09 media
   ========================================================================== */

/* ---------- 01 reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body, h1, h2, h3, h4, h5, p, ul, ol, li, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

/* ---------- 02 tokens ---------- */
:root {
  --ink: #0F3B2E;
  --ink-deep: #0A2A20;
  --orange: #FF6B1A;
  --orange-soft: #FFA45C;
  --paper: #F6F1E4;
  --paper-2: #EAE2D2;
  --char: #2B2B28;
  --graphite: #6B6A63;
  --teal: #2E8C7A;
  --cream: #FFD9A0;

  --line: rgba(43, 43, 40, .14);
  --line-2: rgba(43, 43, 40, .30);
  --line-paper: rgba(246, 241, 228, .22);
  --line-paper-2: rgba(246, 241, 228, .42);

  --hd-top-h: 32px;
  --hd-main-h: 64px;
  --hd-main-h-sm: 52px;

  --wrap: 1280px;
  --pad: clamp(16px, 4vw, 40px);

  --fs-12: 12px; --fs-14: 14px; --fs-16: 16px; --fs-20: 20px;
  --fs-25: 25px; --fs-31: 31px; --fs-39: 39px; --fs-49: 49px;

  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- 03 base ---------- */
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: 1.75;
  letter-spacing: .01em;
  color: var(--char);
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(15, 59, 46, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 59, 46, .055) 1px, transparent 1px);
  background-size: 96px 96px;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5 {
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.18;
  color: var(--char);
}
h1 { font-size: clamp(30px, 4.4vw, var(--fs-49)); }
h2 { font-size: clamp(24px, 3vw, var(--fs-39)); }
h3 { font-size: clamp(19px, 2vw, var(--fs-25)); }
h4 { font-size: var(--fs-20); }

p { max-width: 74ch; }
strong, b { font-weight: 900; }

.mono {
  font-family: var(--font-mono);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

::selection { background: var(--orange); color: var(--char); }

.sr-only, .visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 300;
  background: var(--orange);
  color: var(--char);
  font-size: var(--fs-14);
  font-weight: 900;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- 04 layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section { padding-block: clamp(32px, 6vw, 76px); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 20px;
  padding-bottom: 14px;
  margin-bottom: clamp(18px, 2.6vw, 32px);
  border-bottom: 1px solid var(--line-2);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .12em;
  color: var(--orange);
  text-transform: uppercase;
}

.sec-num {
  font-family: var(--font-mono);
  font-size: var(--fs-14);
  letter-spacing: .06em;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
}

.lede {
  font-size: var(--fs-20);
  line-height: 1.7;
  color: var(--char);
  max-width: 62ch;
}

.grid { display: grid; gap: clamp(14px, 1.8vw, 24px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 05 header ---------- */
.hd {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--paper);
}

.hd-top {
  height: var(--hd-top-h);
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  transition: height .22s ease, opacity .22s ease;
}
.hd[data-scrolled] .hd-top { height: 0; opacity: 0; }

.hd-top__inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  height: var(--hd-top-h);
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  gap: 20px;
}

.hd-top__links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.hd-top__link {
  font-size: var(--fs-12);
  letter-spacing: .02em;
  color: rgba(246, 241, 228, .74);
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.hd-top__link:hover { color: var(--orange-soft); border-bottom-color: var(--orange-soft); }

.hd-top__status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-12);
  color: var(--cream);
  white-space: nowrap;
  max-width: none;
}
.hd-top__dot {
  width: 8px; height: 8px;
  background: var(--orange);
  flex: none;
}
.hd-top__ver {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  color: rgba(246, 241, 228, .62);
  border: 1px solid var(--line-paper);
  padding: 1px 7px;
}

.hd-main {
  position: relative;
  background: var(--paper);
  border-bottom: 1px solid var(--line-2);
}

.hd-main__inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  min-height: var(--hd-main-h);
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  transition: min-height .22s ease;
}
.hd[data-scrolled] .hd-main__inner { min-height: var(--hd-main-h-sm); }

.hd-brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hd-brand__mark {
  width: 28px; height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: var(--ink-deep);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}
.hd-brand__text {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--ink);
  white-space: nowrap;
}
.hd-brand:hover .hd-brand__text { color: var(--orange); }

.hd-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  padding: 7px 11px;
  font-size: var(--fs-12);
  font-weight: 900;
  letter-spacing: .06em;
  color: var(--ink);
}
.hd-toggle:hover { border-color: var(--ink); }
.hd-toggle__bars { display: grid; gap: 3px; width: 16px; }
.hd-toggle__bars span { display: block; height: 2px; background: var(--ink); }
.hd-toggle[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.hd-toggle[aria-expanded="true"] .hd-toggle__bars span { background: var(--paper); }
.hd-toggle__label { line-height: 1; }

.hd-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.hd-nav__list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.7vw, 26px);
}
.hd-nav__item { flex: none; }
.hd-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 1px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--char);
  border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.hd-nav__link:hover { color: var(--ink); border-bottom-color: var(--orange-soft); }
.hd-nav__link[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--orange);
}
.hd-nav__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  font-weight: 400;
  background: var(--orange);
  color: var(--char);
  padding: 1px 5px;
  line-height: 1.5;
}

.hd-tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hd-index { position: relative; }
.hd-index__input {
  width: 190px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--char);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
}
.hd-index__input::placeholder { color: var(--graphite); }
.hd-index__input:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--paper);
  box-shadow: 0 0 0 2px rgba(255, 107, 26, .2);
}
.hd-index__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 0 0 1px var(--line);
  z-index: 130;
}
.hd-index__hit { border-bottom: 1px solid var(--line); }
.hd-index__hit:last-child { border-bottom: 0; }
.hd-index__hit-link {
  display: block;
  padding: 9px 12px;
  transition: background .16s ease;
}
.hd-index__hit-link:hover { background: var(--paper-2); }
.hd-index__hit-t {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
}
.hd-index__hit-s {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--graphite);
}
.hd-index__empty {
  padding: 12px;
  font-size: 12px;
  color: var(--graphite);
}

.hd-cta { flex: none; }

/* ---------- 06 footer ---------- */
.ft {
  margin-top: auto;
  background: var(--ink);
  color: var(--cream);
  border-top: 4px solid var(--orange);
}
.ft__inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(36px, 5.5vw, 64px) var(--pad) 0;
}
.ft__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.1fr 1.3fr;
  gap: clamp(24px, 4vw, 56px);
  padding-bottom: clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--line-paper);
}
.ft__col { min-width: 0; }

.ft__brand {
  font-size: var(--fs-25);
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--paper);
  max-width: none;
  line-height: 1.3;
}
.ft__line {
  margin-top: 8px;
  font-size: var(--fs-14);
  color: var(--cream);
  max-width: 26ch;
}
.ft__mono {
  margin-top: 12px;
  font-size: var(--fs-12);
  color: rgba(246, 241, 228, .58);
}

.ft__title {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 400;
  letter-spacing: .14em;
  color: var(--orange-soft);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.ft__list { display: grid; gap: 6px; }
.ft__list--inline {
  grid-auto-flow: column;
  justify-content: start;
  gap: 18px;
  margin-top: 16px;
}
.ft__item { min-width: 0; }

.ft__link {
  display: inline-block;
  font-size: var(--fs-14);
  color: rgba(246, 241, 228, .84);
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.ft__link:hover { color: var(--orange); border-bottom-color: var(--orange); }

.ft__contact { display: block; margin-bottom: 12px; }
.ft__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--orange-soft);
  margin-bottom: 2px;
}
.ft__value {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(246, 241, 228, .88);
  overflow-wrap: anywhere;
}
.ft__copy-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  border: 1px solid var(--line-paper-2);
  color: var(--cream);
  padding: 1px 7px;
  margin-left: 8px;
  vertical-align: 2px;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.ft__copy-btn:hover { background: var(--orange); color: var(--char); border-color: var(--orange); }
.ft__copy-btn[data-state="done"] { background: var(--teal); border-color: var(--teal); color: var(--paper); }

.ft__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-block: 18px 22px;
}
.ft__copy {
  font-size: var(--fs-12);
  color: rgba(246, 241, 228, .64);
  max-width: none;
}
.ft__icp {
  font-family: var(--font-mono);
  letter-spacing: .04em;
  margin-left: 6px;
}
.ft__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-left: auto;
}
.ft__legal-link {
  font-size: var(--fs-12);
  color: rgba(246, 241, 228, .74);
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.ft__legal-link:hover { color: var(--orange); border-bottom-color: var(--orange); }

.to-top {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-12);
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--cream);
  border: 1px solid var(--line-paper-2);
  padding: 6px 11px;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.to-top[data-show] { display: inline-flex; }
.to-top:hover { background: var(--orange); color: var(--char); border-color: var(--orange); }

/* ---------- 07 components ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: var(--fs-14);
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1;
  text-align: center;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn--primary { background: var(--orange); color: var(--char); border-color: var(--orange); }
.btn--primary:hover { background: var(--orange-soft); border-color: var(--orange-soft); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--paper { background: transparent; color: var(--cream); border-color: var(--line-paper-2); }
.btn--paper:hover { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.btn--block { width: 100%; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .04em;
  color: var(--graphite);
}
.crumbs a { color: var(--ink); border-bottom: 1px solid var(--line-2); }
.crumbs a:hover { color: var(--orange); border-color: var(--orange); }
.crumbs__sep { color: var(--line-2); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  line-height: 1.6;
  padding: 2px 8px;
  background: var(--orange);
  color: var(--char);
}
.tag--teal { background: var(--teal); color: var(--paper); }
.tag--line { background: transparent; border: 1px solid var(--line-2); color: var(--graphite); }

.card {
  position: relative;
  padding: clamp(16px, 2.2vw, 26px);
  background: var(--paper);
  border: 1px solid var(--line-2);
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--ink); }
.card--file {
  background: var(--paper-2);
  border: 1px solid var(--ink);
}
.card--ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.card--ink h2, .card--ink h3, .card--ink h4 { color: var(--paper); }
.card--ink p { color: rgba(246, 241, 228, .86); }
.card__tag {
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  padding: 3px 9px;
  background: var(--orange);
  color: var(--char);
}

.disclosure {
  display: grid;
  border-top: 1px solid var(--line-2);
}
.disclosure__item { border-bottom: 1px solid var(--line-2); }
.disclosure__btn {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 2px;
  text-align: left;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--char);
  transition: color .18s ease;
}
.disclosure__btn:hover { color: var(--orange); }
.disclosure__btn[aria-expanded="true"] { color: var(--ink); }
.disclosure__idx {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .06em;
  color: var(--orange);
  padding-top: 6px;
}
.disclosure__title { flex: 1 1 auto; }
.disclosure__mark {
  flex: none;
  position: relative;
  width: 20px; height: 20px;
  margin-top: 5px;
  border: 1px solid var(--line-2);
}
.disclosure__mark::before,
.disclosure__mark::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.disclosure__mark::before { left: 4px; right: 4px; top: 9px; height: 1px; }
.disclosure__mark::after { top: 4px; bottom: 4px; left: 9px; width: 1px; transition: transform .22s ease; }
.disclosure__btn[aria-expanded="true"] .disclosure__mark::after { transform: scaleY(0); }
.disclosure__panel {
  padding: 0 2px 20px 38px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--char);
}

.figure {
  position: relative;
  margin: 0;
  border: 1px solid var(--line-2);
  background: var(--paper-2);
}
.figure__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--paper-2);
  background-image: repeating-linear-gradient(45deg, rgba(15, 59, 46, .07) 0 1px, transparent 1px 12px);
}
.figure__frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure__cap {
  padding: 8px 11px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: .04em;
  color: var(--graphite);
}
.figure--wide .figure__frame { aspect-ratio: 21 / 9; }
.figure--tall .figure__frame { aspect-ratio: 3 / 4; }
.figure--square .figure__frame { aspect-ratio: 1 / 1; }
.figure--ink .figure__frame {
  background-color: var(--ink);
  background-image: repeating-linear-gradient(45deg, rgba(246, 241, 228, .08) 0 1px, transparent 1px 12px);
}
.figure--ink .figure__cap { color: var(--cream); border-top-color: var(--line-paper); }

/* ---------- 08 tools ---------- */
[data-reveal] { opacity: 0; transform: translateY(10px); }
[data-reveal].is-inview {
  opacity: 1;
  transform: none;
  transition: opacity .5s ease, transform .5s ease;
}

/* ---------- 09 media ---------- */
@media (max-width: 1100px) {
  .hd-nav__list { gap: 12px; }
  .hd-nav__link { font-size: 14px; }
  .hd-index__input { width: 150px; }
}

@media (max-width: 900px) {
  html { scroll-padding-top: 84px; }

  .hd-toggle { display: inline-flex; margin-left: auto; }
  .hd-tools { margin-left: 0; }
  .hd-index { display: none; }

  .hd-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    justify-content: stretch;
    padding: 8px var(--pad) 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }
  .hd-nav[data-open] { display: block; }
  .hd-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .hd-nav__item { width: 100%; }
  .hd-nav__link {
    display: flex;
    padding: 13px 10px;
    font-size: var(--fs-16);
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
  }
  .hd-nav__link:hover { border-bottom-color: var(--line); }
  .hd-nav__link[aria-current="page"] {
    border-bottom-color: var(--line);
    border-left-color: var(--orange);
    background: var(--paper-2);
  }

  .ft__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ft__legal { margin-left: 0; width: 100%; }

  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .hd-top__links { display: none; }
  .hd-top__status { width: 100%; justify-content: flex-end; }
  .hd-brand__text { font-size: 15px; }
}

@media (max-width: 600px) {
  body { background-size: 56px 56px; }
  .ft__grid { grid-template-columns: 1fr; }
  .ft__list--inline { grid-auto-flow: row; gap: 6px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .disclosure__panel { padding-left: 2px; }
  .hd-cta { padding: 0 12px; font-size: 13px; }
  .hd-top__ver { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
