:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --surface: #ffffff;
  --text: #0a0a0b;
  --text-2: #3f3f46;
  --muted: #71717a;
  --line: rgba(9, 9, 11, 0.08);
  --line-strong: rgba(9, 9, 11, 0.14);
  --brand: #2f6fed;
  --brand-ink: #1d4ed8;
  --brand-soft: rgba(47, 111, 237, 0.09);
  --ink: #0a0a0b;
  --r-pill: 999px;
  --r-card: 22px;
  --r-input: 13px;
  --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.05);
  --shadow-md: 0 6px 22px rgba(9, 9, 11, 0.06), 0 1px 3px rgba(9, 9, 11, 0.04);
  --shadow-lg: 0 18px 50px rgba(9, 9, 11, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Geist", -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  line-height: 1.62;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 顶部粉彩渐变晕染 */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 520px;
  z-index: -1;
  background:
    radial-gradient(520px 320px at 12% -8%, rgba(47, 111, 237, 0.10), transparent 60%),
    radial-gradient(480px 300px at 88% -14%, rgba(168, 130, 255, 0.12), transparent 60%),
    radial-gradient(420px 260px at 60% -20%, rgba(255, 175, 138, 0.10), transparent 62%);
  pointer-events: none;
}

/* ---------- 外壳:侧栏 + 主区 ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: 244px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: saturate(180%) blur(14px);
  z-index: 20;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 20px; }
.logo { font-size: 22px; color: var(--brand); line-height: 1; }
.side-brand .brand-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.side-brand .brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

.skill-nav { flex: 1; }
.nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 0 10px 8px;
}
.skill-nav ul { list-style: none; margin: 0; padding: 0; }
.skill-nav li {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 4px;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.skill-nav li:hover { background: rgba(9, 9, 11, 0.035); }
.skill-nav li.active { background: var(--brand-soft); border-color: rgba(47, 111, 237, 0.18); }
.skill-nav .s-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 9px;
  background: #fff; border: 1px solid var(--line);
  color: var(--brand); font-size: 14px;
}
.skill-nav li.active .s-icon { background: var(--ink); color: #fff; border-color: var(--ink); }
.skill-nav .s-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.skill-nav .s-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.skill-nav .s-en { font-size: 11px; color: var(--muted); }
.skill-nav .s-count {
  font-size: 11px; color: var(--muted);
  background: rgba(9, 9, 11, 0.05); border-radius: 999px;
  min-width: 20px; text-align: center; padding: 1px 6px;
}
.skill-nav li.active .s-count { background: rgba(47, 111, 237, 0.16); color: var(--brand-ink); }

.side-foot { padding: 12px 10px 4px; border-top: 1px solid var(--line); }
.side-foot .soon { font-size: 12px; color: var(--muted); }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- 顶栏(主区内) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 13px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
}
.project-switcher { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; font-family: inherit; font-size: 13px; line-height: 1.25; color: var(--brand-ink); font-weight: 500; }
.project-switcher-label { letter-spacing: .02em; }
.project-switcher select { min-width: 178px; max-width: 220px; margin: 0; padding: 8px 30px 8px 11px; font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.25; color: var(--text-2); background-color: #fff; border-color: rgba(47, 111, 237, .32); box-shadow: 0 0 0 3px rgba(47, 111, 237, .06); }
.new-project-btn { border: 1px solid #2563eb; border-radius: 10px; background: linear-gradient(135deg, #2f6fed, #5b52e8); color: #fff; padding: 8px 13px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 5px 13px rgba(47, 111, 237, .22); transition: transform .15s, box-shadow .15s; }
.new-project-btn:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(47, 111, 237, .32); }

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(9, 9, 11, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
.tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 7px 18px;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 54px 24px 30px;
  max-width: 780px;
  margin: 0 auto;
}
.badge {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border: 1px solid rgba(47, 111, 237, 0.18);
  padding: 5px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 20px;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 44px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.hero .grad {
  background: linear-gradient(100deg, var(--brand) 10%, #8b5cf6 55%, #f0883e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 620px;
  margin-inline: auto;
}
.weak-hint { font-style: italic; line-height: 1.65; }

/* ---------- 布局 ---------- */
main { padding: 8px 30px 40px; max-width: 1200px; margin: 0 auto; }
.view { display: none; animation: fade 0.3s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 未进入项目时，技能中心保持锁定，避免任何跨项目操作。 */
.project-gate { display: none; max-width: 610px; margin: 78px auto 40px; padding: 48px 28px; text-align: center; border: 1px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.88); box-shadow: var(--shadow-lg); }
.project-gate-icon { display: grid; width: 48px; height: 48px; place-items: center; margin: 0 auto 17px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); font-size: 24px; }
.project-gate .badge { margin-bottom: 15px; }
.project-gate h1 { margin: 0; font-size: 34px; line-height: 1.16; letter-spacing: -.025em; }
.project-gate p { max-width: 420px; margin: 16px auto 24px; color: var(--muted); font-size: 14px; }
.project-gate .primary { min-width: 170px; }
.project-locked .hero, .project-locked .view { display: none !important; }
.project-locked .project-gate { display: block; }
.project-locked .skill-nav { pointer-events: none; }
.project-locked .skill-nav ul { opacity: .5; }
.skill-locked-note { padding: 10px 11px; color: var(--muted); font-size: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.card h2 { margin: 0 0 16px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.card h2 .muted, .card h2 .sub { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 8px; }

.grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 20px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 20px; }

/* ---------- 表单 ---------- */
.form .hint { color: var(--muted); font-size: 13px; font-style: italic; margin: -8px 0 18px; }
.form code { background: var(--brand-soft); padding: 1px 6px; border-radius: 5px; color: var(--brand-ink); font-size: 12px; }
.form label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 15px; }
.form h2 .sub { color: var(--brand-ink); }
.project-import {
  margin: -3px 0 20px;
  padding: 13px 14px;
  border: 1px solid rgba(47, 111, 237, 0.16);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 111, 237, 0.07), rgba(139, 92, 246, 0.04));
}
.project-import label { margin: 0; }
.project-import-title { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text); }
.project-import .optional {
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.8);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}
#project-select {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.9);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
#project-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.project-import-status { margin-top: 7px; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.project-import-status.active { color: var(--brand-ink); font-weight: 500; }
.project-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); color: var(--text); }
.project-dialog::backdrop { background: rgba(9, 9, 11, .35); backdrop-filter: blur(3px); }
.project-dialog form { padding: 24px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.dialog-heading h2 { margin: 2px 0 0; font-size: 22px; }
.dialog-kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); font-weight: 600; }
.dialog-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(9,9,11,.05); font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.project-dialog p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.project-dialog label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 14px; }
.project-dialog input, .project-dialog textarea { width: 100%; margin-top: 6px; }
.project-dialog .primary { width: 100%; margin-top: 4px; }
.local-upload {
  margin: 2px 0 18px;
  padding: 13px 14px;
  border: 1px dashed rgba(47, 111, 237, 0.3);
  border-radius: 13px;
  background: rgba(47, 111, 237, 0.035);
}
.upload-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.upload-title { color: var(--text); font-size: 13px; font-weight: 650; }
.upload-caption { margin-top: 1px; color: var(--muted); font-size: 11px; font-style: italic; }
.local-upload .optional { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: var(--r-pill); background: rgba(255,255,255,.8); color: var(--muted); font-size: 10px; font-weight: 500; }
.upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form .upload-btn {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid rgba(47, 111, 237, 0.2);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.upload-btn:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.upload-btn input { display: none; }
.upload-clear {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.upload-clear:hover { color: #ef4444; }
.upload-clear.hidden { display: none; }
.upload-help { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.upload-summary {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.upload-summary.active { color: var(--brand-ink); }
.upload-summary.warning { color: #b45309; }
.upload-progress { margin-top: 10px; padding: 9px 10px; border: 1px solid rgba(47, 111, 237, .16); border-radius: 10px; background: rgba(47, 111, 237, .045); }
.upload-progress.hidden { display: none; }
.upload-progress-head { display: flex; justify-content: space-between; gap: 10px; color: var(--brand-ink); font-size: 11.5px; font-weight: 600; }
.upload-progress-track { height: 6px; margin-top: 7px; overflow: hidden; border-radius: var(--r-pill); background: rgba(47, 111, 237, .13); }
.upload-progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #8b5cf6); transition: width .2s ease; }
.upload-progress.done { border-color: rgba(22, 163, 74, .2); background: rgba(22, 163, 74, .05); }
.upload-progress.done .upload-progress-head { color: #166534; }
.upload-progress.done .upload-progress-track { background: rgba(22, 163, 74, .14); }
.upload-progress.done .upload-progress-bar { background: #16a34a; }
.upload-progress.error { border-color: rgba(239, 68, 68, .2); background: rgba(239, 68, 68, .05); }
.upload-progress.error .upload-progress-head { color: #b91c1c; }
.upload-progress.error .upload-progress-track { background: rgba(239, 68, 68, .13); }
.upload-progress.error .upload-progress-bar { background: #ef4444; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.req { color: #ef4444; }
.key {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  margin-left: 4px;
}

input, textarea {
  width: 100%;
  margin-top: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--r-input);
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: #a1a1aa; font-style: italic; }
input:focus, textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

button.primary {
  width: 100%;
  margin-top: 8px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.18s, opacity 0.15s;
  box-shadow: var(--shadow-sm);
}
button.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
button.primary:active { transform: translateY(0); }
button.primary:disabled { opacity: 0.55; cursor: default; transform: none; }

/* ---------- 流水线 ---------- */
.pipeline-list { margin: 0; padding-left: 0; list-style: none; counter-reset: step; }
.pipeline-list li {
  position: relative;
  padding: 12px 14px 12px 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 9px;
  background: var(--bg-soft);
  transition: border-color 0.15s, transform 0.15s;
}
.pipeline-list li:hover { border-color: var(--line-strong); transform: translateX(2px); }
.pipeline-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 13px; top: 14px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px; font-weight: 600;
  display: grid; place-items: center;
}
.pipeline-list .pl-name { font-size: 14px; font-weight: 600; }
.pipeline-list .pl-desc { font-size: 12.5px; color: var(--muted); }
.pipeline-list .pl-out { display: inline-flex; align-items: center; margin: 2px 0 0; padding: 0; border: 0; background: transparent; color: var(--brand); font-family: "Geist", monospace; font-size: 11px; text-align: left; cursor: pointer; }
.pipeline-list .pl-out:hover:not(:disabled) { color: var(--brand-ink); text-decoration: underline; }
.pipeline-list .pl-out:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 3px; }
.pipeline-list .pl-out:disabled { color: #a1a1aa; cursor: default; }
.pipeline-progress {
  margin: -4px 0 14px;
  padding: 11px 12px 5px;
  border: 1px solid rgba(47, 111, 237, 0.16);
  border-radius: 12px;
  background: var(--brand-soft);
}
.pipeline-progress.hidden { display: none; }
.pipeline-progress.error { border-color: rgba(239, 68, 68, .2); background: rgba(239, 68, 68, .06); }
.pipeline-progress-text { color: var(--brand-ink); font-size: 12.5px; line-height: 1.5; }
.pipeline-progress.error .pipeline-progress-text { color: #b91c1c; }
.pipeline-progress .progress { margin: 9px 0 4px; background: rgba(47, 111, 237, .12); }
.pipeline-list.is-running li { transform: none; }
.pipeline-list.is-running li.pg-todo { opacity: .58; }
.pipeline-list.is-running li.pg-todo::before {
  content: "";
  background: transparent;
  border: 1.5px solid #a1a1aa;
}
.pipeline-list.is-running li.pg-cur { border-color: rgba(47, 111, 237, .32); background: var(--brand-soft); }
.pipeline-list.is-running li.pg-cur::before { content: "◐"; background: var(--brand); animation: spin 1.2s linear infinite; }
.pipeline-list.is-running li.pg-done { border-color: rgba(22, 163, 74, .2); background: rgba(22, 163, 74, .045); }
.pipeline-list.is-running li.pg-done::before { content: "✓"; background: #16a34a; }

/* ---------- 结果 ---------- */
/* ---------- 模型选择 ---------- */
.model-row { margin: 6px 0 14px; }
.model-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); }
#model-select {
  width: 100%;
  margin-top: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--r-input);
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
#model-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
#model-select:disabled { color: var(--muted); cursor: default; }

/* ---------- 生成进度 ---------- */
.progress { height: 8px; background: rgba(9,9,11,.06); border-radius: 999px; overflow: hidden; margin: 6px 0 14px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand), #8b5cf6); border-radius: 999px; transition: width 0.4s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

.result.hidden { display: none; }
.result .note {
  background: var(--brand-soft);
  border: 1px solid rgba(47, 111, 237, 0.16);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--brand-ink);
  margin-bottom: 16px;
}
.material-saved {
  margin: -4px 0 15px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 163, 74, .2);
  border-radius: 12px;
  background: rgba(22, 163, 74, .05);
  color: #166534;
  font-size: 12.5px;
  line-height: 1.55;
}
.material-saved code { padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.72); }
.material-saved button, .doc-download button {
  margin-left: 8px;
  padding: 5px 9px;
  border: 1px solid rgba(22, 163, 74, .26);
  border-radius: 8px;
  background: #fff;
  color: #166534;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.brief-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.brief-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.brief-table td.k { color: var(--muted); white-space: nowrap; width: 132px; font-weight: 500; }
.brief-table td.v { color: var(--text); }
.brief-table td.v.empty { color: #a1a1aa; font-style: italic; }
.next { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.err { color: #ef4444; font-size: 14px; }

/* ---------- 运行结果 / 版本管理 ---------- */
.runs-layout { display: block; }
.version-manager { display: flex; align-items: center; gap: 14px; padding: 0 0 17px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.version-heading { display: flex; flex-direction: column; flex: 0 0 auto; line-height: 1.25; font-size: 14px; font-weight: 600; }
.version-hint { margin-top: 3px; font-size: 11px; font-weight: 400; color: var(--muted); }
.version-list { display: flex; flex: 1; gap: 8px; overflow-x: auto; list-style: none; margin: 0; padding: 2px; scrollbar-width: thin; }
.version-list li { min-width: 150px; max-width: 230px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: all .16s; background: var(--bg-soft); }
.version-list li:hover { border-color: var(--brand); background: #fff; box-shadow: var(--shadow-sm); }
.version-list li.active { border-color: var(--brand); background: var(--brand-soft); }
.version-list .r-title { overflow: hidden; color: var(--text-2); font-size: 12.5px; font-weight: 600; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.version-list .r-meta { overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.version-list .placeholder { min-width: auto; padding: 8px 0; border: 0; background: transparent; cursor: default; }

.run-meta { margin-bottom: 16px; }
.run-meta h3 { margin: 0 0 5px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.run-meta .m-line { font-size: 13px; color: var(--muted); }
.run-meta .m-line code { background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; }
.run-meta .m-line.sub { color: var(--text-2); font-weight: 500; margin: 2px 0 4px; }
.run-meta .goal { color: var(--brand-ink); font-weight: 500; margin-top: 2px; }
.doc-download { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 11px; color: var(--text-2); font-size: 12px; font-weight: 600; }
.doc-download[hidden] { display: none; }
.doc-download select { margin: 0; padding: 5px 27px 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--text-2); font: inherit; font-size: 12px; }
.doc-download button { margin-left: 0; border-color: var(--brand); color: var(--brand-ink); }

.doc-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.doc-tabs button {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text-2);
  padding: 6px 13px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.doc-tabs button:hover { border-color: var(--line-strong); color: var(--text); }
.doc-tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.placeholder { color: var(--muted); }

/* ---------- Markdown 渲染 ---------- */
.markdown-body { font-size: 14.5px; color: var(--text-2); }
.markdown-body h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 6px 0 18px; }
.markdown-body h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 28px 0 12px; color: var(--text); }
.markdown-body h3 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; color: var(--text); }
.markdown-body p { margin: 10px 0; }
.markdown-body a { color: var(--brand); text-decoration: none; border-bottom: 1px solid rgba(47, 111, 237, 0.28); }
.markdown-body a:hover { border-bottom-color: var(--brand); }
.markdown-body code { background: var(--bg-soft); border: 1px solid var(--line); padding: 1.5px 6px; border-radius: 6px; font-size: 12.5px; color: var(--brand-ink); }
.markdown-body pre { background: var(--bg-soft); border: 1px solid var(--line); padding: 14px; border-radius: 12px; overflow-x: auto; }
.markdown-body pre code { background: none; border: none; padding: 0; color: var(--text-2); }
.markdown-body blockquote {
  border-left: 3px solid var(--brand);
  margin: 14px 0;
  padding: 6px 16px;
  background: var(--brand-soft);
  border-radius: 0 10px 10px 0;
  color: var(--text-2);
}
.markdown-body ul, .markdown-body ol { padding-left: 22px; }
.markdown-body li { margin: 4px 0; }
.markdown-body hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 13px; display: block; overflow-x: auto; border-radius: 10px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; }
.markdown-body th { background: var(--bg-soft); color: var(--text); font-weight: 600; }
.markdown-body tr:nth-child(even) td { background: #fcfcfd; }

/* ---------- 页脚 ---------- */
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 28px; border-top: 1px solid var(--line); }
.foot code { background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: static; height: auto; width: 100%;
    flex-direction: row; align-items: center; gap: 8px;
    padding: 10px 14px; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .side-brand { padding: 0 12px 0 4px; }
  .skill-nav { flex: none; }
  .nav-label { display: none; }
  .skill-nav ul { display: flex; gap: 8px; }
  .skill-nav li { margin-bottom: 0; white-space: nowrap; }
  .skill-nav .s-count { display: none; }
  .side-foot { display: none; }
}
@media (max-width: 760px) {
  .hero { padding: 40px 16px 24px; }
  .hero h1 { font-size: 32px; }
  .grid { grid-template-columns: 1fr; }
  .version-manager { align-items: flex-start; flex-direction: column; gap: 9px; }
  .version-list { width: 100%; }
  .form .two { grid-template-columns: 1fr; }
  main { padding: 8px 16px 40px; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .project-switcher { position: static; order: 3; width: 100%; margin-left: 0; transform: none; }
  .project-switcher select { flex: 1; max-width: none; }
  .upload-heading { flex-direction: column; }
  .doc-download { align-items: flex-start; }
}
