/* ==========================================================================
   BEPLAY · /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 站点头部 / 站点页脚 / 通用组件
   颜色节奏：深墨蓝底 → 夜色蓝分区 → 轨道蓝边界 → 荧光青路径 → 暖橙节点
   ========================================================================== */

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

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

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

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

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

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

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

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

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

hr { border: 0; border-top: 1px solid var(--track); margin: 0; }

/* 2. 变量 ----------------------------------------------------------------- */
:root {
  --ink: #081226;
  --night: #0E1D35;
  --track: #17304F;
  --slate: #1E3A5C;
  --cyan: #35F2D8;
  --amber: #FF8A3D;
  --mist: #C7F5EC;
  --paper: #EAF1F8;
  --grey: #9FB3CC;
  --index: #6C82A0;

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

  --ease: cubic-bezier(.22, .61, .36, 1);
  --gutter: 20px;
  --maxw: 1240px;
  --header-h: 76px;
  --dock-h: 0px;
  --radius-soft: 6px 26px 8px 22px;
  --radius-chip: 14px 4px 14px 4px;
}

@media (min-width: 768px) {
  :root { --gutter: 40px; --header-h: 88px; }
}

@media (min-width: 1200px) {
  :root { --gutter: 56px; }
}

/* 3. 基础排版 ------------------------------------------------------------- */
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: padding-bottom 220ms var(--ease);
}

@media (max-width: 960px) {
  body { padding-bottom: var(--dock-h); }
}

html[data-nav-open="true"] body { padding-bottom: calc(var(--dock-h) + 220px); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 300;
  line-height: 1.16;
  letter-spacing: -.01em;
}

.h-display {
  font-family: var(--font-head);
  font-size: clamp(40px, 9vw, 128px);
  font-weight: 200;
  line-height: .98;
  letter-spacing: -.02em;
}

.h-section {
  font-family: var(--font-head);
  font-size: clamp(28px, 4.4vw, 56px);
  font-weight: 300;
  line-height: 1.12;
}

strong, b { font-weight: 800; }

.key { font-weight: 800; }

.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--cyan);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--cyan);
  opacity: .75;
}

.index-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--amber);
}

.meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--index);
  line-height: 1.7;
}

.lede {
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.8;
  color: var(--grey);
  max-width: 64ch;
}

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

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

.prose h2 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 400;
  margin-top: 2.2em;
}

.prose h3 { font-size: 19px; font-weight: 600; margin-top: 1.8em; }

.prose ul li { position: relative; padding-left: 22px; }

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

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .9em;
  width: 8px;
  height: 1px;
  background: var(--cyan);
}

.prose a { color: var(--cyan); border-bottom: 1px solid rgba(53, 242, 216, .35); }

/* 4. 布局容器与网格 ------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.container--wide { max-width: 1440px; }

.page-top { padding-top: calc(var(--header-h) + 44px); }

.section { padding-block: clamp(56px, 9vw, 120px); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: clamp(24px, 4vw, 48px);
}

.section-head__title {
  font-family: var(--font-head);
  font-size: clamp(28px, 4.4vw, 56px);
  font-weight: 300;
  line-height: 1.12;
}

.grid { display: grid; gap: 24px; }

.offset-1, .offset-2, .offset-3 { margin-left: 0; }

@media (min-width: 720px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
  .offset-1 { margin-left: 24px; }
  .offset-2 { margin-left: 56px; }
  .offset-3 { margin-left: 88px; }
}

.divider { height: 1px; border: 0; background: var(--track); margin-block: 32px; }

.divider--glow {
  background: linear-gradient(90deg, var(--cyan), var(--track) 42%, transparent);
}

/* 5. 按钮、标签、卡片 ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-chip);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background-color 180ms var(--ease), color 180ms var(--ease),
              border-color 180ms var(--ease);
}

.btn--primary { background: var(--amber); color: var(--ink); }
.btn--primary:hover { background: #FFA268; }

.btn--cyan { background: var(--cyan); color: var(--ink); }
.btn--cyan:hover { background: var(--mist); }

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

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

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 2px 12px;
  border: 1px solid var(--track);
  border-radius: var(--radius-chip);
  background: rgba(23, 48, 79, .5);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--grey);
}

.tag--cyan { background: var(--cyan); border-color: var(--cyan); color: var(--ink); }
.tag--amber { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.tag--mist { background: var(--mist); border-color: var(--mist); color: var(--ink); }
.tag--ghost { background: transparent; }

.card {
  position: relative;
  padding: 24px;
  background: var(--night);
  border: 1px solid var(--track);
  border-radius: var(--radius-soft);
  transition: border-color 200ms var(--ease), background-color 200ms var(--ease);
}

.card--slate { background: var(--slate); }

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

.card__index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--amber);
}

.card__title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  margin-top: 10px;
}

.card__text { margin-top: 8px; font-size: 15px; color: var(--grey); }

/* 6. 路径轨道与专题研究板 ------------------------------------------------- */
.rail { position: relative; padding-left: 40px; }

.rail::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--track);
}

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

.rail-node {
  position: absolute;
  left: -26px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--index);
  background: var(--ink);
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease);
}

.rail-item.is-current .rail-node,
.rail-item[aria-current] .rail-node {
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--amber);
  border-color: var(--amber);
}

.chapter { position: relative; }

.chapter-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--amber);
  transition: color 200ms var(--ease);
}

.chapter.is-current .chapter-num { color: var(--cyan); }

[data-toc-link][aria-current="true"] { color: var(--cyan); }

/* 7. 图片占位容器 --------------------------------------------------------- */
.figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--night);
  border: 1px solid var(--track);
  border-radius: var(--radius-soft);
}

.figure__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.figure__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.86) brightness(.82) contrast(1.06);
}

.figure__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 82% 8%, rgba(255, 138, 61, .18), transparent 62%);
}

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

.figure__caption {
  padding: 12px 18px;
  border-top: 1px solid var(--track);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--index);
}

.figure--overlay .figure__caption {
  position: absolute;
  inset: auto 0 0 0;
  border-top: 0;
  color: var(--mist);
  background: linear-gradient(transparent, rgba(8, 18, 38, .88));
}

/* 8. 面包屑 --------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--index);
}

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

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

.breadcrumb a { color: var(--grey); transition: color 180ms var(--ease); }
.breadcrumb a:hover { color: var(--cyan); }

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

/* 9. 站点头部 ------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -72px;
  left: var(--gutter);
  z-index: 95;
  padding: 12px 20px;
  background: var(--mist);
  color: var(--ink);
  border-radius: var(--radius-chip);
  font-size: 14px;
  font-weight: 600;
  transition: top 180ms var(--ease);
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: transparent;
  transition: background-color 260ms var(--ease);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--track);
  opacity: 0;
  transition: opacity 260ms var(--ease);
}

.site-header.is-solid { background: var(--ink); }

.site-header.is-solid::after { opacity: 1; }

.header-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 24px var(--gutter);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: padding 260ms var(--ease);
}

.site-header.is-solid .header-inner { padding-block: 18px; }

.brand { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }

.brand-mark {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .18em;
  color: var(--paper);
}

.brand-mark::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 9px;
  border-radius: 50%;
  background: var(--cyan);
  vertical-align: .06em;
}

.brand-line {
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .22em;
  color: var(--index);
}

.primary-nav { margin-left: auto; }

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

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--grey);
  transition: color 180ms var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms var(--ease);
}

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

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

.header-utility { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.utility-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--track);
  border-radius: var(--radius-chip);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--grey);
  transition: background-color 180ms var(--ease), color 180ms var(--ease),
              border-color 180ms var(--ease);
}

.utility-link:hover { background: var(--mist); border-color: var(--mist); color: var(--ink); }

.utility-link--cta { border-color: var(--amber); color: var(--amber); }
.utility-link--cta:hover { background: var(--amber); border-color: var(--amber); color: var(--ink); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid var(--track);
  border-radius: var(--radius-chip);
  color: var(--paper);
  transition: background-color 180ms var(--ease), color 180ms var(--ease),
              border-color 180ms var(--ease);
}

.nav-toggle-lines { display: flex; flex-direction: column; gap: 4px; }

.nav-toggle-bar { display: block; width: 14px; height: 1.5px; background: currentColor; }

.nav-toggle-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
}

.nav-toggle[aria-expanded="true"] {
  background: var(--mist);
  border-color: var(--mist);
  color: var(--ink);
}

.nav-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--dock-h);
  z-index: 58;
  display: none;
  max-height: 72vh;
  overflow-y: auto;
  padding: 22px var(--gutter) 26px;
  background: var(--night);
  border-top: 1px solid var(--track);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease), visibility 220ms var(--ease);
}

.nav-drawer[data-open] { opacity: 1; visibility: visible; transform: translateY(0); }

.drawer-label {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--index);
}

.drawer-list { display: grid; grid-template-columns: 1fr; gap: 6px; }

.drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-chip);
  font-size: 16px;
  color: var(--paper);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease),
              color 180ms var(--ease);
}

.drawer-link:hover { background: rgba(30, 58, 92, .55); border-color: var(--track); }

.drawer-link[aria-current="page"] { background: rgba(30, 58, 92, .55); border-color: var(--track); color: var(--cyan); }

.drawer-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--index);
}

.drawer-text { flex: 1; }

.drawer-utility {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--track);
}

.scroll-line {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transition: width 120ms linear;
}

/* 10. 移动端底部轨道 ------------------------------------------------------ */
.mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: none;
  background: var(--night);
  border-top: 1px solid var(--track);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.dock-list { display: grid; grid-template-columns: repeat(6, 1fr); }

.dock-item { display: flex; }

.dock-link {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: var(--dock-h);
  padding: 8px 2px;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: center;
  color: var(--grey);
  transition: color 180ms var(--ease);
}

.dock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--index);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease),
              transform 180ms var(--ease);
}

.dock-link:hover { color: var(--paper); }

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

.dock-link[aria-current="page"] .dock-dot {
  background: var(--amber);
  border-color: var(--amber);
  transform: scale(1.35);
}

@media (max-width: 960px) {
  :root { --dock-h: 68px; }
  .primary-nav, .header-utility { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-drawer { display: block; }
  .mobile-dock { display: block; }
}

@media (max-width: 1100px) and (min-width: 961px) {
  .nav-link { padding: 0 9px; font-size: 14px; }
  .nav-link::after { left: 9px; right: 9px; }
  .utility-link { padding: 0 10px; }
}

@media (min-width: 560px) {
  .drawer-list { grid-template-columns: repeat(2, 1fr); }
}

/* 11. 返回顶部 ------------------------------------------------------------ */
.to-top {
  position: fixed;
  right: 18px;
  bottom: calc(var(--dock-h) + 18px);
  z-index: 68;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--track);
  border-radius: var(--radius-chip);
  background: rgba(14, 29, 53, .94);
  color: var(--paper);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease),
              visibility 220ms var(--ease), border-color 180ms var(--ease),
              color 180ms var(--ease);
}

.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

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

.to-top-glyph { font-family: var(--font-mono); font-size: 16px; line-height: 1; }

/* 12. 站点页脚 ------------------------------------------------------------ */
.site-footer {
  position: relative;
  margin-top: clamp(72px, 10vw, 140px);
  background: var(--night);
  border-top: 1px solid var(--track);
}

.footer-grid {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(48px, 7vw, 80px) var(--gutter) 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .footer-grid { grid-template-columns: 1.5fr repeat(3, 1fr); gap: 40px; }
}

.footer-brand { display: flex; flex-direction: column; gap: 12px; }

.footer-mark {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--paper);
}

.footer-mark::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 9px;
  border-radius: 50%;
  background: var(--amber);
  vertical-align: .06em;
}

.footer-line { font-size: 14px; color: var(--grey); letter-spacing: .06em; }

.footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--index);
}

.footer-col { display: flex; flex-direction: column; gap: 14px; }

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .18em;
  color: var(--cyan);
}

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

.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 14px;
  color: var(--grey);
  transition: color 180ms var(--ease);
}

.footer-link::before {
  content: "";
  width: 10px;
  height: 1px;
  margin-right: 10px;
  background: var(--track);
  transition: width 180ms var(--ease), background-color 180ms var(--ease);
}

.footer-link:hover { color: var(--paper); }
.footer-link:hover::before { width: 18px; background: var(--cyan); }

.footer-base {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 28px var(--gutter) 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  border-top: 1px solid var(--track);
  font-size: 13px;
  color: var(--index);
}

.footer-contact { color: var(--grey); }

.footer-address { color: var(--grey); }

.footer-service { flex: 1 1 320px; line-height: 1.7; }

.footer-legal { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; }

@media (max-width: 960px) {
  .site-footer { padding-bottom: var(--dock-h); }
}

/* 13. 显现动效与可访问性 -------------------------------------------------- */
[data-reveal] { transition: opacity 280ms var(--ease), transform 280ms var(--ease); }

html.js-ready [data-reveal] { opacity: 0; transform: translateY(16px); }

html.js-ready [data-reveal].is-visible { opacity: 1; transform: none; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html.js-ready [data-reveal] { opacity: 1; transform: none; }
}
