:root {
  --bg: #f3eee2;
  --paper: #fbf6e8;
  --ink: #5a3c20;
  --body: #6a5641;
  --muted: #9a8b74;
  --faint: #cbbda6;
  --line: #e4dcc6;
  --teal: #14b8a8;
  --teal-deep: #0f8f84;
  --green: #68b12a;
  --yellow: #e6b400;
  --red: #d94b4b;
  --maker: #c45c3a;
  --shadow: 0 10px 28px rgba(90, 60, 32, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--body);
  font: 15px/1.5 "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(circle, rgba(20, 184, 168, .09) 1.4px, transparent 1.4px),
    radial-gradient(circle, rgba(189, 174, 160, .12) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 14px 14px;
  background-position: 0 0, 7px 7px;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 64px;
}

.top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 24px;
  align-items: end;
  padding: 18px 22px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 12px;
  z-index: 20;
}

.brand { display: flex; gap: 12px; align-items: center; }
.mark {
  width: 14px;
  height: 42px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--teal), var(--green));
  flex: none;
}
h1 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: .02em;
}
.tag, .fresh, .panel-head p, .muted-block p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.fresh { justify-self: end; }

.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  text-decoration: none;
  color: var(--body);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--faint);
  background: #fffdf6;
}
.nav a.on {
  color: #fff;
  background: var(--teal);
  border-color: transparent;
}
.nav a.soon { opacity: .55; }

.block { margin-top: 22px; }
.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.kpi {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.kpi strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 30px;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.kpi.alert { border-color: #f0b8b8; background: #fdf3f1; }
.kpi.alert strong { color: var(--red); }

.panel, .queue-card, .muted-block {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.panel, .muted-block { padding: 18px 18px 16px; }
.panel + .panel, .overdue-panel { margin-top: 14px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 8px;
}
.panel-head h2, .muted-block h2, .queue-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.queue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.queue-card { padding: 16px 16px 12px; }
.queue-card.hot { border-color: #f0b8b8; background: #fff6f3; }
.queue-card.maker { border-color: #f0cbb8; }
.queue-card.head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.sla {
  flex: none;
  font-size: 11px;
  font-weight: 800;
  color: var(--teal-deep);
  background: #e7f8f5;
  border-radius: 999px;
  padding: 4px 9px;
}
.queue-card.hot .sla,
.queue-card.maker .sla { color: var(--maker); background: #fdeee6; }
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 8px;
}
.metric {
  background: #fffdf6;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.metric b {
  display: block;
  font-size: 24px;
  color: var(--ink);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.metric.bad b { color: var(--red); }
.metric small, .queue-card p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.queue-card p { margin: 6px 0 0; }
.item-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.item-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.item-list b { color: var(--ink); font-weight: 700; }
.item-list span { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr);
  gap: 16px;
  align-items: start;
}
.side .insight {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: #fffdf6;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
}
.bands { display: grid; gap: 8px; margin-top: 8px; }
.band { display: grid; grid-template-columns: 92px 1fr 52px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.band i {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--teal), #7ee0d4);
}
.band b { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }

.chart { width: 100%; min-height: 168px; }
.chart.tall { min-height: 220px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-weight: 600; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .area { fill: rgba(20, 184, 168, .16); }
.chart .line { fill: none; stroke: var(--teal-deep); stroke-width: 2.4; }
.chart .over { fill: none; stroke: var(--red); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .bar { fill: #9fe1d8; }
.chart .bar.alt { fill: #14b8a8; }
.chart .dot { fill: var(--red); }

.table-wrap { overflow-x: auto; margin-top: 8px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1.5px solid var(--line);
  font-variant-numeric: tabular-nums;
}
th { color: var(--muted); font-size: 12px; }
td.num, th.num { text-align: right; }
.empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}
.banner {
  margin: 14px 2px 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff6d8;
  border: 1.5px solid #ead48a;
  color: #7a5b12;
  font-size: 13px;
  font-weight: 700;
}
.part-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.part-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
.part-card.planned { opacity: .78; }
.part-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.part-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  vertical-align: middle;
}
.badge.draft { color: #7a5b12; background: #fff1c2; }
.badge.planned { color: var(--muted); background: #efe8d6; }
.badge.locked { color: #0f8f84; background: #e7f8f5; }
.placeholder-part {
  background: var(--paper);
  border: 2px dashed var(--faint);
  border-radius: 22px;
  padding: 18px;
  box-shadow: none;
}
.placeholder-part h2 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.placeholder-part p { margin: 0; color: var(--muted); font-weight: 600; }
.gap-top { margin-top: 14px; }

@media (max-width: 920px) {
  .kpis, .queue-grid, .split, .part-grid { grid-template-columns: 1fr 1fr; }
  .top { grid-template-columns: 1fr; position: static; }
  .fresh { justify-self: start; }
}
@media (max-width: 640px) {
  .kpis, .queue-grid, .split, .part-grid { grid-template-columns: 1fr; }
  h1 { font-size: 20px; }
  .kpi strong { font-size: 26px; }
}

/* ===== 榜单监控 part 样式 ===== */
.mon-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.mon-tab { appearance: none; border: 1.5px solid var(--line); background: #fffdf6; color: var(--body); font: inherit; font-size: 13px; font-weight: 700; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.mon-tab.on { color: #fff; background: var(--teal); border-color: transparent; }
.mon-user { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: #fffdf6; font-size: 13px; color: var(--body); }
.mon-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.mon-user b { color: var(--ink); } .mon-user span { color: var(--muted); font-weight: 600; }

.monitor { background: var(--paper); border: 2px solid var(--line); border-radius: 22px; padding: 18px 18px 8px; }
.monitor-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.monitor-sub { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.monitor-tabs { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 8px; margin: 6px 0 14px; scrollbar-width: thin; }
.monitor-tabs::-webkit-scrollbar { height: 6px; } .monitor-tabs::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 99px; }
.monitor-tabs .tab { appearance: none; flex: none; border: 1.5px solid var(--line); background: #fffdf6; color: var(--body); font: inherit; font-size: 13px; font-weight: 700; padding: 7px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.monitor-tabs .tab.on { color: #fff; background: var(--teal); border-color: transparent; }
.monitor-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.monitor-platforms { display: inline-flex; gap: 6px; flex: none; }
.monitor-platforms .plat { appearance: none; border: 1.5px solid var(--line); background: #fffdf6; color: var(--body); font: inherit; font-size: 13px; font-weight: 800; padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.monitor-platforms .plat.on { color: var(--teal-deep); background: #e7f8f5; border-color: #bfe8e0; }
.monitor-search { flex: 1 1 240px; min-width: 200px; font: inherit; font-size: 13.5px; color: var(--ink); background: #fffdf6; border: 1.5px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.monitor-search:focus { outline: none; border-color: var(--teal); }
.monitor-count { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.monitor-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.monitor-table th { color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; padding: 9px 8px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.monitor-table td { padding: 10px 8px; border-bottom: 1.5px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: top; }
.monitor-table td.rank { color: var(--muted); font-weight: 800; }
.monitor-table td.game b { color: var(--ink); font-weight: 750; }
.monitor-table td.game a.app-link { display: inline-block; margin-top: 2px; color: var(--teal-deep); font-size: 12px; font-weight: 700; text-decoration: none; }
.monitor-table td.game a.app-link:hover { text-decoration: underline; }
.monitor-table td.rate { color: var(--ink); font-weight: 700; } .monitor-table td.first { color: var(--muted); white-space: nowrap; }
.monitor-table .tags { white-space: nowrap; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: 1px solid transparent; margin: 1px 3px 1px 0; }
.chip.type { color: #0f8f84; background: #e7f8f5; border-color: #bfe8e0; }
.chip.theme { color: #8a6d1a; background: #f6eed3; border-color: #e6d6a4; }
.mov { font-size: 12.5px; font-weight: 800; white-space: nowrap; } .mov.up { color: var(--green); } .mov.down { color: var(--red); } .mov.dash { color: var(--faint); font-weight: 600; }
.badge.bad { color: var(--red); background: #fdf3f1; }

.settings-block { background: #fffdf6; border: 1.5px solid var(--line); border-radius: 18px; padding: 16px 18px; margin: 0 0 14px; }
.settings-block h3 { margin: 0 0 10px; color: var(--ink); font-size: 16px; }
.settings-block .muted { margin: 6px 0 10px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.setting-line, .rule-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; font-size: 13.5px; color: var(--body); }
.setting-line label, .rule-row label { font-weight: 700; color: var(--ink); } .rule-row span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.field { display: grid; gap: 4px; margin: 8px 0; color: var(--muted); font-size: 12.5px; font-weight: 700; }
#s-form input, #s-form textarea, #s-form select, .user-role { font: inherit; font-size: 13px; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; }
#s-form input[type="number"] { width: 72px; } #s-form textarea { min-width: 240px; resize: vertical; }
#s-form input:focus, #s-form textarea:focus, #s-form select:focus { outline: none; border-color: var(--teal); }
.chart-checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chart-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--body); background: #fffdf6; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.chart-check input { accent-color: var(--teal); } .user-role { width: auto; }

.btn.mini { font-size: 12px; padding: 5px 12px; margin-right: 6px; }
.btn.mini.confident, .btn.mini.pass { background: var(--teal); } .btn.mini.passed { background: var(--green); } .btn.mini.passed:hover { background: #529b1e; }
.btn.mini.reviewing { background: #fff; color: #b8860b; border-color: #e6d6a4; } .btn.mini.reviewing:hover { background: #f6eed3; }
.btn.mini.risk, .btn.mini.reject { background: #fff; color: var(--red); border-color: #f0b8b8; } .btn.mini.risk:hover, .btn.mini.reject:hover { background: #fdf3f1; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ops { margin-top: 6px; display: grid; gap: 4px; } .op { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--body); }
.op b { color: var(--ink); font-weight: 750; } .op-t { color: var(--muted); } .op-note { color: var(--red); font-weight: 600; } .op-by { color: var(--muted); font-weight: 600; }
.risk-note-line { display: block; margin-top: 6px; color: var(--red); font-size: 12.5px; font-weight: 600; }
.risk-box { display: grid; gap: 6px; } .risk-note { width: 100%; min-width: 200px; font: inherit; font-size: 13px; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 10px; resize: vertical; }
.risk-note:focus { outline: none; border-color: var(--red); }
.risk-box-title { margin: 0; color: var(--ink); font-size: 13px; font-weight: 800; }
.risk-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 4px 10px; margin: 2px 0; }
.risk-type { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--body); cursor: pointer; }
.risk-type input { accent-color: var(--red); width: 13px; height: 13px; flex: none; }
.risk-chips { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.chip.risk { color: #b23a3a; background: #fdf3f1; border-color: #f0b8b8; }

.login-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(90,60,32,.12); backdrop-filter: blur(3px); }
.login-overlay[hidden] { display: none !important; }
.login-card { width: min(360px, 92vw); background: var(--paper); border: 2px solid var(--line); border-radius: 24px; padding: 26px; }
.login-card h2 { margin: 0 0 4px; color: var(--ink); font-size: 22px; } .login-card .muted { margin: 0 0 16px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.login-card .field input { font: inherit; font-size: 14px; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.login-card .btn { width: 100%; margin-top: 8px; } .login-err { margin: 8px 0 0; color: var(--red); font-size: 12.5px; font-weight: 700; }

/* ===== 待审核 · 审查卡片（复刻参考版）===== */
.review-card { background: var(--paper); border: 2px solid var(--line); border-radius: 20px; padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.rc-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.rc-title b { color: var(--ink); font-size: 16px; }
.rc-rate { color: var(--green); font-weight: 800; font-size: 13px; margin-left: 8px; }
.rc-rate em { font-style: normal; color: var(--muted); font-weight: 700; }
.rc-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.rc-opt { appearance: none; border: 1.5px solid var(--line); background: #fffdf6; color: var(--body); font: inherit; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.rc-opt:hover { border-color: var(--faint); }
.rc-line { margin: 6px 0; font-size: 13px; color: var(--body); }
.rc-line b { color: var(--ink); font-weight: 700; margin-right: 4px; }
.rc-meta { margin: 4px 0 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rc-risk { background: #fffdf6; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 8px; }
.rc-risk-head { font-weight: 800; color: var(--ink); font-size: 13px; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.rc-lvl { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.rc-lvl.hi { color: #fff; background: var(--red); }
.rc-lvl.mid { color: #7a5b12; background: #fff1c2; }
.rc-lvl.lo { color: #0f8f84; background: #e7f8f5; }
.rc-risks { display: grid; gap: 4px; margin: 4px 0; }
.rc-risk-item { font-size: 12.5px; color: var(--body); }
.rc-risk-item b { color: var(--red); font-weight: 800; margin-right: 6px; }
.rc-empty { color: var(--muted); font-size: 12.5px; margin: 4px 0; }
.rc-review { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.rc-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ===== 左侧边栏布局（现有模块竖排） ===== */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  padding: 18px 14px 28px; background: var(--paper); border-right: 2px solid var(--line);
  display: flex; flex-direction: column;
}
.sidebar .brand { margin-bottom: 2px; }
.sidebar h1 { font-size: 17px; }
.side-nav { margin-top: 16px; display: grid; gap: 4px; align-content: start; }
.side-nav a {
  display: flex; align-items: center; width: 100%; min-height: 38px; text-decoration: none;
  color: var(--body); font: inherit; font-size: 13.5px; font-weight: 700;
  padding: 9px 12px; border-radius: 12px;
}
.side-nav a:hover { background: #fffdf6; }
.side-nav a.on { color: #fff; background: var(--teal); }
.side-nav a.soon { opacity: .55; }
.workspace { min-width: 0; padding: 18px 20px 64px; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.nav-toggle {
  appearance: none; border: 1.5px solid var(--line); background: #fffdf6; color: var(--ink);
  font: inherit; font-size: 18px; line-height: 1; padding: 6px 10px; border-radius: 10px;
  cursor: pointer; display: none;
}
.workspace .fresh { margin: 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: -272px; top: 0; bottom: 0; width: 260px; z-index: 40;
    transition: left .22s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { left: 0; }
  .nav-toggle { display: inline-flex; }
}

/* 单页路由：非当前 part 隐藏 */
.is-hidden { display: none !important; }
.chip.reviewing { color: #b8860b; background: #f6eed3; border-color: #e6d6a4; }

/* 全局账号 · 侧边栏用户徽章 */
.side-user { margin-top: auto; padding-top: 12px; }
.side-user-card { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: #fffdf6; }
.side-user-card .avatar { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.side-user-card div { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.side-user-card b { display: block; color: var(--ink); font-size: 13px; }
.side-user-card span { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.side-user-card .logout { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.side-user-card .logout:hover { color: var(--red); }
