/* ========================================
   AI 漫剧工厂 - 统一文档站样式
   设计参考: Apple.com 风格
    - 清晰排版 · 充足留白 · 极简配色
   ======================================== */

/* --- CSS 变量 --- */
:root {
  --bg-page: #0d1117;
  --bg-surface: #161b22;
  --bg-surface2: #1c2333;
  --bg-surface3: #21262d;
  --bg-code: #161b22;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-tertiary: #6e7681;
  --text-accent: #58a6ff;
  --text-link: #58a6ff;
  --border: #30363d;
  --border-light: #21262d;
  --accent: #58a6ff;
  --accent-dark: #1f6feb;
  --green: #3fb950;
  --green-bg: rgba(63,185,80,0.15);
  --yellow: #d29922;
  --yellow-bg: rgba(210,153,34,0.15);
  --red: #f85149;
  --red-bg: rgba(248,81,73,0.15);
  --blue: #58a6ff;
  --blue-bg: rgba(88,166,255,0.12);
  --purple: #bc8cff;
  --purple-bg: rgba(188,140,255,0.15);
  --orange: #d29922;
  --orange-bg: rgba(210,153,34,0.15);
  --pink: #f778ba;
  --pink-bg: rgba(247,120,186,0.15);
  --cyan: #76e3ea;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --font-sans: -apple-system, "SF Pro Display", "Helvetica Neue", "Noto Sans SC", BlinkMacSystemFont, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Fira Code", Menlo, monospace;
}

/* --- 基础重置 --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--accent-dark); }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-code);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

/* --- 导航栏 --- */
.navbar {
  background: rgba(13,17,23,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.navbar .brand {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  margin-right: 24px;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.navbar .brand small {
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: 12px;
  margin-left: 4px;
}
.navbar a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  white-space: nowrap;
}
.navbar a:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.navbar a.active { color: var(--accent); background: rgba(88,166,255,0.15); }

/* --- 主体容器 --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* --- 标题 --- */
h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--text-primary);
}
h1 small {
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: 20px;
  letter-spacing: 0;
  margin-left: 8px;
}
.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 40px;
  padding-left: 0;
  border-left: none;
  line-height: 1.4;
}
.subtitle code {
  font-size: 0.85em;
}

/* --- 统计栏 --- */
.stats {
  display: flex;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 22px;
  flex: 1;
  min-width: 100px;
  text-align: center;
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); }
.stat-card .num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-card .label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
  font-weight: 500;
}
.stat-card.blue .num { color: var(--accent); }
.stat-card.green .num { color: var(--green); }
.stat-card.yellow .num { color: var(--yellow); }
.stat-card.orange .num { color: var(--orange); }
.stat-card.purple .num { color: var(--purple); }
.stat-card.pink .num { color: var(--pink); }
.stat-card.cyan .num { color: var(--cyan); }
.stat-card.red .num { color: var(--red); }

/* --- 区块分类标题 --- */
.category { margin-bottom: 48px; }
.category h2 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.category h2 .count {
  font-weight: 400;
  color: var(--text-tertiary);
  background: var(--bg-surface2);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

/* --- 卡片网格 --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
.card .header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.card .name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.card .name code { font-size: 0.9em; }
.card .alias {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 4px;
}
.card .filepath {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  background: var(--bg-surface2);
  padding: 2px 8px;
  border-radius: 4px;
}
.card .desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}
.card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

/* --- 标签 --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-dev { background: var(--green-bg); color: var(--green); }
.badge-ndev { background: var(--red-bg); color: var(--red); }
.badge-planned { background: var(--yellow-bg); color: var(--yellow); }
.badge-cat {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}
.badge-cat-core { background: var(--blue-bg); color: var(--accent); }
.badge-cat-review { background: var(--purple-bg); color: var(--purple); }
.badge-cat-knowledge { background: var(--green-bg); color: var(--green); }
.badge-cat-marketing { background: var(--orange-bg); color: var(--orange); }
.badge-cat-support { background: rgba(188,140,255,0.12); color: var(--purple); }
.badge-cat-future { background: var(--pink-bg); color: var(--pink); }
.badge-field {
  font-size: 11px;
  color: var(--accent);
  background: var(--blue-bg);
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

/* --- 模型类型标签 --- */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.type-llm { background: var(--blue-bg); color: var(--accent); }
.type-image { background: var(--purple-bg); color: var(--purple); }
.type-video { background: var(--green-bg); color: var(--green); }
.type-audio { background: var(--orange-bg); color: var(--orange); }
.type-lipsync { background: var(--pink-bg); color: var(--pink); }
.type-tool { background: rgba(0,168,168,0.12); color: #56d4d4; }
.type-encoder { background: var(--yellow-bg); color: var(--yellow); }

/* --- 使用说明块 --- */
.usage-box {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.usage-label {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 2px;
}

/* --- 字段列表 --- */
.field-list {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.8;
  padding: 8px 10px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  max-height: 100px;
  overflow-y: auto;
}
.field-list::-webkit-scrollbar { width: 4px; }
.field-list::-webkit-scrollbar-track { background: transparent; }
.field-list::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* --- API 专用样式 --- */
.api-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.api-group-header {
  padding: 12px 20px;
  background: var(--bg-surface2);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.api-group-header:hover { background: var(--bg-surface3); }
.api-group-header .tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.api-group-header .tag.green  { background: var(--green-bg); color: var(--green); }
.api-group-header .tag.blue   { background: var(--blue-bg); color: var(--accent); }
.api-group-header .tag.purple { background: var(--purple-bg); color: var(--purple); }
.api-group-header .tag.orange { background: var(--orange-bg); color: var(--orange); }
.api-group-header .tag.red    { background: var(--red-bg); color: var(--red); }
.api-group-header .name { font-size: 14px; font-weight: 600; flex: 1; }
.api-group-header .count { font-size: 11px; color: var(--text-tertiary); }
.api-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.api-row:last-child { border-bottom: none; }
.api-row:hover { background: var(--bg-surface2); }
.method {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
  min-width: 52px;
  text-align: center;
  font-family: var(--font-mono);
}
.get { background: var(--blue-bg); color: var(--accent); }
.post { background: var(--green-bg); color: var(--green); }
.put { background: var(--orange-bg); color: var(--orange); }
.delete { background: var(--red-bg); color: var(--red); }
.patch { background: var(--purple-bg); color: var(--purple); }
.api-path, .path { font-family: var(--font-mono); font-size: 12px; flex: 1; color: var(--text-primary); }
.api-path code, .path code { color: var(--accent); font-weight: 500; }
.api-desc, .desc { color: var(--text-secondary); font-size: 12px; min-width: 120px; text-align: right; }

/* --- 工作流 / 路线图 样式 --- */
.tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  margin-right: 3px;
  margin-top: 4px;
}
.tag.green  { background: var(--green-bg); color: var(--green); }
.tag.blue   { background: var(--blue-bg); color: var(--accent); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }
.tag.orange { background: var(--orange-bg); color: var(--orange); }
.tag.red    { background: var(--red-bg); color: var(--red); }
.tag.gray   { background: var(--bg-surface2); color: var(--text-tertiary); }
.tag.pink   { background: var(--pink-bg); color: var(--pink); }

/* --- 阶段卡片（工作流/路线图/PRD） --- */
.phase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
}
.phase-card-header {
  padding: 14px 22px;
  background: var(--bg-surface2);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
}
.phase-card-header .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--blue-bg);
  border: 1px solid var(--accent);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.phase-card-header .host {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--blue-bg);
  padding: 2px 10px;
  border-radius: 10px;
  margin-left: 4px;
}
.phase-card-header .worker-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--purple);
  background: var(--purple-bg);
  padding: 2px 10px;
  border-radius: 10px;
  margin-left: 4px;
}
.phase-card-body {
  padding: 18px 22px;
}
.phase-card-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}
.phase-card-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}
.phase-card-body li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 16px;
  position: relative;
}
.phase-card-body li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--accent);
}

/* 步骤网格 */
.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.step-card {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.step-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.step-card .title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
  margin-bottom: 5px;
}
.step-card .title .new {
  color: var(--orange);
  font-size: 10px;
  margin-left: 6px;
  font-weight: 600;
  background: var(--orange-bg);
  padding: 1px 6px;
  border-radius: 8px;
}
.step-card .desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 机器卡片 */
.machine-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.machine-card {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
}
.machine-card.main {
  border-left: 3px solid var(--accent);
}
.machine-card.worker {
  border-left: 3px solid var(--purple);
}
.machine-card .name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.machine-card .name .badge {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 500;
}
.machine-card.main .badge {
  background: var(--blue-bg);
  color: var(--accent);
}
.machine-card.worker .badge {
  background: var(--purple-bg);
  color: var(--purple);
}
.machine-card .specs {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.machine-card .services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.machine-card .srv {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--bg-surface2);
  border: 1px solid var(--border-light);
}
.machine-card.worker .srv {
  background: var(--purple-bg);
  border-color: var(--border-light);
  color: var(--purple);
}

/* 箭头行 */
.arrow-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0 16px;
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 500;
  gap: 6px;
}
.arrow-row::before,
.arrow-row::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  max-width: 80px;
}

/* DAG 管道 */
.dag-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0;
}
.dag-node {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.dag-node.optional {
  border-style: dashed;
  color: var(--text-tertiary);
}
.dag-arrow {
  font-size: 16px;
  color: var(--text-tertiary);
  font-weight: 300;
}
.dag-optional {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 4px 10px;
  background: var(--bg-page);
  border-radius: 12px;
  font-weight: 500;
}

/* 约束框 */
.constraint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.constraint-box {
  background: var(--bg-page);
  border: 1px dashed var(--orange);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.constraint-box .ctitle {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--orange);
  margin-bottom: 8px;
}
.constraint-box .item {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 10px;
  border-left: 2px solid var(--orange);
  margin-bottom: 2px;
  opacity: 0.8;
}

/* 数据流框 */
.dataflow-box {
  background: var(--bg-page);
  border: 1px dashed var(--green);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 12px;
}
.dataflow-box .dftitle {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--green);
  margin-bottom: 8px;
}
.dataflow-box .item {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 10px;
  border-left: 2px solid var(--green);
  margin-bottom: 2px;
}

/* 对比表 */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12.5px;
}
.compare-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-page);
  border-bottom: 2px solid var(--border-light);
  color: var(--text-tertiary);
  font-weight: 500;
}
.compare-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}
.compare-table .win  { color: var(--green); font-weight: 600; }
.compare-table .lose { color: var(--red); }
.compare-table .mid  { color: var(--orange); }

/* 服务列表 */
.services-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.service-card {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
}
.service-card .sname { font-weight: 600; color: var(--text-primary); }
.service-card .sdetail { color: var(--text-secondary); font-size: 11px; margin-top: 2px; }
.service-card .smachine { font-size: 10px; color: var(--purple); margin-top: 2px; }

/* 退役标记 */
.retired {
  opacity: 0.4;
  position: relative;
}
.retired::after {
  content: "退役";
  position: absolute;
  top: -4px; right: -4px;
  font-size: 9px;
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid var(--red);
  border-radius: 4px;
  padding: 0 5px;
}

/* 目录/导航（PRD/用户指南） */
.toc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.toc-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.toc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 13px;
}
.toc-grid a {
  color: var(--text-link);
  text-decoration: none;
  display: block;
  padding: 4px 8px;
  border-radius: 4px;
}
.toc-grid a:hover {
  background: var(--bg-surface2);
}

/* 步骤列表 */
.steps-list {
  list-style: none;
  padding: 0;
}
.step-item {
  padding: 10px 14px;
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.step-item .snum {
  display: inline-block;
  width: 22px; height: 22px;
  background: var(--blue-bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-align: center;
  line-height: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-right: 8px;
}
.step-item .stitle {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

/* 状态标签（路线图） */
.status-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 500;
}
.status-pending   { background: var(--bg-surface2); color: var(--text-tertiary); border: 1px solid var(--border-light); }
.status-planned  { background: var(--blue-bg); color: var(--accent); border: 1px solid var(--accent); }
.status-progress { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange); }
.status-done     { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.status-cancel   { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }

/* 最后的更新时间 */
.last-updated {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  margin-bottom: 28px;
}

/* ===== 路线图专用样式 ===== */

/* 图例 */
.legend {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.legend-item {
  display: inline-flex;
  align-items: center;
}

/* 前提条件框 */
.risk-box {
  background: var(--orange-bg);
  border: 1px solid var(--orange);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
}
.rtitle {
  font-weight: 600;
  font-size: 14px;
  color: var(--orange);
  margin-bottom: 10px;
}
.ritem {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 12px;
  border-left: 2px solid var(--orange);
  margin-bottom: 4px;
  opacity: 0.9;
}

/* Phase 编号（路线图） */
.phase-card-header .num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--blue-bg);
  color: var(--accent);
}
.phase-card-header .num.p2 { background: var(--purple-bg); color: var(--purple); }
.phase-card-header .num.p3 { background: var(--green-bg); color: var(--green); }
.phase-card-header .num.p4 { background: var(--orange-bg); color: var(--orange); }

/* Phase header info block */
.phase-card-header .info { flex: 1; min-width: 0; }
.phase-card-header .info .name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.phase-card-header .info .meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.phase-card-header .actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.phase-card-header .dep {
  font-size: 10px;
  color: var(--text-tertiary);
  max-width: 160px;
  text-align: right;
  line-height: 1.4;
}

/* 任务表格 */
.task-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.task-table th {
  text-align: left;
  padding: 6px 8px;
  background: var(--bg-surface2);
  border-bottom: 2px solid var(--border-light);
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 11px;
}
.task-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: top;
  line-height: 1.5;
}
.col-check { width: 32px; text-align: center; }
.col-id { width: 52px; font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.col-name { min-width: 180px; }
.col-file { width: 160px; font-size: 11px; font-family: var(--font-mono); color: var(--text-tertiary); word-break: break-all; }
.col-est { width: 60px; text-align: center; font-size: 11px; color: var(--text-tertiary); }
.col-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; line-height: 1.5; }
.pending-mark { font-size: 16px; color: var(--border); }

/* 里程碑行 */
.milestone-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  background: var(--green-bg);
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
}
.milestone-row .icon { font-size: 18px; }
.milestone-row .text { font-size: 12.5px; color: var(--text-primary); flex: 1; line-height: 1.5; }
.milestone-row .hl { color: var(--green); font-weight: 600; }
.tag-go {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green);
}

/* ===== PRD 专用样式 ===== */
.highlight {
  background: var(--blue-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin: 12px 0;
  line-height: 1.6;
}
.arch-note {
  background: var(--purple-bg);
  border: 1px solid var(--purple);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-primary);
  margin: 12px 0;
  line-height: 1.6;
}

/* ===== 用户指南专用样式 ===== */
/* 用户指南：header 内的 icon 和 name */
.phase-card-header .icon { font-size: 18px; flex-shrink: 0; }
.phase-card-header .name { font-size: 15px; font-weight: 600; color: var(--text-primary); }

/* 步骤容器 */
.steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sdesc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 3px;
  padding-left: 30px;
}

/* 提示框 */
.tip {
  background: var(--yellow-bg);
  border: 1px solid var(--yellow);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.6;
  margin-top: 12px;
}

/* ===== 预告行 ===== */
.teaser {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* 阶段右下角标签 */
.phase-tag-right {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-tertiary);
}
.phase-tag-right .new-label {
  color: var(--orange);
  font-weight: 600;
  background: var(--orange-bg);
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 11px;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .container { padding: 28px 16px 60px; }
  .navbar { overflow-x: auto; gap: 0; padding: 0 12px; }
  .navbar .brand { margin-right: 12px; font-size: 13px; }
  .navbar a { font-size: 11px; padding: 8px 8px; }
  .card-grid { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  h1 small { font-size: 16px; display: block; margin-left: 0; }
  .stat-card { min-width: 70px; padding: 10px 14px; }
  .stat-card .num { font-size: 22px; }
}
