/* 设计系统：浅色现代资讯媒体风 */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #fafbfd;
  --surface-tint: #f0f4fb;
  --ink: #16222f;
  --ink-2: #48586b;
  --ink-3: #8794a4;
  --line: #e5eaf1;
  --line-strong: #d5dde8;
  --brand: #1d4ed8;
  --brand-deep: #1535a8;
  --brand-soft: #eef3ff;
  --accent: #d4523f;
  --success: #0e8c7f;
  --warning: #b7791f;
  --danger: #c0392b;
  --radius-s: 8px;
  --radius: 14px;
  --radius-l: 20px;
  --shadow-s: 0 1px 2px rgba(22, 34, 47, .04);
  --shadow: 0 1px 2px rgba(22, 34, 47, .04), 0 10px 30px rgba(22, 34, 47, .055);
  --shadow-hover: 0 2px 6px rgba(22, 34, 47, .06), 0 18px 44px rgba(22, 34, 47, .10);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 750; letter-spacing: -.022em; line-height: 1.32; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

::selection { background: #dbe6ff; color: var(--brand-deep); }

.ic { flex: none; vertical-align: middle; }

.container { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
@media (max-width: 720px) { .container { width: calc(100% - 32px); } }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  padding: 9px 15px; border-radius: var(--radius-s); font-size: 13.5px; font-weight: 600;
  transition: .18s ease; white-space: nowrap;
}
.btn:hover { border-color: #b9c8de; color: var(--brand); background: var(--surface-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(29, 78, 216, .18); }
.btn--primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-tint); border-color: transparent; }
.btn--danger { color: var(--danger); border-color: #f0d7d3; background: #fff; }
.btn--danger:hover { background: #fdf3f2; border-color: #e8b9b3; color: var(--danger); }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn--lg { padding: 12px 20px; font-size: 14.5px; }
.btn--block { width: 100%; }

/* ---------- 标签 / 徽标 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  transition: .18s ease;
}
.chip:hover { border-color: #b9c8de; color: var(--brand); }
.chip--active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(29, 78, 216, .18); }
.chip--active:hover { color: #fff; background: var(--brand-deep); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  padding: 4px 10px; border-radius: 5px;
  background: var(--brand-soft); color: var(--brand);
}
.pill--solid { color: #fff; }
.pill--outline { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.32); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- 封面占位（无外链图时按栏目色生成） ---------- */
.cover {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(circle at 82% 16%, rgba(255,255,255,.30) 0%, transparent 44%),
    radial-gradient(circle at 12% 88%, rgba(255,255,255,.14) 0%, transparent 38%),
    linear-gradient(var(--cover-angle, 128deg), var(--cover-accent, #2C5FD0) 0%, #16294a 100%);
  color: #fff;
}
.cover::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: repeating-linear-gradient(125deg, rgba(255,255,255,.06) 0 1px, transparent 1px 22px);
}
.cover::after {
  content: ''; position: absolute; right: -56px; bottom: -96px; width: 230px; height: 230px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255,255,255,.045), 0 0 0 76px rgba(255,255,255,.035);
}
.cover__glyph {
  position: absolute; right: 18px; bottom: 4px; font-size: 92px; font-weight: 800;
  line-height: 1; color: rgba(255,255,255,.13); letter-spacing: -.08em; user-select: none;
}
.cover--img { background-size: contain; background-position: center; background-repeat: no-repeat; background-color: var(--surface-soft); }
.cover--img::before, .cover--img::after, .cover--img .cover__glyph { display: none; }

/* ---------- 状态 / 反馈 ---------- */
.state {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 36px 32px; text-align: center; color: var(--ink-2);
}
.state__icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  margin: 0 auto 16px; background: var(--brand-soft); color: var(--brand);
}
.state h3 { font-size: 17px; margin-bottom: 8px; color: var(--ink); }
.state p { font-size: 13.5px; line-height: 1.8; max-width: 520px; margin: 0 auto 18px; color: var(--ink-3); }
.state--error .state__icon { background: #fdf0ee; color: var(--accent); }

.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #e3e9f1 50%, #eef1f6 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.boot { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--ink-3); font-size: 14px; }
.boot-mark { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); position: relative; animation: bob 1.3s ease-in-out infinite; }
.boot-mark::after { content: ''; position: absolute; inset: 11px; border: 2px solid #fff; border-radius: 4px; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: #1b2a3d; color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 12px 34px rgba(16, 28, 44, .22);
  opacity: 0; pointer-events: none; transition: .25s ease; z-index: 999; max-width: min(90vw, 560px);
}
.toast--show { opacity: 1; transform: translate(-50%, 0); }
.toast--error { background: #a83b2e; }
.toast--success { background: #12695f; }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.spacer { flex: 1; }

/* ---------- Markdown 正文 ---------- */
.prose { font-size: 16px; line-height: 1.92; color: #27364a; }
.prose .md-h { margin: 34px 0 14px; color: var(--ink); }
.prose .md-h2 { font-size: 22px; padding-left: 14px; border-left: 4px solid var(--brand); }
.prose .md-h3 { font-size: 18.5px; }
.prose .md-h4 { font-size: 16.5px; }
.prose .md-p { margin: 0 0 18px; }
.prose .md-list { margin: 0 0 20px; padding-left: 22px; }
.prose .md-list li { margin-bottom: 9px; padding-left: 3px; }
.prose .md-list li::marker { color: var(--brand); font-weight: 700; }
.prose .md-quote {
  margin: 0 0 20px; padding: 14px 18px; border-left: 3px solid var(--brand);
  background: var(--surface-tint); border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--ink-2); font-size: 14.5px;
}
.prose .md-code { background: #eef2f8; color: var(--brand-deep); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: .88em; }
.prose .md-pre { background: #f3f6fa; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 16px 18px; overflow-x: auto; margin: 0 0 20px; font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.prose .md-table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.prose .md-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose .md-table th { background: var(--surface-tint); text-align: left; padding: 11px 14px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose .md-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.prose .md-table tr:last-child td { border-bottom: 0; }
.prose .md-hr { height: 1px; background: var(--line); border: 0; margin: 30px 0; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink); font-weight: 750; }
.prose .md-img { border-radius: var(--radius-s); margin: 6px 0 20px; display: block; max-width: 100%; height: auto; border: 1px solid var(--line); }
.prose .md-figure { margin: 0 0 24px; }
.prose .md-video { display: block; width: 100%; max-width: 100%; max-height: 520px; background: #0d1726; border-radius: var(--radius-s); }
.prose .md-embed { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--radius-s); overflow: hidden; background: #0d1726; }
.prose .md-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose .md-figure__cap { margin-top: 10px; text-align: center; font-size: 13px; color: var(--ink-3); line-height: 1.6; }
