/* ==========================================================================
   乐博指南 · 共享样式表 /assets/site.css
   深墨蓝基底 · 电光青直达 · 暖橙旧版提示
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --ink: #0B1B2B;
  --night: #071320;
  --panel: #152C41;
  --line: #2A4358;
  --cyan: #35E0D6;
  --cyan-soft: #9BF3ED;
  --orange: #FF8A3D;
  --orange-deep: #C75A16;
  --paper: #F2F6FA;
  --slate: #8CA3B8;

  --head-h: 84px;
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-flat: 0 1px 0 rgba(0, 0, 0, 0.35);

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Barlow Semi Condensed", Impact,
    "Arial Narrow", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular",
    "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- 2. 重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 20px);
}

body {
  margin: 0;
  padding-top: calc(var(--head-h) + 2px);
  min-height: 100vh;
  background-color: var(--ink);
  background-image:
    radial-gradient(1200px 620px at 10% -8%, rgba(53, 224, 214, 0.07), transparent 62%),
    radial-gradient(960px 520px at 94% 2%, rgba(255, 138, 61, 0.055), transparent 60%);
  background-repeat: no-repeat;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.005em;
  font-stretch: semi-condensed;
}
h1 { font-size: clamp(30px, 5.6vw, 58px); line-height: 1.12; }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: clamp(18px, 2.2vw, 24px); }
h4 { font-size: 18px; }

p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }

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

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

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

button { font: inherit; color: inherit; }

::selection {
  background: rgba(53, 224, 214, 0.28);
  color: var(--paper);
}

/* ---------- 3. 焦点 ---------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- 4. 布局工具 ---------- */
.wrap {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
}

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

.section__head {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}
.section__title { margin: 0; }
.section__lead {
  color: var(--slate);
  max-width: 46ch;
  font-size: 16px;
}

.page-head {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}
.page-head__sub {
  margin-top: 14px;
  color: var(--slate);
  max-width: 44ch;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}
.kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--cyan);
}

.tick-rule {
  height: 8px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    90deg,
    var(--line) 0 1px,
    transparent 1px 12px
  );
}

.mono { font-family: var(--font-mono); font-size: 0.88em; letter-spacing: 0.02em; }
.muted { color: var(--slate); }

/* ---------- 5. 面包屑 ---------- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--slate);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
}
.breadcrumb li::after {
  content: "/";
  margin: 0 10px;
  color: var(--line);
}
.breadcrumb li:last-child::after { display: none; }
.breadcrumb a {
  color: var(--slate);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb [aria-current="page"] { color: var(--paper); }

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease,
    color 0.16s ease;
}
.btn--primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #05161c;
}
.btn--primary:hover {
  background: var(--cyan-soft);
  border-color: var(--cyan-soft);
  color: #05161c;
}
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--paper);
}
.btn--ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.btn--legacy {
  background: transparent;
  border-color: var(--orange-deep);
  color: var(--orange);
}
.btn--legacy:hover {
  border-color: var(--orange);
  background: rgba(255, 138, 61, 0.1);
  color: var(--orange);
}

/* ---------- 7. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(21, 44, 65, 0.62);
  color: var(--slate);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.5;
  white-space: nowrap;
}
.tag--live {
  border-color: rgba(53, 224, 214, 0.45);
  background: rgba(53, 224, 214, 0.1);
  color: var(--cyan);
}
.tag--legacy {
  border-color: var(--orange-deep);
  background: rgba(199, 90, 22, 0.14);
  color: var(--orange);
}

/* ---------- 8. 面板 ---------- */
.panel {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: var(--shadow-soft);
}

/* ---------- 9. 图片容器（供页面阶段放置占位） ---------- */
.frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.frame > img,
.frame > svg,
.frame > picture,
.frame > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame--21x9 { aspect-ratio: 21 / 9; }
.frame--16x9 { aspect-ratio: 16 / 9; }
.frame--4x3  { aspect-ratio: 4 / 3; }
.frame--1x1  { aspect-ratio: 1 / 1; }
.frame--plain { aspect-ratio: auto; }
.frame--plain > img,
.frame--plain > picture > img {
  height: auto;
  object-fit: contain;
}
.frame__badge {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 5px 11px;
  background: var(--orange);
  color: #220f03;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.5;
}

/* ---------- 10. 章节索引 ---------- */
.sec-index {
  position: sticky;
  top: calc(var(--head-h) + 28px);
}
.sec-index__link {
  display: block;
  padding: 7px 10px;
  border-left: 1px solid var(--line);
  color: var(--slate);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.16s ease, border-color 0.16s ease,
    background-color 0.16s ease;
}
.sec-index__link:hover {
  color: var(--paper);
  border-left-color: var(--slate);
}
.sec-index__link[data-active],
.sec-index__link[aria-current] {
  color: var(--cyan);
  border-left-color: var(--cyan);
  background: rgba(53, 224, 214, 0.07);
}

/* ---------- 11. 头部 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(7, 19, 32, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.site-header[data-scrolled] {
  background: rgba(7, 19, 32, 0.97);
  border-bottom-color: rgba(53, 224, 214, 0.26);
}

.read-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(42, 67, 88, 0.55);
  overflow: hidden;
}
.read-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-soft));
  box-shadow: 0 0 10px rgba(53, 224, 214, 0.5);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 90;
  padding: 10px 16px;
  background: var(--cyan);
  color: var(--night);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 2px;
  transform: translateY(-180%);
  transition: transform 0.16s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--night);
}

.masthead__inner {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
  min-height: var(--head-h);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 28px;
}

.masthead__brand {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  justify-self: start;
  text-decoration: none;
  color: var(--paper);
}
.masthead__logo {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  font-stretch: semi-condensed;
  transition: color 0.16s ease;
}
.masthead__brand:hover .masthead__logo { color: var(--cyan); }
.masthead__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.26em;
  color: var(--cyan);
}

.masthead__nav { justify-self: center; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-list__link {
  position: relative;
  display: block;
  padding: 9px 12px;
  border-radius: 2px;
  color: var(--slate);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.16s ease, background-color 0.16s ease;
}
.nav-list__link:hover {
  color: var(--paper);
  background: rgba(53, 224, 214, 0.08);
}
.nav-list__link[aria-current="page"] { color: var(--cyan); }
.nav-list__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: var(--cyan);
}

.masthead__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}
.masthead__cta { white-space: nowrap; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease;
}
.nav-toggle:hover { border-color: var(--cyan); color: var(--cyan); }
.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.18s ease;
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { bottom: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  transform: translateY(4.25px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  transform: translateY(-4.25px) rotate(-45deg);
}

/* ---------- 12. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: 96px;
  background: var(--night);
  border-top: 1px solid var(--line);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--line) 0 1px,
    transparent 1px 24px
  );
  opacity: 0.75;
  pointer-events: none;
}
.site-footer__inner {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
  padding: 64px 0 28px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.5fr 1.1fr;
  gap: 40px 32px;
}

.foot-col { min-width: 0; }
.foot-col__title {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  line-height: 1.4;
}

.foot-sign {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.1;
  color: var(--paper);
}
.foot-sub {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--slate);
}
.foot-mono {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--cyan-soft);
  word-break: break-all;
}
.foot-mono--icp {
  color: var(--slate);
  margin-top: 16px;
}
.foot-note {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--slate);
  max-width: 34ch;
}

.foot-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.foot-links a {
  color: var(--slate);
  font-size: 15px;
  text-decoration: none;
  transition: color 0.16s ease;
}
.foot-links a:hover { color: var(--cyan); }

.foot-list {
  display: grid;
  gap: 14px;
}
.foot-list li { min-width: 0; }
.foot-list__key {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--slate);
}
.foot-list__val {
  display: block;
  font-size: 15px;
  line-height: 1.6;
  color: var(--paper);
  word-break: break-word;
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--slate);
}
.foot-base p { margin: 0; }
.foot-base__meta { color: var(--slate); }

/* ---------- 13. 返回顶部 ---------- */
.back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--night);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease,
    border-color 0.16s ease;
}
.back-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.back-top:hover { border-color: var(--cyan); }

/* ---------- 14. 滚动显现 ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.24s ease-out, transform 0.24s ease-out;
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 15. 响应式 ---------- */
@media (max-width: 1080px) {
  .masthead__inner { gap: 14px 18px; }
  .nav-list__link { padding: 9px 9px; font-size: 14px; }
  .foot-grid { grid-template-columns: 1.2fr 1fr 1.4fr 1fr; gap: 36px 24px; }
}

@media (max-width: 980px) {
  :root { --head-h: 68px; }

  body { font-size: 16px; }

  .masthead__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .masthead__logo { font-size: 21px; }
  .masthead__tag { font-size: 9px; letter-spacing: 0.22em; }

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

  .masthead__nav {
    position: fixed;
    top: calc(var(--head-h) + 2px);
    left: 0;
    right: 0;
    justify-self: stretch;
    padding: 8px 20px 22px;
    background: var(--night);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
    max-height: calc(100vh - var(--head-h) - 2px);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  }
  .masthead__nav[data-open] {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-list__link {
    padding: 14px 6px;
    font-size: 16px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .nav-list__link[aria-current="page"] {
    background: rgba(53, 224, 214, 0.07);
    padding-left: 12px;
  }
  .nav-list__link[aria-current="page"]::after { display: none; }

  .section { padding: 44px 0; }
  .site-footer { margin-top: 68px; }
  .site-footer__inner { padding: 52px 0 24px; }
  .foot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px 28px;
  }
  .foot-base { margin-top: 40px; }

  .sec-index { position: static; }
}

@media (max-width: 620px) {
  .wrap,
  .masthead__inner,
  .site-footer__inner { width: min(1200px, 100% - 32px); }

  h1 { font-size: clamp(28px, 8vw, 34px); }

  .masthead__cta { padding: 9px 12px; font-size: 13px; }
  .nav-toggle { padding: 9px 11px; letter-spacing: 0.1em; }
  .nav-toggle__text { display: none; }

  .page-head { padding: 40px 0 30px; }
  .section { padding: 36px 0; }

  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .foot-note { max-width: none; }
  .foot-base { flex-direction: column; align-items: flex-start; }

  .panel { padding: 18px; }
  .back-top { right: 14px; bottom: 14px; width: 40px; height: 40px; }
}

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

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