* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f0f2f5;
  --card: #fff;
  --text: #1f2329;
  --muted: #8a919f;
  --line: #e5e6eb;
  --primary: #1677ff;
  --danger: #f53f3f;
  --radius: 12px;
}
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 16px;
}
.top {
  max-width: 1100px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.top h1 { font-size: 1.35rem; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8e8e8;
  color: #555;
}
.badge.on { background: #e6f4ff; color: var(--primary); }
.layout {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px 20px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.card-head h2 { font-size: 1.05rem; font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 12px; line-height: 1.5; }
.empty { padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-ghost { background: #fff; }
.btn-danger { color: var(--danger); border-color: #ffccc7; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat {
  background: #f7f8fa;
  border-radius: 10px;
  padding: 12px;
}
.stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-size: 1.25rem; font-weight: 600; }
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #4e5969;
  min-width: 140px;
  flex: 1;
}
label.full { width: 100%; flex: 1 1 100%; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}
.ops { white-space: nowrap; }
.ops .btn { margin: 2px 0; }
.table th { color: var(--muted); font-weight: 500; }
.pay-box {
  background: #f7f8fa;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.pay-meta { margin-bottom: 10px; font-size: 14px; }
.reader {
  margin-top: 12px;
  max-width: 360px;
  aspect-ratio: 1;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}
dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: min(520px, 94vw);
  width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
dialog::backdrop { background: rgba(0,0,0,.35); }
.dialog-form {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dialog-form h3 { font-size: 1.1rem; }
.sign-mode-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: #f7f8fa;
  border-radius: 8px;
}
/* author 的 display:flex 会压过 UA 的 [hidden]{display:none}，必须显式隐藏 */
.sign-mode-block[hidden] {
  display: none !important;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.btn-xs {
  padding: 4px 8px;
  font-size: 12px;
}
.btn-block {
  width: 100%;
  margin-top: 10px;
}
.pay-page-body {
  background: #0b0e14;
  color: #e8eef8;
  min-height: 100vh;
  padding: 20px 14px 40px;
}
.pay-shell {
  max-width: 480px;
  margin: 0 auto;
  background: #1a1f2b;
  border-radius: 28px;
  padding: 22px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pay-shell h1 {
  font-size: 1.35rem;
  background: linear-gradient(90deg, #b7d9ff, #7aa9ff);
  -webkit-background-clip: text;
  color: transparent;
}
.pay-page-body .hint { color: #9aa7bd; }
.pay-amount {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}
.pay-page-body label { color: #c5d0e0; }
.pay-page-body input {
  background: #131a26;
  border-color: #2a3346;
  color: #fff;
}
.pay-page-body .btn-ghost {
  background: #2a3346;
  border-color: #2a3346;
  color: #e8eef8;
}
.status-box {
  min-height: 1.4em;
  font-size: 13px;
  color: #9aa7bd;
  line-height: 1.5;
}
.status-box.ok { color: #3dd68c; }
.status-box.err { color: #ff8f8f; }
@media (max-width: 520px) {
  .pay-shell { border-radius: 20px; }
}
