:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-card: #ffffff;
  --text: #1f2328;
  --text-muted: #656d76;
  --text-invert: #f0f6fc;
  --border: #d0d7de;
  --border-muted: #eaeef2;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: #eef2ff;
  --code-bg: #f6f8fa;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.6;
}
code, pre { font-family: "SF Mono", "Fira Code", Consolas, "Liberation Mono", monospace; }

/* hero */
.hero {
  background: linear-gradient(135deg, #0d1117 0%, #1a2332 100%);
  color: var(--text-invert);
  padding: 96px 24px 72px;
  text-align: center;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero p { margin: 0 auto 28px; max-width: 560px; font-size: 18px; color: #c9d1d9; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.08); color: var(--text-invert); border-color: rgba(255,255,255,.2); }
.btn-ghost:hover { background: rgba(255,255,255,.14); }

/* 主体 */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.section-title { font-size: 28px; font-weight: 700; margin: 56px 0 8px; }
.section-sub { color: var(--text-muted); margin: 0 0 24px; }

/* 卡片网格 */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,.1), 0 16px 40px rgba(0,0,0,.1); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 20px; font-weight: 700; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.badge-archetype { background: #ecfdf5; color: #047857; }
.card-desc { color: var(--text-muted); font-size: 14px; margin: 0 0 16px; flex: 1; }
.card-actions { display: flex; gap: 8px; }
.card-actions a { font-size: 14px; padding: 8px 14px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }

/* 详情页 */
.detail-header {
  background: linear-gradient(135deg, #0d1117 0%, #1a2332 100%);
  color: var(--text-invert);
  padding: 64px 24px 40px;
}
.detail-header a.back { color: #8b949e; font-size: 14px; text-decoration: none; }
.detail-header a.back:hover { color: var(--text-invert); }
.detail-header h1 { margin: 12px 0 8px; font-size: 36px; font-weight: 800; }
.detail-header .badges { display: flex; gap: 8px; margin-top: 12px; }
.detail-header .badge { background: rgba(99,102,241,.25); color: #c7d2fe; }
.detail-header .badge-archetype { background: rgba(16,185,129,.25); color: #a7f3d0; }

.detail-body { max-width: 820px; margin: 0 auto; padding: 40px 24px 80px; }
.detail-section { margin-bottom: 40px; }
.detail-section h2 { font-size: 20px; font-weight: 700; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-muted); }

/* chip 标签 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-radius: 999px;
  font-size: 13px;
}

/* capabilities 列表 */
.cap-list { list-style: none; padding: 0; margin: 0; }
.cap-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-muted);
  font-size: 14px;
  color: var(--text);
}
.cap-list li:last-child { border-bottom: none; }
.cap-list li::before { content: "✓ "; color: #10b981; font-weight: 700; }

/* 代码块 + 复制按钮 */
.code-block {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}
.code-block pre { margin: 0; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
}
.copy-btn:hover { background: var(--accent-soft); color: var(--accent-hover); border-color: var(--accent); }
.copy-btn.copied { background: #ecfdf5; color: #047857; border-color: #10b981; }

/* 目录树 */
.tree {
  background: var(--code-bg);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  padding: 16px;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}
.tree ul { list-style: none; padding-left: 0; margin: 0; }
.tree ul ul { padding-left: 20px; }
.tree-dir span { color: var(--accent-hover); font-weight: 600; }
.tree-file span { color: var(--text-muted); }
.tree-empty { color: var(--text-muted); margin: 0; }

/* 两个目录树并排 */
.tree-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tree-grid h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--text-muted); }

/* 例子卡片 */
.examples-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.example-card {
  background: var(--code-bg);
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  padding: 14px 16px;
}
.example-card .prompt { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.example-card .desc { color: var(--text-muted); font-size: 13px; font-family: "SF Mono", monospace; }

/* 底部 */
.footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-muted);
}
.footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 720px) {
  .hero { padding: 64px 20px 48px; }
  .hero h1 { font-size: 36px; }
  .cards { grid-template-columns: 1fr; }
  .tree-grid { grid-template-columns: 1fr; }
}
