/* 部署仓 v2 · 深夜实验室设计系统（GPT-6 Luna 改版蓝图 2026-11-03 落地） */
:root {
  --bg-page: #0f1216;
  --bg-surface: #171b21;
  --bg-surface-highlight: #1f2630;
  --bg-code: #0c0f14;
  --text-main: #eef1f5;
  --text-sub: #9aa3ad;
  --text-dim: #5b6370;
  --border: #2a313c;
  --border-focus: #3d4755;
  --color-monitor: #38bdf8;
  --color-storage: #60a5fa;
  --color-panel: #f59e0b;
  --color-blog: #818cf8;
  --color-media: #f472b6;
  --color-tool: #2dd4bf;
  --color-ai: #c084fc;
  --accent: #38bdf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #f43f5e;
  --radius: 12px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, "Noto Sans Mono", monospace;
  --topbar-h: 64px;
  --cat: var(--accent);
}
[data-cat="monitor"] { --cat: var(--color-monitor); }
[data-cat="storage"] { --cat: var(--color-storage); }
[data-cat="panel"] { --cat: var(--color-panel); }
[data-cat="blog"] { --cat: var(--color-blog); }
[data-cat="media"] { --cat: var(--color-media); }
[data-cat="tool"] { --cat: var(--color-tool); }
[data-cat="ai"] { --cat: var(--color-ai); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-page); color: var(--text-main);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; min-width: 0;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
::selection { background: rgba(56, 189, 248, .35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 顶部通栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100; height: var(--topbar-h);
  display: flex; align-items: center; gap: 20px; padding: 0 20px;
  background: rgba(15, 18, 22, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 20px; font-weight: 700; color: var(--text-main); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; color: var(--accent); }
.topbar .pills { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topbar .pills::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-sub); font-size: 13px; background: var(--bg-surface);
}
.pill:hover { color: var(--text-main); border-color: var(--border-focus); text-decoration: none; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cat); flex: none; }
.pill.on { color: var(--text-main); border-color: var(--cat); }
.topbar .actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--bg-surface); color: var(--text-sub); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; font-family: inherit;
}
.icon-btn:hover { color: var(--text-main); border-color: var(--border-focus); }
.burger { display: none; }
.mobile-nav {
  display: none; position: sticky; top: var(--topbar-h); z-index: 99;
  background: var(--bg-surface); border-bottom: 1px solid var(--border); padding: 10px 16px;
}
.mobile-nav.open { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 搜索悬浮窗 ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(5, 7, 10, .72); backdrop-filter: blur(3px); padding: 10vh 16px 16px;
}
.search-overlay.open { display: block; }
.search-box {
  max-width: 640px; margin: 0 auto; background: var(--bg-surface);
  border: 1px solid var(--border-focus); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.search-box input {
  width: 100%; border: 0; background: var(--bg-code); color: var(--text-main);
  font-size: 18px; padding: 16px 18px; font-family: inherit; outline: none;
}
.search-hot { padding: 10px 18px; border-top: 1px solid var(--border); color: var(--text-sub); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.search-hot button {
  background: var(--bg-code); color: var(--text-sub); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.search-hot button:hover { color: var(--accent); border-color: var(--accent); }
.search-results { max-height: 46vh; overflow-y: auto; }
.search-results a {
  display: flex; justify-content: space-between; gap: 12px; padding: 11px 18px;
  color: var(--text-main); border-top: 1px solid var(--border); font-size: 15px;
}
.search-results a:hover { background: var(--bg-surface-highlight); text-decoration: none; }
.search-results a .rc { color: var(--text-sub); font-size: 12.5px; white-space: nowrap; }
.search-none { padding: 16px 18px; color: var(--text-sub); font-size: 14px; border-top: 1px solid var(--border); }

/* ---------- 布局与 Hero ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hero { padding: 44px 0 8px; display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: stretch; }
.hero h1 { font-size: 36px; line-height: 1.3; font-weight: 700; }
.hero h1 .hl { color: var(--accent); }
.hero .sub { color: var(--text-sub); margin-top: 12px; font-size: 16px; }
.quick-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--text-main);
  transition: border-color .15s, transform .15s;
}
.quick-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.quick-card .qc-t { font-weight: 600; font-size: 17px; }
.quick-card .qc-d { color: var(--text-sub); font-size: 13.5px; line-height: 1.6; }
.quick-card .qc-go { color: var(--accent); font-size: 13.5px; margin-top: auto; }
.pills-row { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 4px; scrollbar-width: none; }
.pills-row::-webkit-scrollbar { display: none; }
.pills-row .pill { font-size: 13.5px; padding: 7px 14px; }
.pills-row .pill .cnt { color: var(--text-dim); font-size: 12px; }

section.cat-sec { padding: 26px 0 4px; }
section.cat-sec > h2 {
  font-size: 24px; font-weight: 600; display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
section.cat-sec > h2::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--cat); }
section.cat-sec > h2 a { color: var(--text-main); }
section.cat-sec > h2 .more { font-size: 13px; color: var(--text-sub); margin-left: auto; font-weight: 400; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* ---------- 卡片 ---------- */
.card {
  position: relative; display: flex; flex-direction: column; gap: 9px; padding: 18px 16px 15px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-main); overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--cat); }
.card:hover { border-color: var(--cat); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); text-decoration: none; }
.card h3 { font-size: 17px; font-weight: 600; line-height: 1.45; }
.card .sum { color: var(--text-sub); font-size: 13.5px; line-height: 1.6; flex: 1; }
.card .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ver-badge { background: rgba(56, 189, 248, .1); color: var(--cat); padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.read-badge { color: var(--text-sub); font-size: 12px; }
.card.disabled { opacity: .55; pointer-events: none; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--bg-code); border: 1px solid var(--border); color: var(--text-sub); }

/* ---------- CTA 与页脚 ---------- */
.cta-bar {
  margin: 40px 0 8px; padding: 20px 22px; border: 1px dashed var(--border-focus); border-radius: var(--radius);
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; color: var(--text-sub); font-size: 14.5px;
}
.cta-bar strong { color: var(--text-main); }
.cta-bar .soon { border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; color: var(--text-dim); }
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 30px; color: var(--text-sub); font-size: 13.5px; }
.site-footer a { color: var(--text-sub); }
.site-footer a:hover { color: var(--accent); }
.site-footer .fr { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- 文章页 ---------- */
.reading-progress { position: fixed; top: var(--topbar-h); left: 0; height: 2px; background: var(--accent); width: 0; z-index: 101; }
.breadcrumb { padding: 18px 0 4px; color: var(--text-sub); font-size: 13.5px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-sub); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-dim); }
.article-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 34px; margin-top: 12px; }
.article-card h1 { font-size: 30px; line-height: 1.4; font-weight: 700; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 14px 0 4px; color: var(--text-sub); font-size: 13.5px; }
.article-meta .chip { color: var(--cat); border: 1px solid var(--cat); border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 600; }
.article-meta .tools { margin-left: auto; display: flex; gap: 8px; }
.article-meta .tools button {
  background: var(--bg-code); color: var(--text-sub); border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.article-meta .tools button:hover, .article-meta .tools button.on { color: var(--accent); border-color: var(--accent); }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 30px; align-items: start; margin-top: 10px; }
.article-body { min-width: 0; max-width: 800px; }
.article-body p { margin: 12px 0; }
.article-body h2 {
  font-size: 22px; font-weight: 600; margin: 30px 0 12px; padding-left: 12px;
  border-left: 4px solid var(--cat); line-height: 1.45; scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.article-body h3 { font-size: 18px; font-weight: 600; margin: 22px 0 8px; }
.article-body ul, .article-body ol { margin: 10px 0 10px 22px; }
.article-body li { margin: 5px 0; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body code {
  font-family: var(--font-mono); font-size: 13.5px; background: var(--bg-code);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: #d1d5db;
  overflow-wrap: anywhere;
}
.article-body figure { margin: 18px 0; }
.article-body figure img { border: 1px solid var(--border); border-radius: 8px; width: 100%; }
.article-body figcaption { color: var(--text-sub); font-size: 13.5px; margin-top: 8px; text-align: center; }
.article-body table { border-collapse: collapse; margin: 14px 0; width: 100%; font-size: 14.5px; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.article-body th { background: var(--bg-code); }
ol.steps > li { margin: 14px 0; }

/* 代码块 */
.code-block { position: relative; background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius); margin: 18px 0; overflow: hidden; }
.code-toolbar {
  display: flex; justify-content: space-between; align-items: center; padding: 6px 12px;
  background: var(--bg-surface-highlight); border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-sub); font-family: var(--font-mono);
}
.copy-btn {
  background: var(--bg-code); border: 1px solid var(--border); color: var(--text-sub);
  padding: 3px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.code-block pre {
  margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.6;
  font-family: var(--font-mono); color: #d1d5db;
}
.code-block pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }

/* 提示/警告框（正文既有类名统一视觉） */
.tip, .tip-box, .callout {
  background: rgba(56, 189, 248, .07); border-left: 4px solid var(--accent);
  padding: 13px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 16px 0;
}
.warn, .callout-warn, .alert-warning {
  background: rgba(245, 158, 11, .08); border-left: 4px solid var(--warning);
  padding: 13px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 16px 0;
}
.tip p, .warn p, .tip-box p, .callout p { margin: 6px 0; }
.callout-title { font-weight: 600; }

/* 踩坑实录警示框 */
.warn-box {
  border: 1px solid var(--warning); border-radius: var(--radius);
  background: rgba(245, 158, 11, .05); padding: 6px 18px 12px; margin: 4px 0 10px;
}
.warn-box::before {
  content: "⚠ 实测踩坑 · 照着避"; display: block; color: var(--warning);
  font-size: 13px; font-weight: 600; padding: 10px 0 2px; letter-spacing: .04em;
}

/* 目录 TOC */
.toc {
  position: sticky; top: calc(var(--topbar-h) + 16px); background: var(--bg-code);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; font-size: 13.5px;
}
.toc h4 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--text-main); }
.toc ul { list-style: none; }
.toc a { display: block; padding: 4px 8px; color: var(--text-sub); border-radius: 6px; line-height: 1.5; }
.toc a:hover { text-decoration: none; background: var(--bg-surface-highlight); color: var(--text-main); }
.toc a.active { background: var(--bg-surface-highlight); color: var(--accent); }
.toc-btn {
  display: none; position: fixed; right: 16px; bottom: 22px; z-index: 120;
  background: var(--bg-surface-highlight); color: var(--text-main); border: 1px solid var(--border-focus);
  border-radius: 999px; padding: 9px 18px; font-size: 14px; cursor: pointer; font-family: inherit;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}

/* 相关教程 / 上下篇 / 页脚戳 */
.related-sec { margin-top: 34px; }
.related-sec h2 { font-size: 20px; border-left: 4px solid var(--cat); padding-left: 12px; margin-bottom: 12px; }
.capsules { display: flex; flex-wrap: wrap; gap: 8px; }
.capsules a {
  border: 1px solid var(--border); background: var(--bg-code); color: var(--text-main);
  border-radius: 999px; padding: 6px 14px; font-size: 13.5px; max-width: 100%;
}
.capsules a:hover { border-color: var(--cat); color: var(--cat); text-decoration: none; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.prevnext a {
  background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; color: var(--text-main); display: block;
}
.prevnext a:hover { border-color: var(--cat); text-decoration: none; }
.prevnext .dir { color: var(--text-sub); font-size: 12.5px; display: block; margin-bottom: 5px; }
.prevnext .tt { font-weight: 600; font-size: 15px; line-height: 1.5; display: block; }
.prevnext a.next { text-align: right; }
.prevnext .empty { border: 1px dashed var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text-dim); font-size: 13.5px; }
.article-stamp {
  margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border);
  color: var(--text-sub); font-size: 13.5px;
}
.article-stamp a { color: var(--text-sub); text-decoration: underline; }

/* 枢纽页 */
.hub-intro { color: var(--text-sub); max-width: 760px; margin-top: 10px; }
.hub-faq { margin-top: 34px; max-width: 860px; }
.hub-faq h2 { font-size: 22px; margin-bottom: 12px; }
.hub-faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); padding: 13px 18px; margin-bottom: 10px; }
.hub-faq summary { cursor: pointer; font-weight: 600; }
.hub-faq details p { color: var(--text-sub); margin-top: 8px; font-size: 15px; }

/* 404 */
.nf { text-align: center; padding: 70px 0 10px; }
.nf .code { font-size: 84px; font-weight: 700; color: var(--accent); line-height: 1; }
.nf p { color: var(--text-sub); margin: 14px 0 22px; }
.nf form { display: flex; gap: 8px; max-width: 480px; margin: 0 auto 18px; }
.nf input {
  flex: 1; background: var(--bg-surface); border: 1px solid var(--border-focus); border-radius: 8px;
  color: var(--text-main); padding: 11px 14px; font-size: 15px; font-family: inherit; min-width: 0;
}
.nf button, .btn-home {
  background: var(--accent); color: #06202e; border: 0; border-radius: 8px; padding: 11px 20px;
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; display: inline-block;
}
.nf .btn-home:hover { text-decoration: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface-highlight); color: var(--text-main); border: 1px solid var(--border-focus);
  border-radius: 999px; padding: 9px 20px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 300; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .article-grid { grid-template-columns: minmax(0, 1fr); }
  .article-body { max-width: none; }
  .toc {
    display: none; position: fixed; right: 12px; bottom: 74px; top: auto; z-index: 130;
    width: min(300px, calc(100vw - 24px)); max-height: 55vh; overflow-y: auto;
    background: var(--bg-surface); box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
  }
  .toc.open { display: block; }
  .toc-btn { display: block; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --topbar-h: 56px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .pills { display: none; }
  .burger { display: inline-flex; }
  .hero { padding-top: 30px; }
  .hero h1 { font-size: 28px; }
  .article-card { padding: 20px 16px; }
  .article-card h1 { font-size: 24px; }
  .article-meta .tools { margin-left: 0; }
  .prevnext { grid-template-columns: 1fr; }
  .wrap { padding: 0 14px; }
  .nf .code { font-size: 60px; }
}
