/* ============================================================
   十八游戏站 · 共享样式 /assets/site.css
   深空黑底 + 霓虹青 + 琥珀橙 + 紫罗兰，切角面板与扫描线质感
   ============================================================ */

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

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

ul, ol { list-style: none; }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

button { cursor: pointer; }

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

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

/* ---------- 2. 变量 ---------- */
:root {
  /* 色彩 */
  --void: #05070B;
  --panel: #0D1218;
  --edge: #1E2A36;
  --cyan: #4FF0DC;
  --cyan-dim: #0E9C8F;
  --amber: #FFB13C;
  --magenta: #FF3D7F;
  --violet: #7C6BFF;
  --text: #EEF3F7;
  --muted: #93A2B0;

  --edge-soft: rgba(30, 42, 54, 0.68);
  --panel-veil: rgba(13, 18, 24, 0.78);
  --cyan-veil: rgba(79, 240, 220, 0.10);
  --amber-veil: rgba(255, 177, 60, 0.12);
  --violet-veil: rgba(124, 107, 255, 0.14);
  --magenta-veil: rgba(255, 61, 127, 0.12);

  /* 尺寸 */
  --shell: 1280px;
  --pad: 28px;
  --header-h: 88px;
  --header-h-stuck: 64px;
  --radius-cut: 20px;

  /* 字体 */
  --font-body: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "PingFang SC", "Source Han Sans SC", "Microsoft YaHei",
    system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "JetBrains Mono",
    "Menlo", "Consolas", "Courier New", monospace;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 3. 基础排版 ---------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--void);
}

body {
  min-height: 100vh;
  background-color: var(--void);
  background-image:
    radial-gradient(900px 520px at 82% -6%, rgba(79, 240, 220, 0.07), transparent 68%),
    radial-gradient(700px 480px at 4% 12%, rgba(124, 107, 255, 0.06), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(238, 243, 247, 0.026) 0 1px,
    transparent 1px 5px
  );
}

body.nav-open { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

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

::selection {
  background: var(--cyan);
  color: var(--void);
}

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

/* ---------- 4. 容器与栅格 ---------- */
.shell {
  width: min(var(--shell), 100%);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

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

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

/* ---------- 5. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 12px 20px;
  background: var(--cyan);
  color: var(--void);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

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

/* ---------- 6. 头部 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  background: transparent;
  transition:
    height 0.26s var(--ease),
    background-color 0.26s var(--ease),
    border-color 0.26s var(--ease);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--cyan) 0 14%,
    var(--violet) 14% 18%,
    transparent 18% 100%
  );
  opacity: 0.5;
  transition: opacity 0.26s var(--ease);
}

.site-header.is-stuck {
  height: var(--header-h-stuck);
  background-color: rgba(13, 18, 24, 0.95);
  border-bottom-color: var(--edge);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header.is-stuck::after { opacity: 0.85; }

.header-shell {
  position: relative;
  height: 100%;
  width: min(var(--shell), 100%);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

/* 品牌 */
.brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  justify-self: start;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.12;
  color: var(--text);
  text-transform: uppercase;
}

.brand-mark em {
  font-style: normal;
  color: var(--cyan);
}

.brand-note {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
}

.brand-note .mono { color: var(--muted); }

.brand:hover .brand-mark { color: var(--cyan); }
.brand:hover .brand-mark em { color: var(--text); }

/* 移动端目录按钮 */
.nav-toggle {
  grid-column: 2;
  justify-self: end;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--edge);
  background: var(--panel-veil);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

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

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

.nav-toggle .bars i {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.24s var(--ease), opacity 0.2s var(--ease);
}

.site-header[data-open] .nav-toggle .bars i:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.site-header[data-open] .nav-toggle .bars i:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle .bars i:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* 导航 */
.site-nav {
  justify-self: center;
  min-width: 0;
}

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

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.07em;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}

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

.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  translate: 0 -50%;
  width: 3px;
  height: 0;
  background: var(--cyan);
  clip-path: polygon(0 0, 100% 10%, 100% 90%, 0 100%);
  transition: height 0.24s var(--ease);
}

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

.nav-link[aria-current="page"] { color: var(--cyan); }
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"]::before { height: 18px; }

.nav-aside { display: none; }

.header-rail {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 更新口径胶囊 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--cyan-veil);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
  clip-path: polygon(
    12px 0,
    100% 0,
    100% calc(100% - 12px),
    calc(100% - 12px) 100%,
    0 100%,
    0 12px
  );
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.pill:hover { background: rgba(79, 240, 220, 0.2); }
.pill:active { background: var(--cyan-dim); color: var(--void); }

/* ---------- 7. 移动端导航 ---------- */
@media (max-width: 1059px) {
  .site-header,
  .site-header.is-stuck { height: 64px; }

  .header-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

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

  .header-rail { display: none; }

  .site-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    justify-self: stretch;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 10px var(--pad) 30px;
    background-color: var(--panel);
    border-top: 1px solid var(--edge);
    border-bottom: 1px solid var(--edge);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition:
      opacity 0.22s var(--ease),
      transform 0.22s var(--ease),
      visibility 0.22s linear;
  }

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

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

  .nav-link {
    justify-content: space-between;
    padding: 15px 10px 15px 16px;
    border-bottom: 1px solid var(--edge-soft);
    font-size: 17px;
    letter-spacing: 0.08em;
  }

  .nav-link::after { display: none; }

  .nav-link[aria-current="page"] {
    background: linear-gradient(90deg, var(--cyan-veil), transparent 72%);
  }

  .nav-aside {
    display: block;
    padding-top: 20px;
  }

  .nav-aside .pill { width: 100%; justify-content: center; }
}

/* ---------- 8. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--cyan);
  color: var(--void);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  clip-path: polygon(
    14px 0,
    100% 0,
    100% calc(100% - 14px),
    calc(100% - 14px) 100%,
    0 100%,
    0 14px
  );
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.btn:hover { background: #7CF6E7; }
.btn:active { background: var(--cyan-dim); color: var(--void); transform: translateY(1px); }

.btn--ghost {
  background: var(--cyan-veil);
  color: var(--cyan);
}

.btn--ghost:hover { background: rgba(79, 240, 220, 0.22); }

/* ---------- 9. 面包屑 ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.breadcrumbs li + li::before {
  content: "/";
  color: var(--edge);
  font-family: var(--font-mono);
}

.breadcrumbs a { color: var(--muted); transition: color 0.18s var(--ease); }
.breadcrumbs a:hover { color: var(--cyan); }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* ---------- 10. 页面头 / 编号章节 ---------- */
.page-head {
  padding-top: calc(var(--header-h) + 56px);
  padding-bottom: 40px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--edge);
}

.section-no {
  font-family: var(--font-mono);
  font-size: clamp(38px, 7vw, 76px);
  font-weight: 700;
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1px var(--cyan-dim);
  text-stroke: 1px var(--cyan-dim);
  letter-spacing: -0.03em;
}

.section-title {
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.divider-slant {
  height: 1px;
  margin: 56px 0;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent,
    var(--edge) 12%,
    var(--edge) 88%,
    transparent
  );
  transform: skewY(-0.5deg);
}

/* ---------- 11. 正文 ---------- */
.prose {
  max-width: 62ch;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}

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

.prose h2 {
  margin: 2.2em 0 0.7em;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: 0.03em;
}

.prose h3 {
  margin: 1.8em 0 0.5em;
  font-size: 18px;
  color: var(--cyan);
  letter-spacing: 0.05em;
}

.prose ul,
.prose ol {
  margin: 1.1em 0;
  padding-left: 1.2em;
  list-style: none;
}

.prose li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 0.5em;
  color: var(--muted);
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  background: var(--cyan);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.prose strong { color: var(--text); font-weight: 700; }

.prose a {
  color: var(--cyan);
  border-bottom: 1px solid var(--cyan-dim);
}

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

/* ---------- 12. 面板 / 卡片 ---------- */
.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--edge);
  padding: 26px;
  clip-path: polygon(
    0 0,
    calc(100% - var(--radius-cut)) 0,
    100% var(--radius-cut),
    100% 100%,
    0 100%
  );
}

.panel--flat { background: rgba(13, 18, 24, 0.6); }

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.card:hover { border-color: var(--cyan-dim); background: #101822; }

/* ---------- 13. 数据锚点 ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; }

.stat-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(34px, 6vw, 68px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.stat-value--cyan { color: var(--cyan); }
.stat-value--amber { color: var(--amber); }
.stat-value--violet { color: var(--violet); }
.stat-value--magenta { color: var(--magenta); }

.stat-value small {
  font-size: 0.34em;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-left: 6px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 14. 图片容器 ---------- */
.media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--panel);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(79, 240, 220, 0.05) 0 8px,
    transparent 8px 18px
  );
  border: 1px solid var(--edge);
  clip-path: polygon(
    0 0,
    calc(100% - 22px) 0,
    100% 22px,
    100% 100%,
    22px 100%,
    0 calc(100% - 22px)
  );
}

.media > img,
.media > video,
.media > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media--wide { aspect-ratio: 21 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x4 { aspect-ratio: 3 / 4; }
.media--1x1 { aspect-ratio: 1 / 1; }

.media-caption {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- 15. 标签与线标识 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  clip-path: polygon(
    8px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 8px
  );
}

.tag--review { background: var(--amber-veil); color: var(--amber); }
.tag--config { background: var(--cyan-veil); color: var(--cyan); }
.tag--schedule { background: var(--violet-veil); color: var(--violet); }
.tag--alert { background: var(--magenta-veil); color: var(--magenta); }

/* ---------- 16. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: 104px;
  background-color: var(--panel);
  border-top: 1px solid var(--edge);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(238, 243, 247, 0.022) 0 1px,
    transparent 1px 6px
  );
}

.site-footer::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 44vw);
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--amber));
  opacity: 0.75;
}

.footer-shell {
  position: relative;
  z-index: 1;
  width: min(var(--shell), 100%);
  margin-inline: auto;
  padding: 68px var(--pad) 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 42px;
}

@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.35fr 1fr 1.25fr; gap: 44px; }
}

.footer-col { min-width: 0; }

.brand--footer {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 18px;
}

.footer-blurb {
  max-width: 40ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.line-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.footer-title {
  position: relative;
  margin-bottom: 18px;
  padding-left: 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  translate: 0 -50%;
  width: 3px;
  height: 14px;
  background: var(--cyan);
  clip-path: polygon(0 0, 100% 12%, 100% 88%, 0 100%);
}

.footer-links li { border-bottom: 1px solid var(--edge-soft); }

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transition: color 0.18s var(--ease), transform 0.18s var(--ease);
}

.footer-links a::before {
  content: "";
  width: 8px;
  height: 1px;
  background: var(--edge);
  transition: width 0.18s var(--ease), background-color 0.18s var(--ease);
}

.footer-links a:hover { color: var(--cyan); transform: translateX(3px); }
.footer-links a:hover::before { width: 16px; background: var(--cyan); }

.footer-meta li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--edge-soft);
  font-size: 14px;
}

.footer-key {
  flex: 0 0 74px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding-top: 3px;
}

.footer-val {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  word-break: break-word;
}

/* 年份刻度带 */
.ruler {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 58px;
  padding-top: 22px;
  border-top: 1px solid var(--edge);
}

.ruler-year {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.ruler-bar {
  position: relative;
  flex: 1 1 auto;
  min-width: 60px;
  height: 1px;
  background: var(--edge);
}

.ruler-bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -4px;
  height: 9px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--edge) 0 1px,
    transparent 1px 16px
  );
}

.ruler-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--violet),
    var(--cyan) 55%,
    var(--amber)
  );
  opacity: 0.6;
}

.ruler-note {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--edge-soft);
  font-size: 12px;
  color: var(--muted);
}

.footer-copy { letter-spacing: 0.08em; }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.footer-legal a {
  color: var(--muted);
  letter-spacing: 0.08em;
  transition: color 0.18s var(--ease);
}

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

/* ---------- 17. 滚动进度 / 返回顶部 / 显现 ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 220;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--amber));
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
  pointer-events: none;
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--edge);
  background: rgba(13, 18, 24, 0.92);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  clip-path: polygon(
    10px 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%,
    0 10px
  );
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease),
    visibility 0.22s linear,
    border-color 0.2s var(--ease);
}

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

.to-top:hover { border-color: var(--cyan-dim); background: #101822; }

@media (min-width: 760px) {
  .to-top { right: 34px; bottom: 32px; }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

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

/* 章节目录跟随 */
[data-toc] a.is-current {
  color: var(--cyan);
}

/* 锚点定位避让固定头 */
:target,
[id] { scroll-margin-top: calc(var(--header-h-stuck) + 24px); }

/* ---------- 18. 响应式微调 ---------- */
@media (max-width: 520px) {
  :root { --pad: 18px; --radius-cut: 16px; }

  .brand-mark { font-size: 18px; letter-spacing: 0.16em; }
  .brand-note { font-size: 9px; letter-spacing: 0.16em; }

  .footer-shell { padding-top: 52px; }
  .footer-meta li { font-size: 13px; }
  .footer-key { flex-basis: 100%; padding-top: 0; }

  .ruler { flex-wrap: wrap; gap: 10px; }
  .ruler-note { width: 100%; }

  .panel,
  .card { padding: 20px; }
}

/* ---------- 19. 减少动效 ---------- */
@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;
  }

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