/* ========== YABO 极简索引台 共享样式 /assets/site.css ========== */
:root {
  --bg-ink: #151213;
  --bg-panel: #f2ead8;
  --bg-card: #1e1a1c;
  --text-cream: #ecdbba;
  --accent-red: #f04b32;
  --accent-blue: #3b82f6;
  --accent-green: #c5f04a;
  --muted-amber: #d99a3d;
  --line-faint: #4a3f3a;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-code: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  --shadow-panel: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px rgba(0,0,0,.35);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg-ink); color: var(--text-cream);
  font-family: var(--font-body); font-size: 16px; line-height: 1.75;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
main { display: block; flex: 1 0 auto; }
#main-content { scroll-margin-top: 104px; }
h1, h2, h3, h4 { font-weight: 900; line-height: 1.2; margin: 0 0 .55em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }
a { color: var(--accent-blue); }
a:hover { color: var(--accent-green); }
::selection { background: var(--accent-green); color: var(--bg-ink); }
:focus-visible { outline: 2px solid var(--accent-green); outline-offset: 3px; }

.yb-container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.yb-content { width: min(1200px, 100% - 40px); margin-inline: auto; padding-block: clamp(36px, 6vw, 72px); }
.yb-section { margin-block: clamp(32px, 5vw, 56px); }
.yb-page-header { margin-bottom: clamp(28px, 4vw, 48px); padding-bottom: 20px; border-bottom: 1px solid var(--line-faint); }
.yb-page-title { font-size: clamp(28px, 5vw, 46px); letter-spacing: -.02em; }
.yb-lead { font-size: clamp(16px, 2vw, 18px); line-height: 1.8; color: rgba(236,219,186,.82); max-width: 60ch; }

/* ========== 头部 ========== */
.yb-head {
  position: sticky; top: 0; z-index: 120;
  border-top: 3px solid var(--accent-red);
  background: rgba(21,18,19,.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.yb-skip {
  position: absolute; left: 16px; top: -48px; z-index: 300;
  background: var(--accent-green); color: var(--bg-ink);
  font-weight: 900; font-size: 13px; padding: 10px 16px;
  text-decoration: none; transition: top .18s ease;
}
.yb-skip:focus { top: 8px; }
.yb-topbar { background: rgba(30,26,28,.72); border-bottom: 1px solid var(--line-faint); }
.yb-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.yb-brand { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; }
.yb-brand-mark {
  font-family: var(--font-code); font-weight: 900; font-size: 16px;
  letter-spacing: .08em; color: var(--accent-green); line-height: 1;
}
.yb-brand-mark::before { content: "▶"; color: var(--accent-red); font-size: 9px; margin-right: 2px; letter-spacing: 0; vertical-align: 2px; }
.yb-brand-mark::after { content: "▍"; margin-left: 2px; animation: yb-blink 1.1s steps(2,start) infinite; }
.yb-brand-sub { font-size: 12px; color: var(--text-cream); opacity: .72; letter-spacing: .06em; font-weight: 700; }
.yb-top-meta { display: flex; align-items: center; gap: 12px; }
.yb-pill {
  font-family: var(--font-code); font-size: 11px; color: var(--muted-amber);
  border: 1px solid var(--line-faint); padding: 2px 8px; border-radius: 2px; white-space: nowrap;
}
.yb-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-code); font-size: 11px; color: var(--text-cream); opacity: .9; }
.yb-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green); animation: yb-breathe 2.4s ease-in-out infinite; flex: none;
}
.yb-cur { color: var(--accent-green); font-weight: 700; }

.yb-navbar { position: relative; border-bottom: 1px solid var(--line-faint); }
.yb-navbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.yb-nav { display: flex; align-items: center; gap: 2px; }
.yb-nav-link {
  display: inline-flex; align-items: center; gap: 8px; position: relative;
  padding: 14px 12px; color: var(--text-cream);
  text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.yb-nav-idx { font-family: var(--font-code); font-size: 11px; color: var(--muted-amber); }
.yb-nav-idx::after { content: "/"; margin-left: 4px; color: var(--line-faint); }
.yb-nav-label { white-space: nowrap; }
.yb-nav-link:hover { color: var(--accent-green); }
.yb-nav-link[aria-current="page"] { color: var(--accent-green); }
.yb-nav-link[aria-current="page"]::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); flex: none;
}
.yb-nav-link[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0;
  height: 2px; background: var(--accent-green);
}
.yb-scrollbar {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--accent-green); box-shadow: 0 0 8px rgba(197,240,74,.8);
  transform: scaleX(var(--scroll, 0)); transform-origin: 0 50%;
  transition: transform 90ms linear; pointer-events: none; z-index: 2;
}

.yb-nav-toggle { display: none; }
.yb-toggle-icon { display: inline-flex; flex-direction: column; gap: 4px; width: 18px; }
.yb-toggle-bar { height: 2px; background: currentColor; transition: transform .18s ease; }
.yb-nav-toggle[aria-expanded="true"] .yb-toggle-bar:first-child { transform: translateY(3px) rotate(45deg); }
.yb-nav-toggle[aria-expanded="true"] .yb-toggle-bar:last-child { transform: translateY(-3px) rotate(-45deg); }
.yb-toggle-label { letter-spacing: .08em; }

@keyframes yb-breathe { 50% { opacity: .45; } }
@keyframes yb-blink { 50% { opacity: 0; } }

/* ========== 页脚 ========== */
.yb-foot {
  margin-top: clamp(60px, 10vw, 120px); position: relative; overflow: hidden;
  background: var(--bg-card); border-top: 1px solid var(--line-faint);
  border-bottom: 3px solid var(--accent-red);
}
.yb-foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-blue), transparent); opacity: .5;
}
.yb-foot-main {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.4fr 2fr; gap: 48px;
  padding-block: clamp(40px, 6vw, 72px) 32px;
}
.yb-foot-logo { font-size: 24px; font-weight: 900; color: var(--text-cream); margin-bottom: 8px; }
.yb-foot-logo span { color: var(--accent-red); }
.yb-foot-desc { font-size: 13px; opacity: .75; max-width: 46ch; margin-bottom: 16px; }
.yb-foot-icp {
  display: inline-block; font-family: var(--font-code); font-size: 11px;
  color: var(--muted-amber); border: 1px solid var(--line-faint); padding: 2px 8px;
}
.yb-foot-cols { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 24px; }
.yb-foot-title { font-size: 12px; color: var(--accent-green); font-family: var(--font-code); letter-spacing: .12em; margin-bottom: 14px; }
.yb-foot-col ul { list-style: none; }
.yb-foot-col li { margin-bottom: 8px; }
.yb-foot-col a { color: var(--text-cream); text-decoration: none; font-size: 13px; }
.yb-foot-col a:hover { color: var(--accent-red); }
.yb-foot-col p { font-size: 13px; margin-bottom: 6px; opacity: .82; color: var(--text-cream); }
.yb-foot-col p a { color: var(--accent-blue); }
.yb-foot-note { font-size: 12px; opacity: .6; max-width: 36ch; border-left: 2px solid var(--accent-red); padding-left: 10px; }
.yb-foot-base { position: relative; z-index: 1; border-top: 1px solid var(--line-faint); }
.yb-foot-base-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 56px; font-family: var(--font-code); font-size: 12px;
  color: rgba(236,219,186,.55);
}
.yb-base-badge {
  font-size: 11px; color: var(--muted-amber);
  border: 1px solid var(--line-faint); padding: 2px 8px; white-space: nowrap;
}
.yb-waves {
  position: absolute; left: 0; right: 0; bottom: -2px; height: 32px; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(217,154,61,.22) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(0deg, rgba(240,75,50,.14) 0 1px, transparent 1px 9px);
  transform: skewY(-1deg) scaleY(.8); transform-origin: bottom center;
}
.yb-tower {
  position: absolute; right: 4%; bottom: 28px; width: 120px; height: 150px; z-index: 0; pointer-events: none;
  background: rgba(236,219,186,.05);
  clip-path: polygon(
    50% 0%, 55% 2%, 55% 8%, 63% 12%, 57% 14%, 57% 22%, 65% 26%, 58% 28%, 58% 36%,
    67% 40%, 59% 42%, 59% 50%, 68% 55%, 60% 57%, 60% 66%, 66% 72%, 52% 88%, 50% 92%,
    48% 88%, 34% 72%, 40% 66%, 40% 57%, 32% 55%, 41% 50%, 41% 42%, 33% 40%, 42% 36%,
    42% 28%, 35% 26%, 43% 22%, 43% 14%, 37% 12%, 45% 8%, 45% 2%
  );
}

/* ========== 面包屑 / 按钮 / 面板 / 标签 / 状态 / 网格 ========== */
.yb-breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: var(--font-code); font-size: 13px; color: var(--muted-amber); margin-bottom: 16px; }
.yb-breadcrumb a { color: var(--accent-blue); text-decoration: none; }
.yb-breadcrumb a:hover { color: var(--accent-green); }
.yb-crumb-sep { color: var(--line-faint); }

.yb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: 1px solid var(--line-faint); background: var(--bg-card);
  color: var(--text-cream); font: inherit; font-weight: 700; font-size: 14px;
  text-decoration: none; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.yb-btn:hover { border-color: var(--accent-green); color: var(--accent-green); }
.yb-btn-primary { background: var(--accent-red); border-color: var(--accent-red); color: #fff; }
.yb-btn-primary:hover { background: #d43c26; border-color: #d43c26; color: #fff; }
.yb-btn-ghost { background: transparent; border-color: var(--accent-blue); color: var(--accent-blue); }
.yb-btn-ghost:hover { background: rgba(59,130,246,.1); color: var(--accent-blue); border-color: var(--accent-blue); }

.yb-panel { background: var(--bg-card); border: 1px solid var(--line-faint); box-shadow: var(--shadow-panel); }
.yb-panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-faint); }
.yb-panel-title { font-size: 15px; font-weight: 900; color: var(--text-cream); margin: 0; flex: 1; }
.yb-panel-body { padding: 16px; }
.yb-panel-body > :last-child { margin-bottom: 0; }

.yb-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line-faint); background: var(--bg-card); color: var(--text-cream); font-family: var(--font-code); font-size: 12px; line-height: 1.6; }
.yb-tag-green { border-color: rgba(197,240,74,.55); color: var(--accent-green); }
.yb-tag-red { border-color: rgba(240,75,50,.55); color: var(--accent-red); }

.yb-status-light { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); animation: yb-breathe 2.4s ease-in-out infinite; vertical-align: middle; }

.yb-idx { font-family: var(--font-code); font-size: 12px; color: var(--muted-amber); letter-spacing: .04em; }

.yb-grid { display: grid; gap: 20px; }
.yb-grid-2, .yb-grid-3 { grid-template-columns: 1fr; }
.yb-nav::-webkit-scrollbar { width: 6px; }
.yb-nav::-webkit-scrollbar-thumb { background: var(--line-faint); }

/* ========== 响应式 ========== */
@media (min-width: 768px) {
  .yb-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .yb-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1080px) {
  .yb-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 920px) {
  .yb-foot-main { grid-template-columns: 1fr; gap: 32px; }
  .yb-foot-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .yb-nav-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-card); border: 1px solid var(--line-faint); color: var(--text-cream); font-family: var(--font-code); font-size: 12px; cursor: pointer; }
  .yb-nav-toggle:hover { border-color: var(--accent-green); color: var(--accent-green); }
  .yb-nav {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 88;
    flex-direction: column; align-items: stretch; gap: 0;
    max-height: 0; overflow: hidden; visibility: hidden;
    background: rgba(21,18,19,.98); border-bottom: 1px solid var(--line-faint);
    transition: max-height .18s ease, visibility .18s ease;
  }
  .yb-nav[data-open] { max-height: calc(100vh - 96px); overflow-y: auto; visibility: visible; padding-block: 8px; }
  .yb-nav-link { padding: 13px 22px; border-bottom: 1px solid rgba(74,63,58,.4); }
  .yb-nav-link[aria-current="page"]::after { display: none; }
  .yb-navbar-inner { min-height: 50px; }
  .yb-pill { display: none; }
  .yb-foot-main { padding-top: 40px; }
}
@media (max-width: 560px) {
  .yb-foot-cols { grid-template-columns: 1fr; }
  .yb-foot-base-inner { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding-block: 12px; }
  .yb-tower { right: -6%; width: 100px; opacity: .8; }
}
@media (max-width: 420px) {
  .yb-live-text { display: none; }
  .yb-brand-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .yb-dot, .yb-status-light { animation: none; }
  .yb-scrollbar { transition: none; }
}
