/* vLLM 学习站 — 参考 governance-agent-rsi-radar.pages.dev 设计系统 */
:root {
  color-scheme: light;
  --ink: #172238;
  --muted: #69758b;
  --line: #e6eaf1;
  --accent: #5158d7;
  --accent-deep: #424dc1;
  --accent-soft: #e5e8ff;
  --nav: #101c32;
  --nav-hover: #1d2c45;
  --nav-active: #535dde;
  --nav-text: #c3ccdf;
  --nav-label: #8f9fb8;
  --nav-border: #29364d;
  --panel: #16263f;
  --panel-line: #34445e;
  --background: #f5f7fb;
  --card: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15.5px;
  color: var(--ink);
  background: var(--background);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 2rem; letter-spacing: -0.04em; line-height: 1.4; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }

/* ===== 工作区:深色侧栏 + 主壳 ===== */
.workspace { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 70;
  background: var(--nav); color: var(--nav-text);
  padding: 30px 20px 24px; display: flex; flex-direction: column;
  /* 必须 overflow visible:二级 flyout 要伸出侧栏右缘,任何 auto/hidden 都会裁剪它 */
  overflow: visible;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px; color: #fff; font-size: 1.15rem; font-weight: 650; line-height: 1.3; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand-icon {
  background: #555de1; color: #fff; width: 42px; height: 42px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 11px;
  font-size: 1.25rem; font-weight: 800; letter-spacing: -0.05em;
}
.brand-sub { display: block; font-size: .72rem; letter-spacing: .09em; font-weight: 500; color: #98a6c0; margin-top: 5px; }
.nav-label { font-size: .75rem; letter-spacing: .05em; color: var(--nav-label); margin: 24px 12px 13px; font-weight: 600; }
.main-nav { display: grid; gap: 5px; }

.source-item { position: relative; }
.source-item > a {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 14px; border-radius: 7px; font-size: .9rem; font-weight: 600; color: var(--nav-text);
}
.source-item > a:hover { background: var(--nav-hover); }
.source-item.active > a { background: var(--nav-active); color: #fff; }
.src-ico {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  background: #555de1; color: #fff; display: grid; place-items: center;
  font-size: .8rem; font-weight: 800;
}
.side-count { margin-left: auto; font-size: .78rem; color: #d0d6ff; font-weight: 500; }
.source-item > a:hover .side-count, .source-item.active .side-count { color: #e6e9ff; }
.source-item .arrow { margin-left: 2px; color: var(--nav-label); font-size: 11px; transition: transform 0.15s; flex-shrink: 0; }
.source-item:hover .arrow, .source-item:focus-within .arrow { transform: rotate(90deg); color: #fff; }

/* 二级 flyout(深色,贴侧栏右缘) */
.flyout {
  position: absolute; left: calc(100% + 10px); top: -4px; z-index: 80;
  min-width: 216px; background: var(--nav); border: 1px solid var(--nav-border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(9, 16, 32, 0.4); padding: 7px;
  opacity: 0; visibility: hidden; transform: translateX(-4px);
  transition: opacity 0.13s ease, transform 0.13s ease, visibility 0.13s;
}
.source-item:hover .flyout, .source-item:focus-within .flyout { opacity: 1; visibility: visible; transform: translateX(0); }
.flyout a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 6px; color: var(--nav-text); font-size: .875rem; font-weight: 500;
}
.flyout a:hover { background: var(--nav-hover); color: #fff; }
.flyout a.active { background: var(--nav-active); color: #fff; font-weight: 650; }
.flyout a.sub { padding-left: 37px; font-size: .8rem; }
.flyout a svg { flex-shrink: 0; opacity: .75; }
.flyout a.active svg, .flyout a:hover svg { opacity: 1; }
.flyout .sep { height: 1px; margin: 6px 8px; background: var(--nav-border); }

.source-hint { padding: 14px 12px 0; color: #7587a5; font-size: .75rem; line-height: 1.7; }
.sidebar-bottom { margin-top: auto; padding: 18px 12px 0; border-top: 1px solid var(--nav-border); font-size: .78rem; color: #8193af; line-height: 1.8; }
.sidebar-bottom b { color: #b9c4d9; font-weight: 600; display: block; }

/* ===== 主壳:顶栏 + 内容 ===== */
.main-shell { margin-left: 250px; width: calc(100% - 250px); min-width: 0; }
.topbar {
  height: 70px; border-bottom: 1px solid var(--line); padding: 0 38px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--card); position: sticky; top: 0; z-index: 60;
}
.breadcrumb { font-size: .875rem; color: var(--muted); display: flex; gap: 14px; align-items: center; min-width: 0; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .crumb-sep { color: #c8cfdc; }
.breadcrumb .crumb-current { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.topbar-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.sync-label { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.stamp-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #6d78de; }
.search-box {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid #dce2ec; border-radius: 7px; padding: 9px 13px; color: #8190a5; width: 240px;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input { border: none; outline: none; background: none; width: 100%; color: var(--ink); font-size: .875rem; }
.search-box input::placeholder { color: #8f9aab; }

main { padding: 32px 38px 8px; max-width: 1640px; margin: auto; }

/* ===== 页头 ===== */
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; margin-bottom: 27px; }
.eyebrow { font-size: .75rem; letter-spacing: .09em; font-weight: 650; color: var(--accent); margin-bottom: 6px; text-transform: uppercase; }
.heading-note { color: var(--muted); font-size: .875rem; margin-top: 7px; max-width: 640px; }
.update-stamp { text-align: right; white-space: nowrap; font-size: .75rem; color: var(--muted); }
.update-stamp > span { display: block; font-size: .875rem; }
.update-stamp strong { display: block; font-weight: 600; color: var(--ink); font-size: 1rem; margin-top: 3px; }
.update-stamp small { font-size: .75rem; }

/* ===== 统计条 ===== */
.overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 29px; }
.overview > div { padding: 20px 25px; }
.overview > div + div { border-left: 1px solid var(--line); }
.overview span { display: block; font-size: .875rem; color: var(--muted); }
.overview strong { display: block; font-size: 1.8rem; line-height: 1.5; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0; }
.overview small { font-size: .75rem; color: #8290a3; }

/* ===== 分区标题 ===== */
.section { margin: 34px 0; }
.section-title { font-size: 1.05rem; font-weight: 650; margin: 0 0 16px; display: flex; align-items: baseline; gap: 10px; }
.section-title .more { font-size: .78rem; font-weight: 500; color: var(--muted); margin-left: auto; }
.section-title .more a { color: var(--accent); }
.section-title .more a:hover { text-decoration: underline; }

/* ===== 卡片 ===== */
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 20px 22px; }
.card:hover { border-color: #cbd1ef; box-shadow: 0 4px 15px rgba(23, 34, 56, 0.04); }

.topic-card h3 { font-size: 1.02rem; margin: 10px 0 6px; display: flex; align-items: center; gap: 9px; }
.topic-card .t-emoji { font-size: 1.3rem; line-height: 1; }
.topic-card .desc { color: var(--muted); font-size: .875rem; margin: 0 0 12px; line-height: 1.7; }
.topic-card .count { font-size: .8rem; color: var(--accent); font-weight: 600; }
.topic-card .count:hover { text-decoration: underline; }
.topic-card .focus-tag {
  font-size: .7rem; font-weight: 650; color: var(--accent-deep); background: var(--accent-soft);
  padding: 2px 8px; border-radius: 4px; letter-spacing: .04em;
}

/* ===== 分区折叠 ===== */
.section-collapse { margin: 34px 0 30px; }
.section-collapse summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; user-select: none; }
.section-collapse summary::-webkit-details-marker { display: none; }
.section-collapse .sec-title { font-size: 1.05rem; font-weight: 650; display: flex; align-items: baseline; gap: 10px; }
.section-collapse .sec-count { font-size: .78rem; color: var(--muted); font-weight: 500; }
.section-collapse summary .more { margin-left: auto; font-size: .78rem; color: var(--muted); }
.section-collapse summary .more a { color: var(--accent); }
.section-collapse summary .more a:hover { text-decoration: underline; }
.section-collapse .chev { color: var(--muted); font-size: 12px; transition: transform 0.15s; }
.section-collapse[open] .chev { transform: rotate(90deg); }
.section-collapse[open] summary { margin-bottom: 18px; }
.section-collapse summary:hover .sec-title { color: var(--accent-deep); }

/* 首页最新文章:更大卡片 */
.home-latest { grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); }
.home-latest .article-card { padding: 24px 26px 20px; }
.home-latest .card-title { font-size: 1.16rem; }
.home-latest .card-summary { font-size: .95rem; -webkit-line-clamp: 3; margin-top: 11px; }
.home-latest .card-meta { font-size: .78rem; margin-bottom: 11px; }

/* ===== 文章卡片 ===== */
.article-list { display: grid; gap: 14px; }
.article-card { background: var(--card); border: 1px solid var(--line); padding: 20px 22px 16px; border-radius: 9px; transition: border-color .15s, box-shadow .15s; }
.article-card:hover { border-color: #cbd1ef; box-shadow: 0 4px 15px rgba(23, 34, 56, 0.04); }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; font-size: .75rem; color: #8490a2; margin-bottom: 9px; }
.card-date { margin-left: auto; }
.card-title { display: block; font-size: 1.06rem; font-weight: 650; line-height: 1.5; color: #18243a; }
.card-title:hover { color: #4d55c7; }
.card-summary { font-size: .9rem; line-height: 1.7; color: #637089; margin-top: 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 13px; }

.badge { font-size: .72rem; font-weight: 600; display: inline-block; line-height: 1.7; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.badge.deep { background: #eaeaff; color: #4d54c2; }
.badge.mid { background: #edf4fa; color: #487197; }
.badge.entry { background: #f0f1f5; color: #7c8494; }
.badge.star { background: #fdf3df; color: #92672a; }

.chip {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .78rem;
  border: 1px solid #e5e8f0; color: #69758a; background: transparent;
}
a.chip:hover, button.chip:hover { color: #4b52bd; background: #f4f5ff; border-color: #d9ddf5; }
.chip .cnt { opacity: .55; margin-left: 3px; }

/* ===== 筛选 ===== */
.topic-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 18px; }
.topic-filters .chip { cursor: pointer; font-size: .82rem; padding: 5px 11px; user-select: none; background: var(--card); }
.topic-filters .chip.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; border-color: transparent; }

/* ===== 学习摘要面板(浅色卡片) ===== */
.focus-panel {
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: 10px; padding: 22px 26px 18px; margin: 4px 0 26px;
}
.rail-label { font-size: .78rem; color: var(--accent); display: flex; align-items: center; gap: 8px; letter-spacing: .08em; text-transform: uppercase; font-weight: 650; }
.focus-panel .one-liner { margin-top: 14px; font-size: 1.18rem; line-height: 1.65; letter-spacing: -0.02em; font-weight: 650; color: var(--ink); }
.focus-panel h4 { margin: 20px 0 8px; font-size: .82rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 650; }
.focus-panel ul, .focus-panel ol { margin: 6px 0; padding-left: 22px; }
.focus-panel li { margin: 5px 0; font-size: .9rem; color: #3d4a63; line-height: 1.75; }
.focus-panel li b { color: var(--ink); }
.focus-panel p { font-size: .9rem; color: #3d4a63; line-height: 1.75; }
.focus-panel .kd-table { width: 100%; border-collapse: collapse; font-size: .84rem; margin: 8px 0; }
.focus-panel .kd-table th, .focus-panel .kd-table td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; vertical-align: top; }
.focus-panel .kd-table th { color: var(--muted); font-weight: 600; background: #f5f7fc; }
.focus-panel .kd-table td { color: #3d4a63; }
.focus-panel .kd-table td.v { font-weight: 700; color: var(--accent-deep); white-space: nowrap; }
.focus-panel blockquote {
  margin: 10px 0 4px; padding: 8px 14px; border-left: 3px solid var(--accent);
  background: #f6f8fc; border-radius: 0 8px 8px 0;
  color: var(--muted); font-size: .8rem; line-height: 1.7;
}
.focus-panel blockquote + blockquote { margin-top: 6px; }
.focus-panel code { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; background: #eef1f8; border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-size: .82em; color: var(--accent-deep); }
.focus-panel .path-note { color: var(--muted); font-size: .78rem; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ===== 文章页 ===== */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 27px; align-items: start; }
.article-main { max-width: 1420px; min-width: 0; }
.document-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 34px 40px 28px; }
.doc-meta { display: flex; gap: 15px; font-size: .8rem; color: var(--accent); margin-bottom: 13px; flex-wrap: wrap; align-items: center; }
.doc-meta a { font-weight: 600; }
.doc-meta a:hover { text-decoration: underline; }
.document-card > h1 { font-size: 1.65rem; line-height: 1.5; }
.doc-byline { color: var(--muted); font-size: .84rem; margin-top: 10px; }
.doc-chips { margin-top: 14px; }

.toc-wrap { position: sticky; top: 86px; align-self: start; max-height: calc(100vh - 106px); overflow: auto; font-size: .8rem; }
.toc-wrap .toc-title { font-weight: 650; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.toc-wrap a { display: block; color: var(--muted); padding: 4px 0 4px 12px; border-left: 2px solid var(--line); line-height: 1.5; }
.toc-wrap a:hover { color: var(--accent); border-left-color: var(--accent); }
.toc-wrap a.lvl3 { padding-left: 24px; font-size: .76rem; }

/* ===== 正文排版 ===== */
.prose { font-size: .95rem; }
.prose h2 { font-size: 1.28rem; margin: 36px 0 14px; padding-bottom: 9px; border-bottom: 1px solid var(--line); scroll-margin-top: 92px; letter-spacing: -0.02em; font-weight: 700; }
.prose h3 { font-size: 1.06rem; margin: 28px 0 10px; scroll-margin-top: 92px; font-weight: 650; }
.prose h4 { font-size: .96rem; margin: 22px 0 8px; font-weight: 650; }
.prose p { margin: 13px 0; line-height: 1.8; color: #2c3a52; }
.prose img { max-width: 100%; border-radius: 9px; border: 1px solid var(--line); margin: 8px 0; }
.prose figure { margin: 18px 0; }
.prose figcaption { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 6px; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }
.prose code { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; background: #f0f2f6; padding: 2px 6px; border-radius: 5px; font-size: .86em; color: #3f4a63; }
.prose pre { background: #f7f8fb; border: 1px solid var(--line); border-radius: 9px; padding: 15px 17px; overflow-x: auto; line-height: 1.6; font-size: .82rem; }
.prose pre code { background: none; padding: 0; font-size: .82rem; }
.prose table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: .84rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 13px; text-align: left; }
.prose th { background: #f5f7fc; font-weight: 650; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 15px 0; padding: 4px 18px; color: var(--muted); background: #f8f9fc; border-radius: 0 8px 8px 0; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 30px 0; }

/* ===== 专题学习路径 ===== */
.path-list { display: grid; gap: 14px; }
.path-step { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 18px 20px; transition: border-color .15s, box-shadow .15s; }
.path-step:hover { border-color: #cbd1ef; box-shadow: 0 4px 15px rgba(23, 34, 56, 0.04); }
.path-num {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; margin-top: 2px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center; font-size: .84rem; font-weight: 700;
}
.path-body { min-width: 0; }
.path-body h3 { font-size: .98rem; line-height: 1.5; }
.path-body h3 a { color: #18243a; }
.path-body h3 a:hover { color: #4d55c7; }
.path-body .note { color: var(--muted); font-size: .84rem; margin: 6px 0 0; line-height: 1.7; }
.path-rail { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; font-size: .74rem; color: #8490a2; }

/* ===== 标签页 ===== */
.tag-section { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 18px 22px; margin-bottom: 14px; }
.tag-section .section-title { margin-bottom: 10px; }
.tag-row { display: flex; gap: 14px; align-items: baseline; padding: 8px 2px; border-bottom: 1px solid #f0f2f6; font-size: .86rem; }
.tag-row:last-child { border-bottom: none; }
.tag-row .date { color: #939cab; font-size: .76rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag-row a { color: #2c3a52; font-weight: 550; }
.tag-row a:hover { color: var(--accent); }
.tag-row .rm { color: #939cab; font-size: .74rem; white-space: nowrap; margin-left: auto; }

/* ===== 搜索页 ===== */
.big-search { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid #dce2ec; border-radius: 9px; padding: 14px 18px; color: #8190a5; max-width: 680px; margin: 6px 0 22px; }
.big-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(81, 88, 215, 0.08); }
.big-search input { border: none; outline: none; background: none; width: 100%; color: var(--ink); font-size: 1rem; }
.big-search input::placeholder { color: #8f9aab; }
#result-count { color: var(--muted); font-size: .82rem; margin-bottom: 12px; }
mark { background: #fdf0d7; color: inherit; border-radius: 3px; padding: 0 2px; }

/* ===== 关于页 ===== */
.about-doc { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 32px 38px; max-width: 860px; }
.about-doc h2 { margin-top: 26px; }

footer.site { font-size: .76rem; color: #8995a8; border-top: 1px solid var(--line); padding: 20px 38px 26px; margin-top: 44px; display: flex; justify-content: space-between; gap: 15px; flex-wrap: wrap; }
footer.site a { color: var(--accent); }

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview > div:nth-child(3) { border-left: none; }
  .overview > div:nth-child(3), .overview > div:nth-child(4) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc-wrap { display: none; }
  .document-card { padding: 24px 20px; }
}
@media (max-width: 860px) {
  .workspace { flex-direction: column; }
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; flex-direction: row; align-items: center; gap: 6px; padding: 9px 14px; overflow: visible; overflow-x: auto; }
  .brand { padding: 0 6px 0 0; font-size: .95rem; }
  .brand-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 1rem; }
  .brand-sub { display: none; }
  .nav-label, .source-hint, .sidebar-bottom { display: none; }
  .main-nav { display: flex; align-items: center; }
  .source-item { display: contents; }
  .source-item > a { padding: 8px 11px; white-space: nowrap; }
  .side-count, .source-item .arrow { display: none; }
  .flyout {
    position: static; display: flex; gap: 2px; min-width: 0;
    background: none; border: none; box-shadow: none; padding: 0;
    opacity: 1; visibility: visible; transform: none;
  }
  .flyout a { padding: 8px 11px; font-size: .8rem; white-space: nowrap; }
  .flyout a.sub, .flyout .sep { display: none; }
  .flyout a svg { display: none; }
  .main-shell { margin-left: 0; width: 100%; }
  .topbar { padding: 0 16px; height: 58px; }
  .breadcrumb { display: none; }
  .search-box { width: 150px; padding: 7px 11px; }
  .sync-label { display: none; }
  main { padding: 22px 16px 8px; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .update-stamp { text-align: left; }
  footer.site { padding: 18px 16px 24px; }
}
