:root {
  --ink: #17211d;
  --muted: #607069;
  --paper: #f4f1e8;
  --surface: #fffdf8;
  --green: #12372d;
  --green-2: #1e5647;
  --copper: #c87935;
  --line: #d9d8cf;
  --sidebar-width: 286px;
  --theme-color: #1e5647;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

.site-topbar {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto 0;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  color: #fff;
  background: rgba(18, 55, 45, .98);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  color: var(--green); background: #e2c28d; border-radius: 8px 2px 8px 2px;
  font-family: serif; font-size: 22px; font-weight: 800;
}
.brand strong { display: block; font-size: 18px; letter-spacing: .08em; }
.brand small { display: block; margin-top: 3px; color: #b9cbc4; font-size: 9px; letter-spacing: .17em; }
.site-topbar nav { display: flex; align-items: center; gap: 26px; }
.site-topbar nav a { color: #d9e4df; font-size: 14px; text-decoration: none; }
.site-topbar nav a:hover { color: #fff; }
.ai-entry { padding: 10px 15px; border: 1px solid rgba(226,194,141,.6); border-radius: 999px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-left: 5px; border-radius: 50%; background: #97a29e; }
.status-dot.online { background: #5ee09d; box-shadow: 0 0 0 4px rgba(94,224,157,.12); }
.status-dot.offline { background: #df806f; }

.sidebar { top: 76px; padding: 25px 18px 70px; background: #e9e7de; border-right: 1px solid var(--line); }
.sidebar .app-name { display: none; }
.sidebar-nav > ul > li { margin: 18px 0 0; }
.sidebar-nav > ul > li > strong, .sidebar-nav > ul > li > p { color: var(--green); font-size: 13px; letter-spacing: .08em; }
.sidebar-nav li a { color: #4f5e58; border-radius: 6px; font-size: 14px; }
.sidebar-nav li a:hover, .sidebar-nav li.active > a { color: var(--green-2); font-weight: 700; }
.sidebar-nav li.active > a { border-right: 3px solid var(--copper); }
.sidebar .search { margin: 0 0 18px; padding: 0; border: 0; }
.sidebar .search input { padding: 12px 14px; background: var(--surface); border: 1px solid #cbcfc9; border-radius: 8px; }

.content { top: 76px; padding-bottom: 90px; }
.markdown-section { max-width: 1040px; padding: 44px 58px 80px; }
.markdown-section h1 { color: var(--green); font-size: clamp(30px, 4vw, 48px); line-height: 1.15; }
.markdown-section h2 { margin-top: 48px; color: var(--green); font-size: 25px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.markdown-section h3 { color: var(--green-2); }
.markdown-section p, .markdown-section li { line-height: 1.85; }
.markdown-section a { color: var(--green-2); font-weight: 600; text-decoration-color: rgba(30,86,71,.35); }
.markdown-section blockquote { margin: 24px 0; padding: 16px 20px; color: #44534d; background: #ebe8dd; border-left: 4px solid var(--copper); }
.markdown-section table { display: table; width: 100%; overflow: hidden; background: var(--surface); border-radius: 8px; box-shadow: 0 10px 26px rgba(18,55,45,.06); }
.markdown-section th { color: #fff; background: var(--green); }
.markdown-section code { color: #9a4f1d; background: #ede8dc; }
.markdown-section pre { background: #18251f; border-radius: 8px; }
.markdown-section pre code { color: #ecf3ef; background: transparent; }

.library-hero {
  position: relative; overflow: hidden; margin: -44px -58px 36px; padding: 78px 58px 68px;
  color: #fff; background: var(--green);
}
.library-hero::after {
  content: ""; position: absolute; width: 390px; height: 390px; right: -90px; top: -170px;
  border: 1px solid rgba(226,194,141,.28); border-radius: 50%; box-shadow: 0 0 0 60px rgba(226,194,141,.05), 0 0 0 120px rgba(226,194,141,.03);
}
.eyebrow { color: #e2c28d; font-size: 12px; font-weight: 800; letter-spacing: .22em; }
.library-hero h1 { max-width: 700px; margin: 18px 0; color: #fff; font-size: clamp(38px, 5vw, 66px); letter-spacing: -.03em; }
.library-hero p { max-width: 650px; color: #c9d8d2; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-actions a { display: inline-flex; align-items: center; padding: 12px 18px; border-radius: 6px; text-decoration: none; }
.hero-actions .primary { color: var(--green); background: #e2c28d; }
.hero-actions .secondary { color: #fff; border: 1px solid rgba(255,255,255,.28); }
.metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; margin: -36px 0 38px; position: relative; z-index: 2; background: var(--line); border: 1px solid var(--line); box-shadow: 0 16px 35px rgba(18,55,45,.08); }
.metric { padding: 22px; text-align: center; background: var(--surface); }
.metric strong { display: block; color: var(--green); font-family: Georgia,serif; font-size: 30px; }
.metric span { color: var(--muted); font-size: 13px; }
.topic-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; margin: 20px 0 36px; }
.topic-card { display: block; padding: 24px; color: inherit !important; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; text-decoration: none !important; transition: transform .2s, box-shadow .2s; }
.topic-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(18,55,45,.09); }
.topic-card b { display: block; margin-bottom: 7px; color: var(--green); font-size: 18px; }
.topic-card span { color: var(--muted); font-size: 14px; font-weight: 400; }
.ai-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; margin-top: 42px; padding: 28px; color: #fff; background: #1c2924; border-left: 5px solid var(--copper); border-radius: 8px; }
.ai-panel h3 { margin: 0 0 8px; color: #fff; }
.ai-panel p { margin: 0; color: #b9c9c2; }
.ai-panel a { padding: 11px 17px; color: #1c2924; background: #e2c28d; border-radius: 6px; text-decoration: none; white-space: nowrap; }

.site-footer { position: fixed; z-index: 25; inset: auto 0 0 0; min-height: 42px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 10px 28px 10px calc(var(--sidebar-width) + 28px); color: #76817c; background: rgba(244,241,232,.96); border-top: 1px solid var(--line); font-size: 12px; }
.site-footer a { color: #66736d; text-decoration: none; }
.loading-shell { min-height: 70vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.loading-shell span { width: 34px; height: 34px; margin: auto; border: 3px solid #d4d7d1; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .site-topbar { height: 64px; padding: 0 18px 0 58px; }
  .brand-mark { width: 34px; height: 34px; font-size: 18px; }
  .brand strong { font-size: 15px; }
  .brand small, .site-topbar nav a:not(.ai-entry) { display: none; }
  .ai-entry { padding: 8px 11px !important; font-size: 12px !important; }
  .sidebar { top: 64px; }
  .content { top: 64px; }
  .markdown-section { padding: 30px 20px 80px; }
  .library-hero { margin: -30px -20px 30px; padding: 58px 22px 54px; }
  .metrics { margin-top: -30px; }
  .topic-grid { grid-template-columns: 1fr; }
  .ai-panel { grid-template-columns: 1fr; }
  .site-footer { padding-left: 18px; }
  .site-footer span { display: none; }
}

@media (max-width: 520px) {
  .library-hero h1 { font-size: 38px; }
  .library-hero p { font-size: 16px; }
  .metrics { grid-template-columns: 1fr 1fr 1fr; }
  .metric { padding: 16px 5px; }
  .metric strong { font-size: 24px; }
  .metric span { font-size: 11px; }
}
