* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f6f8; color: #17202a; font-size: 14px; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef0f2; padding: 1px 5px; border-radius: 4px; word-break: break-all; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 12px; }
.loading { padding: 40px; text-align: center; color: #6b7280; }

.top { display: flex; align-items: center; gap: 10px; background: #17202a; color: #fff; padding: 12px 20px; position: sticky; top: 0; z-index: 5; }
.brand { font-size: 18px; font-weight: 700; }
.spacer { flex: 1; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #2563eb; color: #fff; }
.badge.live { background: #b42318; }
.top .muted { color: #c7ccd4; }

.tabs { display: flex; gap: 4px; background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 12px; overflow-x: auto; position: sticky; top: 50px; z-index: 4; }
.tabs button { background: none; color: #374151; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 12px 14px; font-size: 14px; white-space: nowrap; }
.tabs button.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 700; }

main { max-width: 1200px; margin: 18px auto; padding: 0 14px 40px; }
.card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 2px 10px #00000012; }
.section { margin-top: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.label { color: #6b7280; font-size: 13px; }
.value { font-size: 22px; font-weight: 700; margin-top: 6px; }
.sub { color: #6b7280; font-size: 12px; margin-top: 6px; }
.muted { color: #6b7280; }
.small { font-size: 12px; }
.ok { color: #16803c; }
.bad { color: #b42318; }
.warn { color: #b45309; }
.up { color: #16803c; font-weight: 600; }
.down { color: #b42318; font-weight: 600; }

.banner { border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; font-weight: 600; }
.banner.live { background: #fee4e2; color: #912018; }
.banner.paper { background: #e0eaff; color: #1e3a8a; }
.banner.error { background: #fef0c7; color: #93370d; }

.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

button { background: #2563eb; color: #fff; border: 0; border-radius: 8px; padding: 9px 14px; cursor: pointer; font-size: 14px; }
button:hover { filter: brightness(1.05); }
button:disabled { background: #9ca3af; cursor: not-allowed; }
button.ghost { background: #fff; color: #17202a; border: 1px solid #d1d5db; }
button.danger { background: #b42318; }
button.warnbtn { background: #b45309; }
button.small { padding: 5px 9px; font-size: 12px; }

input, select { padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; width: 100%; background: #fff; }
textarea { padding: 9px 10px; border: 1px solid #d1d5db; border-radius: 8px; font: 13px ui-monospace, Consolas, monospace; width: 100%; resize: vertical; }
label.check { display: flex; align-items: center; gap: 8px; }
label.check > span { display: inline; margin: 0; }
ol { margin: 4px 0 10px 20px; padding: 0; }
li { margin: 4px 0; word-break: break-all; }
input[type=checkbox] { width: auto; transform: scale(1.3); margin: 6px 0; }
label { display: block; margin-bottom: 12px; }
label > span { display: block; margin-bottom: 4px; }
.unit { display: flex; align-items: center; gap: 6px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 18px; }
.tag { display: inline-block; font-size: 11px; color: #b45309; border: 1px solid #f5c26b; border-radius: 4px; padding: 0 4px; margin-left: 4px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #eef0f2; white-space: nowrap; font-size: 13px; }
th { color: #6b7280; font-weight: 600; }
td.wrap { white-space: normal; min-width: 180px; }

.bar { height: 6px; background: #eef0f2; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #b42318; }

.login { max-width: 420px; margin: 60px auto; }
.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr svg { width: 220px; height: 220px; }

pre.log { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 8px; max-height: 480px; overflow: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; }

.chart { width: 100%; height: 220px; }
.chart .barup { fill: #16803c; }
.chart .bardown { fill: #b42318; }
.chart .axis { stroke: #d1d5db; }
.chart text { font-size: 11px; fill: #6b7280; }

.modal { position: fixed; inset: 0; background: #0008; display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.dialog { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; }
.hidden { display: none !important; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #17202a; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 30; max-width: 90vw; }
.toast.bad { background: #b42318; }

@media (max-width: 640px) {
  .top { padding: 10px 12px; }
  .tabs { top: 46px; }
  .value { font-size: 18px; }
  .two { grid-template-columns: 1fr; }
}
