/* =========================================================
   8868在线 — /assets/site.css
   全站共享外壳：reset / tokens / 排版 / 头部 / 页脚 / 通用组件
   ========================================================= */

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

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

body,
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

img,
svg,
picture,
video {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

a { color: inherit; }

/* ---------- 2. Design tokens ---------- */
:root {
  --c-red: #B42318;
  --c-red-deep: #7A1010;
  --c-blue: #0B4F6C;
  --c-blue-mid: #1D6F8C;
  --c-ice: #D7EAF2;
  --c-gold: #D4A017;
  --c-snow: #FDFBF7;
  --c-ink: #1B1F24;
  --c-stone: #E8E4DC;
  --c-green: #2F7D5D;

  --f-display: 'Noto Sans SC', 'Source Han Sans SC', sans-serif;
  --f-head: 'Noto Sans SC', 'Source Han Sans SC', 'Barlow Condensed', sans-serif;
  --f-data: 'JetBrains Mono', 'Roboto Mono', ui-monospace, monospace;
  --f-body: 'Noto Sans SC', 'Source Han Sans SC', system-ui, -apple-system, sans-serif;

  --rail-w: 88px;
  --bar-h: 58px;
  --shell-max: 1240px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --read-progress: 0%;
}

/* ---------- 3. Base ---------- */
body {
  margin: 0;
  background-color: var(--c-snow);
  color: var(--c-ink);
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { display: block; }

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

/* ---------- 4. Focus ---------- */
:where(a, button, [tabindex], summary):focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(122, 16, 16, 0.35);
  border-radius: 2px;
}

/* ---------- 5. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  transform: translateY(-180%);
  padding: 10px 18px;
  background-color: var(--c-gold);
  color: #231A00;
  font-family: var(--f-head);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-radius: 2px;
  transition: transform 0.18s var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--c-red-deep);
  outline-offset: 2px;
}

/* ---------- 6. Header — mobile first ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  color: var(--c-snow);
  background-image: linear-gradient(150deg, #0B4F6C 0%, #073A50 60%, #06222F 100%);
  border-bottom: 1px solid rgba(212, 160, 23, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--bar-h);
  padding: 0 16px;
}

.brand {
  order: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--c-snow);
  font-family: var(--f-head);
  font-weight: 900;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  background-color: var(--c-red);
  color: var(--c-snow);
  font-family: var(--f-data);
  font-size: 0.8125rem;
  font-weight: 700;
  border: 1px solid var(--c-gold);
  border-radius: 2px;
}

.brand-name {
  display: block;
  white-space: nowrap;
  font-size: 1rem;
  line-height: 1;
}

.version-badge {
  order: 2;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 2px 7px;
  color: var(--c-gold);
  font-family: var(--f-data);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border: 1px solid rgba(212, 160, 23, 0.55);
  border-radius: 999px;
}

.nav-toggle {
  order: 3;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  background-color: rgba(253, 251, 247, 0.08);
  border: 1px solid rgba(212, 160, 23, 0.45);
  border-radius: 2px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--c-snow);
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}

.site-header[data-nav-open="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header[data-nav-open="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header[data-nav-open="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 抽屉导航 */
.site-nav {
  order: 4;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  width: min(340px, 86vw);
  padding: calc(var(--bar-h) + 28px) 20px 36px;
  overflow-y: auto;
  background-image: linear-gradient(165deg, #0C4A66 0%, #082A3A 68%, #061A24 100%);
  border-left: 1px solid rgba(212, 160, 23, 0.42);
  box-shadow: -28px 0 60px rgba(6, 26, 36, 0.45);
  transform: translateX(103%);
  visibility: hidden;
  transition: transform 0.3s var(--ease), visibility 0s linear 0.3s;
}

.site-nav[data-open="true"] {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.3s var(--ease), visibility 0s linear 0s;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  border-bottom: 1px solid rgba(253, 251, 247, 0.1);
}

.nav-link {
  display: block;
  padding: 14px 12px;
  color: rgba(253, 251, 247, 0.82);
  font-family: var(--f-head);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.nav-link:hover {
  color: var(--c-snow);
  background-color: rgba(253, 251, 247, 0.08);
}

.nav-link[aria-current="page"] {
  color: var(--c-snow);
  background-color: rgba(180, 35, 24, 0.92);
  border-left-color: var(--c-gold);
}

/* 阅读进度轨 */
.progress-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  background-color: rgba(253, 251, 247, 0.14);
}

.progress-rail-fill {
  display: block;
  width: var(--read-progress);
  height: 100%;
  background-image: linear-gradient(90deg, var(--c-gold), var(--c-red));
  transition: width 0.12s linear;
}

/* ---------- 7. Footer ---------- */
.site-footer {
  position: relative;
  margin-top: 72px;
  padding-top: 56px;
  background-color: var(--c-ink);
  color: rgba(253, 251, 247, 0.78);
  font-size: 0.9375rem;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background-image: linear-gradient(90deg, var(--c-red) 0%, var(--c-gold) 42%, var(--c-blue-mid) 100%);
}

.footer-inner {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: 20px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(212, 160, 23, 0.28);
}

.footer-brand { min-width: 0; }

.footer-wordmark {
  display: inline-block;
  padding-bottom: 10px;
  color: var(--c-snow);
  font-family: var(--f-head);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
  border-bottom: 2px solid var(--c-red);
}

.footer-version {
  margin-top: 14px;
  color: var(--c-gold);
  font-family: var(--f-data);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.footer-tagline {
  margin-top: 10px;
  max-width: 32ch;
  color: rgba(253, 251, 247, 0.62);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.footer-col { min-width: 0; }

.footer-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--c-gold);
  font-family: var(--f-head);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.footer-col-title::before {
  content: "";
  flex: none;
  width: 12px;
  height: 2px;
  background-color: var(--c-red);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-link {
  display: inline-block;
  color: rgba(253, 251, 247, 0.75);
  font-size: 0.9375rem;
  line-height: 1.6;
  text-decoration: none;
  transition: color 0.16s var(--ease), transform 0.16s var(--ease);
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--c-gold);
  transform: translateX(4px);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-contact-key {
  color: rgba(253, 251, 247, 0.45);
  font-family: var(--f-head);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.footer-contact-value {
  color: var(--c-snow);
  font-size: 0.9375rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.footer-contact-value--mono {
  font-family: var(--f-data);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.footer-note {
  margin-top: 16px;
  padding-left: 12px;
  color: rgba(253, 251, 247, 0.55);
  font-size: 0.8125rem;
  line-height: 1.65;
  border-left: 2px solid var(--c-green);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 20px 0 28px;
  color: rgba(253, 251, 247, 0.55);
  font-size: 0.8125rem;
}

.footer-copy,
.footer-icp { margin: 0; }

.footer-icp {
  font-family: var(--f-data);
  letter-spacing: 0.02em;
}

/* ---------- 8. Content shell & grid ---------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: 20px;
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

/* ---------- 9. Type components ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--c-red);
  font-family: var(--f-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 18px;
  height: 2px;
  background-color: var(--c-gold);
}

.display-title {
  margin: 0;
  color: var(--c-ink);
  font-family: var(--f-display);
  font-size: clamp(2.75rem, 6.5vw, 5.5rem);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}

.section-title {
  margin: 0;
  color: var(--c-ink);
  font-family: var(--f-head);
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.06;
}

.lede {
  max-width: 68ch;
  margin: 0;
  color: #3A424A;
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.75;
}

.data-figure {
  font-family: var(--f-data);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* ---------- 10. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  font-family: var(--f-head);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease),
              border-color 0.16s var(--ease), transform 0.16s var(--ease);
}

.btn--primary {
  background-color: var(--c-red);
  color: var(--c-snow);
  border-color: var(--c-red-deep);
}

.btn--primary:hover {
  background-color: var(--c-red-deep);
  transform: translateY(-1px);
}

.btn--ghost {
  background-color: transparent;
  color: var(--c-blue);
  border-color: rgba(11, 79, 108, 0.42);
}

.btn--ghost:hover {
  background-color: var(--c-ice);
  border-color: var(--c-blue);
}

.btn--gold {
  background-color: var(--c-gold);
  color: #241A00;
  border-color: #B98B10;
}

.btn--gold:hover {
  background-color: #E3B233;
  transform: translateY(-1px);
}

/* ---------- 11. Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background-color: var(--c-ice);
  color: var(--c-blue);
  font-family: var(--f-head);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(11, 79, 108, 0.18);
  border-radius: 2px;
}

.tag--red {
  background-color: var(--c-red);
  color: var(--c-snow);
  border-color: var(--c-red-deep);
}

.tag--gold {
  background-color: var(--c-gold);
  color: #3A2A00;
  border-color: #B98B10;
}

/* ---------- 12. Paper & print surfaces ---------- */
.paper {
  position: relative;
  padding: 24px;
  background-color: var(--c-snow);
  border: 1px solid rgba(27, 31, 36, 0.12);
  box-shadow: 0 1px 0 rgba(27, 31, 36, 0.06), 8px 8px 0 -3px var(--c-stone);
}

.print-frame {
  position: relative;
  padding: 20px;
  background-color: #FFFFFF;
  border: 1.5px solid var(--c-ink);
}

.print-frame::after {
  content: "";
  position: absolute;
  inset: 4px;
  pointer-events: none;
  border: 1px solid rgba(27, 31, 36, 0.18);
}

/* ---------- 13. Media frame ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-image: linear-gradient(135deg, var(--c-ice) 0%, #EDF4F7 55%, var(--c-stone) 100%);
  border: 1px solid rgba(11, 79, 108, 0.15);
}

.media-frame > img,
.media-frame > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }

.media-frame-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 10px;
  background-color: rgba(11, 31, 42, 0.82);
  color: var(--c-snow);
  font-family: var(--f-data);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-left: 2px solid var(--c-gold);
}

/* ---------- 14. Breadcrumbs & status ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: #5A6470;
  font-family: var(--f-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--c-gold);
}

.breadcrumbs a {
  color: var(--c-blue);
  text-decoration: none;
}

.breadcrumbs a:hover { text-decoration: underline; }

.breadcrumbs [aria-current="page"] { color: var(--c-ink); }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  background-color: var(--c-green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(47, 125, 93, 0.18);
}

/* ---------- 15. Tablet ---------- */
@media (min-width: 640px) {
  .grid-12 { gap: 20px; }

  .shell { padding-inline: 32px; }

  .footer-inner { padding-inline: 32px; }

  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 32px;
  }

  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- 16. Desktop rail ---------- */
@media (min-width: 1024px) {
  body {
    padding-left: var(--rail-w);
  }

  .shell { padding-inline: 48px; }

  .skip-link { left: calc(var(--rail-w) + 12px); }

  .site-header {
    position: fixed;
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    width: var(--rail-w);
    height: 100vh;
    height: 100dvh;
    z-index: 120;
    border-bottom: 0;
    border-right: 1px solid rgba(212, 160, 23, 0.35);
    background-image: linear-gradient(180deg, #0B4F6C 0%, #06303F 58%, #071E29 100%);
  }

  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    height: 100%;
    min-height: 0;
    padding: 18px 8px 24px;
  }

  .brand {
    order: 1;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .brand-name {
    font-size: 0.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
  }

  .version-badge {
    order: 3;
    margin-left: 0;
    padding: 2px 6px;
    font-size: 0.625rem;
  }

  .nav-toggle { display: none; }

  .site-nav {
    order: 2;
    position: static;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    width: 100%;
    padding: 0;
    overflow: visible;
    background-image: none;
    border: 0;
    box-shadow: none;
    transform: none;
    visibility: visible;
    transition: none;
  }

  .nav-list {
    width: 100%;
    gap: 3px;
  }

  .nav-item { border-bottom: 0; }

  .nav-link {
    padding: 10px 2px;
    font-size: 0.6875rem;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-align: center;
    border-left: 0;
    border-radius: 2px;
  }

  .nav-link[aria-current="page"] {
    background-color: var(--c-red);
    color: var(--c-snow);
    box-shadow: inset 0 -2px 0 var(--c-gold);
  }

  .progress-rail {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 3px;
    height: auto;
  }

  .progress-rail-fill {
    width: 100%;
    height: var(--read-progress);
    background-image: linear-gradient(180deg, var(--c-gold), var(--c-red));
    transition: height 0.12s linear;
  }

  .footer-inner { padding-inline: 48px; }

  .footer-top {
    grid-template-columns: 1.5fr 0.85fr 0.85fr 1.3fr;
    gap: 32px 40px;
  }

  .footer-brand { grid-column: auto; }
}

/* ---------- 17. Reduced motion ---------- */
@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;
  }

  .progress-rail-fill { transition: none !important; }
}
