/* AI 前沿知识体系 · 样式 */
:root {
  --sidebar-bg: #101828;
  --sidebar-fg: #c7d2e5;
  --sidebar-active: #26334d;
  --accent: #7c6cf0;
  --accent-2: #22d3ee;
  --accent-dark: #5b4bd6;
  --content-bg: #f6f7fb;
  --card-bg: #ffffff;
  --text: #1b2333;
  --text-muted: #5d6b80;
  --border: #e4e8f0;
  --code-bg: #eef1f8;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--text);
  background: var(--content-bg);
  line-height: 1.75;
}

#app { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
#sidebar {
  width: 300px; flex-shrink: 0;
  background: var(--sidebar-bg); color: var(--sidebar-fg);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}

.site-brand {
  display: flex; gap: 12px; align-items: center;
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 44px; height: 44px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; letter-spacing: .02em;
}
.site-brand h1 { font-size: 17px; color: #fff; line-height: 1.3; }
.site-brand p { font-size: 12px; color: #8fa3c0; margin-top: 2px; }

.search-box { padding: 12px 14px; }
#search-input {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06);
  color: #fff; font-size: 13.5px; outline: none;
}
#search-input::placeholder { color: #7d91ab; }
#search-input:focus { border-color: var(--accent); }

#chapter-nav { flex: 1; padding: 4px 10px 16px; }
.nav-group-title {
  font-size: 11.5px; color: #6f85a5; letter-spacing: .08em;
  padding: 14px 10px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; gap: 9px; align-items: center;
  padding: 8px 10px; margin: 2px 0; border-radius: 8px;
  cursor: pointer; font-size: 13.5px; color: var(--sidebar-fg);
  transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item .num {
  font-size: 11px; color: var(--accent-2); font-weight: 700; min-width: 22px;
}
.nav-item .nav-title { flex: 1; }
.sidebar-footer { padding: 10px 16px 16px; font-size: 11.5px; color: #6f85a5; border-top: 1px solid rgba(255,255,255,.08); }

/* ---------- 主内容区 ---------- */
#content { flex: 1; min-width: 0; padding: 28px 40px 60px; max-width: 1100px; }

#page-head { margin-bottom: 26px; }
.breadcrumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumb b { color: var(--accent-dark); font-weight: 600; }
.head-row { display: flex; gap: 18px; align-items: flex-start; }
.head-num {
  font-size: 44px; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  flex-shrink: 0; margin-top: 4px;
}
.head-text h2 { font-size: 26px; color: #111a2e; line-height: 1.35; }
.head-text p { color: var(--text-muted); font-size: 14.5px; margin-top: 8px; }
.page-meta { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 12px; padding: 3px 10px; border-radius: 20px;
  background: #eef1f8; color: #44536b;
}
.chip.tag { background: rgba(124,108,240,.12); color: var(--accent-dark); }

#page-body { margin-bottom: 30px; }

section { margin-bottom: 34px; }
.section-heading {
  font-size: 19px; color: #111a2e;
  border-left: 4px solid var(--accent);
  padding-left: 12px; margin-bottom: 14px; line-height: 1.4;
}

p { margin: 8px 0; }
ul, ol { margin: 8px 0 8px 22px; }
li { margin: 4px 0; }
strong { color: #101a30; }
code.inline-code {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 12px 0; }
table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  background: var(--card-bg); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
th {
  background: #f0f2fa; color: #33405c; text-align: left;
  padding: 9px 12px; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8f9fd; }

/* ---------- 提示块 ---------- */
.callout {
  border-radius: 8px; padding: 12px 14px; margin: 12px 0;
  font-size: 14px; border-left: 4px solid;
}
.callout b { display: inline; }
.callout.info { background: #eef6ff; border-color: #3b82f6; }
.callout.warn { background: #fff8ec; border-color: #f59e0b; }
.callout.key { background: #f3f0ff; border-color: var(--accent); }
.callout.ok { background: #eefbf3; border-color: #10b981; }

/* ---------- 卡片 ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px; margin: 12px 0;
}
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
  box-shadow: var(--shadow);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.12); }
.card-icon { font-size: 22px; margin-bottom: 6px; }
.card h4 { font-size: 14.5px; color: #111a2e; margin-bottom: 4px; }
.card p { font-size: 12.5px; color: var(--text-muted); margin: 0; line-height: 1.6; }

/* ---------- 厂商/产品档案卡片 ---------- */
.platform-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.platform-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.platform-card.open { border-color: rgba(124,108,240,.5); }
.pc-head {
  display: flex; gap: 10px; align-items: center;
  padding: 11px 16px; cursor: pointer; user-select: none;
  background: linear-gradient(90deg, #f7f6ff, #fbfcff);
}
.pc-head:hover { background: #f1efff; }
.pc-head h4 { font-size: 15px; color: #111a2e; flex: 1; }
.pc-tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px;
  background: rgba(124,108,240,.12); color: var(--accent-dark);
}
.pc-arrow { color: var(--text-muted); font-size: 12px; transition: transform .15s; }
.platform-card.open .pc-arrow { transform: rotate(90deg); }
.pc-body { display: none; padding: 4px 18px 16px; }
.platform-card.open .pc-body { display: block; }
.pc-field { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.pc-field:last-child { border-bottom: none; }
.pc-field .f-label {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  margin-bottom: 2px; letter-spacing: .02em;
}
.pc-field p { margin: 2px 0; }
.pc-field ul { margin: 2px 0 2px 18px; }
.pc-field li { font-size: 13.5px; margin: 2px 0; }

/* ---------- 搜索结果 ---------- */
#search-results { display: none; }
#search-results.show { display: block; }
.result-item {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; margin: 10px 0; cursor: pointer;
}
.result-item:hover { border-color: var(--accent); }
.r-title { font-size: 14.5px; color: #111a2e; font-weight: 600; }
.r-path { font-size: 11.5px; color: var(--accent-dark); margin: 2px 0; }
.r-snip { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.r-snip mark.hit, .r-title mark.hit {
  background: rgba(124,108,240,.18); color: var(--accent-dark);
  font-weight: 600; padding: 0 2px; border-radius: 3px;
}
.search-note { font-size: 12.5px; color: var(--text-muted); margin: -4px 0 10px; }

/* ---------- 页脚 ---------- */
#page-footer { border-top: 1px solid var(--border); padding-top: 18px; }
.foot-block { margin-bottom: 16px; }
.foot-block h5 { font-size: 13px; color: #33405c; margin-bottom: 6px; }
.foot-block ul { margin: 0 0 0 18px; }
.foot-block li { font-size: 12.5px; color: var(--text-muted); margin: 3px 0; }

/* ---------- 二级导航目录 ---------- */
.nav-ch-wrap { position: relative; }
.nav-item { cursor: pointer; }
.nav-item.has-children .nav-arrow {
  margin-left: auto; font-size: 10px; color: #7d91ab;
  transition: transform .18s; flex-shrink: 0; padding-left: 6px;
}
.nav-item.open .nav-arrow { transform: rotate(90deg); color: var(--accent-2); }
.nav-item.has-children.active { background: var(--sidebar-active); }
.nav-children {
  display: none; margin: 2px 0 4px; padding: 2px 0 2px 14px;
  border-left: 1px solid rgba(255,255,255,.09); margin-left: 22px;
}
.nav-children.open { display: block; }
.nav-child {
  display: flex; gap: 7px; align-items: baseline;
  padding: 4px 8px; margin: 1px 0; border-radius: 6px;
  cursor: pointer; font-size: 12.5px; line-height: 1.55;
  color: #a9bad2; transition: background .12s, color .12s;
}
.nav-child .child-num { font-size: 9px; color: #6f85a5; flex-shrink: 0; }
.nav-child:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-child.active { color: var(--accent-2); }

/* 小节跳转高亮闪烁 */
@keyframes secFlash {
  0%   { background: rgba(124,108,240,.14); }
  100% { background: transparent; }
}
#page-body section.sec-flash {
  border-radius: 10px;
  animation: secFlash 2.2s ease-out;
}
#page-body section.sec-flash > .section-heading { border-left-color: var(--accent-2); }

/* 锚点跳转时为顶部工具条留出空间 */
#page-body section { scroll-margin-top: 18px; }

/* ---------- 移动端 ---------- */
#menu-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 60;
  background: var(--sidebar-bg); color: #fff; border: none;
  padding: 8px 14px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
@media (max-width: 860px) {
  #menu-toggle { display: block; }
  #sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; height: 100vh;
    transform: translateX(-100%); transition: transform .2s;
    box-shadow: 4px 0 20px rgba(0,0,0,.2);
  }
  #sidebar.open { transform: translateX(0); }
  #content { padding: 56px 18px 40px; }
  .head-num { font-size: 32px; }
  .head-text h2 { font-size: 21px; }
  #page-body section { scroll-margin-top: 64px; }
}
