/* ==========================================================================
   加拿大预测站 · 共享样式表 /assets/site.css
   北境黑底 + 深枫叶红锚点 + 极光青数据线 · 框景双层胶囊导航 · 四段式页脚
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 150px;
}

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

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

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

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; }

/* ---------- 2. 变量与中文排版 ---------- */
:root {
  --ink: #070B12;
  --panel: #0E1524;
  --graphite: #1B2436;
  --aurora-deep: #17233A;
  --red: #A31621;
  --red-bright: #E4572E;
  --cyan: #37C8C3;
  --gold: #E3B505;
  --mist: #8C93A3;
  --snow: #F4F1EA;

  --font-display: "Noto Sans SC", "Source Han Sans SC", "HarmonyOS Sans SC",
    "HarmonyOS Sans", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia,
    "Times New Roman", serif;
  --font-data: "JetBrains Mono", "Roboto Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, monospace;

  --shell-width: min(1240px, 92vw);
  --grid-gap: 24px;
  --radius-organic: 22px 22px 22px 6px;
  --radius-soft: 4px 20px 4px 20px;
  --line-soft: rgba(140, 147, 163, 0.22);
}

body {
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    radial-gradient(1200px 520px at 82% -10%, rgba(55, 200, 195, 0.10), transparent 68%),
    radial-gradient(900px 480px at -8% 6%, rgba(163, 22, 33, 0.16), transparent 66%);
  background-repeat: no-repeat;
  color: rgba(244, 241, 234, 0.88);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--snow);
}

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

/* ---------- 3. 通用容器与网格 ---------- */
.shell {
  width: var(--shell-width);
  margin-inline: auto;
}

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

.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

.section-index {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-data);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
}

.section-index::after {
  content: "";
  width: 48px;
  height: 1px;
  background-color: currentColor;
  opacity: 0.6;
}

.scale-rule {
  height: 10px;
  border-top: 1px solid var(--graphite);
  background-image: repeating-linear-gradient(
    90deg,
    var(--graphite) 0 1px,
    transparent 1px 26px
  );
  background-position: 0 3px;
  background-repeat: repeat-x;
  background-size: 100% 7px;
}

.aurora-band {
  height: 3px;
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    var(--cyan) 22%,
    var(--gold) 62%,
    var(--red) 88%,
    transparent 100%
  );
}

/* ---------- 4. 正文容器 ---------- */
.prose {
  max-width: 68ch;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  color: rgba(244, 241, 234, 0.86);
}

.prose > * + * { margin-top: 1.2em; }

.prose h2 {
  font-size: 28px;
  margin-top: 2.2em;
}

.prose h3 {
  font-size: 21px;
  margin-top: 1.8em;
}

.prose p { margin: 0; }

.prose ul,
.prose ol {
  padding-left: 1.4em;
  list-style: disc;
}

.prose ol { list-style: decimal; }

.prose li + li { margin-top: 0.45em; }

.prose li::marker { color: var(--gold); }

.prose a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose blockquote {
  padding-left: 18px;
  border-left: 3px solid var(--red);
  color: var(--snow);
}

.prose code {
  font-family: var(--font-data);
  font-size: 0.92em;
  padding: 2px 6px;
  background-color: var(--aurora-deep);
  border-radius: 4px;
  color: var(--snow);
}

/* ---------- 5. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 12px 20px;
  background-color: var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  border-radius: var(--radius-soft);
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}

.skip-link:focus { transform: translateY(0); }

/* ---------- 6. 共享头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 14px 0 12px;
  background-image: linear-gradient(
    180deg,
    rgba(7, 11, 18, 0.97) 0%,
    rgba(7, 11, 18, 0.84) 58%,
    rgba(7, 11, 18, 0) 100%
  );
}

.scroll-meter {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: rgba(27, 36, 54, 0.9);
}

.scroll-meter__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background-image: linear-gradient(
    90deg,
    var(--cyan) 0%,
    var(--gold) 62%,
    var(--red-bright) 100%
  );
}

.header-capsule {
  position: relative;
  background-color: var(--panel);
  border: 1px solid var(--graphite);
  border-radius: var(--radius-organic);
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(7, 11, 18, 0.6);
}

.header-capsule::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 74px;
  height: 3px;
  background-color: var(--red);
}

.header-ribbon {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--graphite);
  max-height: 96px;
  opacity: 1;
  transition: max-height 0.24s ease, opacity 0.2s ease, padding 0.24s ease,
    border-color 0.2s ease;
}

.site-header[data-condensed] .header-ribbon {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom-color: transparent;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--snow);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  background-color: var(--red);
  color: var(--snow);
  font-family: var(--font-data);
  font-size: 13px;
  letter-spacing: 0.06em;
  border-radius: 12px 3px 12px 3px;
}

.brand-text { display: block; }

.brand-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.brand-note {
  display: block;
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--mist);
}

.ribbon-note {
  margin: 0 0 0 auto;
  font-family: var(--font-data);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--mist);
  white-space: nowrap;
}

.version-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(55, 200, 195, 0.42);
  border-radius: 999px;
  background-color: rgba(55, 200, 195, 0.08);
  white-space: nowrap;
}

.version-chip__label {
  font-family: var(--font-data);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--mist);
}

.version-chip__value {
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--cyan);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px 8px 18px;
}

.header-nav { flex: 1 1 auto; }

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.nav-item { display: block; }

.nav-link {
  position: relative;
  display: inline-block;
  padding: 10px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  color: var(--mist);
  text-decoration: none;
  border-radius: 12px 12px 12px 3px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  background-color: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.22s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--snow);
  background-color: rgba(27, 36, 54, 0.92);
}

.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }

.nav-link[aria-current="page"] {
  color: var(--snow);
  background-color: var(--red);
}

.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  background-color: var(--gold);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background-color: transparent;
  border: 1px solid var(--graphite);
  border-radius: 14px 14px 14px 4px;
  color: var(--snow);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.nav-toggle:hover { border-color: var(--cyan); color: var(--cyan); }

.nav-toggle__label { letter-spacing: 0.04em; }

.nav-toggle__bars {
  display: grid;
  gap: 4px;
  width: 18px;
}

.nav-toggle__bars i {
  display: block;
  height: 2px;
  background-color: currentColor;
  transition: transform 0.2s ease;
}

.header-capsule[data-open] .nav-toggle__bars i:first-child {
  transform: translateY(3px) rotate(45deg);
}

.header-capsule[data-open] .nav-toggle__bars i:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* ---------- 7. 共享页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 9vw, 128px);
  padding-bottom: 40px;
  background-color: var(--ink);
  border-top: 1px solid var(--graphite);
  color: var(--mist);
}

.footer-aurora {
  height: 5px;
  background-image: linear-gradient(
    90deg,
    rgba(55, 200, 195, 0) 0%,
    rgba(55, 200, 195, 0.9) 16%,
    rgba(55, 200, 195, 0.32) 36%,
    rgba(227, 181, 5, 0.55) 58%,
    rgba(163, 22, 33, 0.88) 84%,
    rgba(163, 22, 33, 0) 100%
  );
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.25fr;
  gap: 40px;
  padding: 56px 0 36px;
}

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

.footer-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--snow);
  margin-bottom: 10px;
}

.footer-tagline {
  max-width: 30ch;
  margin-bottom: 22px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--mist);
}

.footer-cta { margin-top: 2px; }

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

.footer-col__title {
  margin-bottom: 18px;
  font-family: var(--font-data);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--snow);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}

.footer-link {
  display: inline-block;
  padding-bottom: 2px;
  font-size: 15px;
  color: var(--mist);
  text-decoration: none;
  background-image: linear-gradient(90deg, var(--cyan), var(--cyan));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.2s ease, color 0.2s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--snow);
  background-size: 100% 1px;
}

.footer-contact {
  display: grid;
  gap: 14px;
}

.footer-contact__item {
  display: grid;
  gap: 3px;
}

.footer-contact__key {
  font-family: var(--font-data);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--mist);
}

.footer-contact__value {
  font-size: 15px;
  line-height: 1.7;
  color: var(--snow);
  word-break: break-word;
}

.footer-note {
  margin-top: 18px;
  padding-left: 12px;
  border-left: 2px solid var(--graphite);
  font-size: 13px;
  line-height: 1.75;
  color: var(--mist);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--graphite);
  font-family: var(--font-data);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--mist);
}

.footer-legal__line { margin: 0; }

.footer-legal__mark {
  margin: 0;
  padding: 5px 12px;
  border: 1px solid rgba(55, 200, 195, 0.42);
  border-radius: 999px;
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--cyan);
}

/* ---------- 8. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-soft);
  transition: transform 0.18s ease, background-color 0.18s ease,
    color 0.18s ease, border-color 0.18s ease;
}

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

.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--red-bright);
  transform: translateX(4px);
}

.btn--ghost {
  background-color: transparent;
  color: var(--snow);
  border-color: var(--line-soft);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateX(4px);
}

/* ---------- 9. 面包屑 ---------- */
.breadcrumb { padding-top: 22px; }

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--mist);
}

.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  color: var(--line-soft);
}

.breadcrumb__link {
  color: var(--mist);
  text-decoration: none;
  transition: color 0.18s ease;
}

.breadcrumb__link:hover,
.breadcrumb__link:focus-visible { color: var(--snow); }

/* ---------- 10. 图片框景基础规则 ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background-color: var(--aurora-deep);
  border: 1px solid var(--graphite);
  border-radius: var(--radius-soft);
}

.media-frame img,
.media-frame__img {
  display: block;
  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::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(244, 241, 234, 0.04) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: soft-light;
}

.media-frame__tag {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 6px 12px;
  background-color: var(--gold);
  color: var(--ink);
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.media-frame__caption {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--graphite);
  background-color: var(--panel);
  font-family: var(--font-data);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--mist);
}

/* ---------- 11. 显现动效 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 12. 辅助类 ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 13. 响应式 ---------- */
@media (max-width: 1080px) {
  .footer-grid {
    grid-template-columns: 1.3fr 1fr;
    gap: 36px;
  }
  .footer-col:last-child { grid-column: span 2; }
}

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

  .ribbon-note { display: none; }

  .header-bar {
    flex-wrap: wrap;
    padding: 8px 12px;
  }

  .header-nav {
    flex: 1 1 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.26s ease;
  }

  .header-capsule[data-open] .header-nav { max-height: 620px; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 4px 0 12px;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
  }

  .nav-link::after {
    left: 16px;
    right: 16px;
    bottom: 7px;
  }

  .nav-toggle { display: inline-flex; }

  .grid-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

  .col-4,
  .col-5,
  .col-7,
  .col-8 { grid-column: span 6; }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding-top: 46px;
  }

  .footer-col:last-child { grid-column: span 1; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }

  .header-ribbon {
    gap: 12px;
    padding: 11px 14px;
  }

  .brand-note { display: none; }

  .version-chip { padding: 5px 11px; }

  .grid-12 { grid-template-columns: minmax(0, 1fr); }

  .col-4,
  .col-5,
  .col-7,
  .col-8,
  .col-12 { grid-column: span 1; }

  .footer-links { grid-template-columns: minmax(0, 1fr); }

  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .btn { width: 100%; justify-content: center; }

  .footer-cta { width: auto; justify-content: flex-start; }
}

/* ---------- 14. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  html { scroll-behavior: auto; }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .nav-link:hover,
  .btn--primary:hover,
  .btn--ghost:hover { transform: none; }
}
