:root {
  color-scheme: light;
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --line: #d9e1ec;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --danger: #dc2626;
  --ok: #138a50;
  --warn: #b45309;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
}
button:hover { background: var(--brand-strong); }
button.secondary { background: #e8eef8; color: #1f2a44; }
button.danger { background: var(--danger); }
button.ghost { background: transparent; color: var(--brand); padding: 6px 8px; }
button:disabled { cursor: not-allowed; opacity: .5; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: #8bb5ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
textarea { min-height: 88px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #475467; font-size: 12px; font-weight: 700; background: var(--panel-soft); }
td { font-size: 13px; }
code, pre { font-family: Consolas, "SFMono-Regular", monospace; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 16px 36px rgba(24, 39, 75, .08);
}
.login-card h1 { margin: 0 0 6px; font-size: 26px; }
.login-card form, .form-grid { display: grid; gap: 14px; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar {
  background: #101828;
  color: #e5e7eb;
  padding: 22px 14px;
}
.brand { padding: 4px 10px 22px; font-size: 18px; font-weight: 800; }
.nav { display: grid; gap: 4px; }
.nav button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #cbd5e1;
  box-shadow: none;
  padding: 10px 12px;
}
.nav button.active, .nav button:hover { background: #243044; color: #fff; }
.main { min-width: 0; }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 8;
}
.topbar h1 { margin: 0; font-size: 20px; }
.content { padding: 22px 24px 36px; display: grid; gap: 18px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(16, 24, 40, .05);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-body { padding: 18px; }
.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}
.table-tools input { width: min(440px, 100%); }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-box input { width: min(420px, 100%); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
  box-shadow: 0 8px 18px rgba(16, 24, 40, .04);
}
.metric strong { display: block; font-size: 26px; line-height: 1.2; }
.metric strong code, .metric strong {
  overflow-wrap: anywhere;
}
.metric span, .muted { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input { width: min(360px, 100%); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: #eef2ff;
  color: #3730a3;
}
.badge.ok { background: #eaf8f0; color: var(--ok); }
.badge.warn { background: #fff6df; color: var(--warn); }
.badge.danger { background: #fee2e2; color: var(--danger); }
.badge.muted-state { background: #eef2f6; color: #475467; }
.module-counts { display: flex; gap: 5px; flex-wrap: wrap; min-width: 130px; }
.module-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
}
.module-status-card {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.module-status-card > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.module-status-card strong { font-size: 14px; }
.module-status-card p { margin: 0; color: #475467; font-size: 12px; line-height: 1.55; }
.module-status-card small { color: var(--muted); }
.cell-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  max-width: 220px;
  overflow-wrap: anywhere;
}
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .42);
}
.modal {
  width: min(1080px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.confirm-mask { z-index: 30; }
.confirm-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}
.confirm-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.confirm-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.modal .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.modal .panel-head { position: sticky; top: 0; background: var(--panel); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid .wide { grid-column: 1 / -1; }
.update-config { display: grid; gap: 18px; }
.update-basic {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.update-platforms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.update-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.update-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.update-card-head strong { font-size: 15px; }
.update-card-head span { color: var(--muted); font-size: 12px; }
.alert {
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff1f2;
  color: #be123c;
  margin: 12px 0;
}
.success { background: #ecfdf3; color: #067647; }
.logpre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 58vh;
  overflow: auto;
  margin: 0;
  padding: 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
}
.chart-bars {
  height: 240px;
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  align-items: end;
  gap: 12px;
  padding: 18px;
}
.bar-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 7px;
  text-align: center;
  color: var(--muted);
}
.bar-track {
  height: 150px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  border-bottom: 1px solid var(--line);
}
.bar {
  width: 12px;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
}
.success-bar { background: var(--ok); }
.failed-bar { background: var(--danger); }
.stopped-bar { background: #d97706; }
.bar-item strong { color: var(--text); font-size: 13px; }
.bar-item small { font-size: 12px; }
.empty-chart {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: var(--muted);
}
.donut-wrap {
  min-height: 240px;
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 18px;
}
.donut {
  width: 142px;
  height: 142px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.donut > div {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: var(--panel);
}
.donut strong { font-size: 24px; }
.donut span { color: var(--muted); font-size: 12px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.success-dot { background: var(--ok); }
.failed-dot { background: var(--danger); }
.stopped-dot { background: #d97706; }
.account-chart {
  min-height: 240px;
  display: grid;
  align-content: center;
  gap: 22px;
  padding: 24px;
}
.progress-line {
  height: 14px;
  border-radius: 999px;
  background: #edf1f7;
  overflow: hidden;
}
.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}
.split-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.split-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.split-stats strong { display: block; font-size: 24px; }
.split-stats span { color: var(--muted); }
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.detail-list {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}
.detail-list dt,
.detail-list dd {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.detail-list dt {
  background: var(--panel-soft);
  color: var(--muted);
  font-weight: 700;
}
.detail-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
}
.detail-list dt:nth-last-child(2),
.detail-list dd:last-child {
  border-bottom: 0;
}
.fingerprint-list {
  border: 0;
  border-radius: 0;
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; padding: 12px; }
  .nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nav button { text-align: center; padding: 8px 6px; }
  .metrics, .grid-2, .grid-3, .field-grid, .update-basic, .update-platforms, .module-status-grid { grid-template-columns: 1fr; }
  .modal .metrics { grid-template-columns: 1fr; }
  .table-tools { align-items: stretch; flex-direction: column; }
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
  .table-wrap { overflow-x: auto; }
  th, td { min-width: 110px; }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list dt { border-bottom: 0; }
}
