/* ==========================================================================
   加拿大主页 / northstar-pc.com.cn —— 共享站点样式 ( /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, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

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

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

/* ---------- 2. 变量 ---------- */
:root {
  /* 色彩 */
  --ink: #081627;
  --ink-2: #0F2742;
  --cyan: #5FD8CE;
  --teal: #2E9E93;
  --maple: #D2453C;
  --gold: #F0B44A;
  --slate: #7C8A9B;
  --moss: #3F6B57;
  --clay: #A9624A;
  --paper: #F4F1EA;

  /* 字体 */
  --font-display: "HarmonyOS Sans SC", "PingFang SC", "Source Han Sans SC",
                  "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-body: "HarmonyOS Sans SC", "PingFang SC", "Source Han Sans SC",
               "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Sarasa Mono SC", ui-monospace,
               SFMono-Regular, Menlo, Consolas, monospace;

  /* 尺寸 */
  --header-h: 74px;
  --cut: 14px;
  --hair: rgba(95, 216, 206, 0.22);
  --hair-soft: rgba(124, 138, 155, 0.2);
}

/* ---------- 3. 基础中文排版 ---------- */
body {
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

p { max-width: 68ch; }

::selection {
  background: var(--cyan);
  color: var(--ink);
}

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

/* ---------- 4. 布局工具 ---------- */
.wrap {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 44px);
}

.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 28px);
}

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

/* ---------- 5. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 0.62em 1.05em;
  background: var(--cyan);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  transform: translateY(-180%);
  transition: transform 0.18s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-offset: 4px;
}

/* ---------- 6. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background-image: linear-gradient(
    180deg,
    rgba(8, 22, 39, 0.94) 0%,
    rgba(8, 22, 39, 0.62) 62%,
    rgba(8, 22, 39, 0) 100%
  );
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease,
              box-shadow 0.18s ease;
}

.site-header[data-scrolled="true"] {
  background-image: none;
  background-color: rgba(9, 24, 42, 0.97);
  border-bottom-color: rgba(95, 216, 206, 0.28);
  box-shadow: 0 18px 46px -30px rgba(0, 0, 0, 0.95);
}

.site-header[data-open="true"] {
  background-image: none;
  background-color: rgba(9, 24, 42, 0.99);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--header-h);
  padding-block: 10px;
  transition: min-height 0.18s ease, padding-block 0.18s ease;
}

.site-header[data-scrolled="true"] .site-header__bar {
  min-height: 58px;
  padding-block: 6px;
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand__mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  background: conic-gradient(
    from 205deg,
    var(--cyan) 0deg,
    var(--teal) 95deg,
    var(--ink-2) 215deg,
    var(--cyan) 360deg
  );
  clip-path: polygon(50% 0%, 100% 26%, 100% 74%, 50% 100%, 0% 74%, 0% 26%);
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  background: var(--ink);
  clip-path: polygon(50% 0%, 100% 26%, 100% 74%, 50% 100%, 0% 74%, 0% 26%);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--paper);
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}

.brand--footer .brand__name { font-size: 19px; }

/* 导航（移动优先：抽屉） */
.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  max-height: calc(100dvh - 86px);
  overflow-y: auto;
  padding: 8px clamp(16px, 4vw, 44px) 22px;
  background: var(--ink-2);
  border-block: 1px solid rgba(95, 216, 206, 0.24);
  box-shadow: 0 34px 60px -32px rgba(0, 0, 0, 0.95);
}

.site-header[data-open="true"] .site-nav { display: block; }

.site-nav__list {
  display: flex;
  flex-direction: column;
}

.site-nav__item { display: block; }

.site-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
  border-bottom: 1px solid rgba(124, 138, 155, 0.16);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: rgba(244, 241, 234, 0.82);
  transition: color 0.18s ease;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 3px;
  height: 2px;
  display: none;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.18s ease;
}

.site-nav__link:hover { color: var(--paper); }

.site-nav__link[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: rgba(240, 180, 74, 0.5);
}

/* 头部动作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

/* 目录开合按钮 */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(95, 216, 206, 0.38);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

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

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: var(--cyan);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--cyan);
  transition: top 0.2s ease, transform 0.2s ease;
}

.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

.site-header[data-open="true"] .nav-toggle__bars { background: transparent; }
.site-header[data-open="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.site-header[data-open="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

.nav-toggle__label { line-height: 1; }

/* 阅读进度线 */
.scroll-line {
  height: 2px;
  background: rgba(95, 216, 206, 0.14);
  overflow: hidden;
}

.scroll-line__fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.1s linear;
}

/* ---------- 7. 按钮 ---------- */
.btn {
  --btn-cut: 11px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 11px 18px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--paper);
  background: var(--maple);
  clip-path: polygon(
    0 0,
    calc(100% - var(--btn-cut)) 0,
    100% var(--btn-cut),
    100% 100%,
    0 100%
  );
  transition: background-color 0.18s ease, color 0.18s ease,
              transform 0.18s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn--primary {
  background: var(--maple);
  color: var(--paper);
}

.btn--primary:hover { background: #e2564c; }

.btn--ghost {
  background: rgba(95, 216, 206, 0.14);
  color: var(--cyan);
}

.btn--ghost:hover { background: rgba(95, 216, 206, 0.26); }

.btn--sm {
  --btn-cut: 9px;
  padding: 8px 14px;
  font-size: 13.5px;
}

/* ---------- 8. 通用内容组件 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow::before {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  transform: skewX(-24deg);
}

.lede {
  max-width: 62ch;
  font-size: clamp(16px, 1.5vw, 18px);
  color: rgba(244, 241, 234, 0.78);
}

.rule {
  height: 6px;
  border: 0;
  background-image: repeating-linear-gradient(
    115deg,
    rgba(95, 216, 206, 0.55) 0 2px,
    transparent 2px 16px
  );
  opacity: 0.75;
}

.panel {
  position: relative;
  padding: clamp(18px, 2.4vw, 30px);
  background: linear-gradient(158deg, rgba(15, 39, 66, 0.96), rgba(8, 22, 39, 0.92));
  border: 1px solid var(--hair);
  clip-path: polygon(
    0 0,
    calc(100% - var(--cut)) 0,
    100% var(--cut),
    100% 100%,
    0 100%
  );
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--paper);
  background: var(--moss);
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
}

.tag--teal { background: var(--teal); }
.tag--clay { background: var(--clay); }

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--slate);
}

.breadcrumbs a {
  color: var(--slate);
  transition: color 0.18s ease;
}

.breadcrumbs a:hover { color: var(--cyan); }

.breadcrumbs__sep {
  color: rgba(124, 138, 155, 0.55);
}

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

/* 图片容器基础规则（供页面阶段放置占位图） */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: var(--ink-2);
  background-image: linear-gradient(
    132deg,
    rgba(15, 39, 66, 1) 0%,
    rgba(11, 29, 51, 1) 52%,
    rgba(46, 158, 147, 0.42) 100%
  );
  border: 1px solid var(--hair);
  clip-path: polygon(
    0 0,
    calc(100% - 18px) 0,
    100% 18px,
    100% 100%,
    0 100%
  );
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(95, 216, 206, 0.16) 0 1px,
    transparent 1px 14px
  );
}

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

.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 4 / 5; }
.media--square { aspect-ratio: 1 / 1; }
.media--detail { aspect-ratio: 3 / 2; }

.media__caption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--paper);
  background: rgba(8, 22, 39, 0.82);
  border-top: 1px solid var(--hair);
}

/* ---------- 9. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 8vw, 96px);
  background-image: linear-gradient(180deg, var(--ink-2) 0%, var(--ink) 62%);
  border-top: 1px solid rgba(95, 216, 206, 0.2);
  color: var(--paper);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(
    58% 78% at 86% 0%,
    rgba(95, 216, 206, 0.14),
    transparent 66%
  );
}

.site-footer__rail {
  position: relative;
  height: 8px;
  background-color: rgba(46, 158, 147, 0.4);
  background-image: repeating-linear-gradient(
    115deg,
    rgba(240, 180, 74, 0.92) 0 8px,
    rgba(8, 22, 39, 0) 8px 26px
  );
}

.site-footer__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(26px, 4vw, 48px);
  padding-block: clamp(34px, 6vw, 64px);
}

.footer-identity {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 34ch;
}

.footer-identity__note {
  font-size: 14.5px;
  line-height: 1.75;
  color: rgba(244, 241, 234, 0.7);
}

.footer-identity__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px clamp(18px, 3vw, 36px);
}

.footer-col__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.footer-col__title::before {
  content: "";
  display: block;
  width: 10px;
  height: 2px;
  background: var(--gold);
  transform: skewX(-24deg);
}

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

.footer-link {
  display: inline-block;
  padding: 4px 0;
  font-size: 15px;
  color: rgba(244, 241, 234, 0.74);
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--cyan);
  border-bottom-color: rgba(95, 216, 206, 0.5);
}

.footer-contact {
  display: flex;
  flex-direction: column;
}

.footer-contact__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

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

.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--slate);
}

.footer-contact__val {
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(244, 241, 234, 0.86);
  overflow-wrap: anywhere;
}

.footer-contact__more {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--cyan);
}

.site-footer__base {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 28px;
  padding-block: 18px 30px;
  border-top: 1px solid var(--hair-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--slate);
}

.site-footer__base p { max-width: none; }

/* ---------- 10. 平板 ---------- */
@media (min-width: 720px) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .footer-identity {
    grid-column: 1 / -1;
    max-width: 46ch;
  }

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

/* ---------- 11. 桌面 ---------- */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    display: block;
    margin-inline: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .site-nav__list {
    flex-direction: row;
    align-items: center;
    gap: 2px;
  }

  .site-nav__link {
    padding: 10px 14px;
    border-bottom: 0;
    font-size: 15px;
    font-weight: 600;
    color: rgba(244, 241, 234, 0.78);
  }

  .site-nav__link::after {
    display: block;
    left: 14px;
    right: 14px;
    bottom: 3px;
  }

  .site-nav__link:hover::after { transform: scaleX(0.42); }

  .site-nav__link[aria-current="page"] {
    color: var(--paper);
    border-bottom-color: transparent;
  }

  .site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

  .site-footer__inner {
    grid-template-columns: minmax(220px, 1.25fr) minmax(0, 1.9fr) minmax(0, 1.15fr);
    gap: clamp(28px, 4vw, 60px);
  }

  .footer-identity {
    grid-column: auto;
    max-width: 32ch;
  }
}

/* ---------- 12. 小屏微调 ---------- */
@media (max-width: 639px) {
  .brand__sub { display: none; }

  .btn--sm {
    padding: 7px 11px;
    font-size: 12.5px;
  }

  .header-actions { gap: 6px; }

  .site-footer__base {
    justify-content: flex-start;
    font-size: 11.5px;
  }
}

@media (max-width: 429px) {
  .brand__text { display: none; }
  .nav-toggle__label { display: none; }
  .nav-toggle { padding: 9px 10px; }
}

/* ---------- 13. 动效降级 ---------- */
@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;
  }

  .btn:hover { transform: none; }
  .skip-link { transition: none; }
}
