:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #e4e8ee;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #067647;
  --shadow: 0 8px 28px rgba(16, 24, 40, 0.07);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 26px; line-height: 1.25; margin-bottom: 8px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef2f6; padding: 1px 5px; border-radius: 4px; }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1 1 320px; min-width: 220px; }
.stack { display: grid; gap: 14px; }

.topbar {
  background: #132a2e;
  color: #f0fdfa;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .04em; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}
.brand-mark.small { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 6px; flex: 1; }
.nav a {
  color: #c7dedb;
  padding: 7px 12px;
  border-radius: 8px;
  text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .13); color: #fff; }
.tag {
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 9px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: 1px;
}
.userbox { display: flex; align-items: center; gap: 12px; color: #d5e7e4; font-size: 13px; }

.page { max-width: 1280px; margin: 0 auto; padding: 26px 24px 56px; }
.page.narrow { max-width: 900px; }

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.hero h1 { margin-bottom: 4px; }
.cutoffs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cutoff {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  font-size: 12px;
}
.cutoff-name { font-weight: 600; }
.cutoff-meta { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #98a2b3; }
.dot.online { background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .15); }
.dot.offline { background: #98a2b3; }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.input {
  border: 1px solid #cfd6df;
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #cfd6df;
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .3); color: inherit; }
.btn-ghost:hover { background: rgba(255, 255, 255, .09); }
.btn-small { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

.result-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 2px 10px;
  color: var(--muted);
}
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  box-shadow: var(--shadow);
}
.result-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.result-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #f9fafb;
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
}
.result-table td { padding: 12px 14px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.result-table tr:last-child td { border-bottom: 0; }
.result-table tbody tr:hover { background: #fbfcfd; }
.filename { font-weight: 600; word-break: break-all; }
.path { color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }
.site-chip { background: #eef6f5; color: #115e59; border-radius: 6px; padding: 2px 7px; font-size: 12px; }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  border: 1px solid transparent;
  margin: 1px 4px 1px 0;
}
.pill.ok { color: var(--ok); background: #ecfdf3; border-color: #abefc6; }
.pill.bad { color: var(--danger); background: #fef3f2; border-color: #fecdca; }
.pill.warn { color: var(--warn); background: #fffaeb; border-color: #fedf89; }
.pill.soft { color: #475467; background: #f2f4f7; border-color: #e4e7ec; }

.task-state { font-size: 12px; color: var(--muted); margin-top: 6px; max-width: 190px; white-space: normal; }
.task-state.warn { color: var(--warn); }
.task-state.bad { color: var(--danger); }
.task-state a { margin-top: 2px; }

.empty { text-align: center; color: var(--muted); padding: 44px 16px !important; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; color: var(--muted); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #d9efeb, transparent 40%), var(--bg); }
.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 30px 26px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, .12);
}
.login-card .brand-mark { margin-bottom: 18px; }
.login-card h1 { font-size: 23px; margin-bottom: 4px; }
.login-card label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.login-card input {
  border: 1px solid #cfd6df;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  outline: none;
}
.login-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.login-foot { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.alert { background: #fef3f2; border: 1px solid #fecdca; color: var(--danger); padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.panel h1 { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.fact { background: #f8fafb; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 3px; }
.fact span { color: var(--muted); font-size: 12px; }
.fact strong { font-size: 14px; }

.detail-title { margin: 0; font-size: 22px; word-break: break-all; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 20px 0; }
.kv > div { display: grid; gap: 3px; padding: 10px 12px; background: #f8fafb; border: 1px solid var(--line); border-radius: 10px; }
.kv span { color: var(--muted); font-size: 12px; }
.kv strong { font-size: 13px; word-break: break-all; }
.detail-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.result-table.compact { min-width: 620px; }
.result-table.compact td, .result-table.compact th { padding: 9px 10px; }
.audit-detail { max-width: 520px; word-break: break-all; font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); display: grid; gap: 5px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 24px; }
.stat-card .muted { font-size: 12px; }
.token-box { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 16px; overflow-x: auto; font-size: 12px; line-height: 1.6; }
.sites-table { min-width: 1080px; }
.input-mini { padding: 6px 8px; font-size: 12px; width: 150px; }
.input-num { width: 72px; }

@media (max-width: 760px) {
  .topbar-inner { padding: 0 14px; gap: 12px; }
  .userbox span { display: none; }
  .page { padding: 18px 14px 42px; }
  .hero { display: block; }
  .cutoffs { justify-content: flex-start; margin-top: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 22px; }
}

.form-panel { max-width: 560px; }
.form-panel label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.flash { background: #ecfdf3; border: 1px solid #abefc6; color: #067647; padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; }
.player { width: 100%; max-height: 70vh; background: #000; border-radius: 10px; margin-top: 16px; }
