/* =========================================================
   银河品牌站 · /assets/site.css
   共享层：reset / tokens / 中文排版 / 页头 / 页脚 / 基础组件
   ========================================================= */

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

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

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

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

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

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

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

kbd {
  font-family: inherit;
  font-size: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------- tokens ---------- */
:root {
  /* 品牌色 */
  --deep-space: #0a1a33;
  --midnight: #122a56;
  --violet: #6c4dff;
  --cyan: #45e0d1;
  --orange: #ff7a3d;
  --cream: #f3e9d7;
  --ink: #201812;
  --haze: #a9b7cc;
  --white: #f7faff;
  --orbit: #2e4470;

  /* 字体 */
  --font-display: "Space Grotesk", "Noto Sans SC", "Source Han Sans SC",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, "Liberation Mono", monospace;

  /* 尺度 */
  --shell-w: 1280px;
  --gutter: clamp(1.15rem, 4vw, 3.5rem);
  --rail: rgba(46, 68, 112, 0.72);
  --line: 1px solid var(--rail);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- base ---------- */
html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  line-height: 1.8;
  font-weight: 400;
  color: var(--haze);
  background-color: var(--deep-space);
  background-image: radial-gradient(
      ellipse 72% 46% at 50% -10%,
      rgba(108, 77, 255, 0.3),
      transparent 72%
    ),
    radial-gradient(circle at 88% 4%, rgba(69, 224, 209, 0.1), transparent 42%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--white);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
}

h3 {
  font-size: clamp(1.18rem, 2vw, 1.5rem);
}

p {
  text-wrap: pretty;
}

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

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 0;
}

/* ---------- 布局容器 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(2.8rem, 7vw, 6rem);
}

.section + .section {
  border-top: 1px solid rgba(46, 68, 112, 0.45);
}

.section--midnight {
  background: var(--midnight);
  color: rgba(247, 250, 255, 0.82);
}

.section--cream {
  background: var(--cream);
  color: var(--ink);
}

.section--cream h1,
.section--cream h2,
.section--cream h3,
.section--cream h4 {
  color: var(--ink);
}

.section--cream a:not(.btn) {
  border-bottom: 1px solid rgba(32, 24, 18, 0.35);
}

.section--cream a:not(.btn):hover {
  border-bottom-color: var(--ink);
}

.rule {
  height: 1px;
  border: 0;
  background: var(--rail);
  margin-block: clamp(1.6rem, 4vw, 3rem);
}

/* ---------- 排版工具 ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.9rem;
}

.section--cream .eyebrow {
  color: #5a3fbf;
}

.annotation {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  line-height: 1.6;
  color: rgba(169, 183, 204, 0.9);
}

.section--cream .annotation {
  color: rgba(32, 24, 18, 0.62);
}

.annotation--vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.34em;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.prose {
  max-width: 68ch;
  line-height: 1.85;
}

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

.prose h2 {
  margin-top: 2.2em;
  margin-bottom: 0.7em;
}

.prose h3 {
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}

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

.prose ol {
  list-style: decimal;
}

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

.prose strong {
  color: var(--white);
  font-weight: 600;
}

.section--cream .prose strong {
  color: var(--ink);
}

/* ---------- 网格 ---------- */
.grid {
  display: grid;
  gap: clamp(1.2rem, 2.6vw, 2.6rem);
}

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

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.55rem;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.btn--primary {
  background: var(--orange);
  color: var(--ink);
}

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

.btn--ghost {
  border-color: var(--orbit);
  color: var(--white);
}

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

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: rgba(169, 183, 204, 0.85);
}

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

.breadcrumb__sep {
  color: var(--orbit);
}

/* ---------- 图片容器（页面阶段复用） ---------- */
.figure {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--orbit);
  background: linear-gradient(
    158deg,
    rgba(18, 42, 86, 0.92),
    rgba(10, 26, 51, 0.94)
  );
}

.figure--tall {
  aspect-ratio: 3 / 4;
}

.figure--wide {
  aspect-ratio: 21 / 9;
}

.figure > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure--grid::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(69, 224, 209, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(69, 224, 209, 0.14) 1px, transparent 1px);
  background-size: 34px 34px;
}

.figure__caption {
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: rgba(169, 183, 204, 0.85);
}

/* ---------- 目录（文档页） ---------- */
.toc__list {
  display: grid;
  gap: 0.15rem;
  border-left: 1px solid var(--rail);
}

.toc__link {
  display: block;
  padding: 0.42rem 0 0.42rem 1rem;
  font-size: 0.9rem;
  color: rgba(169, 183, 204, 0.92);
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.toc__link:hover {
  color: var(--white);
}

.toc__link[aria-current="true"] {
  color: var(--cyan);
  border-left-color: var(--cyan);
}

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: 0.6rem;
  left: 50%;
  z-index: 300;
  transform: translate(-50%, -180%);
  padding: 0.7rem 1.25rem;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 0.2s var(--ease);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
  outline-offset: 4px;
}

/* =========================================================
   页头
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 26, 51, 0.96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--orbit);
}

.site-header[data-stuck] {
  background: rgba(8, 21, 42, 0.99);
  box-shadow: 0 14px 34px -22px rgba(0, 0, 0, 0.9);
}

/* --- 检索带 --- */
.site-header__top {
  background: rgba(18, 42, 86, 0.55);
  border-bottom: 1px solid rgba(46, 68, 112, 0.55);
}

.site-header__top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 38px;
}

.coord-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.4;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(169, 183, 204, 0.78);
  white-space: nowrap;
}

.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.7rem 0.3rem 0.78rem;
  border: 1px solid rgba(255, 122, 61, 0.75);
  border-radius: 999px;
  background: rgba(255, 122, 61, 0.08);
  color: var(--orange);
  font-family: var(--font-body);
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.search-pill:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--ink);
}

.search-pill__icon {
  position: relative;
  flex: none;
  width: 0.72rem;
  height: 0.72rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.search-pill__icon::after {
  content: "";
  position: absolute;
  right: -0.3rem;
  bottom: -0.22rem;
  width: 0.38rem;
  height: 1.5px;
  background: currentColor;
  transform: rotate(45deg);
}

.search-pill__key {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  line-height: 1.35;
  padding: 0 0.3rem;
  border: 1px solid currentColor;
  border-radius: 3px;
  opacity: 0.78;
}

/* --- 命令栏 --- */
.site-header__bar-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  flex: none;
  padding-block: 0.35rem;
  color: var(--white);
}

.brand__mark {
  position: relative;
  flex: none;
  display: block;
  width: 16px;
  height: 16px;
  border: 1px solid var(--cyan);
  transform: rotate(45deg);
  transition: border-color 0.18s var(--ease);
}

.brand__mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--violet);
  transition: background-color 0.18s var(--ease);
}

.brand:hover .brand__mark {
  border-color: var(--orange);
}

.brand:hover .brand__mark::after {
  background: var(--orange);
}

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

.brand__name {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: rgba(169, 183, 204, 0.82);
}

/* --- 导航 --- */
.nav {
  margin-left: auto;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(0.35rem, 1.5vw, 1.6rem);
}

.nav__item {
  flex: none;
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.72rem 0.1rem;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: rgba(169, 183, 204, 0.94);
  transition: color 0.18s var(--ease);
}

.nav__num {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1;
  color: rgba(46, 68, 112, 1);
  transition: color 0.18s var(--ease);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.36rem;
  height: 1px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s var(--ease);
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--white);
}

.nav__link:hover .nav__num {
  color: var(--cyan);
}

.nav__link:hover::after {
  transform: scaleX(1);
}

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

.nav__link[aria-current="page"] .nav__num {
  color: var(--orange);
}

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

/* --- 移动导航按钮 --- */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--orbit);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

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

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}

.nav-toggle__bars span {
  display: block;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s var(--ease);
}

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

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

/* --- 滚动进度细线 --- */
.scroll-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(46, 68, 112, 0.55);
  pointer-events: none;
}

.scroll-rail__fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  position: relative;
  overflow: hidden;
  margin-top: clamp(3.5rem, 9vw, 7rem);
  border-top: 1px solid var(--orbit);
  background: linear-gradient(
    180deg,
    rgba(10, 26, 51, 0.55),
    rgba(18, 42, 86, 0.92)
  );
  color: var(--haze);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.85;
  background-image: radial-gradient(
      1px 1px at 12% 24%,
      rgba(247, 250, 255, 0.5),
      transparent
    ),
    radial-gradient(1px 1px at 31% 68%, rgba(69, 224, 209, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 58% 18%, rgba(247, 250, 255, 0.4), transparent),
    radial-gradient(1px 1px at 74% 54%, rgba(108, 77, 255, 0.6), transparent),
    radial-gradient(1px 1px at 88% 32%, rgba(247, 250, 255, 0.45), transparent),
    radial-gradient(1px 1px at 44% 88%, rgba(69, 224, 209, 0.35), transparent);
}

.site-footer > .shell {
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr 1.3fr;
  gap: clamp(1.8rem, 4vw, 3.6rem);
  padding-block: clamp(2.6rem, 6vw, 4.2rem) clamp(1.6rem, 4vw, 2.6rem);
}

.footer-brand .brand {
  padding-block: 0;
}

.brand--footer .brand__name {
  font-size: 1.15rem;
}

.footer-brand__note {
  max-width: 30ch;
  margin-top: 1.05rem;
  font-size: 0.88rem;
  line-height: 1.8;
  color: rgba(169, 183, 204, 0.92);
}

.footer-nav__title {
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(169, 183, 204, 0.9);
}

.footer-nav__list {
  display: grid;
  gap: 0.15rem;
}

.footer-nav__list a {
  display: inline-block;
  padding: 0.24rem 0;
  font-size: 0.94rem;
  color: rgba(247, 250, 255, 0.88);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.footer-nav__list a:hover {
  color: var(--cyan);
  border-bottom-color: rgba(69, 224, 209, 0.65);
}

.contact-list {
  display: grid;
  gap: 0;
}

.contact-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.7rem;
  padding: 0.52rem 0;
  border-bottom: 1px solid rgba(46, 68, 112, 0.55);
}

.contact-list__item:first-child {
  padding-top: 0;
}

.contact-list__key {
  flex: none;
  min-width: 2.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: rgba(169, 183, 204, 0.72);
}

.contact-list__value {
  color: var(--white);
  font-size: 0.9rem;
  line-height: 1.65;
  word-break: break-word;
}

.copy-btn {
  flex: none;
  padding: 0.1rem 0.42rem;
  border: 1px solid rgba(69, 224, 209, 0.5);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.6;
  letter-spacing: 0.1em;
  color: var(--cyan);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.copy-btn:hover,
.copy-btn[data-copied="true"] {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--deep-space);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 2rem;
  padding-block: 1.15rem 2.4rem;
  border-top: 1px solid rgba(46, 68, 112, 0.7);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(169, 183, 204, 0.85);
}

.footer-base__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
}

.footer-base__legal a {
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.footer-base__legal a:hover {
  color: var(--cyan);
  border-bottom-color: rgba(69, 224, 209, 0.6);
}

.footer-base__icp {
  letter-spacing: 0.1em;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1080px) {
  .nav__list {
    gap: 0.5rem;
  }

  .nav__link {
    font-size: 0.86rem;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

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

  .site-header__top-inner {
    min-height: 34px;
  }

  .coord-label {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
  }

  .site-header__bar-inner {
    min-height: 58px;
    gap: 1rem;
  }

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

  .nav {
    position: absolute;
    left: calc(-1 * var(--gutter));
    right: calc(-1 * var(--gutter));
    top: 100%;
    margin-left: 0;
    display: none;
    padding: 0.4rem var(--gutter) 1.1rem;
    background: var(--midnight);
    border-top: 1px solid var(--orbit);
    border-bottom: 1px solid var(--orbit);
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }

  .nav[data-open] {
    display: block;
  }

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

  .nav__link {
    width: 100%;
    padding: 0.9rem 0;
    font-size: 1rem;
    border-bottom: 1px solid rgba(46, 68, 112, 0.5);
  }

  .nav__link::after {
    display: none;
  }

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

  .nav__link[aria-current="page"] .nav__num {
    color: var(--orange);
  }

  .nav__num {
    font-size: 0.68rem;
    color: rgba(169, 183, 204, 0.55);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-brand__note {
    max-width: 46ch;
  }
}

@media (max-width: 620px) {
  .site-header__top-inner {
    min-height: 32px;
    gap: 0.6rem;
  }

  .coord-label {
    display: none;
  }

  .search-pill {
    margin-left: auto;
  }

  .search-pill__key {
    display: none;
  }

  .brand__tag {
    display: none;
  }

  .footer-base {
    justify-content: flex-start;
    gap: 0.6rem 1.4rem;
  }

  .footer-base__copy {
    width: 100%;
  }

  .annotation--vertical {
    writing-mode: horizontal-tb;
    letter-spacing: 0.18em;
  }
}

/* =========================================================
   动效降级
   ========================================================= */
@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;
    scroll-behavior: auto !important;
  }

  .skip-link,
  .nav__link::after {
    transition: none !important;
  }
}
