/* =========================================================
   365国际速发 · CN Dispatch — 共享站点样式 /assets/site.css
   ========================================================= */

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

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

body, h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

/* ---------- 2. Design tokens ---------- */
:root {
  --ds-blue: #0B3D91;
  --ds-navy: #06245C;
  --ds-ink: #0E1B2A;
  --ds-paper: #FBFCFE;
  --ds-grey: #F2F4F7;
  --ds-mist: #DCE6F7;
  --ds-mid: #6B7785;
  --ds-orange: #FF6B1A;
  --ds-orange-soft: #FFB088;
  --ds-cyan: #2E7DD1;
  --ds-green: #1F8A5B;

  --ds-rail-w: 248px;
  --ds-topbar-h: 64px;

  --ds-serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "Times New Roman", Georgia, serif;
  --ds-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ds-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --ds-ease: cubic-bezier(.22, .68, .3, 1);
}

/* ---------- 3. Base typography ---------- */
body {
  font-family: var(--ds-sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ds-ink);
  background: var(--ds-paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-top: var(--ds-topbar-h);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--ds-serif);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.008em;
  color: var(--ds-ink);
}

h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 4rem); }
h2 { font-size: clamp(1.65rem, 1.2rem + 1.9vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 1.02rem + 0.75vw, 1.55rem); }

strong { font-weight: 600; color: var(--ds-blue); }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#main-content { scroll-margin-top: calc(var(--ds-topbar-h) + 12px); }

/* ---------- 4. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  transform: translateY(-180%);
  background: var(--ds-orange);
  color: var(--ds-ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.7rem 1.05rem;
  border-radius: 2px;
  transition: transform 0.2s var(--ds-ease);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 5. Header shell ---------- */
.site-header { position: relative; z-index: 100; }

/* --- 5a. Mobile topbar --- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--ds-topbar-h);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
  background: var(--ds-blue);
  color: var(--ds-paper);
  border-bottom: 1px solid rgba(220, 230, 247, 0.22);
}

.topbar__brand { display: flex; flex-direction: column; line-height: 1.15; }
.topbar__brand-cn { font-family: var(--ds-serif); font-size: 1.05rem; letter-spacing: 0.01em; }
.topbar__brand-en {
  margin-top: 0.15rem;
  font-family: var(--ds-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ds-mist);
}

.topbar__toggle {
  width: 44px; height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(220, 230, 247, 0.4);
  border-radius: 2px;
  background: transparent;
  transition: background 0.2s var(--ds-ease), border-color 0.2s var(--ds-ease);
}
.topbar__toggle:hover { background: rgba(220, 230, 247, 0.14); border-color: var(--ds-mist); }
.topbar__toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--ds-paper);
  border-radius: 1px;
  transition: transform 0.25s var(--ds-ease), opacity 0.2s var(--ds-ease);
}
.topbar__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.topbar__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- 5b. Scrim --- */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 125;
  background: rgba(14, 27, 42, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ds-ease);
}
.nav-scrim[data-open="true"] { opacity: 1; pointer-events: auto; }

/* --- 5c. Rail (mobile = drawer) --- */
.rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 130;
  width: min(84vw, 320px);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.6rem 1.35rem 1.6rem;
  background: var(--ds-blue);
  color: var(--ds-paper);
  overflow-y: auto;
  border-right: 1px solid rgba(220, 230, 247, 0.16);
  transform: translateX(-104%);
  visibility: hidden;
  transition: transform 0.32s var(--ds-ease), visibility 0s linear 0.32s;
}
.rail[data-open="true"] {
  transform: translateX(0);
  visibility: visible;
  box-shadow: 26px 0 70px rgba(6, 36, 92, 0.35);
  transition: transform 0.32s var(--ds-ease), visibility 0s linear 0s;
}

.rail__brand {
  display: block;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid rgba(220, 230, 247, 0.22);
}
.rail__brand-mark {
  display: block;
  font-family: var(--ds-serif);
  font-size: 1.34rem;
  line-height: 1.24;
  letter-spacing: 0.01em;
  color: var(--ds-paper);
}
.rail__brand-sub {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--ds-mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ds-mist);
}

.rail__nav { display: block; }
.rail__list { display: flex; flex-direction: column; gap: 0.1rem; }
.rail__item { display: block; }

.rail__link {
  display: flex;
  align-items: baseline;
  gap: 0.72rem;
  padding: 0.62rem 0.55rem 0.62rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 2px 2px 0;
  color: rgba(251, 252, 254, 0.76);
  font-size: 0.985rem;
  line-height: 1.42;
  transition: color 0.18s var(--ds-ease), background 0.18s var(--ds-ease), border-color 0.18s var(--ds-ease);
}
.rail__link:hover { color: #ffffff; background: rgba(220, 230, 247, 0.1); }
.rail__link[aria-current="page"] {
  color: #ffffff;
  background: rgba(220, 230, 247, 0.16);
  border-left-color: var(--ds-orange);
}
.rail__link[aria-current="page"] .rail__num { color: var(--ds-orange); }

.rail__num {
  font-family: var(--ds-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(220, 230, 247, 0.72);
  transition: color 0.18s var(--ds-ease);
}
.rail__label { display: block; }

.rail__actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(220, 230, 247, 0.2);
}
.rail__action { width: 100%; }
.rail__meta {
  margin-top: 0.85rem;
  font-family: var(--ds-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(220, 230, 247, 0.55);
}

/* --- 5d. Scroll pulse (desktop only) --- */
.scroll-pulse { display: none; }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.15rem;
  font-family: var(--ds-sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.18s var(--ds-ease), color 0.18s var(--ds-ease), border-color 0.18s var(--ds-ease);
}
.btn--solid { background: var(--ds-orange); color: var(--ds-ink); }
.btn--solid:hover { background: var(--ds-orange-soft); }
.btn--ghost { background: transparent; color: var(--ds-paper); border-color: rgba(220, 230, 247, 0.45); }
.btn--ghost:hover { background: rgba(220, 230, 247, 0.14); border-color: var(--ds-mist); }
.btn--line { background: transparent; color: var(--ds-blue); border-color: rgba(11, 61, 145, 0.32); }
.btn--line:hover { background: var(--ds-blue); color: var(--ds-paper); border-color: var(--ds-blue); }

/* ---------- 7. Layout primitives ---------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 3.25rem);
}

.section { padding-block: clamp(2.4rem, 6vw, 5rem); }

.section__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--ds-mono);
  font-size: 0.71rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ds-orange);
}
.section__eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--ds-orange);
  flex: none;
}

.section__title { margin-top: 0.7rem; }

.section__lead {
  margin-top: 1rem;
  max-width: 60ch;
  font-size: 1.03rem;
  line-height: 1.8;
  color: var(--ds-mid);
}

.grid { display: grid; gap: clamp(1rem, 2.4vw, 1.75rem); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }

@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- 8. Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding-block: 1.35rem 0.4rem;
  font-size: 0.82rem;
  color: var(--ds-mid);
}
.breadcrumb__item { display: inline-flex; align-items: center; gap: 0.45rem; }
.breadcrumb__item a {
  color: var(--ds-mid);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ds-ease), border-color 0.18s var(--ds-ease);
}
.breadcrumb__item a:hover { color: var(--ds-blue); border-bottom-color: var(--ds-orange); }
.breadcrumb__item[aria-current="page"] { color: var(--ds-ink); }
.breadcrumb__sep { color: rgba(107, 119, 133, 0.55); }

/* ---------- 9. Card / tag ---------- */
.card {
  background: #ffffff;
  border: 1px solid var(--ds-mist);
  border-top: 2px solid var(--ds-blue);
  border-radius: 3px;
  padding: clamp(1.05rem, 2.2vw, 1.6rem);
  transition: border-color 0.2s var(--ds-ease), background 0.2s var(--ds-ease);
}
.card:hover { border-top-color: var(--ds-orange); background: var(--ds-paper); }

.card__index {
  font-family: var(--ds-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--ds-orange);
}
.card__title {
  margin-top: 0.45rem;
  font-family: var(--ds-serif);
  font-size: 1.16rem;
  line-height: 1.36;
}
.card__text {
  margin-top: 0.55rem;
  font-size: 0.94rem;
  line-height: 1.72;
  color: var(--ds-mid);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.26rem 0.6rem;
  font-family: var(--ds-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  background: var(--ds-mist);
  color: var(--ds-blue);
  border-radius: 2px;
}
.tag--orange { background: rgba(255, 107, 26, 0.14); color: #A63600; }

/* ---------- 10. Media frame ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: var(--ds-mist);
  aspect-ratio: 4 / 3;
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; }
.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(251, 252, 254, 0.5);
  pointer-events: none;
}
.media-frame__stub {
  display: grid;
  place-items: center;
  height: 100%;
  font-family: var(--ds-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ds-blue);
  background: linear-gradient(140deg, var(--ds-mist) 0%, #ffffff 100%);
}

/* ---------- 11. Prose ---------- */
.prose { max-width: 72ch; }
.prose p { line-height: 1.85; }
.prose p + p { margin-top: 1.1em; }
.prose h2 { margin-top: 2.3em; margin-bottom: 0.6em; }
.prose h3 { margin-top: 1.7em; margin-bottom: 0.5em; }
.prose ul, .prose ol { margin-top: 1em; display: flex; flex-direction: column; gap: 0.5rem; }
.prose ul li { position: relative; padding-left: 1.5rem; line-height: 1.8; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.78em;
  width: 9px; height: 1px;
  background: var(--ds-orange);
}
.prose a { color: var(--ds-blue); border-bottom: 1px solid rgba(11, 61, 145, 0.3); }
.prose a:hover { border-bottom-color: var(--ds-orange); }
.prose strong { color: var(--ds-ink); }

/* ---------- 12. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(3rem, 8vw, 6rem);
  padding: clamp(2.4rem, 5vw, 4.2rem) clamp(1.15rem, 4vw, 3.25rem) 1.6rem;
  background: var(--ds-ink);
  color: var(--ds-paper);
  overflow: hidden;
}

.footer__pulse {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ds-blue), var(--ds-cyan), var(--ds-orange), var(--ds-orange-soft), var(--ds-blue));
  background-size: 200% 100%;
  animation: pulse-slide 9s linear infinite;
}
@keyframes pulse-slide {
  to { background-position: -200% 0; }
}

.footer__grid {
  display: grid;
  gap: 2.4rem;
  max-width: 1180px;
  margin-inline: auto;
}
@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

.footer__brand { display: block; }
.footer__brand-line {
  font-family: var(--ds-serif);
  font-size: 1.34rem;
  line-height: 1.35;
  color: var(--ds-paper);
}
.footer__brand-sub {
  margin-top: 0.4rem;
  font-family: var(--ds-mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ds-mist);
}
.footer__note {
  margin-top: 1.3rem;
  max-width: 44ch;
  font-size: 0.86rem;
  line-height: 1.75;
  color: rgba(251, 252, 254, 0.6);
}

.footer__col { display: block; }
.footer__col-title {
  margin-bottom: 0.95rem;
  font-family: var(--ds-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ds-mist);
}

.footer__list { display: flex; flex-direction: column; gap: 0.55rem; }
.footer__link {
  font-size: 0.94rem;
  color: rgba(251, 252, 254, 0.78);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ds-ease), border-color 0.18s var(--ds-ease);
}
.footer__link:hover { color: var(--ds-orange); border-bottom-color: var(--ds-orange); }

.footer__contact { display: flex; flex-direction: column; gap: 0.85rem; }
.footer__contact-item {
  font-size: 0.94rem;
  line-height: 1.6;
  color: rgba(251, 252, 254, 0.82);
}
.footer__contact-label {
  display: block;
  margin-bottom: 0.15rem;
  font-family: var(--ds-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(107, 119, 133, 0.95);
}

.footer__bottom {
  max-width: 1180px;
  margin: 2.4rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(220, 230, 247, 0.16);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem 1.6rem;
  font-size: 0.8rem;
  color: rgba(251, 252, 254, 0.58);
}
.footer__legal { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; align-items: center; }
.footer__copy { font-size: 0.8rem; color: rgba(251, 252, 254, 0.58); }
.footer__icp {
  font-family: var(--ds-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: rgba(251, 252, 254, 0.66);
}

/* ---------- 13. Reveal protocol ---------- */
[data-js="on"] [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ds-ease), transform 0.6s var(--ds-ease);
}
[data-js="on"] [data-reveal][data-revealed="true"] {
  opacity: 1;
  transform: none;
}

/* ---------- 14. Desktop layout (>=1024px) ---------- */
@media (min-width: 1024px) {
  body {
    padding-top: 0;
    padding-left: var(--ds-rail-w);
  }

  .topbar { display: none; }
  .nav-scrim { display: none; }

  .rail {
    width: var(--ds-rail-w);
    z-index: 60;
    padding: 2.15rem 1.35rem 1.5rem;
    transform: none;
    visibility: visible;
    box-shadow: none;
    transition: none;
  }
  .rail[data-open="true"] { box-shadow: none; }

  .scroll-pulse {
    display: block;
    position: fixed;
    top: 0;
    left: calc(var(--ds-rail-w) - 2px);
    width: 2px;
    height: 100vh;
    z-index: 70;
    background: rgba(220, 230, 247, 0.15);
    pointer-events: none;
  }
  .scroll-pulse__fill {
    display: block;
    width: 100%;
    height: 0;
    background: linear-gradient(180deg, var(--ds-orange-soft), var(--ds-orange));
    transition: height 0.12s linear;
  }

  #main-content { scroll-margin-top: 24px; }
}

/* ---------- 15. Motion & accessibility ---------- */
body[data-nav-lock="true"] { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-js="on"] [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .scroll-pulse__fill { transition: none !important; }
  .footer__pulse { animation: none !important; background-position: 0 0 !important; }
}
