/* ============================================================
   liquid · 澄澈液态玻璃主题
   材质：多层内阴影 + 细高光 + 受控背景模糊，不使用蓝紫渐变
   性能：大面积装饰不做 blur 动画，导航滚动不做逐项布局读取
   ============================================================ */

:root {
  --bg: #faf8f7;
  --grid: rgba(60, 24, 34, .015);
  --ink: #24191c;
  --ink-2: #65555a;
  --ink-3: #9a878c;
  --line: rgba(60, 24, 34, .12);
  --line-strong: rgba(60, 24, 34, .22);
  --brand-orange: #ff7a1a;
  --brand-pink: #ff2d55;
  --brand-crimson: #e0115f;
  --accent: #ff2d55;
  --accent-2: #ff7a1a;
  --jade: #e0115f;
  --rose: #e0115f;
  --accent-soft: rgba(255, 45, 85, .1);
  --jade-soft: rgba(255, 122, 26, .1);
  --amber-soft: rgba(224, 17, 95, .07);
  --glass-bg: rgba(255, 255, 255, .52);
  --glass-bg-strong: rgba(255, 255, 255, .8);
  --glass-line: rgba(255, 255, 255, .88);
  --glass-hi: rgba(255, 255, 255, .94);
  --glass-inner: rgba(60, 24, 34, .08);
  --shadow: 0 20px 46px -28px rgba(70, 18, 34, .3);
  --shadow-sm: 0 10px 24px -18px rgba(70, 18, 34, .26);
  --shadow-lift: 0 20px 38px -24px rgba(70, 18, 34, .34);
  --head-h: 68px;
  --sub-w: 268px;
  --aside-w: 210px;
  --radius: 18px;
  --radius-lg: 26px;
  --font: "Inter", "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif CJK SC", serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #120d10;
  --grid: rgba(255, 225, 235, .015);
  --ink: #fff3f5;
  --ink-2: #d5bbc2;
  --ink-3: #a38b93;
  --line: rgba(255, 225, 235, .12);
  --line-strong: rgba(255, 225, 235, .22);
  --brand-orange: #ff8f3a;
  --brand-pink: #ff4d73;
  --brand-crimson: #ff3d86;
  --accent: #ff4d73;
  --accent-2: #ff8f3a;
  --jade: #ff3d86;
  --rose: #ff4d86;
  --accent-soft: rgba(255, 77, 115, .14);
  --jade-soft: rgba(255, 143, 58, .12);
  --amber-soft: rgba(255, 61, 134, .1);
  --glass-bg: rgba(36, 24, 30, .58);
  --glass-bg-strong: rgba(36, 24, 30, .86);
  --glass-line: rgba(255, 225, 235, .15);
  --glass-hi: rgba(255, 225, 235, .19);
  --glass-inner: rgba(255, 225, 235, .09);
  --shadow: 0 20px 46px -28px rgba(0, 0, 0, .84);
  --shadow-sm: 0 10px 24px -18px rgba(0, 0, 0, .82);
  --shadow-lift: 0 20px 38px -24px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head-h) + 18px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.drawer-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
}

::selection {
  background: rgba(255, 45, 85, .18);
}

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

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  transition: top .2s ease;
}

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

/* ---------------- 背景：正文纯色，首页极弱静态网格 ---------------- */

.canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg);
  background-image:
    linear-gradient(0deg, transparent 24%, var(--grid) 25%, var(--grid) 26%, transparent 27%, transparent 74%, var(--grid) 75%, var(--grid) 76%, transparent 77%, transparent),
    linear-gradient(90deg, transparent 24%, var(--grid) 25%, var(--grid) 26%, transparent 27%, transparent 74%, var(--grid) 75%, var(--grid) 76%, transparent 77%, transparent);
  background-size: 64px 64px;
}

/* ---------------- 液态玻璃材质 ---------------- */

.glass-panel,
.bar,
.submenu,
.pagetoc,
.search-panel,
.hero-panel,
.route-aside,
.surface,
.volume,
.route,
.guide-step,
.util,
.pager-card,
.article blockquote {
  position: relative;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background: var(--glass-bg);
  box-shadow:
    inset 2px 2px 0 var(--glass-hi),
    inset -2px -2px 0 rgba(255, 255, 255, .18),
    inset 0 0 0 1px var(--glass-inner),
    var(--shadow-sm);
  overflow: hidden;
  contain: paint;
}

html[data-theme="dark"] .glass-panel,
html[data-theme="dark"] .bar,
html[data-theme="dark"] .submenu,
html[data-theme="dark"] .pagetoc,
html[data-theme="dark"] .search-panel,
html[data-theme="dark"] .hero-panel,
html[data-theme="dark"] .route-aside,
html[data-theme="dark"] .surface,
html[data-theme="dark"] .volume,
html[data-theme="dark"] .route,
html[data-theme="dark"] .guide-step,
html[data-theme="dark"] .util,
html[data-theme="dark"] .pager-card,
html[data-theme="dark"] .article blockquote {
  box-shadow:
    inset 2px 2px 0 var(--glass-hi),
    inset -2px -2px 0 rgba(0, 0, 0, .18),
    inset 0 0 0 1px var(--glass-inner),
    var(--shadow-sm);
}

.bar,
.search-panel,
.hero-panel {
  -webkit-backdrop-filter: blur(10px) saturate(135%);
  backdrop-filter: blur(10px) saturate(135%);
}

.glass-panel::before,
.bar::before,
.submenu::before,
.pagetoc::before,
.search-panel::before,
.hero-panel::before,
.route-aside::before,
.surface::before,
.volume::before,
.route::before,
.guide-step::before,
.util::before,
.pager-card::before,
.article blockquote::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 0;
  border: 1px solid var(--glass-inner);
  border-radius: max(10px, calc(var(--radius) - 6px));
  pointer-events: none;
}

.glass-panel::after,
.bar::after,
.submenu::after,
.pagetoc::after,
.search-panel::after,
.hero-panel::after,
.route-aside::after,
.surface::after,
.volume::after,
.route::after,
.guide-step::after,
.util::after,
.pager-card::after,
.article blockquote::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(112deg, rgba(255, 255, 255, .5), transparent 26%, transparent 74%, rgba(255, 255, 255, .24));
  background-size: 220% 100%;
  background-position: 0 0;
  opacity: .72;
  pointer-events: none;
  transition: background-position .5s ease, opacity .3s ease;
}

html[data-theme="dark"] .glass-panel::after,
html[data-theme="dark"] .bar::after,
html[data-theme="dark"] .submenu::after,
html[data-theme="dark"] .pagetoc::after,
html[data-theme="dark"] .search-panel::after,
html[data-theme="dark"] .hero-panel::after,
html[data-theme="dark"] .route-aside::after,
html[data-theme="dark"] .surface::after,
html[data-theme="dark"] .volume::after,
html[data-theme="dark"] .route::after,
html[data-theme="dark"] .guide-step::after,
html[data-theme="dark"] .util::after,
html[data-theme="dark"] .pager-card::after,
html[data-theme="dark"] .article blockquote::after {
  background: linear-gradient(112deg, rgba(198, 232, 222, .13), transparent 26%, transparent 74%, rgba(198, 232, 222, .06));
}

.glass-panel:hover::after,
.bar:hover::after,
.submenu:hover::after,
.pagetoc:hover::after,
.search-panel:hover::after,
.hero-panel:hover::after,
.route-aside:hover::after,
.surface:hover::after,
.volume:hover::after,
.route:hover::after,
.guide-step:hover::after,
.util:hover::after,
.pager-card:hover::after,
.article blockquote:hover::after {
  background-position: 100% 0;
  opacity: .95;
}

.glass-panel > *,
.bar > *,
.submenu > *,
.pagetoc > *,
.search-panel > *,
.hero-panel > *,
.route-aside > *,
.surface > *,
.volume > *,
.route > *,
.guide-step > *,
.util > *,
.pager-card > *,
.article blockquote > * {
  position: relative;
  z-index: 1;
}

/* ---------------- 顶栏 ---------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 10px clamp(12px, 2vw, 30px);
  transition: padding .2s ease;
}

.masthead.is-stuck {
  padding-top: 6px;
  padding-bottom: 6px;
}

.bar {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 26px);
  width: 100%;
  max-width: 1760px;
  min-height: 54px;
  margin: 0 auto;
  padding: 5px 8px 5px 12px;
  border-radius: 999px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 3px 6px;
  border-radius: 999px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 45, 85, .26);
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(255, 122, 26, .18), rgba(255, 45, 85, .12), rgba(224, 17, 95, .16));
  box-shadow: inset 1px 1px 0 var(--glass-hi), 0 4px 10px -6px rgba(70, 18, 34, .5);
}

.brand-logo {
  width: 25px;
  height: 25px;
}

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

.brand-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.brand-sub {
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: .06em;
  white-space: nowrap;
}

.navwrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.topnav {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}

.topnav-track {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding: 2px 0;
}

.topnav-track::-webkit-scrollbar {
  display: none;
}

.navchip {
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
  scroll-snap-align: center;
  transition:
    transform .16s cubic-bezier(.2, .9, .3, 1.35),
    background .16s ease,
    color .16s ease,
    box-shadow .16s ease;
}

.navchip:hover {
  transform: translateY(-2px) scale(1.03);
  background: linear-gradient(110deg, rgba(255, 122, 26, .18), rgba(255, 45, 85, .16));
  color: var(--brand-pink);
  box-shadow: 0 8px 16px -12px rgba(255, 45, 85, .85);
}

.navchip:active {
  transform: translateY(0) scale(.98);
}

.navchip.is-active {
  background: linear-gradient(110deg, var(--brand-orange), var(--brand-pink) 54%, var(--brand-crimson));
  color: #fff;
  box-shadow: 0 8px 18px -12px rgba(255, 45, 85, .9);
}

.navchip.is-active:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.nav-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft, var(--glass-bg));
  color: var(--ink-3);
  cursor: pointer;
}

.nav-arrow svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-arrow.is-muted {
  opacity: .35;
}

.nav-fade {
  display: none;
}

.tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  width: clamp(170px, 15vw, 240px);
  height: 34px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-bg);
  box-shadow: inset 1px 1px 0 var(--glass-hi), inset -1px -1px 0 rgba(255, 255, 255, .15);
}

.search-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.search-input::placeholder {
  color: var(--ink-3);
}

.search-kbd {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-3);
  font: 10px var(--mono);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  background: var(--glass-bg);
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: inset 1px 1px 0 var(--glass-hi);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-btn:active {
  transform: scale(.94);
}

.search-btn,
.menu-btn {
  display: none;
}

html[data-width="full"] .width-icon-full,
html[data-theme="light"] .theme-sun {
  display: none;
}

html[data-width="boxed"] .width-icon-boxed,
html[data-theme="dark"] .theme-moon {
  display: none;
}

/* ---------------- 搜索面板 ---------------- */

.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: clamp(12px, 2vw, 30px);
  width: min(560px, calc(100vw - 24px));
  max-height: min(70vh, 620px);
  padding: 16px;
  border-radius: 22px;
  overflow-y: auto;
}

.panel-search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass-bg-strong);
}

.panel-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.panel-search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.search-hint {
  margin: 12px 2px 8px;
  color: var(--ink-3);
  font-size: 11px;
}

.search-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-hit {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background .16s ease;
}

.search-hit:hover {
  background: var(--accent-soft);
}

.search-hit-title {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.search-hit-path {
  display: block;
  margin-top: 2px;
  color: var(--ink-3);
  font: 10px var(--mono);
  word-break: break-all;
}

.search-hit-text {
  display: block;
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
}

.search-hit mark {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--amber-soft);
  color: var(--accent);
}

.search-skeleton {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
}

.search-skeleton span {
  display: block;
  height: 9px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--line), var(--glass-hi), var(--line));
  background-size: 220% 100%;
  animation: skeleton 1.5s linear infinite;
}

.search-skeleton .sk-title { width: 44%; height: 12px; }
.search-skeleton .sk-path { width: 72%; }
.search-skeleton .sk-line { width: 100%; }
.search-skeleton .sk-line.is-short { width: 68%; }

@keyframes skeleton {
  to { background-position: -220% 0; }
}

.search-progress {
  margin: 12px 2px;
}

.search-progress-track {
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.search-progress-fill {
  display: block;
  height: 100%;
  width: 18%;
  border-radius: inherit;
  background: var(--accent);
}

.search-progress.is-indeterminate .search-progress-fill {
  animation: indeterminate 1.2s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(560%); }
}

.search-progress-text {
  margin: 7px 0 0;
  color: var(--ink-3);
  font-size: 11px;
}

.search-retry {
  margin: 10px 2px 2px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass-bg);
  color: var(--accent);
  cursor: pointer;
}

/* ---------------- 三栏阅读骨架 ---------------- */

.shell {
  display: grid;
  grid-template-columns: var(--sub-w) minmax(0, 1fr);
  gap: clamp(16px, 1.8vw, 26px);
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 0 clamp(12px, 2vw, 30px);
}

body:not(.has-sub) .shell,
body.is-landing .shell {
  grid-template-columns: minmax(0, 1fr);
}

.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  min-width: 0;
}

body.has-aside .main {
  grid-template-columns: minmax(0, 1fr) var(--aside-w);
  gap: clamp(16px, 1.8vw, 26px);
}

.main-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px clamp(2px, 1.2vw, 18px) 78px;
  transition: max-width .24s ease;
}

html[data-width="boxed"] .main-inner {
  max-width: 820px;
}

/* ---------------- 左侧本册目录 ---------------- */

.submenu {
  position: sticky;
  top: calc(var(--head-h) + 14px);
  align-self: start;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--head-h) - 28px);
  margin: 0;
  padding: 18px 13px 12px;
  border-radius: 24px;
}

.submenu-top {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 2px 8px 12px;
}

.submenu-kicker {
  margin: 0;
  color: var(--ink-3);
  font: 10px var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.submenu-book {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.submenu-book:hover {
  color: var(--accent);
}

.submenu-close {
  display: none;
}

.submenu-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  margin: 0 6px 10px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-bg-strong);
}

.submenu-filter:focus-within {
  border-color: var(--accent);
}

.submenu-filter svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.submenu-filter input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.submenu-filter input::placeholder {
  color: var(--ink-3);
}

.submenu-nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.sub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sub-node {
  margin: 1px 0;
}

.sub-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.45;
  transition:
    transform .15s cubic-bezier(.2, .9, .3, 1.3),
    background .15s ease,
    color .15s ease;
}

.sub-row:hover {
  transform: translateX(3px);
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  color: var(--brand-pink);
}

.sub-link,
.sub-leaf {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-link.is-active,
.sub-leaf.is-active {
  color: var(--accent);
  font-weight: 650;
}

.sub-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--ink-3);
}

.sub-toggle svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

.sub-group[open] > .sub-row .sub-toggle svg {
  transform: rotate(90deg);
}

.sub-children {
  margin: 2px 0 2px 9px;
  padding-left: 9px;
  border-left: 1px solid var(--line-strong);
  overflow: hidden;
  transition: height .28s ease, opacity .2s ease;
}

.sub-group[open] > .sub-children {
  border-left-color: rgba(255, 45, 85, .3);
}

html[data-theme="dark"] .sub-group[open] > .sub-children {
  border-left-color: rgba(255, 77, 115, .34);
}

.sub-node[data-depth="2"] > .sub-row {
  font-size: 12px;
}

.sub-node[data-depth="3"] > .sub-row {
  font-size: 11.5px;
}

.sub-node[data-depth="2"] > .sub-row::before,
.sub-node[data-depth="3"] > .sub-row::before {
  content: "";
  flex: 0 0 auto;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

.sub-node[data-depth="3"] > .sub-row::before {
  background: var(--brand-orange);
}

.submenu-empty {
  margin: 12px 8px;
  color: var(--ink-3);
  font-size: 12px;
}

.submenu-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 8px 2px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 10.5px;
}

.submenu-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px var(--jade-soft);
}

.drawer-mask {
  display: none;
}

/* ---------------- 正文 ---------------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 18px;
  color: var(--ink-3);
  font-size: 12px;
}

.crumbs a {
  color: var(--ink-2);
}

.crumbs a:hover {
  color: var(--accent);
}

.crumb-current {
  color: var(--accent);
  font-weight: 600;
}

.mobile-outline {
  display: none;
}

.article {
  width: 100%;
  overflow-wrap: break-word;
}

.article h1,
.article h2,
.article h3,
.article h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.36;
  letter-spacing: -.015em;
  overflow-wrap: break-word;
}

.article h1 {
  margin: 0 0 24px;
  font-size: clamp(27px, 2.8vw, 36px);
  letter-spacing: -.03em;
}

.article h2 {
  margin: 44px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 22px;
}

.article h3 {
  margin: 30px 0 12px;
  font-size: 18px;
}

.article h4 {
  margin: 24px 0 10px;
  font-size: 16px;
}

.article p {
  margin: 12px 0;
  color: var(--ink-2);
  line-height: 1.9;
}

.article a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color .16s ease, text-decoration-color .16s ease;
}

.article a:hover {
  color: var(--rose);
  text-decoration-color: currentColor;
}

.article ul,
.article ol {
  margin: 10px 0 16px;
  padding-left: 1.35em;
}

.article li {
  margin: 5px 0;
  color: var(--ink-2);
  line-height: 1.85;
}

.article li::marker {
  color: var(--accent-2);
}

.article strong {
  color: var(--ink);
  font-weight: 650;
}

.article hr {
  height: 1px;
  margin: 36px 0;
  border: 0;
  background: var(--line);
}

.article blockquote {
  margin: 18px 0;
  padding: 13px 18px;
  border-radius: var(--radius);
  color: var(--ink-2);
}

.article blockquote p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.8;
}

.article blockquote a {
  color: var(--jade);
}

.article code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: .88em;
}

.article pre,
.article .code-block pre {
  margin: 0;
}

.article img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* ---------------- 代码块：中性石墨底，语法色只用朱砂暖色梯度 ---------------- */

.code-block {
  margin: 20px 0;
  border: 1px solid rgba(120, 126, 122, .2);
  border-radius: var(--radius);
  background: #171818;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

html[data-theme="dark"] .code-block {
  border-color: rgba(230, 235, 232, .12);
  background: #0e0f0e;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 38px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .03);
}

.code-lang {
  color: #a5aaa6;
  font: 600 10.5px/1 var(--font);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(230, 235, 232, .16);
  border-radius: 8px;
  background: transparent;
  color: #c8cbc8;
  font-size: 11px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.code-copy svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.code-copy:hover {
  border-color: rgba(255, 45, 85, .55);
  background: rgba(255, 45, 85, .16);
  color: #ffc2d1;
}

.code-copy.is-copied {
  border-color: rgba(255, 122, 26, .6);
  background: rgba(255, 122, 26, .18);
  color: #ffd5b0;
}

.code-block pre {
  padding: 16px 18px;
  overflow-x: auto;
}

.code-block pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e8e7e3;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.72;
  tab-size: 2;
}

.code-block .hljs { background: transparent; color: #fff1f4; }
.code-block .hljs-comment,
.code-block .hljs-quote { color: #9b878d; font-style: italic; }
.code-block .hljs-keyword,
.code-block .hljs-selector-tag,
.code-block .hljs-literal,
.code-block .hljs-link { color: #ff6b8a; }
.code-block .hljs-string,
.code-block .hljs-attr,
.code-block .hljs-attribute,
.code-block .hljs-name,
.code-block .hljs-symbol,
.code-block .hljs-bullet,
.code-block .hljs-addition { color: #ffb27a; }
.code-block .hljs-number,
.code-block .hljs-type,
.code-block .hljs-built_in,
.code-block .hljs-builtin-name,
.code-block .hljs-selector-id,
.code-block .hljs-selector-class { color: #ff8f3a; }
.code-block .hljs-title,
.code-block .hljs-function,
.code-block .hljs-section { color: #ff4d73; }
.code-block .hljs-variable,
.code-block .hljs-template-variable,
.code-block .hljs-params,
.code-block .hljs-subst { color: #ffe1e7; }
.code-block .hljs-regexp,
.code-block .hljs-deletion,
.code-block .hljs-selector-attr,
.code-block .hljs-selector-pseudo { color: #ff3d86; }
.code-block .hljs-meta,
.code-block .hljs-doctag { color: #c9aeb6; }

/* ---------------- 表格 ---------------- */

.article table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.65;
}

.article th,
.article td {
  padding: 9px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article th {
  background: var(--glass-bg);
  color: var(--ink);
  font-weight: 650;
}

.article td {
  color: var(--ink-2);
}

.article tr:nth-child(even) td {
  background: rgba(23, 56, 49, .025);
}

html[data-theme="dark"] .article tr:nth-child(even) td {
  background: rgba(198, 232, 222, .03);
}

.table-scroll {
  width: 100%;
  margin: 18px 0;
  border-radius: 12px;
  overflow-x: auto;
}

.table-scroll table {
  margin: 0;
  min-width: 100%;
}

.table-tip {
  margin: -10px 0 16px;
  color: var(--ink-3);
  font-size: 11.5px;
}

/* ---------------- 右侧本页导航 ---------------- */

.pagetoc {
  position: sticky;
  top: calc(var(--head-h) + 16px);
  align-self: start;
  max-height: calc(100vh - var(--head-h) - 32px);
  margin: 22px 0 40px;
  padding: 16px 12px;
  border-radius: 20px;
  overflow-y: auto;
  scrollbar-width: none;
}

.pagetoc::-webkit-scrollbar {
  display: none;
}

.pagetoc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px 4px;
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: .14em;
}

.pagetoc-rule {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pagetoc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagetoc-item a {
  display: block;
  padding: 5px 9px;
  border-radius: 9px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.5;
  transition: background .16s ease, color .16s ease;
}

.pagetoc-item.lvl-3 a {
  padding-left: 18px;
  font-size: 11.5px;
}

.pagetoc-item a:hover {
  background: var(--glass-bg);
  color: var(--ink);
}

.pagetoc-item a.is-current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ---------------- 翻页 ---------------- */

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 52px;
}

.pager-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 18px;
  color: inherit;
  transition: transform .18s ease, background-position .4s ease;
}

.pager-card:hover {
  transform: translateY(-2px);
}

.pager-card.is-next {
  text-align: right;
}

.pager-dir {
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: .1em;
}

.pager-card strong {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------------- 首页：错落功能模块 ---------------- */

.home {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 14px clamp(12px, 2.4vw, 36px) 90px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  align-items: center;
  gap: clamp(26px, 4vw, 64px);
  min-height: 460px;
  padding: 18px 0 34px;
}

.hero-copy {
  min-width: 0;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: .12em;
}

.hero-year {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 9.5px;
}

.hero-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(44px, 5.4vw, 74px);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -.045em;
}

.hero-line {
  margin: 18px 0 0;
  color: var(--ink-2);
  font-size: clamp(17px, 1.8vw, 23px);
  line-height: 1.5;
}

.hero-line span {
  color: var(--accent);
  font-weight: 650;
}

.hero-lead {
  max-width: 640px;
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.9;
}

.home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 560px);
  height: 50px;
  margin-top: 24px;
  padding: 5px 5px 5px 17px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-bg-strong);
  box-shadow: inset 2px 2px 0 var(--glass-hi), inset -2px -2px 0 rgba(255, 255, 255, .2), var(--shadow-sm);
}

.home-search:focus-within {
  border-color: var(--accent);
}

.home-search-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.home-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.home-search-input::placeholder {
  color: var(--ink-3);
}

.home-search-btn {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(110deg, var(--brand-orange), var(--brand-pink) 58%, var(--brand-crimson));
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 20px -14px rgba(255, 45, 85, .9);
  transition: filter .18s ease, transform .18s ease;
}

.home-search-btn:hover {
  filter: brightness(1.08);
  transform: translateX(2px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn-primary {
  background: linear-gradient(110deg, var(--brand-orange), var(--brand-pink) 58%, var(--brand-crimson));
  color: #fff;
  box-shadow: 0 14px 26px -16px rgba(255, 45, 85, .9);
}

.btn-primary:hover {
  filter: brightness(1.07);
  color: #fff;
  transform: translateY(-1px);
}

.btn-quiet {
  background: var(--glass-bg);
  color: var(--ink-2);
}

.btn-quiet:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.hero-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 400px;
  isolation: isolate;
}

.orb {
  position: absolute;
  z-index: 0;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  opacity: .65;
}

.orb-one {
  top: 4%;
  right: 2%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .9), rgba(255, 122, 26, .18) 44%, transparent 70%);
}

.orb-two {
  bottom: 4%;
  left: 2%;
  width: 210px;
  height: 210px;
  background: radial-gradient(circle at 36% 32%, rgba(255, 255, 255, .8), rgba(255, 45, 85, .16) 44%, transparent 70%);
}

.hero-panel {
  --radius: 30px;
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 22px 24px 20px;
  transform: rotate(-1deg);
  transition: transform .28s ease;
}

.hero-stage:hover .hero-panel {
  transform: rotate(0deg) translateY(-3px);
}

.hero-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-3);
  font: 10px var(--mono);
  letter-spacing: .1em;
}

.panel-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--jade);
  letter-spacing: 0;
}

.panel-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px var(--jade-soft);
}

.hero-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 170px;
  height: 170px;
  margin: 22px auto 12px;
}

.orbit-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--glass-line);
  border-radius: 50%;
}

.ring-two {
  inset: 24px;
  border-color: rgba(255, 45, 85, .3);
  border-style: dashed;
}

.orbit-core {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  background: var(--glass-bg-strong);
  box-shadow: inset 3px 3px 0 var(--glass-hi), inset -3px -3px 0 rgba(255, 255, 255, .16), 0 10px 24px -14px rgba(20, 24, 23, .5);
  color: var(--accent);
  font-size: 36px;
  font-weight: 750;
  letter-spacing: -.04em;
}

.hero-panel-label {
  margin: 0 0 12px;
  color: var(--ink-2);
  font-size: 11px;
  text-align: center;
  letter-spacing: .04em;
  min-height: 1.5em;
  transition: color .16s ease;
}

.hero-panel-label.is-active {
  color: var(--brand-pink);
  font-weight: 650;
}

.hero-panel-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.panel-cell {
  position: relative;
  display: block;
  padding: 7px 0;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--ink-2);
  font: 10px var(--mono);
  text-align: center;
  transition:
    transform .16s cubic-bezier(.2, .9, .3, 1.35),
    background .16s ease,
    color .16s ease,
    box-shadow .16s ease;
}

.panel-cell:nth-child(3n) {
  background: var(--jade-soft);
}

.panel-cell:hover,
.panel-cell:focus-visible {
  z-index: 2;
  transform: translateY(-3px) scale(1.08);
  background: linear-gradient(120deg, var(--brand-orange), var(--brand-pink));
  color: #fff;
  box-shadow: 0 8px 16px -10px rgba(255, 45, 85, .9);
}

.hero-panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.panel-curve {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 58px;
  opacity: .45;
  pointer-events: none;
}

.panel-curve path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* 首页功能拼图 */

.home-board {
  margin-top: 18px;
}

.board-caption {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 14px 4px;
}

.board-caption span {
  color: var(--accent);
  font: 600 10.5px var(--mono);
  letter-spacing: .16em;
}

.board-caption p {
  margin: 0;
  color: var(--ink-3);
  font-size: 11.5px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(128px, auto);
  gap: 12px;
}

.tile {
  --radius: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background: var(--glass-bg);
  color: inherit;
  text-align: left;
  overflow: hidden;
  contain: paint;
  box-shadow: inset 2px 2px 0 var(--glass-hi), inset -2px -2px 0 rgba(255, 255, 255, .16), inset 0 0 0 1px var(--glass-inner), var(--shadow-sm);
  transition:
    transform .2s cubic-bezier(.2, .9, .3, 1.3),
    box-shadow .2s ease;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(112deg, rgba(255, 255, 255, .42), transparent 28%, transparent 72%, rgba(255, 255, 255, .18));
  pointer-events: none;
}

.tile > * {
  position: relative;
  z-index: 1;
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: inset 2px 2px 0 var(--glass-hi), inset -2px -2px 0 rgba(255, 255, 255, .2), inset 0 0 0 1px var(--glass-inner), var(--shadow-lift);
}

.tile-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.tile-index {
  color: var(--ink-3);
  font: 600 10px var(--mono);
  letter-spacing: .1em;
}

.tile-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.tile-head em {
  color: var(--ink-3);
  font-size: 10px;
  font-style: normal;
}

.tile-head a {
  margin-left: auto;
  color: var(--accent);
  font-size: 11px;
}

.tile-link {
  margin-top: auto;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
}

.tile-stats {
  grid-column: 1 / 8;
  grid-row: 1;
}

.stat-cloud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 4px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat strong {
  color: var(--brand-orange);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.stat:nth-child(2n) strong { color: var(--brand-pink); }
.stat:nth-child(3n) strong { color: var(--brand-crimson); }
.stat:nth-child(5n) strong { color: var(--brand-orange); }

.stat strong i {
  margin-left: 2px;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.stat > span {
  color: var(--ink-2);
  font-size: 10.5px;
}

.stat small {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 9.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stat-structure {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--ink-3);
  font-size: 10px;
}

.stat-structure > span {
  margin-right: 6px;
  color: var(--brand-pink);
  font-weight: 650;
}

.stat-structure i {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  color: var(--ink-2);
  font-style: normal;
}

.stat-structure b {
  color: var(--brand-orange);
  font-weight: 600;
}

.tile-books {
  grid-column: 8 / 13;
  grid-row: 1 / 3;
}

.book-cloud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.book-chip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--glass-bg-strong);
  color: inherit;
  transition:
    transform .18s cubic-bezier(.2, .9, .3, 1.35),
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.book-chip:hover {
  transform: translateY(-3px);
  border-color: var(--brand-pink);
  background: linear-gradient(120deg, rgba(255, 122, 26, .12), rgba(255, 45, 85, .1));
  box-shadow: 0 12px 24px -18px rgba(255, 45, 85, .8);
}

.chip-num,
.path-num {
  flex: 0 0 auto;
  color: var(--accent);
  font: 600 10.5px var(--mono);
}

.chip-body,
.path-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chip-body strong {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.35;
}

.chip-body em,
.path-body em {
  display: block;
  max-height: 2.9em;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 10px;
  font-style: normal;
  line-height: 1.45;
}

.chip-arrow {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-left: auto;
  fill: none;
  stroke: var(--brand-pink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity .18s ease, transform .18s ease;
}

.book-chip:hover .chip-arrow,
.path-chip:hover .chip-arrow {
  opacity: 1;
  transform: none;
}

.tile-foot {
  margin: auto 0 0;
  color: var(--ink-3);
  font-size: 10.5px;
}

.tile-search {
  grid-column: 1 / 5;
  grid-row: 2;
  cursor: pointer;
}

.tile-search strong,
.tile-routes-link strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.search-demo,
.tile-routes-link > span:nth-of-type(3) {
  color: var(--ink-3);
  font-size: 11px;
}

.tile-routes-link {
  grid-column: 5 / 8;
  grid-row: 2;
}

.search-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 4px;
}

.search-hint-chip {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-bg-strong);
  color: var(--ink-2);
  font: 10.5px var(--mono);
  cursor: pointer;
  transition:
    transform .15s cubic-bezier(.2, .9, .3, 1.35),
    border-color .15s ease,
    background .15s ease,
    color .15s ease;
}

.search-hint-chip:hover {
  transform: translateY(-2px);
  border-color: var(--brand-pink);
  background: var(--accent-soft);
  color: var(--brand-pink);
}

.tile-link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.route-points {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.5;
}

.route-points i {
  margin-right: 6px;
  color: var(--brand-orange);
  font: 600 10px var(--mono);
  font-style: normal;
}

.tile-paths {
  grid-column: 1 / 9;
  grid-row: 3 / 5;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin-top: 2px;
}

.path-chip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: inherit;
  transition:
    transform .16s cubic-bezier(.2, .9, .3, 1.35),
    background .16s ease,
    border-color .16s ease;
}

.path-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 45, 85, .25);
  background: var(--accent-soft);
}

.path-chip.is-overview {
  background: var(--jade-soft);
}

.path-body strong {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.35;
}

.tile-start {
  grid-column: 9 / 13;
  grid-row: 3;
}

.start-label {
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: .12em;
}

.tile-start strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.start-desc {
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.6;
}

.tile-guide {
  grid-column: 9 / 13;
  grid-row: 4;
}

.guide-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.guide-inline span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 11px;
}

.guide-inline i {
  color: var(--accent);
  font: 600 10px var(--mono);
  font-style: normal;
}

.tile-guide p {
  margin: auto 0 0;
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.7;
}

@media (max-width: 1080px) {
  .board-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .tile-stats { grid-column: 1 / 7; grid-row: 1; }
  .tile-books { grid-column: 1 / 4; grid-row: 2 / 4; }
  .tile-search { grid-column: 4 / 7; grid-row: 2; }
  .tile-routes-link { grid-column: 4 / 7; grid-row: 3; }
  .tile-paths { grid-column: 1 / 7; grid-row: 4; }
  .tile-start { grid-column: 1 / 4; grid-row: 5; }
  .tile-guide { grid-column: 4 / 7; grid-row: 5; }
}

@media (max-width: 960px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-top: 28px;
  }

  .hero-stage {
    min-height: 360px;
  }
}

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

  .tile-stats,
  .tile-books,
  .tile-search,
  .tile-routes-link,
  .tile-paths,
  .tile-start,
  .tile-guide {
    grid-column: 1 / 2;
    grid-row: auto;
  }

  .stat-cloud,
  .book-cloud,
  .path-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat strong {
    font-size: 19px;
  }

  .stat > span {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(38px, 10vw, 54px);
  }

  .hero-stage {
    min-height: 320px;
  }

  .hero-panel {
    padding: 18px;
  }

  .hero-orbit {
    width: 140px;
    height: 140px;
  }

  .orbit-core {
    width: 76px;
    height: 76px;
    font-size: 30px;
  }

  .stat-cloud,
  .book-cloud,
  .path-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }
}

/* ---------------- 入场 ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .75, .3, 1);
}

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

/* ---------------- 页脚 ---------------- */

.foot {
  position: relative;
  margin-top: 24px;
  background: #1a1014;
  color: #f5e9ec;
  border-top: 1px solid rgba(255, 210, 220, .08);
}

html[data-theme="dark"] .foot {
  background: #0d070a;
}

.foot-inner {
  display: grid;
  grid-template-columns: 1.2fr .8fr 1fr;
  gap: clamp(22px, 4vw, 60px);
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 34px clamp(18px, 3vw, 44px) 26px;
}

.foot-brand {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.foot-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 45, 85, .34);
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(255, 122, 26, .16), rgba(255, 45, 85, .12), rgba(224, 17, 95, .14));
}

.foot-mark img {
  width: 25px;
  height: 25px;
}

.foot-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.ai-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: #c7aeb5;
  font-size: 11px;
  line-height: 1.7;
}

.ai-chip {
  padding: 1px 7px;
  border: 1px solid rgba(255, 45, 85, .36);
  border-radius: 999px;
  background: rgba(255, 45, 85, .14);
  color: #ffb3c6;
  font: 10px var(--mono);
}

.foot-label {
  margin: 0 0 10px;
  color: #b79aa3;
  font: 10px var(--mono);
  letter-spacing: .14em;
}

.foot-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  color: #f5e9ec;
  font-size: 11.5px;
}

.contact-label {
  margin-right: 5px;
  color: #b79aa3;
}

.foot-contact a {
  color: #f5e9ec;
}

.foot-contact a:hover {
  color: var(--accent-2);
}

.contact-sep,
.legal-sep {
  color: #7d5a66;
}

.foot-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}

.foot-links-label {
  color: #b79aa3;
  font-size: 10px;
}

.foot-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #f5e9ec;
}

.foot-link:hover {
  color: var(--accent-2);
}

.foot-link-name {
  font-size: 12px;
  font-weight: 600;
}

.foot-link-desc {
  color: #b79aa3;
  font-size: 10.5px;
}

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
}

.foot-legal a {
  color: #c7aeb5;
}

.foot-legal a:hover {
  color: #fff;
}

.police {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.police-icon {
  width: 16px;
  height: 16px;
}

.foot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 210, 220, .08);
  color: #b79aa3;
  font-size: 10.5px;
}

.foot-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c7aeb5;
  font: inherit;
  cursor: pointer;
}

.foot-top:hover {
  color: var(--accent-2);
}

.foot-top svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1280px) {
  .search {
    width: 150px;
  }

  .route-board {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
}

@media (max-width: 1080px) {
  body.has-aside .main {
    grid-template-columns: minmax(0, 1fr);
  }

  .pagetoc {
    display: none;
  }

  .mobile-outline {
    display: block;
    margin: 0 0 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--glass-bg);
  }

  .mobile-outline summary {
    display: flex;
    justify-content: space-between;
    padding: 11px 14px;
    cursor: pointer;
    font-size: 12px;
  }

  .mobile-outline-hint {
    color: var(--ink-3);
    font-size: 11px;
  }

  .mobile-outline-list {
    margin: 0;
    padding: 0 14px 12px;
    list-style: none;
  }

  .mobile-outline-list a {
    display: block;
    padding: 6px 0;
    color: var(--ink-2);
    font-size: 12px;
  }

  .mobile-outline-list .lvl-3 a {
    padding-left: 14px;
  }
}

@media (max-width: 960px) {
  .masthead {
    padding: 8px 12px;
  }

  .bar {
    flex-wrap: wrap;
    border-radius: 22px;
    padding: 8px 10px;
  }

  .brand {
    order: 1;
  }

  .tools {
    order: 2;
    margin-left: auto;
  }

  .navwrap {
    order: 3;
    flex: 1 0 100%;
  }

  .search {
    display: none;
  }

  .search-btn,
  .menu-btn {
    display: grid;
  }

  .shell,
  body.is-landing .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .submenu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    width: min(330px, 86vw);
    height: 100vh;
    max-height: none;
    margin: 0;
    padding: 22px 16px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0 24px 24px 0;
    background: #fff;
    box-shadow: 16px 0 60px -24px rgba(40, 12, 24, .55);
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.2, .8, .3, 1);
  }

  html[data-theme="dark"] .submenu {
    background: #1c1418;
  }

  .submenu::before,
  .submenu::after {
    display: none;
  }

  body.drawer-open .submenu {
    transform: none;
  }

  .submenu-close {
    position: absolute;
    top: 18px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--glass-bg);
    cursor: pointer;
  }

  .submenu-close svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
  }

  .drawer-mask {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    background: rgba(18, 8, 12, .55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s ease;
  }

  body.drawer-open .drawer-mask {
    opacity: 1;
    pointer-events: auto;
  }

  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-top: 28px;
  }

  .hero-stage {
    min-height: 360px;
  }

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

  .route-aside {
    max-width: none;
  }

  .guide-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .brand-sub {
    display: none;
  }

  .hero-title {
    font-size: clamp(38px, 10vw, 54px);
  }

  .home-facts {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .facts-row {
    flex-wrap: wrap;
    gap: 12px 24px;
  }

  .guide-steps,
  .home-util {
    grid-template-columns: minmax(0, 1fr);
  }

  .volume {
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    gap: 10px;
    padding: 12px 14px;
  }

  .hero-panel-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .panel-cell {
    padding: 5px 0;
    font-size: 9px;
  }

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

  .foot-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .hero-eyebrow {
    flex-wrap: wrap;
  }

  .home-search-btn {
    padding: 0 14px;
  }

  .btn {
    padding: 0 14px;
  }

  .hero-stage {
    min-height: 320px;
  }

  .hero-panel {
    padding: 18px;
  }

  .hero-orbit {
    width: 140px;
    height: 140px;
  }

  .orbit-core {
    width: 76px;
    height: 76px;
    font-size: 30px;
  }

  .article h2 {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .search-skeleton span,
  .search-progress.is-indeterminate .search-progress-fill {
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .glass-panel,
  .surface,
  .volume,
  .route,
  .util,
  .pager-card {
    transition: none;
  }
}

@media print {
  .canvas,
  .masthead,
  .submenu,
  .pagetoc,
  .pager,
  .foot,
  .search-panel,
  .mobile-outline {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .shell,
  .main,
  .main-inner {
    display: block;
    max-width: none;
    padding: 0;
  }

  .article {
    color: #000;
  }

  .article a {
    color: #000;
    text-decoration: none;
  }

  .code-block {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}
