/* ==========================================================================
   北单 · 中国官方主站   /assets/site.css
   共享外壳：重置 / 变量 / 中文排版 / 页头 / 页脚 / 基础组件 / 响应式
   ========================================================================== */

/* ---------- 1. 重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--white); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 2. 设计变量 ---------- */
:root {
  --ink:        #0B1220;
  --ink-2:      #131C2E;
  --ink-3:      #071B1C;
  --red:        #E23A2E;
  --red-lite:   #FF7A6B;
  --cyan:       #20C4C9;
  --ochre:      #C97A3C;
  --gold:       #E8B84B;
  --cream:      #F4EFE6;
  --graphite:   #2A3446;
  --mist:       #9FB0C4;
  --white:      #FFFFFF;

  --text:       #DDE4EE;
  --text-dim:   #93A5BB;
  --line:       rgba(147,165,187,.22);
  --line-soft:  rgba(147,165,187,.12);
  --line-strong:rgba(147,165,187,.44);

  --paper-ink:  #211A14;
  --paper-dim:  #5C5147;
  --paper-line: rgba(33,26,20,.16);

  --font-head: "PingFang SC", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-body: var(--font-head);
  --font-mono: ui-monospace, "JetBrains Mono", "Roboto Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --shell: 1440px;
  --gutter: 64px;
  --nav-break: 980px;

  --ease: cubic-bezier(.22,.61,.36,1);
}

@media (max-width: 1100px) { :root { --gutter: 40px; } }
@media (max-width: 720px)  { :root { --gutter: 20px; } }

/* ---------- 3. 中文排版基线 ---------- */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.display {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.04;
  color: var(--white);
  font-size: clamp(2.4rem, 6vw, 5.5rem);
}

.h2 {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
  color: var(--white);
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
}

.h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.35;
  color: var(--white);
  font-size: 1.25rem;
}

.lede {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 62ch;
}

.prose { max-width: 68ch; }
.prose p + p { margin-top: 1.15em; }

.section--paper {
  background: var(--cream);
  color: var(--paper-ink);
}
.section--paper .h2,
.section--paper .h3,
.section--paper .display { color: var(--paper-ink); }
.section--paper .lede { color: var(--paper-dim); }
.section--paper a { color: #A32A20; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ochre);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--red);
}

/* ---------- 4. 布局容器 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.section--flush { padding: 0 0 96px; }

.section-head { margin-bottom: 48px; }

@media (max-width: 720px) {
  .section { padding: 64px 0; }
  .section--tight { padding: 44px 0; }
  .section-head { margin-bottom: 32px; }
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .grid-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
  .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 6; }
}
@media (max-width: 640px) {
  .grid-12 { grid-template-columns: minmax(0, 1fr); }
  .col-4, .col-5, .col-6, .col-7, .col-8, .col-12 { grid-column: span 1; }
}

/* ---------- 5. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}
.btn-primary:hover { background: #F04B3D; border-color: #F04B3D; color: var(--white); }

.btn-ghost {
  background: rgba(226,58,46,.10);
  border-color: rgba(226,58,46,.55);
  color: var(--red-lite);
}
.btn-ghost:hover { background: var(--red); border-color: var(--red); color: var(--white); }

/* ---------- 6. 跳过链接 ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -90px;
  z-index: 300;
  padding: 12px 20px;
  border-radius: 2px;
  background: var(--red);
  color: var(--white);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  transition: top .22s var(--ease);
}
.skip-link:focus { top: 12px; color: var(--white); }

/* ---------- 7. 页头命令栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  background: rgba(11,18,32,.94);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-shell {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 72px;
  transition: min-height .26s var(--ease);
}
.site-header.is-compact .header-shell { min-height: 56px; }

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(226,58,46,.62);
  background: linear-gradient(158deg, rgba(226,58,46,.20), rgba(11,18,32,0) 72%);
}
.brand-mark::before {
  content: "";
  width: 20px;
  height: 13px;
  background: var(--red);
  clip-path: polygon(
    0 62%, 20% 62%, 31% 6%, 47% 98%, 61% 44%, 69% 62%, 100% 62%,
    100% 76%, 64% 76%, 60% 66%, 47% 92%, 30% 0%, 25% 76%, 0 76%
  );
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.05;
}
.brand-name {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--white);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: .625rem;
  letter-spacing: .22em;
  color: var(--mist);
  text-transform: uppercase;
}

/* 主导航 */
.nav { margin-left: auto; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 14px;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--mist);
  text-decoration: none;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav-link:hover { color: var(--cream); background: rgba(32,196,201,.08); }
.nav-link:hover .nav-idx { color: var(--cyan); }

.nav-idx {
  font-family: var(--font-mono);
  font-size: .625rem;
  letter-spacing: .06em;
  color: rgba(147,165,187,.5);
  transition: color .2s var(--ease);
}

.nav-link[aria-current="page"] {
  color: var(--white);
  background: rgba(226,58,46,.12);
}
.nav-link[aria-current="page"] .nav-idx { color: var(--red-lite); }
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--red);
}

/* 右侧工具 */
.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.header-cta { white-space: nowrap; }

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.nav-toggle:hover { border-color: var(--cyan); background: rgba(32,196,201,.08); }
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--cream);
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 页头脉冲进度线 */
.header-pulse {
  position: relative;
  height: 2px;
  background: rgba(147,165,187,.14);
  overflow: hidden;
}
.header-pulse-fill {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--red) 0%, var(--ochre) 46%, var(--cyan) 100%);
  transition: transform .12s linear;
}

/* ---------- 8. 页头响应式 ---------- */
@media (max-width: 1180px) {
  .nav-link { padding: 10px 10px; font-size: .875rem; }
  .nav-idx { display: none; }
  .header-cta { padding: 10px 14px; font-size: .8125rem; }
}

@media (max-width: 980px) {
  .nav-toggle { display: flex; }

  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin: 0;
    background: var(--ink-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s var(--ease);
  }
  .nav[data-open] { max-height: calc(100vh - 56px); }

  .nav-list {
    display: block;
    padding: 8px 0 14px;
  }
  .nav-link {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 15px var(--gutter);
    border-bottom: 1px solid var(--line-soft);
    font-size: 1rem;
    color: var(--text);
  }
  .nav-link:last-child { border-bottom: 0; }
  .nav-link[aria-current="page"]::after { display: none; }
  .nav-link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--red);
  }
  .nav-idx { display: inline; color: var(--graphite); }
  .nav-link[aria-current="page"] .nav-idx { color: var(--red-lite); }
}

@media (max-width: 620px) {
  .header-cta { display: none; }
  .brand-sub { display: none; }
}

/* ---------- 9. 页脚 ---------- */
.site-footer {
  position: relative;
  background: var(--ink-3);
  color: var(--text);
  padding-top: 76px;
  margin-top: 0;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan) 0%, rgba(32,196,201,0) 42%, rgba(226,58,46,0) 58%, var(--red) 100%);
}

/* 品牌 + 三栏链接 */
.footer-top {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(0, 2.6fr);
  gap: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-brand-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.1;
  color: var(--white);
}
.footer-brand-line {
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ochre);
}
.footer-brand-note {
  margin-top: 14px;
  max-width: 34ch;
  font-size: .9375rem;
  line-height: 1.8;
  color: var(--text-dim);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer-col-title {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

.footer-col-list {
  display: grid;
  gap: 12px;
  list-style: none;
}
.footer-col-list a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .9375rem;
  color: var(--text);
  text-decoration: none;
  transition: color .2s var(--ease);
}
.footer-col-list a::before {
  content: "";
  width: 10px;
  height: 1px;
  flex: 0 0 auto;
  background: var(--graphite);
  transition: width .22s var(--ease), background-color .22s var(--ease);
}
.footer-col-list a:hover { color: var(--white); }
.footer-col-list a:hover::before { width: 22px; background: var(--cyan); }

/* 大屏订阅帮助文档：三阶步骤 */
.footer-help {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}
.footer-kicker {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mist);
}
.footer-help-title {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--white);
}

.help-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 34px;
  list-style: none;
}

.help-step {
  position: relative;
  padding-top: 22px;
  border-top: 2px solid var(--graphite);
}
.help-step::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  height: 2px;
  width: 40px;
  background: var(--red);
}
.help-step:nth-child(2)::before { width: 62px; background: var(--ochre); }
.help-step:nth-child(3)::before { width: 84px; background: var(--cyan); }

.help-step-kicker {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .18em;
  color: var(--mist);
}
.help-step-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  color: var(--white);
}
.help-step-title {
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream);
}
.help-step-text {
  font-size: .9375rem;
  line-height: 1.8;
  color: var(--text-dim);
}

/* 联系方式 */
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
}
.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.contact-key {
  min-width: 82px;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mist);
}
.contact-val {
  font-size: 1rem;
  color: var(--white);
  word-break: break-word;
}
.contact-row--wide .contact-val { color: var(--text); font-size: .9375rem; }

.contact-note {
  margin-top: 4px;
  max-width: 70ch;
  font-size: .875rem;
  line-height: 1.8;
  color: var(--text-dim);
}

.copy-btn {
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .12em;
  color: var(--mist);
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), background-color .2s var(--ease);
}
.copy-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.copy-btn.is-copied {
  border-color: var(--cyan);
  background: rgba(32,196,201,.14);
  color: var(--cyan);
}

/* 法务条 */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 42px;
}
.footer-legal-text {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .06em;
  color: var(--text-dim);
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
}
.legal-links a {
  font-size: .8125rem;
  color: var(--mist);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.legal-links a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }

/* 页脚响应式 */
@media (max-width: 980px) {
  .site-footer { padding-top: 60px; }
  .footer-top { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .help-steps { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}
@media (max-width: 560px) {
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
  .contact-key { min-width: 100%; }
  .footer-legal { flex-direction: column; align-items: flex-start; }
}

/* ---------- 10. 通用内容组件 ---------- */
.step-list { list-style: none; }
.step-item {
  position: relative;
  padding: 28px 0 28px 46px;
  border-top: 1px solid var(--line);
}
.step-item:last-child { border-bottom: 1px solid var(--line); }

.track {
  position: relative;
  overflow: hidden;
}
.track-inner {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.track-inner::-webkit-scrollbar { height: 6px; }
.track-inner::-webkit-scrollbar-thumb { background: var(--graphite); }
.track-item {
  flex: 0 0 auto;
  width: 360px;
  scroll-snap-align: start;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: .6875rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mist);
}
.tag--red  { border-color: rgba(226,58,46,.62);  color: var(--red-lite); background: rgba(226,58,46,.10); }
.tag--cyan { border-color: rgba(32,196,201,.62);  color: var(--cyan);     background: rgba(32,196,201,.10); }
.tag--gold { border-color: rgba(232,184,75,.62);  color: var(--gold);     background: rgba(232,184,75,.10); }

.breadcrumbs {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  color: var(--text-dim);
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--graphite); }
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--cyan); }
.breadcrumbs [aria-current="page"] { color: var(--cream); }

/* 图片容器基础：页面阶段把 img / video 直接放入 */
.figure {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--ink-2);
  border: 1px solid var(--line);
}
.figure > img,
.figure > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11,18,32,0) 52%, rgba(11,18,32,.52) 100%),
    repeating-linear-gradient(90deg, rgba(159,176,196,.07) 0 1px, transparent 1px 56px);
  pointer-events: none;
}
.figure--16x9 { aspect-ratio: 16 / 9; }
.figure--4x3  { aspect-ratio: 4 / 3; }
.figure--1x1  { aspect-ratio: 1 / 1; }
.figure--21x9 { aspect-ratio: 21 / 9; }
.figure--bare::after { display: none; }

@media (max-width: 720px) {
  .track-item { width: 280px; }
}

/* ---------- 11. 滚动显现 ---------- */
.has-js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
}
.has-js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 12. 降低动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .has-js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .header-pulse-fill { transition: none !important; }
}
