/* ==========================================================================
   乐竞体育官网 — 共享样式表 /assets/site.css
   深夜蓝黑底 · 荧光绿数据态 · 电光蓝链接 · 暖橙关键操作
   ========================================================================== */

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

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

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

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

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

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

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

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

[hidden] { display: none !important; }

/* --- 2. 设计令牌 -------------------------------------------------------- */
:root {
  --ink: #050A12;
  --ink-panel: #0B1420;
  --line: #1D2B3D;
  --green: #38F08C;
  --green-deep: #0E2E22;
  --blue: #35B7FF;
  --orange: #FF8A3C;
  --amber: #FFC24B;
  --paper: #F3F7FB;
  --muted: #93A4B8;
  --on-orange: #1A0F05;

  --font-display: "Source Han Sans Heavy", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-num: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-editorial: "Noto Serif SC", "Songti SC", Georgia, "Times New Roman", serif;

  --shell-w: 1240px;
  --gutter: clamp(18px, 4vw, 42px);
  --cut: 22px;
  --ease: cubic-bezier(.22, .72, .28, 1);
  --offset: 112px;

  --shadow-panel: 0 30px 70px -46px rgba(0, 0, 0, .95);
}

/* --- 3. 基础排版 -------------------------------------------------------- */
body {
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--ink);
  background-image:
    radial-gradient(1180px 640px at 80% -8%, rgba(53, 183, 255, .14), transparent 62%),
    radial-gradient(920px 560px at 4% 6%, rgba(56, 240, 140, .09), transparent 60%),
    linear-gradient(180deg, #050A12 0%, #04070E 100%);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: clamp(16px, .32vw + 15px, 17.5px);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color .2s var(--ease);
}

a:hover { color: var(--green); }

p + p { margin-top: 1.15em; }

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

#main-content { scroll-margin-top: var(--offset); }

::selection { background: rgba(56, 240, 140, .3); color: #fff; }

/* --- 4. 版心与栅格 ------------------------------------------------------ */
.shell {
  width: min(calc(100% - (2 * var(--gutter))), var(--shell-w));
  margin-inline: auto;
}

.grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 28px);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--aside { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.grid--aside-start { grid-template-columns: 280px minmax(0, 1fr); align-items: start; }

.stack > * + * { margin-top: var(--stack-gap, 1.15rem); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* --- 5. 文本工具 -------------------------------------------------------- */
.t-display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.3rem, 6.2vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -.025em;
}

.t-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.02em;
}

.t-sub {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.12rem, 1.9vw, 1.48rem);
  line-height: 1.28;
  letter-spacing: -.01em;
}

.t-lede {
  font-family: var(--font-editorial);
  font-weight: 500;
  font-size: clamp(1.02rem, 1.45vw, 1.32rem);
  line-height: 1.62;
  color: #DCE7F2;
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -.01em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.text-muted { color: var(--muted); }

/* --- 6. 按钮 ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .82em 1.45em;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition: background .22s var(--ease), color .22s var(--ease),
              border-color .22s var(--ease), box-shadow .22s var(--ease),
              transform .22s var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--orange);
  color: var(--on-orange);
  box-shadow: 0 14px 34px -18px rgba(255, 138, 60, .95);
}

.btn--primary:hover {
  color: var(--on-orange);
  background: #FFA05E;
  box-shadow: 0 18px 40px -16px rgba(255, 138, 60, 1);
}

.btn--ghost {
  background: rgba(243, 247, 251, .03);
  border-color: var(--line);
  color: var(--paper);
}

.btn--ghost:hover {
  color: var(--paper);
  border-color: rgba(53, 183, 255, .6);
  background: rgba(53, 183, 255, .1);
}

.btn--signal {
  background: rgba(14, 46, 34, .5);
  border-color: rgba(56, 240, 140, .5);
  color: var(--green);
}

.btn--signal:hover {
  color: var(--on-orange);
  background: var(--green);
  border-color: var(--green);
}

.btn--sm { padding: .6em 1.05em; font-size: 13.5px; }
.btn--block { display: flex; width: 100%; }

/* --- 7. 跳转链接 -------------------------------------------------------- */
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: .7em 1.25em;
  border-radius: 999px;
  background: var(--green);
  color: #05140C;
  font-size: 14px;
  font-weight: 800;
  transition: top .22s var(--ease);
}

.skip-link:focus {
  top: 14px;
  color: #05140C;
}

/* --- 8. 头部 ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 14px 0;
  transition: padding .38s var(--ease);
}

.site-header.is-condensed { padding: 7px 0; }

.header-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 20px);
  padding: 8px 8px 8px 20px;
  border: 1px solid rgba(29, 43, 61, .9);
  border-radius: 999px;
  background: rgba(11, 20, 32, .78);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 24px 56px -38px rgba(0, 0, 0, .98);
  transition: background .38s var(--ease), border-color .38s var(--ease),
              padding .38s var(--ease), box-shadow .38s var(--ease);
}

.site-header.is-condensed .header-shell {
  background: rgba(5, 10, 18, .93);
  border-color: rgba(56, 240, 140, .22);
  box-shadow: 0 20px 46px -32px rgba(0, 0, 0, 1);
}

/* 字标 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--paper);
}

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

.brand__mark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}

.brand__mark i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--green), rgba(56, 240, 140, .22));
}

.brand__mark i:nth-child(1) { height: 10px; }
.brand__mark i:nth-child(2) { height: 22px; }
.brand__mark i:nth-child(3) { height: 15px; }

.brand__text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1;
}

.brand__suffix {
  font-family: var(--font-num);
  font-size: 10.5px;
  letter-spacing: .22em;
  color: var(--muted);
  line-height: 1;
}

.brand--footer .brand__name { font-size: 22px; }

/* 栏目胶囊 */
.nav-capsule {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.nav-capsule__list {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(29, 43, 61, .8);
  border-radius: 999px;
  background: rgba(5, 10, 18, .62);
}

.nav-capsule__link {
  display: block;
  padding: .52em .92em;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: color .22s var(--ease), background .22s var(--ease),
              box-shadow .22s var(--ease);
}

.nav-capsule__link:hover {
  color: var(--paper);
  background: rgba(243, 247, 251, .07);
}

.nav-capsule__link[aria-current="page"] {
  background: var(--green);
  color: #05140C;
  font-weight: 800;
  box-shadow: 0 10px 26px -14px rgba(56, 240, 140, .95);
}

/* 右侧操作区 */
.header-rail {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
}

.pulse-lamp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: .4em .8em;
  border: 1px solid rgba(56, 240, 140, .3);
  border-radius: 999px;
  background: rgba(14, 46, 34, .5);
  color: var(--green);
  font-family: var(--font-num);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.pulse-lamp__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: lamp-pulse 2.6s var(--ease) infinite;
}

@keyframes lamp-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(56, 240, 140, .6); }
  70%  { box-shadow: 0 0 0 9px rgba(56, 240, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 240, 140, 0); }
}

.header-current {
  display: none;
  align-items: center;
  gap: .5em;
  padding: .42em 1em;
  border: 1px dashed rgba(56, 240, 140, .45);
  border-radius: 999px;
  background: rgba(14, 46, 34, .42);
  color: var(--green);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(243, 247, 251, .05);
  transition: border-color .22s var(--ease), background .22s var(--ease);
}

.nav-toggle:hover {
  border-color: rgba(56, 240, 140, .5);
  background: rgba(56, 240, 140, .1);
}

.nav-toggle__bar {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: var(--paper);
  transition: transform .25s var(--ease);
}

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

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

/* --- 9. 页脚 ------------------------------------------------------------ */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 9vw, 132px);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 20, 32, .62) 0%, #03070E 58%);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto 0;
  height: 10px;
  background-image: repeating-linear-gradient(90deg, rgba(56, 240, 140, .5) 0 1px, transparent 1px 18px);
  opacity: .55;
  pointer-events: none;
}

.footer-inner { padding-block: clamp(42px, 6vw, 76px) clamp(22px, 3vw, 34px); }

.footer-masthead {
  display: grid;
  gap: 18px;
  justify-items: start;
  padding-bottom: clamp(26px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.footer-lede {
  max-width: 52ch;
  font-family: var(--font-editorial);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.6;
  color: #C9D6E4;
}

.footer-scale {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 18px;
}

.footer-scale span {
  display: block;
  width: 2px;
  background: rgba(147, 164, 184, .55);
}

.footer-scale span:nth-child(1) { height: 6px; }
.footer-scale span:nth-child(2) { height: 12px; }
.footer-scale span:nth-child(3) { height: 8px; }
.footer-scale span:nth-child(4) { height: 18px; background: var(--green); }
.footer-scale span:nth-child(5) { height: 9px; }
.footer-scale span:nth-child(6) { height: 13px; }
.footer-scale span:nth-child(7) { height: 5px; }
.footer-scale span:nth-child(8) { height: 16px; background: var(--blue); }

.footer-grid {
  display: grid;
  gap: clamp(26px, 3.4vw, 46px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-block: clamp(30px, 4.4vw, 52px);
}

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

.footer-col__title {
  font-family: var(--font-num);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

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

.footer-link {
  color: var(--paper);
  font-size: 15px;
  transition: color .2s var(--ease), padding-left .2s var(--ease);
}

.footer-link:hover {
  color: var(--green);
  padding-left: 4px;
}

.footer-col--contact .footer-col__list { gap: 14px; }

.footer-contact__item {
  display: grid;
  gap: 3px;
}

.footer-contact__key {
  font-family: var(--font-num);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-contact__val {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--paper);
  word-break: break-word;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: clamp(18px, 2.6vw, 26px);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.footer-base__icp {
  font-family: var(--font-num);
  letter-spacing: .02em;
}

/* --- 10. 面包屑 --------------------------------------------------------- */
.crumbs {
  font-size: 12.5px;
  color: var(--muted);
}

.crumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.crumbs__link { color: var(--muted); }
.crumbs__link:hover { color: var(--green); }

.crumbs__sep {
  color: var(--line);
  user-select: none;
}

.crumbs__item--current { color: var(--paper); }

/* --- 11. 切角面板 ------------------------------------------------------- */
.cut-panel {
  position: relative;
  padding: clamp(18px, 2.3vw, 30px);
  border: 1px solid var(--line);
  background-color: var(--ink-panel);
  background-image: linear-gradient(158deg, rgba(53, 183, 255, .08), rgba(5, 10, 18, 0) 58%);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  box-shadow: var(--shadow-panel);
}

.cut-panel--signal { background-image: linear-gradient(158deg, rgba(56, 240, 140, .1), rgba(5, 10, 18, 0) 58%); }
.cut-panel--warn { background-image: linear-gradient(158deg, rgba(255, 138, 60, .11), rgba(5, 10, 18, 0) 58%); }

.cut-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cut-panel__title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.3;
}

.cut-panel__hint {
  font-family: var(--font-num);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- 12. 栏目大标题条 --------------------------------------------------- */
.section-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: clamp(20px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
}

.section-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 84px;
  height: 2px;
  background: var(--green);
}

.section-head__text { max-width: 64ch; }

.tick-line {
  height: 8px;
  border-top: 1px solid var(--line);
  background-image: repeating-linear-gradient(90deg, rgba(147, 164, 184, .45) 0 1px, transparent 1px 16px);
  background-size: 16px 8px;
  background-repeat: repeat-x;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: var(--font-num);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--green);
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(56, 240, 140, .9);
}

/* --- 13. 数据组件 ------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 520px;
  font-size: 15px;
}

.data-table caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.data-table th {
  padding: .72em .85em;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-family: var(--font-num);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.data-table td {
  padding: .88em .85em;
  border-bottom: 1px solid rgba(29, 43, 61, .72);
  color: var(--paper);
  vertical-align: middle;
}

.data-table tbody tr { transition: background .2s var(--ease); }
.data-table tbody tr:hover { background: rgba(53, 183, 255, .06); }
.data-table .num { font-size: 15px; }

.index-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: rgba(11, 20, 32, .64);
  color: var(--paper);
  transition: background .22s var(--ease), border-color .22s var(--ease);
}

.index-row:first-child { border-top: 1px solid var(--line); }

.index-row:hover {
  color: var(--paper);
  background: rgba(53, 183, 255, .09);
  border-color: rgba(53, 183, 255, .42);
}

.index-row__rank {
  font-family: var(--font-num);
  font-size: 15px;
  color: var(--blue);
}

.index-row__name {
  font-size: 15.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.index-row__meta {
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.stat-block {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: rgba(11, 20, 32, .72);
}

.stat-block__value {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--green);
}

.stat-block__label {
  font-family: var(--font-num);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- 14. 筛选胶囊 ------------------------------------------------------- */
.pill-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-filter__btn {
  padding: .55em 1.05em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(243, 247, 251, .03);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  transition: color .22s var(--ease), background .22s var(--ease), border-color .22s var(--ease);
}

.pill-filter__btn:hover {
  color: var(--paper);
  border-color: rgba(53, 183, 255, .55);
}

.pill-filter__btn[aria-pressed="true"] {
  background: rgba(53, 183, 255, .16);
  border-color: var(--blue);
  color: var(--paper);
}

/* --- 15. 章节目录 / 返回顶部 ------------------------------------------- */
.toc-rail {
  position: sticky;
  top: var(--offset);
}

.toc-rail__label {
  font-family: var(--font-num);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc-rail__list {
  margin-top: 14px;
  border-left: 1px solid var(--line);
}

.toc-rail__link {
  display: block;
  margin-left: -1px;
  padding: .55em .95em;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  transition: color .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease);
}

.toc-rail__link:hover { color: var(--paper); }

.toc-rail__link[aria-current="true"] {
  color: var(--green);
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(56, 240, 140, .12), transparent);
}

.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 34px);
  bottom: clamp(14px, 3vw, 34px);
  z-index: 80;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(56, 240, 140, .42);
  border-radius: 50%;
  background: rgba(11, 20, 32, .88);
  color: var(--green);
  opacity: 0;
  transform: translateY(16px) scale(.9);
  pointer-events: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: opacity .3s var(--ease), transform .3s var(--ease),
              background .22s var(--ease), color .22s var(--ease);
}

.to-top.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  background: var(--green);
  color: var(--on-orange);
}

.to-top__glyph {
  font-family: var(--font-num);
  font-size: 17px;
  line-height: 1;
}

/* --- 16. 图片容器 ------------------------------------------------------- */
.media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: var(--ink-panel);
  background-image: linear-gradient(148deg, rgba(53, 183, 255, .12), rgba(5, 10, 18, 0) 62%);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%);
}

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

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

.media-frame__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  font-family: var(--font-num);
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(147, 164, 184, .75);
}

.media-frame__placeholder::before {
  content: "";
  width: 46px;
  height: 46px;
  margin-inline: auto;
  border: 1px dashed rgba(147, 164, 184, .5);
  border-radius: 50%;
}

.media-frame__caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* --- 17. 滚动显现 ------------------------------------------------------- */
[data-reveal] {
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}

[data-reveal].is-pending {
  opacity: 0;
  transform: translate3d(-12px, 14px, 0);
}

[data-reveal].is-pending.is-revealed,
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* --- 18. 响应式 --------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--aside,
  .grid--aside-start { grid-template-columns: minmax(0, 1fr); }
  .toc-rail { position: static; }
}

@media (max-width: 960px) {
  .site-header { padding: 9px 0; }
  .site-header.is-condensed { padding: 9px 0; }

  .header-shell {
    padding: 7px 8px 7px 14px;
    gap: 8px;
    border-radius: 26px;
  }

  .site-header.is-condensed .header-shell {
    background: rgba(11, 20, 32, .88);
    border-color: rgba(29, 43, 61, .9);
  }

  .nav-toggle { display: flex; }

  .nav-capsule {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: none;
    justify-content: flex-start;
    padding: 8px;
    border: 1px solid rgba(29, 43, 61, .95);
    border-radius: 22px;
    background: rgba(5, 10, 18, .97);
    box-shadow: 0 34px 62px -32px rgba(0, 0, 0, 1);
  }

  .site-header[data-open="true"] .nav-capsule { display: block; }

  .nav-capsule__list {
    display: flex;
    gap: 8px;
    padding: 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav-capsule__list::-webkit-scrollbar { display: none; }

  .nav-capsule__link {
    border: 1px solid var(--line);
    background: rgba(243, 247, 251, .04);
    font-size: 14px;
  }

  .header-current { display: none !important; }

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

@media (min-width: 961px) {
  .site-header.is-condensed .header-current.is-live { display: inline-flex; }
  .site-header.is-condensed .nav-capsule { display: none; }
  .site-header.is-condensed:focus-within .nav-capsule { display: flex; }
  .site-header.is-condensed:focus-within .header-current.is-live { display: none; }
}

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

  .pulse-lamp { padding: 0; width: 30px; height: 30px; justify-content: center; }
  .pulse-lamp__text { display: none; }

  .btn--sm { padding: .58em .9em; font-size: 13px; }

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

  .footer-base { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .brand__suffix { display: none; }
  .brand__name { font-size: 17px; }
  .nav-toggle { width: 38px; height: 38px; }
}

/* --- 19. 无障碍与动效偏好 ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

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

  .pulse-lamp__dot { animation: none; }

  [data-reveal].is-pending,
  [data-reveal].is-pending.is-revealed {
    opacity: 1;
    transform: none;
  }
}
