:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --text: #1b2130;
  --muted: #5f687a;
  --line: #e2e5eb;
  --line-strong: #cfd4dd;
  --accent: #4b3bb8;
  --accent-soft: #eeebfb;
  --accent-ink: #ffffff;
  --ok: #1f7a4d;
  --ok-bg: #e4f4eb;
  --live: #0f6b42;
  --live-bg: #cdeedb;
  --warn: #8a5200;
  --warn-bg: #fcf0d9;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --info: #2457c5;
  --info-bg: #e7eefc;
  --muted-bg: #eef0f3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a;
    --panel: #1b1e26;
    --panel-2: #222631;
    --text: #e8eaf0;
    --muted: #9aa3b5;
    --line: #2c313d;
    --line-strong: #3b4252;
    --accent: #9d91f5;
    --accent-soft: #2a2552;
    --accent-ink: #14121f;
    --ok: #6fd3a0;
    --ok-bg: #173527;
    --live: #7be0ae;
    --live-bg: #12402d;
    --warn: #f0b860;
    --warn-bg: #3a2c12;
    --bad: #ff8a80;
    --bad-bg: #3d1a17;
    --info: #8fb0ff;
    --info-bg: #1b2a4a;
    --muted-bg: #272b35;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.35; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ok-text { color: var(--ok); font-weight: 600; }
.bad-text { color: var(--bad); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
.hash { overflow-wrap: anywhere; }
.stack { display: grid; gap: 12px; }

/* 顶栏和导航 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 56px; padding: 0 20px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand__name { font-weight: 650; font-size: 15px; white-space: nowrap; }
.brand__tag { font-size: 12px; color: var(--muted); padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 8px; }
.who__label { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.who select { max-width: 280px; }
.who-row { display: flex; align-items: center; gap: 12px; }

.layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.sidenav {
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow: auto;
  padding: 16px 12px; background: var(--panel); border-right: 1px solid var(--line);
}
.nav__link { display: block; padding: 8px 12px; margin-bottom: 2px; border-radius: 8px; color: var(--text); }
.nav__link:hover { background: var(--panel-2); text-decoration: none; }
.nav__link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav__foot { margin-top: 20px; padding: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.main { padding: 24px 28px 72px; min-width: 0; }
.page { max-width: 1180px; margin: 0 auto; display: grid; gap: 20px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; max-width: 760px; }
.title-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* 卡片 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.card__body { padding: 16px 18px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }

/* 按钮和表单 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn--danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn--danger:hover { background: var(--bad); filter: brightness(1.08); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--accent); padding: 0 6px; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: grid; gap: 6px; align-content: start; }
.field__label { font-size: 13px; font-weight: 600; }
.field__hint { font-size: 12px; color: var(--muted); }
input[type="text"], input[type="password"], input[type="number"], input[type="file"], select, textarea {
  font: inherit; color: inherit; background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; min-width: 0; max-width: 100%;
}
input[type="file"] { padding: 6px; }
input[type="color"] { width: 64px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); }
input:disabled, select:disabled { background: var(--panel-2); color: var(--muted); }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px;
}
.chk { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; white-space: nowrap; }
.chk-row { display: flex; flex-wrap: wrap; row-gap: 4px; }

/* 状态 */
.pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle;
}
.pill--ok { background: var(--ok-bg); color: var(--ok); }
.pill--live { background: var(--live-bg); color: var(--live); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--bad { background: var(--bad-bg); color: var(--bad); }
.pill--info { background: var(--info-bg); color: var(--info); }
.pill--muted { background: var(--muted-bg); color: var(--muted); }

.banner { padding: 11px 14px; border-radius: 8px; border: 1px solid transparent; }
.banner--ok { background: var(--ok-bg); color: var(--ok); }
.banner--bad { background: var(--bad-bg); color: var(--bad); }
.banner--warn { background: var(--warn-bg); color: var(--warn); }
.banner--info { background: var(--info-bg); color: var(--info); }
.banner a { color: inherit; text-decoration: underline; margin-left: 6px; }
.empty { padding: 18px; text-align: center; color: var(--muted); }

/* 表格 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--panel-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.card__body > .table-wrap { margin: -16px -18px; }
.table--wrap td { overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 380px; }
.game-link { display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.game-link:hover { text-decoration: none; }
.game-link:hover strong { color: var(--accent); }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* 游戏 */
.badge {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
  background: var(--game, var(--accent));
}
.badge--lg { width: 48px; height: 48px; border-radius: 12px; font-size: 17px; }
.game-cards { display: grid; gap: 10px; }
.game-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: inherit;
}
.game-card:hover { border-color: var(--line-strong); background: var(--panel-2); text-decoration: none; }
.game-card__name { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 概览 */
.flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.flow span { padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.flow i { font-style: normal; color: var(--muted); }
.flow .flow__back { margin-left: 6px; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.todo a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: inherit;
}
.todo a:hover { border-color: var(--accent); text-decoration: none; }
.todo__label { font-weight: 600; color: var(--accent); margin-right: 6px; }

/* 版本的进度条 */
.stepper {
  display: flex; list-style: none; margin: 0; padding: 14px 18px; overflow-x: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.step { flex: 1 0 auto; display: flex; align-items: center; gap: 8px; padding-right: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.step + .step::before { content: ""; flex: 1 0 18px; max-width: 48px; height: 2px; background: var(--line-strong); margin-right: 2px; }
.step__dot {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; line-height: 1;
}
.step--done .step__dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step--done .step__dot::after { content: "✓"; }
.step--current { color: var(--text); font-weight: 600; }
.step--current .step__dot { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step--fail { color: var(--bad); font-weight: 600; }
.step--fail .step__dot { background: var(--bad); border-color: var(--bad); color: #fff; }
.step--fail .step__dot::after { content: "✕"; }

/* 检查报告 */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.check__icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.check--pass .check__icon { background: var(--ok-bg); color: var(--ok); }
.check--warn .check__icon { background: var(--warn-bg); color: var(--warn); }
.check--skip .check__icon { background: var(--muted-bg); color: var(--muted); }
.check--fail { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: color-mix(in srgb, var(--bad-bg) 50%, var(--panel)); }
.check--fail .check__icon { background: var(--bad); color: #fff; }
.check__head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.check__summary { margin-top: 2px; overflow-wrap: anywhere; }
.check details { margin-top: 6px; }
.check summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.mono-list { margin: 6px 0 0; padding-left: 18px; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }

/* 验收和审核 */
.matrix th, .matrix td { padding: 6px 8px; }
.matrix__case { display: block; min-width: 220px; font-weight: 500; }
.matrix select { width: 100%; min-width: 84px; }
.review-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.review-item:last-of-type { border-bottom: 0; }
.review-item__opts { display: flex; gap: 12px; }
.review-item__opts label { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checklist__item { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; }
.checklist__mark { font-weight: 600; }
.checklist__item.is-pass .checklist__mark { color: var(--ok); }
.checklist__item.is-fail .checklist__mark { color: var(--bad); }
.checklist__item.is-na .checklist__mark { color: var(--muted); }

.prose ul { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; }
pre.code {
  margin: 0; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  overflow: auto; max-height: 440px; font-family: var(--mono); font-size: 12px; line-height: 1.55;
}

/* 提示和对话框 */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  max-width: min(440px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 10px;
  background: var(--text); color: var(--panel); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.toast--bad { background: var(--bad); color: #fff; }
.toast--warn { background: var(--warn); color: #fff; }
.dialog {
  border: 0; border-radius: 14px; padding: 0; width: min(500px, calc(100vw - 32px));
  background: var(--panel); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.dialog::backdrop { background: rgba(15, 18, 30, 0.45); }
.dialog-form { display: grid; gap: 14px; padding: 20px; }
.dialog-form h2 { font-size: 17px; }
.dialog-form .actions { justify-content: flex-end; }
.form-error { color: var(--bad); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav {
    position: static; height: auto; display: flex; gap: 4px; overflow-x: auto;
    padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .nav__link { white-space: nowrap; margin: 0; }
  .nav__foot { display: none; }
  .grid2, .form-grid { grid-template-columns: 1fr; }
  .main { padding: 16px 16px 56px; }
  .topbar { padding: 0 16px; }
  .brand__tag { display: none; }
}
@media (max-width: 600px) {
  .who__label, .brand__name { display: none; }
  .who select { max-width: calc(100vw - 90px); }
  .review-item { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
}

/* 登录页（部署版） */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 360px; display: grid; gap: 20px; }
.login__brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login__brand h1 { font-size: 19px; }
.login__card { display: grid; gap: 14px; padding: 24px; }
.login__card input { width: 100%; height: 38px; }
.login__submit { width: 100%; height: 38px; margin-top: 4px; }
.login__error { padding: 8px 12px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); font-size: 13px; }
.login__foot { text-align: center; }

/* 网页漏斗 */
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.funnel-cell { display: grid; gap: 4px; min-width: 72px; }
.funnel-bar { display: block; height: 4px; border-radius: 2px; background: var(--accent-soft); position: relative; overflow: hidden; }
.funnel-bar::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--accent); }
