/* ============================================================
   拿大正规中心 · 共享样式 /assets/site.css
   档案室 × 操作台 · 框架式导航 · 年份刻度
   ============================================================ */

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

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

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

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

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

a {
  color: inherit;
}

main {
  display: block;
}

hr {
  border: 0;
  height: 0;
}

/* ---------- tokens ---------- */
:root {
  --ink-900: #06111C;
  --ink-800: #0B1B2B;
  --ink-700: #12283D;
  --ink-600: #1A3550;
  --steel: #D7E0E8;
  --mist: #F2F5F7;
  --paper: #FBF8F1;
  --gold: #D99A2B;
  --gold-bright: #F2B84B;
  --graphite: #2B2F36;
  --slate: #7F95A6;

  --rail-w: 232px;
  --topbar-h: 68px;
  --gutter: 22px;
  --maxw: 1180px;

  --shadow-card: 6px 6px 0 var(--ink-900);
  --shadow-lift: 9px 9px 0 var(--ink-900);

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-body: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- base typography ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink-800);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.012em;
  color: var(--paper);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

strong, b {
  font-weight: 700;
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  letter-spacing: 0.02em;
}

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

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  transform: translateY(-260%);
  display: inline-block;
  padding: 0.7rem 1.15rem;
  background-color: var(--gold-bright);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  border: 3px solid var(--ink-900);
  box-shadow: 4px 4px 0 var(--ink-900);
  transition: transform 0.2s var(--ease);
}

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

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

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background-color: var(--ink-800);
}

/* ---------- top bar ---------- */
.site-topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 9px 14px;
  background-color: var(--ink-800);
  border-bottom: 3px solid var(--ink-900);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--paper);
}

.site-brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  background-color: var(--gold);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1;
  border: 2px solid var(--ink-900);
  box-shadow: 3px 3px 0 var(--ink-900);
  transition: background-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.site-brand:hover .site-brand__mark {
  background-color: var(--gold-bright);
  box-shadow: 4px 4px 0 var(--ink-900);
}

.site-brand__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
}

.site-brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  color: var(--paper);
  white-space: nowrap;
}

.site-brand__tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--slate);
  white-space: nowrap;
}

.site-topbar__tools {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 10px;
}

.site-topbar__note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--slate);
  white-space: nowrap;
  display: none;
}

.site-topbar__note::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  background-color: var(--gold);
  vertical-align: middle;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: 2px solid var(--ink-900);
  border-radius: 0;
  background-color: var(--paper);
  color: var(--ink-900);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink-900);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease),
              background-color 0.16s var(--ease), color 0.16s var(--ease),
              border-color 0.16s var(--ease);
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink-900);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink-900);
}

.btn--solid {
  background-color: var(--gold);
  color: var(--ink-900);
  border-color: var(--ink-900);
}

.btn--solid:hover {
  background-color: var(--gold-bright);
}

.btn--quiet {
  background-color: var(--ink-700);
  color: var(--paper);
  border-color: var(--ink-900);
}

.btn--quiet:hover {
  background-color: var(--ink-600);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.btn--block {
  display: flex;
  width: 100%;
}

/* ---------- nav toggle ---------- */
.nav-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.72rem;
  background-color: var(--ink-700);
  color: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink-900);
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.nav-toggle:hover {
  background-color: var(--ink-600);
  border-color: var(--gold-bright);
}

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 12px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  background-color: var(--gold-bright);
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

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

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

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

.nav-toggle__label {
  white-space: nowrap;
}

/* ---------- reading progress ---------- */
.topbar-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background-color: rgba(217, 154, 43, 0.14);
  pointer-events: none;
}

.topbar-progress__fill {
  display: block;
  width: 0;
  height: 100%;
  background-color: var(--gold-bright);
}

/* ---------- rail (mobile drawer) ---------- */
.site-rail {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: min(86vw, 320px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 1.2rem 1rem 1.8rem;
  background-color: var(--ink-800);
  border-right: 3px solid var(--ink-900);
  overflow-y: auto;
  visibility: hidden;
  transform: translateX(-101%);
  transition: transform 0.28s var(--ease), visibility 0s linear 0.28s;
}

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

.site-header[data-open="true"]::after {
  content: "";
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  z-index: 1;
  background-color: rgba(6, 17, 28, 0.62);
}

/* ---------- nav ---------- */
.site-nav__label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 10px;
}

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

.site-nav__list a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-left: 3px solid transparent;
  text-decoration: none;
  color: var(--steel);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.4;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease),
              border-color 0.16s var(--ease), transform 0.16s var(--ease);
}

.site-nav__list a:hover {
  background-color: var(--ink-700);
  border-left-color: var(--gold);
  color: var(--gold-bright);
  transform: translateX(3px);
}

.site-nav__list a:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

.site-nav__list a[aria-current="page"] {
  background-color: var(--ink-700);
  border-left-color: var(--gold-bright);
  color: var(--gold-bright);
}

.site-nav__num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--slate);
  flex: 0 0 auto;
}

.site-nav__list a[aria-current="page"] .site-nav__num {
  color: var(--gold);
}

.site-nav__name {
  min-width: 0;
}

/* ---------- year scale ---------- */
.year-scale {
  margin-top: auto;
  padding-top: 14px;
  border-top: 2px solid var(--ink-900);
}

.year-scale__title {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 10px;
}

.year-scale__list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.year-scale__list li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.year-scale__tick {
  display: block;
  width: 12px;
  height: 2px;
  flex: 0 0 auto;
  background-color: var(--ink-600);
}

.year-scale__val {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: var(--slate);
}

.year-scale__list li:first-child .year-scale__val {
  color: var(--gold);
}

.year-scale__list li:first-child .year-scale__tick {
  background-color: var(--gold);
  width: 20px;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  position: relative;
  margin-top: clamp(3rem, 7vw, 6rem);
  background-color: var(--ink-900);
  color: var(--steel);
}

.site-footer::before {
  content: "";
  display: block;
  height: 5px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--gold) 0 20px,
    transparent 20px 40px
  );
}

.site-footer__grid {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(2rem, 4vw, 3rem) var(--gutter) clamp(1.6rem, 3vw, 2.4rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.6rem, 3vw, 2.5rem);
}

.site-footer__brand {
  min-width: 0;
}

.site-footer__mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background-color: var(--ink-700);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  line-height: 1;
  border: 2px solid var(--gold);
  box-shadow: 4px 4px 0 rgba(217, 154, 43, 0.32);
}

.site-footer__brandline {
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--paper);
}

.site-footer__archive {
  margin-top: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--slate);
  max-width: 34ch;
}

.site-footer__heading {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.85rem;
}

.site-footer__list li + li {
  margin-top: 0.42rem;
}

.site-footer__list a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--steel);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.site-footer__list a:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
}

.site-footer__infoline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: var(--steel);
  overflow-wrap: anywhere;
}

.site-footer__contact .site-footer__archive {
  max-width: 28ch;
  margin-top: 0.7rem;
}

.site-footer__base {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 1.05rem var(--gutter) 1.6rem;
  border-top: 1px solid rgba(127, 149, 166, 0.26);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--slate);
}

.site-footer__copy,
.site-footer__legal {
  min-width: 0;
}

/* ============================================================
   SHARED PAGE BUILDING BLOCKS
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: 820px;
}

.stack > * + * {
  margin-top: clamp(1.1rem, 2.4vw, 1.8rem);
}

.stack--tight > * + * {
  margin-top: 0.7rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

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

.page-head {
  padding-block: clamp(2rem, 5vw, 3.6rem) clamp(1.2rem, 3vw, 2rem);
}

.page-head__kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

.page-head__title {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  letter-spacing: -0.02em;
}

.page-head__lede {
  margin-top: 1rem;
  max-width: 62ch;
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--steel);
}

/* ---------- breadcrumb ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--slate);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

.breadcrumb a {
  color: var(--slate);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.breadcrumb a:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold-bright);
}

.breadcrumb__current {
  color: var(--paper);
}

/* ---------- tag ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border: 2px solid var(--gold);
  color: var(--gold);
  background-color: transparent;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  line-height: 1.4;
  white-space: nowrap;
}

/* ---------- panel / card ---------- */
.panel {
  background-color: var(--mist);
  color: var(--graphite);
  border: 3px solid var(--ink-900);
  box-shadow: var(--shadow-card);
  padding: clamp(1.3rem, 3vw, 2.4rem);
}

.panel h2,
.panel h3,
.panel h4 {
  color: var(--ink-800);
}

.panel p {
  color: var(--graphite);
}

.card {
  position: relative;
  display: block;
  background-color: var(--ink-700);
  color: var(--paper);
  border: 2px solid var(--ink-900);
  box-shadow: var(--shadow-card);
  padding: clamp(1.1rem, 2.2vw, 1.5rem);
  text-decoration: none;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
              border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lift);
  border-color: var(--gold);
  background-color: var(--ink-600);
}

.card__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--paper);
}

.card__meta {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--slate);
}

.card__text {
  margin-top: 0.7rem;
  font-family: var(--font-body);
  font-size: 0.94rem;
  line-height: 1.8;
  color: var(--steel);
}

/* ---------- grids ---------- */
.grid {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.8rem);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

/* ---------- reusable figure ---------- */
.figure {
  display: block;
  margin: 0;
  background-color: var(--ink-700);
  border: 3px solid var(--ink-900);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.figure__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background-color: var(--ink-600);
  filter: saturate(0.72) contrast(1.04);
}

.figure__caption {
  display: block;
  padding: 0.6rem 0.8rem;
  background-color: var(--mist);
  color: var(--graphite);
  border-top: 3px solid var(--ink-900);
  border-left: 6px solid var(--gold);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  line-height: 1.6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 640px) {
  :root {
    --gutter: 28px;
  }
}

@media (min-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 900px) {
  .site-topbar__tools {
    display: flex;
  }

  .nav-toggle {
    margin-left: 0;
  }
}

@media (min-width: 960px) {
  .site-topbar__note {
    display: block;
  }
}

@media (min-width: 1080px) {
  :root {
    --gutter: 34px;
  }

  body {
    padding-left: var(--rail-w);
    padding-top: var(--topbar-h);
  }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    background-color: var(--ink-800);
    border-right: 3px solid var(--ink-900);
    z-index: 60;
  }

  .site-topbar {
    position: fixed;
    top: 0;
    left: var(--rail-w);
    right: 0;
    height: var(--topbar-h);
    padding-inline: 22px;
    border-bottom: 3px solid var(--ink-900);
    z-index: 55;
  }

  .site-rail {
    position: static;
    top: auto;
    left: auto;
    bottom: auto;
    width: auto;
    max-height: none;
    flex: 1 1 auto;
    gap: 22px;
    padding: 1.5rem 1rem 1.8rem;
    border-right: 0;
    overflow-y: auto;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .site-header[data-open="true"]::after {
    content: none;
  }

  .nav-toggle {
    margin-left: 0;
  }

  .site-footer__grid {
    grid-template-columns: 1.6fr 0.9fr 0.9fr 1.3fr;
  }

  .site-footer__brand {
    grid-column: auto;
  }
}

@media (min-width: 1200px) {
  .site-brand__name {
    font-size: 1.04rem;
  }
}

/* ============================================================
   MOTION PREFERENCES
   ============================================================ */

@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;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  .card:hover,
  .site-nav__list a:hover,
  .btn:hover {
    transform: none;
  }
}
