:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel2: #1d2130;
  --line: #2a2f3f;
  --text: #e6e8f0;
  --muted: #8b91a7;
  --accent: #635bff;       /* Stripe 紫 */
  --ok: #2ecc71;
  --warn: #f5a623;
  --bad: #ff5c5c;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px; line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 60px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.topbar .brand { font-weight: 700; font-size: 16px; color: var(--text); }
.topbar .brand .dot { color: var(--accent); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px; margin-top: 20px;
}
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card h3 { margin: 18px 0 8px; font-size: 14px; color: var(--muted); }

.banner {
  display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; margin-top: 20px; font-size: 13px;
}
.banner b { color: var(--accent); }
.banner .tag {
  background: #262b3d; border: 1px solid var(--line); border-radius: 20px;
  padding: 2px 10px; font-size: 12px; color: var(--muted);
}

/* 表单 */
label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=number], select {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #10131c; color: var(--text);
  font-size: 15px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
input:disabled { opacity: 0.5; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
button.btn {
  margin-top: 20px; width: 100%; padding: 12px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}
button.btn:hover { filter: brightness(1.1); }
button.btn:disabled { opacity: 0.5; cursor: wait; }
.hint { margin-top: 10px; font-size: 12px; color: var(--muted); }
.pay-amount { font-size: 22px; font-weight: 700; margin: 4px 0 0; }

/* 评分结果 */
.result-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.gauge {
  width: 108px; height: 108px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 6px solid var(--line); flex: none;
}
.gauge .num { font-size: 30px; font-weight: 800; line-height: 1; }
.gauge .lab { font-size: 11px; color: var(--muted); margin-top: 4px; }
.gauge.ok { border-color: var(--ok); color: var(--ok); }
.gauge.review { border-color: var(--warn); color: var(--warn); }
.gauge.block { border-color: var(--bad); color: var(--bad); }
.badge {
  display: inline-block; padding: 4px 14px; border-radius: 20px; font-weight: 700; font-size: 14px;
}
.badge.ok { background: rgba(46,204,113,.15); color: var(--ok); border: 1px solid var(--ok); }
.badge.review { background: rgba(245,166,35,.15); color: var(--warn); border: 1px solid var(--warn); }
.badge.block { background: rgba(255,92,92,.15); color: var(--bad); border: 1px solid var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 10px; font-size: 12px; color: var(--muted);
}
.chip b { color: var(--text); }
.mode-note {
  margin-top: 12px; font-size: 12.5px; color: var(--muted);
  background: var(--panel2); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px;
}

/* 规则表 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr.hit td { background: rgba(255,92,92,.05); }
tr.hit-bonus td { background: rgba(46,204,113,.06); }
tr.disabled td { opacity: 0.45; }
tr.info td { opacity: 0.7; }
.pts { font-weight: 700; white-space: nowrap; }
.pts.pos { color: var(--bad); }
.pts.neg { color: var(--ok); }
.ev { color: var(--muted); font-size: 12px; }
.cat-title td { background: var(--panel2); font-weight: 700; }

/* 管理页 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.setrow { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.setrow label { margin: 0; width: 130px; flex: none; }
.setrow input, .setrow select { width: auto; flex: 1; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ok); color: #06220f; padding: 10px 22px; border-radius: 8px;
  font-weight: 600; opacity: 0; transition: opacity .3s; pointer-events: none;
}
.toast.show { opacity: 1; }
.clickable { cursor: pointer; }
.clickable:hover td { background: rgba(99,91,255,.06); }
.detail-json pre {
  background: #10131c; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; overflow: auto; font-size: 12px; max-height: 400px;
}
.small { font-size: 12px; color: var(--muted); }
