/* ============================================================
   银河主页 · 共享样式表 /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, ul, ol, li, figure, blockquote {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }

a { color: inherit; }

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

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

/* ---------- 2. 设计变量 ---------- */
:root {
  --ink: #060A16;
  --ink-2: #0D1730;
  --line: #1B2A52;
  --silver: #E9EEF7;
  --cyan: #56C8DE;
  --star: #7E9DFF;
  --amber: #F3B96A;
  --rock: #99A3B5;
  --mute: #AAB4C6;
  --paper: #F4F0E6;
  --moss: #6F9369;
  --clay: #B87A5E;

  --body-text: #C9D3E3;

  --rail-w: 240px;
  --rail-h-sm: 56px;
  --content-max: 1240px;
  --gutter: 24px;

  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;

  --dur: 160ms;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- 3. 基础排版 ---------- */
body {
  min-height: 100vh;
  padding-left: var(--rail-w);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--body-text);
  background-color: var(--ink);
  background-image:
    radial-gradient(circle at 78% 8%, rgba(86, 200, 222, .10), transparent 44%),
    radial-gradient(circle at 14% 76%, rgba(126, 157, 255, .09), transparent 48%),
    linear-gradient(180deg, rgba(13, 23, 48, .92), rgba(6, 10, 22, 0) 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(27, 42, 82, .55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 42, 82, .55) 1px, transparent 1px);
  background-size: 128px 128px;
  opacity: .32;
  -webkit-mask-image: radial-gradient(120% 90% at 72% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 90% at 72% 0%, #000 0%, transparent 72%);
}

main {
  display: block;
  position: relative;
  z-index: 1;
}

h1, h2, h3, h4 {
  color: var(--silver);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
}

h1 { font-size: clamp(2.4rem, 6vw, 5.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }

strong { color: var(--silver); font-weight: 700; }

::selection { background: rgba(86, 200, 222, .3); color: var(--silver); }

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

/* ---------- 4. 容器 / 网格 ---------- */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.container--tight { max-width: 880px; }

.grid {
  display: grid;
  gap: var(--gutter);
}

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

/* ---------- 5. 基础组件 ---------- */
.section { padding-block: clamp(48px, 7vw, 96px); }

.section--band {
  background: linear-gradient(90deg, rgba(13, 23, 48, .9), rgba(6, 10, 22, .35));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 20px;
  margin-bottom: 28px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--rock);
}

.label {
  display: inline-block;
  padding: 3px 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(6, 10, 22, .35);
}

.label--ghost {
  color: var(--cyan);
  background: transparent;
  border-color: rgba(86, 200, 222, .45);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--mute);
  background: rgba(27, 42, 82, .35);
  border: 1px solid var(--line);
}

.tag--cyan { color: var(--cyan); border-color: rgba(86, 200, 222, .5); }
.tag--amber { color: var(--amber); border-color: rgba(243, 185, 106, .5); }
.tag--moss { color: var(--moss); border-color: rgba(111, 147, 105, .6); }
.tag--clay { color: var(--clay); border-color: rgba(184, 122, 94, .6); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--silver);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

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

.btn--primary {
  background: linear-gradient(135deg, rgba(86, 200, 222, .18), rgba(126, 157, 255, .14));
  border-color: rgba(86, 200, 222, .5);
}

.btn--primary:hover {
  background: linear-gradient(135deg, rgba(86, 200, 222, .3), rgba(126, 157, 255, .24));
  border-color: var(--cyan);
}

.btn--ghost { color: var(--mute); }
.btn--ghost:hover { color: var(--silver); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--rock);
}

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

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

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

.breadcrumb a:hover { color: var(--cyan); border-bottom-color: rgba(86, 200, 222, .5); }

.prose {
  max-width: 72ch;
  font-size: 17px;
  line-height: 1.75;
}

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

.prose h2 { margin-top: 2em; }

.prose h3 { margin-top: 1.6em; color: var(--silver); }

.prose a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(86, 200, 222, .4);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.prose a:hover { color: var(--star); border-bottom-color: var(--star); }

.stack-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding: 14px 18px;
  background: rgba(13, 23, 48, .72);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.stack-card:hover {
  transform: translateY(-2px);
  border-color: rgba(86, 200, 222, .55);
  border-left-color: var(--cyan);
}

.paper-card {
  position: relative;
  padding: 24px 26px;
  background: linear-gradient(180deg, rgba(244, 240, 230, .055), rgba(244, 240, 230, .015));
  border: 1px solid var(--line);
  box-shadow: 8px 8px 0 -2px rgba(6, 10, 22, .7), 8px 8px 0 -1px rgba(27, 42, 82, .95);
}

.data-card {
  padding: 18px 20px;
  background: rgba(6, 10, 22, .72);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  letter-spacing: .02em;
}

.data-card__value {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--silver);
  letter-spacing: 0;
}

.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.timeline__item {
  position: relative;
  padding-bottom: 32px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-2);
  border: 1px solid var(--cyan);
}

.step-path {
  display: grid;
  gap: 20px;
}

.step {
  position: relative;
  padding: 20px 22px;
  background: rgba(13, 23, 48, .6);
  border: 1px solid var(--line);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.step:hover { transform: translateY(-2px); border-color: rgba(86, 200, 222, .5); }

.step__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--clay);
}

/* ---------- 6. 图片容器基础规则 ---------- */
.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 70% 20%, rgba(86, 200, 222, .14), transparent 55%),
    linear-gradient(160deg, rgba(13, 23, 48, .96), rgba(6, 10, 22, .99));
  border: 1px solid var(--line);
}

.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(233, 238, 247, .16) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .5;
}

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

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

/* ---------- 7. 页头 ---------- */
.site-header {
  position: relative;
  z-index: 100;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--cyan);
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}

.skip-link:focus { top: 12px; }

/* 顶部叠加导航条 */
.masthead {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  right: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 clamp(20px, 3vw, 36px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: height var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.site-header.is-reading .masthead {
  height: 52px;
  background: rgba(13, 23, 48, .95);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.masthead__sync {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--rock);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: breathe-dot 3s ease-in-out infinite;
}

@keyframes breathe-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(86, 200, 222, .45); }
  50% { box-shadow: 0 0 0 6px rgba(86, 200, 222, 0); }
}

.masthead__link {
  margin-left: auto;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--mute);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.masthead__link:hover { color: var(--cyan); border-bottom-color: var(--cyan); }

/* 左侧品牌轨道 */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: var(--rail-w);
  padding: 28px 22px 26px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(13, 23, 48, .95), rgba(6, 10, 22, .98));
  border-right: 1px solid var(--line);
}

.rail__brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
}

.rail__mark {
  width: 13px;
  height: 13px;
  background: linear-gradient(135deg, var(--cyan), var(--star));
  transform: rotate(45deg);
}

.rail__name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--silver);
}

.rail__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--rock);
}

.rail__status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--mute);
  background: rgba(6, 10, 22, .6);
  border: 1px solid var(--line);
}

.status-light {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  animation: breathe-light 3s ease-in-out infinite;
}

@keyframes breathe-light {
  0%, 100% { box-shadow: 0 0 0 0 rgba(86, 200, 222, .5); }
  50% { box-shadow: 0 0 0 7px rgba(86, 200, 222, 0); }
}

.rail__status-time {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: 100%;
  padding: 6px 9px;
  font-size: 11px;
  color: var(--silver);
  background: var(--ink-2);
  border: 1px solid var(--line);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}

.rail__status:hover .rail__status-time,
.rail__status:focus-within .rail__status-time {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

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

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 1px;
  background: currentColor;
  transition: background var(--dur) var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1px;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}

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

.site-header[data-open] .nav-toggle__bars { background: transparent; }
.site-header[data-open] .nav-toggle__bars::before { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bars::after { transform: translateY(-5px) rotate(-45deg); }

/* 主导航 */
.rail__nav-title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--rock);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--mute);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.nav-link:hover {
  color: var(--silver);
  background: rgba(27, 42, 82, .55);
  border-left-color: var(--line);
}

.nav-link__num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--rock);
  transition: color var(--dur) var(--ease);
}

.nav-link__label {
  background-image: linear-gradient(90deg, var(--cyan), var(--star));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size var(--dur) var(--ease);
}

.nav-link:hover .nav-link__label,
.nav-link[aria-current="page"] .nav-link__label { background-size: 100% 1px; }

.nav-link[aria-current="page"] {
  color: var(--silver);
  background: rgba(86, 200, 222, .1);
  border-left-color: var(--cyan);
}

.nav-link[aria-current="page"] .nav-link__num { color: var(--cyan); }

.rail__foot { margin-top: auto; }

.rail__foot .btn { width: 100%; }

.rail__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(27, 42, 82, .7);
}

.rail__progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan), var(--star));
}

/* ---------- 8. 页脚 ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(64px, 9vw, 112px);
  padding: 56px 0 22px;
  background: linear-gradient(180deg, rgba(13, 23, 48, .92), rgba(6, 10, 22, .99));
  border-top: 1px solid var(--line);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: 32px;
}

.footer__title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--silver);
}

.footer__desc {
  margin-top: 10px;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--mute);
}

.footer__region {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--rock);
}

.footer__list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.footer__list a {
  font-size: 15px;
  color: var(--mute);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.footer__list a:hover { color: var(--cyan); border-bottom-color: rgba(86, 200, 222, .5); }

.footer__contact-line {
  margin-top: 12px;
  font-size: 14px;
  color: var(--mute);
}

.copy-btn {
  display: inline;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--cyan);
  background: transparent;
  border: 1px solid rgba(86, 200, 222, .35);
  border-radius: 2px;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.copy-btn:hover { border-color: var(--cyan); background: rgba(86, 200, 222, .08); }

.copy-btn.is-copied {
  color: var(--amber);
  border-color: var(--amber);
  background: rgba(243, 185, 106, .1);
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid rgba(27, 42, 82, .7);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--rock);
}

/* ---------- 9. 响应式 ---------- */
@media (max-width: 1024px) {
  body {
    padding-left: 0;
    padding-top: var(--rail-h-sm);
  }

  .masthead { display: none; }

  .rail {
    top: 0;
    right: 0;
    bottom: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: auto;
    height: var(--rail-h-sm);
    padding: 0 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail__brand {
    flex-direction: row;
    align-items: center;
    gap: 9px;
  }

  .rail__name { font-size: 17px; }
  .rail__mark { width: 10px; height: 10px; }
  .rail__sub { display: none; }

  .rail__status { margin-left: auto; padding: 6px 9px; }
  .rail__status-text { display: none; }
  .rail__status-time { display: none; }

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

  .rail__nav {
    display: none;
    position: fixed;
    top: var(--rail-h-sm);
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 16px 120px;
    overflow-y: auto;
    background: rgba(6, 10, 22, .98);
    border-top: 1px solid var(--line);
  }

  .site-header[data-open] .rail__nav { display: block; }

  .rail__nav-title { margin-bottom: 14px; }

  .nav-link {
    padding: 15px 12px;
    font-size: 17px;
    border-left-width: 3px;
  }

  .rail__foot { display: none; }

  .site-header[data-open] .rail__foot {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    margin-top: 0;
    padding: 16px 16px 24px;
    background: rgba(6, 10, 22, .98);
    border-top: 1px solid var(--line);
  }

  .footer__inner { grid-template-columns: 1fr 1fr; }
}

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

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

  .paper-card { padding: 20px 18px; box-shadow: 6px 6px 0 -2px rgba(6, 10, 22, .7), 6px 6px 0 -1px rgba(27, 42, 82, .95); }

  .footer__inner { grid-template-columns: 1fr; gap: 28px; }

  .footer__base { justify-content: flex-start; }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
