/* ============================================================
   银河主页 · 共享站点样式 /assets/site.css
   深空墨底 + 银河紫 + 星云青 · 舷窗框景 · 航道留白
   ============================================================ */

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

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

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

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

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

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

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

table { border-collapse: collapse; }

/* ---------- 2. 变量 ---------- */
:root {
  /* 色彩 */
  --ink: #04060E;
  --deep: #0A1024;
  --panel: #121A31;
  --line: #2A3550;
  --purple: #7A5CFF;
  --purple-soft: #A99BFF;
  --cyan: #35D6C8;
  --gold: #E3C36B;
  --warm: #F5F2EA;
  --mist: #A8B0C2;
  --alert: #FF7A6B;
  --grad: linear-gradient(135deg, #7A5CFF, #35D6C8);

  /* 字体 */
  --font-head: "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* 节奏 */
  --gutter: 24px;
  --baseline: 8px;
  --radius: 6px;
  --header-panel-top: 106px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (min-width: 768px) {
  :root { --gutter: 48px; }
}

/* ---------- 3. 基础中文排版 ---------- */
body {
  min-height: 100vh;
  background-color: var(--ink);
  color: var(--warm);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 三层星尘 + 两层光斑，缓慢漂移 */
body::before {
  content: "";
  position: fixed;
  inset: -22% -12%;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 14% 16%, rgba(122, 92, 255, .17), transparent 44%),
    radial-gradient(circle at 86% 6%, rgba(53, 214, 200, .12), transparent 48%),
    radial-gradient(circle at 66% 86%, rgba(122, 92, 255, .11), transparent 52%),
    radial-gradient(circle, rgba(245, 242, 234, .26) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(169, 155, 255, .20) 1px, transparent 1.5px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 150px 150px, 230px 230px;
  background-position: 0 0, 0 0, 0 0, 0 0, 74px 118px;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat;
  animation: star-drift 60s linear infinite;
}

@keyframes star-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-150px, -230px, 0); }
}

.site-header,
.site-main,
.site-footer { position: relative; z-index: 1; }

p { max-width: 72ch; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--warm);
  font-weight: 700;
  letter-spacing: -.02em;
}

h1, .h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1.08; }
h2, .h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; }
h3, .h3 { font-size: 22px; line-height: 1.32; font-weight: 600; }

::selection { background: rgba(122, 92, 255, .45); color: var(--warm); }

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

[id] { scroll-margin-top: calc(var(--header-panel-top) + 16px); }

/* ---------- 4. 工具类 ---------- */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--mist); }

.lede {
  font-size: 19px;
  line-height: 1.8;
  color: var(--mist);
  max-width: 62ch;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--purple-soft);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid rgba(169, 155, 255, .4);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--purple-soft);
}

.tag--cyan { border-color: rgba(53, 214, 200, .42); color: var(--cyan); }
.tag--gold { border-color: rgba(227, 195, 107, .42); color: var(--gold); }

.rule {
  height: 1px;
  border: 0;
  margin-block: 40px;
  background: linear-gradient(90deg,
    rgba(42, 53, 80, .08),
    rgba(122, 92, 255, .55),
    rgba(53, 214, 200, .45),
    rgba(42, 53, 80, .08));
}

/* ---------- 5. 容器与区块 ---------- */
.shell {
  width: min(1240px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.site-main { display: block; }

.section { padding-block: clamp(48px, 7vw, 96px); }

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 14px;
  max-width: 780px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

/* ---------- 6. 框景结构 ---------- */
.frame {
  position: relative;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(10, 16, 36, .82), rgba(4, 6, 14, .68));
}

.frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(var(--purple), var(--purple)) left top / 16px 1px no-repeat,
    linear-gradient(var(--purple), var(--purple)) left top / 1px 16px no-repeat,
    linear-gradient(var(--purple), var(--purple)) right top / 16px 1px no-repeat,
    linear-gradient(var(--purple), var(--purple)) right top / 1px 16px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) left bottom / 16px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) left bottom / 1px 16px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) right bottom / 16px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) right bottom / 1px 16px no-repeat;
}

.frame--hero { padding: clamp(28px, 5vw, 68px); }
.frame--tight { padding: 18px; }

/* ---------- 7. 网格 ---------- */
.grid {
  display: grid;
  gap: var(--gutter);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.grid--8-4 { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }

/* ---------- 8. 面板 / 卡片 ---------- */
.panel {
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 26, 49, .55);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}

.panel:hover {
  border-color: rgba(169, 155, 255, .45);
  transform: translateY(-2px);
}

.panel-title {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 8px;
}

.panel-text {
  color: var(--mist);
  font-size: 15.5px;
  line-height: 1.7;
}

/* ---------- 9. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.2;
  color: var(--warm);
  transition: color .2s var(--ease), border-color .2s var(--ease),
              background-color .2s var(--ease), transform .2s var(--ease),
              box-shadow .2s var(--ease);
}

.btn--primary {
  background: var(--grad);
  border-color: transparent;
  color: #05070F;
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(122, 92, 255, .32);
}

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

.btn--quiet {
  padding-inline: 4px;
  border-color: transparent;
  color: var(--purple-soft);
}

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

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

/* ---------- 10. 面包屑 ---------- */
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--mist);
  margin-bottom: 22px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: var(--line);
}

.breadcrumbs a:hover { color: var(--cyan); }
.breadcrumbs [aria-current="page"] { color: var(--purple-soft); }

/* ---------- 11. 图片容器（页面阶段放图） ---------- */
.media-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 20%, rgba(122, 92, 255, .18), transparent 60%),
    radial-gradient(circle at 78% 84%, rgba(53, 214, 200, .14), transparent 62%),
    rgba(18, 26, 49, .5);
}

.media-frame::before {
  content: "";
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(169, 155, 255, .18);
  border-radius: 50%;
  z-index: 0;
}

.media-frame > img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame--21x9 { aspect-ratio: 21 / 9; }
.media-frame--16x9 { aspect-ratio: 16 / 9; }
.media-frame--4x3 { aspect-ratio: 4 / 3; }
.media-frame--1x1 { aspect-ratio: 1 / 1; }

.media-frame--orbit {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
}

.media-frame__caption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--mist);
}

/* ---------- 12. 数据表 ---------- */
.data-table { width: 100%; }

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--mist);
}

.data-table tbody tr { transition: background-color .2s var(--ease); }
.data-table tbody tr:hover { background: rgba(122, 92, 255, .09); }

.data-table .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

/* ---------- 13. 折叠面板 ---------- */
.fold {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 26, 49, .5);
}

.fold + .fold { margin-top: 10px; }

.fold summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.fold summary::-webkit-details-marker { display: none; }

.fold summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  color: var(--purple-soft);
}

.fold[open] summary::after { content: "–"; }
.fold[open] summary { color: var(--purple-soft); }

.fold-body {
  padding: 0 20px 20px;
  color: var(--mist);
  font-size: 15.5px;
}

/* ---------- 14. 章节目录导轨 ---------- */
.chapter-rail {
  position: sticky;
  top: calc(var(--header-panel-top) + 20px);
}

.toc {
  display: grid;
  gap: 2px;
  border-left: 1px solid var(--line);
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 8px 0 8px 16px;
  border-left: 1px solid transparent;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mist);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.toc a:hover { color: var(--warm); }

.toc a[aria-current="true"] {
  color: var(--purple-soft);
  border-left-color: var(--purple);
}

@media (max-width: 1024px) {
  .chapter-rail { position: static; }
}

/* ---------- 15. 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(10, 16, 36, .92);
  color: var(--warm);
  font-family: var(--font-mono);
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s var(--ease), visibility .28s var(--ease),
              border-color .2s var(--ease), color .2s var(--ease);
}

.to-top[data-visible] { opacity: 1; visibility: visible; }
.to-top:hover { border-color: var(--purple-soft); color: var(--purple-soft); }

/* ---------- 16. 显现 ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
}

[data-reveal][data-revealed] {
  opacity: 1;
  transform: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}

/* ---------- 17. skip link ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -72px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--purple);
  color: #05070F;
  font-size: 14px;
  font-weight: 600;
  transition: top .2s var(--ease);
}

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

/* ---------- 18. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 70;
  background: linear-gradient(180deg, rgba(4, 6, 14, .97), rgba(4, 6, 14, .88));
}

.header-inner { position: relative; }

.header-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(42, 53, 80, .55);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--mist);
}

.header-tagline {
  flex: none;
  letter-spacing: .08em;
  color: var(--purple-soft);
}

.header-strip-rail {
  flex: 1 1 auto;
  height: 1px;
  min-width: 24px;
  background: linear-gradient(90deg, rgba(122, 92, 255, .5), rgba(42, 53, 80, .12));
}

.header-utility {
  flex: none;
  color: var(--mist);
  transition: color .2s var(--ease);
}

.header-utility:hover { color: var(--cyan); }
.header-utility--mono { font-family: var(--font-mono); letter-spacing: .02em; }

.header-main {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0 16px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.brand-orbit {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.brand-orbit::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(122, 92, 255, .55);
}

.brand-orbit::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px dashed rgba(169, 155, 255, .3);
  border-radius: 50%;
}

.brand-text { display: block; }

.brand-name {
  display: block;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.brand-domain {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--mist);
  line-height: 1.4;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

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

.nav-item { display: flex; }

.nav-link {
  position: relative;
  display: inline-block;
  padding: 8px 1px;
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--mist);
  transition: color .2s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s var(--ease);
}

.nav-link:hover { color: var(--warm); }
.nav-link:hover::after { transform: scaleX(1); }

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

.nav-cta { flex: none; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--warm);
}

.nav-toggle-bars { display: grid; gap: 5px; width: 18px; }

.nav-toggle-bars i {
  display: block;
  height: 1px;
  background: var(--warm);
  transition: transform .2s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:first-child {
  transform: translateY(3px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

.header-orbit {
  position: relative;
  height: 1px;
  overflow: hidden;
  background: var(--line);
}

.header-orbit-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left center;
}

.header-scrim { display: none; }

body.nav-open { overflow: hidden; }

/* ---------- 19. 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 16, 36, .72), rgba(4, 6, 14, .96));
}

.footer-inner { padding-block: clamp(40px, 5vw, 64px) 26px; }

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(28px, 4vw, 56px);
}

.footer-brand-line {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.footer-note {
  margin-top: 12px;
  max-width: 46ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--mist);
}

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

.footer-col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--purple-soft);
}

.footer-links { display: grid; gap: 10px; }

.footer-links a {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--mist);
  transition: color .2s var(--ease);
}

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

.footer-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .01em;
  color: var(--gold) !important;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 28px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .03em;
  color: var(--mist);
}

/* ---------- 20. 响应式 ---------- */
@media (max-width: 1024px) {
  .nav-list { gap: 18px; }
  .primary-nav { gap: 20px; }
  .header-utility--mono { display: none; }
}

@media (max-width: 960px) {
  .header-main { gap: 16px; }

  .nav-toggle { display: inline-flex; margin-left: auto; }

  .primary-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-panel-top);
    z-index: 65;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    max-height: calc(100vh - var(--header-panel-top));
    max-height: calc(100dvh - var(--header-panel-top));
    padding: 8px var(--gutter) 40px;
    overflow-y: auto;
    background: linear-gradient(180deg, #0A1024, #04060E);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s var(--ease), transform .28s var(--ease),
                visibility .28s var(--ease);
  }

  .primary-nav[data-open] {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-item { display: block; }

  .nav-link {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    font-size: 17px;
  }

  .nav-link::after { display: none; }
  .nav-link[aria-current="page"] { color: var(--purple-soft); }

  .nav-cta { width: 100%; margin-top: 26px; }

  .header-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(4, 6, 14, .74);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s var(--ease), visibility .28s var(--ease);
  }

  .header-scrim[data-open] { opacity: 1; visibility: visible; }

  .grid--7-5,
  .grid--8-4,
  .footer-top { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .header-strip { display: none; }

  .brand-domain { font-size: 10.5px; }

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

  .footer-nav { grid-template-columns: minmax(0, 1fr); gap: 26px; }

  .footer-legal { flex-direction: column; gap: 8px; }

  .to-top { right: 16px; bottom: 16px; }

  .breadcrumbs { font-size: 11.5px; }
}

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

  body::before { animation: none; }

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

  .panel:hover { transform: none; }
  .btn--primary:hover { transform: none; box-shadow: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
