/* ============================================================
   站点集群管理台 · 样式表
   ============================================================ */

:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #fafbff;
  --ink: #111827;
  --ink-2: #4b5563;
  --muted: #8b93a7;
  --line: #e7e9f2;
  --line-2: #eef0f7;
  --brand: #4f46e5;
  --brand-deep: #4338ca;
  --brand-soft: #eef0fe;
  --cyan: #06b6d4;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --bad: #dc2626;
  --bad-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --sidebar: #0a1020;
  --sidebar-2: #111b30;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 18px 40px -30px rgba(16, 24, 40, .35);
  --mono: "JetBrains Mono", Consolas, Menlo, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
b, strong { font-weight: 700; }
code {
  font-family: var(--mono);
  font-size: 12px;
  background: #f1f3fa;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: #4338ca;
}
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.c-ok { color: var(--ok); font-weight: 600; }
.c-bad { color: var(--bad); font-weight: 600; }
.c-warn { color: var(--warn); font-weight: 600; }
.center { justify-content: center; }

.sprite { display: none; }
.ico { width: 18px; height: 18px; fill: currentColor; flex: none; }
.ico-lg { width: 26px; height: 26px; fill: currentColor; }

/* ---------------- 布局 ---------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: none;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #aeb9d1;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(140deg, #6366f1, #4338ca 70%);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, .9);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { color: #fff; font-size: 15px; letter-spacing: .01em; }
.brand-text i { font-style: normal; font-size: 11px; color: #7d8aa5; letter-spacing: .16em; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; color: #a9b4cc; font-weight: 500;
  transition: background .16s, color .16s;
}
.nav-item .ico { width: 17px; height: 17px; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(99, 102, 241, .26), rgba(99, 102, 241, .08));
  color: #fff;
  box-shadow: inset 2px 0 0 #818cf8;
}
.nav-item.is-active .ico { opacity: 1; color: #c7d2fe; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid rgba(255,255,255,.07); padding-top: 14px; }
.operator { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  display: grid; place-items: center;
  color: #e0e7ff; font-size: 13px; font-weight: 700; text-transform: uppercase;
}
.op-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.op-meta b { color: #e8ecf7; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.op-meta i { font-style: normal; font-size: 11px; color: #6d7a96; }
.nav-logout { color: #8b97b0; }
.nav-logout:hover { color: #fca5a5; background: rgba(239, 68, 68, .1); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 28px;
  background: rgba(244, 245, 250, .86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.page-title { min-width: 0; }
.page-title h1 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.page-title p { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.nav-toggle { display: none; }

.content { padding: 24px 28px 60px; max-width: 1320px; width: 100%; margin: 0 auto; }

/* ---------------- 通用组件 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px;
  font-size: 13px; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s, background .16s, border-color .16s, box-shadow .16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(135deg, #5b52ea, #4338ca);
  color: #fff;
  box-shadow: 0 8px 18px -12px rgba(79, 70, 229, .9);
}
.btn-primary:hover { background: linear-gradient(135deg, #4f46e5, #372fae); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #cdd2e3; color: var(--ink); }
.btn-soft { background: var(--brand-soft); color: var(--brand-deep); border-color: #e0e3fd; }
.btn-soft:hover { background: #e4e7fd; }
.btn-danger { background: var(--bad-soft); color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-mini { padding: 5px 11px; font-size: 12px; border-radius: 8px; background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-mini:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; padding: 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; flex: none;
  transition: background .16s, color .16s;
}
.icon-btn:hover { background: #eef0f8; color: var(--ink); }
.inline-form { display: inline-flex; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.panel-head h2 { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.panel-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.panel-head > .muted { font-size: 12px; }
.pad { padding: 12px 0; }

.link-more { font-size: 12.5px; color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link-more .ico { width: 13px; height: 13px; }

.flash {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 14px; border-radius: 11px;
  font-size: 13px; margin-bottom: 14px;
  border: 1px solid transparent;
}
.flash .ico { width: 16px; height: 16px; margin-top: 1px; flex: none; }
.flash-ok { background: var(--ok-soft); border-color: #bbf7d0; color: #166534; }
.flash-warn { background: var(--warn-soft); border-color: #fde68a; color: #92400e; }
.flash-bad { background: var(--bad-soft); border-color: #fecaca; color: #b91c1c; }

.badge {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: #fecaca; }
.badge-idle { background: #f4f5f9; color: #6b7280; border-color: #e5e7ef; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand-deep);
}
.tag-sm { font-size: 11px; }

/* ---------------- 大盘 ---------------- */

.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 15px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; inset: auto -30px -40px auto;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(99,102,241,.10), transparent 70%);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.stat-ico .ico { width: 15px; height: 15px; }
.i-dl { background: #eef0fe; color: #4f46e5; }
.i-pv { background: #ecfeff; color: #0891b2; }
.i-site { background: #f3f0ff; color: #7c3aed; }
.stat-value { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.stat-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.trend { font-weight: 700; font-variant-numeric: tabular-nums; }
.trend-up { color: #dc2626; }
.trend-down { color: #059669; }
.trend-flat { color: var(--muted); }

.mini-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 16px;
  font-size: 12.5px; color: var(--ink-2); margin-bottom: 18px;
}
.mini-strip .ico { width: 14px; height: 14px; vertical-align: -2px; color: var(--muted); }
.mini-strip b { color: var(--ink); }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: #cfd4e3; display: inline-block; }

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.chart-holder { color: #6b7280; width: 100%; overflow: hidden; }
.chart { width: 100%; height: auto; display: block; }
.chart-mobile { display: none; }
.empty-chart { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }

.rank-list { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.rank-list li { display: flex; gap: 11px; align-items: flex-start; }
.rank-no {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  background: #f3f4fa; color: #8b93a7;
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center; margin-top: 1px;
}
.rank-list li:nth-child(1) .rank-no { background: #fff7ed; color: #c2410c; }
.rank-list li:nth-child(2) .rank-no { background: #f1f5f9; color: #475569; }
.rank-list li:nth-child(3) .rank-no { background: #fef3c7; color: #a16207; }
.rank-main { flex: 1; min-width: 0; }
.rank-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.rank-line a { font-weight: 600; }
.rank-line a:hover { color: var(--brand); }
.rank-line .muted { font-size: 11.5px; white-space: nowrap; }
.bar-track { height: 5px; border-radius: 99px; background: #f1f2f8; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #818cf8, #4f46e5); }

.timeline { list-style: none; position: relative; padding-left: 14px; }
.timeline::before { content: ""; position: absolute; left: 3px; top: 6px; bottom: 8px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 13px 14px; }
.tl-dot { position: absolute; left: -11px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #c7d2fe; border: 2px solid #fff; box-shadow: 0 0 0 1px #e0e7ff; }
.tl-body { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; }
.tl-body b { font-size: 13px; }
.tl-body span { color: var(--ink-2); }
.tl-body i { font-style: normal; color: var(--muted); font-size: 11.5px; }

/* ---------------- 表格 ---------------- */

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
.table thead th { font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:hover td { background: #fbfbff; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* 可排序表头 */
.th-sort {
  display: inline-flex; align-items: center; gap: 4px;
  color: inherit; font: inherit; text-decoration: none; cursor: pointer;
  padding: 2px 0; border-radius: 4px;
}
.th-sort:hover { color: var(--accent); }
.th-sort .sort-ind {
  font-style: normal; font-size: 11px; line-height: 1; opacity: .55;
  color: var(--muted); transition: opacity .15s ease, color .15s ease;
}
.th-sort:hover .sort-ind { opacity: 1; color: var(--accent); }
.th-sort.is-sorted { color: var(--accent); }
.th-sort.is-sorted .sort-ind { opacity: 1; }
.table .num .th-sort { justify-content: flex-end; }
.cell-status { white-space: nowrap; }
.table th.num { white-space: nowrap; }

/* 移动端排序条（表头在卡片模式下隐藏，用下拉替代） */
.sort-mobile { display: none; }
.table-plain th { width: 150px; color: var(--muted); font-weight: 600; background: transparent; }
.table-plain th, .table-plain td { padding: 9px 10px; }
.w-check { width: 34px; }
.w-ops { width: 120px; text-align: right; white-space: nowrap; }
.w-ops .icon-btn { width: 28px; height: 28px; vertical-align: middle; }

.site-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-name { font-weight: 700; font-size: 13.5px; }
.site-name:hover { color: var(--brand); }
.site-url { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.err-dot {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px; margin-left: 5px; border-radius: 50%;
  background: #fee2e2; color: #b91c1c; font-size: 11px; font-weight: 800;
  line-height: 1; cursor: help; vertical-align: 1px;
}
.err-dot:hover { background: #fecaca; }
.log-detail { max-width: 420px; color: var(--ink-2); }
.ua-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 10px;
  background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: 11px;
}
.bulk-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.bulk-fields[hidden] { display: none; }
.bulk-fields .input { min-width: 180px; }

.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-tab {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px;
  color: var(--ink-2); border: 1px solid transparent; background: #f4f5fa;
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-tab i { font-style: normal; font-size: 11px; color: var(--muted); }
.filter-tab:hover { color: var(--brand); }
.filter-tab.is-active { background: var(--brand-soft); color: var(--brand-deep); border-color: #dfe3fd; }
.filter-tab.is-active i { color: var(--brand); }
.filter-groups { margin-top: -6px; padding-top: 2px; align-items: center; }
.filter-label { font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .06em; margin-right: 2px; }
.filter-groups .filter-tab { background: #fff; border-color: var(--line); }
.filter-groups .filter-tab:hover { border-color: #c7cdf7; }
.filter-groups .filter-tab.is-active { background: var(--brand-soft); border-color: #dfe3fd; }

.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.page { min-width: 30px; height: 30px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); background: #fff; }
.page:hover { border-color: var(--brand); color: var(--brand); }
.page.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------- 表单 ---------------- */

.form .field { display: block; margin-bottom: 14px; }
.form .field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form .field > span i { color: var(--bad); font-style: normal; }
.form .field > em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.field input[type=text], .field input[type=password], .field input[type=number], .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink);
  font-size: 13.5px; font-family: inherit; outline: none;
  transition: border-color .16s, background .16s, box-shadow .16s;
}
.field input:focus, .field textarea:focus, .input:focus, .select:focus {
  border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.field textarea { resize: vertical; min-height: 74px; line-height: 1.7; }
.field textarea.mono, .field input.mono { font-family: var(--mono); font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-wide { grid-column: 1 / -1; }
.form-sec { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin: 6px 0 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.form-sec:first-of-type { border-top: none; padding-top: 0; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.form-panel { padding-bottom: 20px; }

.input, .select {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font-size: 13px; color: var(--ink); font-family: inherit; outline: none;
}
.select { padding-right: 26px; }

.check-line { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--ink-2); margin: 4px 0 14px; cursor: pointer; }
.check-line input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.check-line.tight { margin: 0; font-weight: 600; }

.search { position: relative; display: flex; align-items: center; }
.search .ico { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search input {
  padding: 8px 12px 8px 32px; width: 230px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); font-size: 12.5px; outline: none;
}
.search input:focus { border-color: #a5b4fc; background: #fff; }

.stack-form { border-top: 1px solid var(--line-2); padding-top: 4px; }
.stack-form:first-of-type { border-top: none; }
.op-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; flex-wrap: wrap; }
.op-row b { display: block; font-size: 13px; }
.op-row p { font-size: 12px; color: var(--muted); margin-top: 1px; }
.op-row-col { flex-direction: column; align-items: flex-start; }
.op-inline { display: flex; gap: 8px; width: 100%; flex-wrap: wrap; }
.op-inline .input { flex: 1; min-width: 170px; }

.code-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.code-editor {
  width: 100%; min-height: 420px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #0f1729; color: #d7def0;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  resize: vertical; outline: none; tab-size: 2;
}
.log-box {
  max-height: 260px; overflow: auto; margin-top: 12px;
  background: #0f1729; color: #b9c4dc; border-radius: 10px;
  padding: 12px 14px; font-family: var(--mono); font-size: 11.5px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-all;
}

.kv { display: flex; flex-direction: column; }
.kv > div { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 13px; }
.kv > div:last-child { border-bottom: none; }
.kv dt { width: 96px; flex: none; color: var(--muted); font-size: 12.5px; }
.kv dd { flex: 1; min-width: 0; word-break: break-all; }

/* ---------------- 站点详情 ---------------- */

.site-head { margin-bottom: 16px; }
.site-head-main { display: flex; align-items: center; gap: 13px; }
.site-avatar {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  background: linear-gradient(140deg, #eef0fe, #e0e7ff);
  color: var(--brand-deep); font-size: 19px; font-weight: 800;
  display: grid; place-items: center;
}
.site-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.site-title-line h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.site-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.connect-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px 18px; margin-bottom: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, #eef2ff, #f5f3ff 60%, #ecfeff);
  border: 1px solid #dfe3fd; border-radius: var(--radius);
}
.connect-banner b { font-size: 14px; }
.connect-banner p { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; max-width: 720px; }
.connect-banner .muted { color: var(--muted); }
.connect-banner a { color: var(--brand); font-weight: 600; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 9px 14px 10px; font-size: 13px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--brand-deep); border-bottom-color: var(--brand); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.step { display: flex; gap: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; }
.step > span { width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--brand-soft); color: var(--brand-deep); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.step b { font-size: 12.5px; }
.step p { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.6; }

.danger-panel { border-color: #fee2e2; background: #fffafa; }
.danger-panel .panel-head h2 { color: #b91c1c; }

/* ---------------- 空状态 ---------------- */

.empty { text-align: center; padding: 46px 20px 50px; }
.empty-ico { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.empty b { display: block; font-size: 15px; margin-bottom: 4px; }
.empty p { font-size: 12.5px; color: var(--muted); max-width: 420px; margin: 0 auto 16px; }

/* ---------------- 登录 / 安装 ---------------- */

.auth-body { background: #0a1020; }
.auth-wrap { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }

.auth-side {
  position: relative; overflow: hidden;
  padding: 56px 60px;
  background: radial-gradient(1200px 600px at 10% 0%, #1e2a52 0%, #0a1020 55%);
  color: #dbe3f5;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-glow {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, .5), transparent 62%);
  filter: blur(30px); right: -160px; bottom: -180px; pointer-events: none;
}
.auth-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 40px; position: relative; z-index: 1; }
.auth-logo b { color: #fff; font-size: 15px; letter-spacing: .02em; }
.auth-side h2 { font-size: 34px; line-height: 1.35; font-weight: 800; letter-spacing: -.02em; color: #fff; position: relative; z-index: 1; }
.auth-side > p { margin-top: 16px; font-size: 14px; color: #9fabc6; max-width: 440px; position: relative; z-index: 1; }
.auth-points { list-style: none; margin-top: 30px; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.auth-points li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #c3cce0; }
.auth-points .ico { width: 16px; height: 16px; color: #34d399; }

.auth-form {
  display: grid; place-items: center; padding: 40px 24px;
  background: radial-gradient(720px 420px at 100% 0%, #f6f7ff 0%, #fff 62%);
}
.auth-form-inner { width: 100%; max-width: 356px; }
.auth-mobile-brand { display: none; }
.auth-form-inner h1 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.auth-sub { font-size: 13px; color: var(--muted); margin: 4px 0 24px; }
.auth-form .field { margin-bottom: 15px; }
.auth-form .field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.auth-form input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-2); font-size: 14px; outline: none; transition: .16s;
}
.auth-form input:focus { border-color: #a5b4fc; background: #fff; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.auth-form .btn-block { margin-top: 8px; }
.auth-tip { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 20px; }
.auth-tip .ico { width: 14px; height: 14px; }

.install-wrap { max-width: 860px; margin: 0 auto; padding: 46px 22px 70px; }
.install-head { margin-bottom: 22px; }
.install-head .auth-logo { margin-bottom: 18px; }
.install-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.install-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.install-done { text-align: center; padding: 12px 0 6px; }
.ok-ring {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok); display: grid; place-items: center;
}
.ok-ring .ico { width: 26px; height: 26px; }
.install-done h2 { font-size: 19px; font-weight: 800; }
.install-done p { font-size: 13px; margin-top: 3px; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 24px 0 60px -30px rgba(0, 0, 0, .5);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .nav-toggle { display: inline-grid; }
  .scrim {
    position: fixed; inset: 0; background: rgba(10, 16, 32, .45);
    opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 35;
  }
  .topbar { padding: 13px 16px; gap: 10px; }
  .content { padding: 18px 16px 50px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form { min-height: 100vh; background: #fff; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
  .auth-mobile-brand b { font-size: 14px; letter-spacing: .01em; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .page-actions { width: 100%; margin-left: 0; }
  .page-actions .btn { flex: 1 1 auto; }
  .panel-head .search { width: 100%; }
  .panel-head .search input { width: 100%; }
  .chart-desktop { display: none; }
  .chart-mobile { display: block; }
  .table.table-cards { min-width: 0; width: 100%; }
  .auth-form input, .field input[type=text], .field input[type=password],
  .field input[type=number], .field textarea, .input, .select { font-size: 16px; }
  .table-cards thead { display: none; }
  .sort-mobile {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 0 0 10px; font-size: 12px; color: var(--muted);
  }
  .sort-mobile select {
    flex: 1 1 120px; min-width: 0; font-size: 14px; padding: 7px 10px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
  }
  .table-cards, .table-cards tbody { display: block; width: 100%; }
  .table-cards tr {
    display: block; position: relative;
    border: 1px solid var(--line); border-radius: 12px;
    background: #fff; padding: 12px 14px 10px; margin-bottom: 10px;
  }
  .table-cards td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; border: none; padding: 4px 0; font-size: 13px;
  }
  .table-cards td::before {
    content: attr(data-label); color: var(--muted); font-size: 12px; flex: none;
  }
  .table-cards td.cell-site { display: block; padding: 0 34px 9px 0; margin-bottom: 6px; border-bottom: 1px dashed var(--line-2); }
  .table-cards td.cell-site::before { content: none; }
  .table-cards td.w-check { position: absolute; right: 12px; top: 12px; padding: 0; width: auto; }
  .table-cards td.w-check::before { content: none; }
  .table-cards td.w-ops { justify-content: flex-end; padding-top: 9px; }
  .table-cards td.w-ops::before { content: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 26px; }
  .page-title h1 { font-size: 17px; }
  .page-title p { display: none; }
  .panel { padding: 16px 14px 18px; border-radius: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .panel-head .search input { width: 100%; }
  .table th, .table td { padding: 9px 8px; }
  .table { min-width: 620px; }
  .table-plain { min-width: 0; }
  .table-plain th { width: 110px; }
  .kv > div { flex-direction: column; gap: 2px; }
  .kv dt { width: auto; }
  .bulk-bar { gap: 8px; }
  .bulk-bar .btn { width: 100%; }
  .bulk-fields { width: 100%; }
  .bulk-fields .input, .bulk-fields .select { width: 100%; min-width: 0; }
  .site-head-main { align-items: flex-start; }
  .site-avatar { width: 40px; height: 40px; font-size: 16px; }
  .code-editor { min-height: 320px; font-size: 12px; }
  .install-wrap { padding: 26px 14px 50px; }
  .install-head h1 { font-size: 21px; }
  .log-box { font-size: 11px; }
}

/* ================= 1.1 新增组件 ================= */

/* 自检报告 */
.diag-verdict {
  font-size: 12.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  background: #f1f5f9; color: var(--muted);
}
.diag-verdict.is-ok { background: var(--ok-soft); color: var(--ok); }
.diag-verdict.is-warn { background: #fff7ed; color: #c2410c; }
.diag-verdict.is-bad { background: #fef2f2; color: #dc2626; }

.diag-list { list-style: none; margin: 0; padding: 0; }
.diag-item {
  display: flex; gap: 10px; padding: 11px 2px;
  border-bottom: 1px dashed var(--line-2);
}
.diag-item:last-child { border-bottom: none; }
.diag-dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; margin-top: 1px;
}
.diag-dot .ico { width: 13px; height: 13px; }
.diag-item.is-ok .diag-dot { background: var(--ok-soft); color: var(--ok); }
.diag-item.is-warn .diag-dot { background: #fff7ed; color: #c2410c; }
.diag-item.is-fail .diag-dot { background: #fef2f2; color: #dc2626; }
.diag-body { min-width: 0; }
.diag-body b { display: block; font-size: 13px; }
.diag-body span { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; word-break: break-all; }
.diag-body em { display: block; font-style: normal; font-size: 12px; color: #b45309; margin-top: 4px; }
.diag-text { width: 100%; resize: vertical; font-size: 12px; line-height: 1.7; }

/* 系统体检提示条 */
.health-banner {
  border-radius: var(--radius); border: 1px solid #fde68a; background: #fffbeb;
  padding: 13px 16px; margin-bottom: 14px;
}
.health-banner.has-bad { border-color: #fecaca; background: #fef2f2; }
.health-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: #92400e; }
.health-banner.has-bad .health-head { color: #b91c1c; }
.health-head .ico { width: 16px; height: 16px; }
.health-head .grow { flex: 1; }
.health-list { list-style: none; margin: 9px 0 0; padding: 0; display: grid; gap: 6px; }
.health-list li { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: var(--ink-2); }
.health-list a { color: var(--ink); font-weight: 600; }
.health-list a:hover { color: var(--brand); }
.health-list i { font-style: normal; color: var(--muted); }
.lvl-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 6px; background: #f59e0b; }
.lvl-dot.bad { background: #ef4444; }
.lvl-dot.info { background: #94a3b8; }

/* 分页（复用 .pager，多一个信息条） */
.pager-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; font-size: 12.5px; color: var(--muted);
}
.pager-bar .pager { margin: 0; }

/* ================= 1.1 第二批组件：告警中心 / 报表 / 模板 / 账号 ================= */

/* 侧栏告警数字 */
.nav-badge {
  margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; display: inline-grid; place-items: center;
  line-height: 1; letter-spacing: 0;
}

/* 通用圆角筛选项（与 .filter-tab 同风格） */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
}
.chip:hover { border-color: #c7cdf7; color: var(--ink); }
.chip.is-on { background: var(--brand-soft); border-color: #dfe3fd; color: var(--brand-deep); font-weight: 700; }

.tabs-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.tabs-row .tabs { margin-bottom: 0; border-bottom: none; }
.tabs-row .filter-groups { margin: 0; }

/* 分段切换（报表页右上） */
.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px;
  background: #f1f2f8; border: 1px solid var(--line);
}
.seg-item {
  padding: 6px 13px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); font-weight: 600;
}
.seg-item:hover { color: var(--ink); }
.seg-item.is-on { background: #fff; color: var(--brand-deep); box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }

/* 告警概览 */
.alert-summary {
  display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin-bottom: 14px;
}
.alert-kpi {
  flex: 1 1 120px; min-width: 108px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
  border-left-width: 3px;
}
.alert-kpi b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.alert-kpi span { font-size: 12px; color: var(--muted); }
.alert-kpi.is-bad { border-left-color: #ef4444; }
.alert-kpi.is-bad b { color: #dc2626; }
.alert-kpi.is-warn { border-left-color: #f59e0b; }
.alert-kpi.is-warn b { color: #d97706; }
.alert-kpi.is-info { border-left-color: #94a3b8; }
.alert-kpi.is-info b { color: #475569; }

.alert-channel {
  flex: 2 1 320px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--ok-soft); border: 1px solid #bbf7d0; color: #15803d;
  border-radius: var(--radius); padding: 14px 16px; font-size: 12.5px; font-weight: 600;
}
.alert-channel .ico { width: 16px; height: 16px; }
.alert-channel.is-off { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.alert-channel .link-more { margin-left: auto; }

/* 告警列表 */
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-item {
  display: flex; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--line-2);
  align-items: flex-start;
}
.alert-item:last-child { border-bottom: none; }
.alert-item.is-done { opacity: .62; }
.alert-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: #f1f5f9; color: var(--muted);
}
.alert-item.lv-bad .alert-ico { background: #fef2f2; color: #dc2626; }
.alert-item.lv-warn .alert-ico { background: #fffbeb; color: #d97706; }
.alert-item.lv-info .alert-ico { background: #f1f5f9; color: #64748b; }
.alert-body { min-width: 0; flex: 1; }
.alert-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.alert-title b { font-size: 13.5px; }
.alert-body p {
  margin: 4px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.65;
  white-space: pre-line; word-break: break-word;
}
.alert-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.alert-meta a { color: var(--brand); font-weight: 600; }
.alert-op { flex: none; }

/* 标签补充色 */
.tag-ok { background: var(--ok-soft); color: #15803d; border-color: #bbf7d0; }
.tag-warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }

/* 报表 */
.report-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
  font-size: 12.5px;
}
.report-toolbar .grow { flex: 1; }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-value .unit { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; font-style: normal; }

.insight-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.insight {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff; align-items: flex-start;
}
.insight .ico { width: 17px; height: 17px; margin-top: 2px; flex: none; }
.insight b { display: block; font-size: 13px; }
.insight span { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.insight.is-good { border-color: #bbf7d0; background: #f0fdf4; }
.insight.is-good .ico { color: #16a34a; }
.insight.is-bad { border-color: #fecaca; background: #fef2f2; }
.insight.is-bad .ico { color: #dc2626; }

.bar-track.slim { height: 4px; width: 90px; display: inline-block; vertical-align: middle; }
.cell-bar { width: 100px; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.compare-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  background: linear-gradient(180deg, #fff, #fbfcff); display: grid; gap: 7px;
}
.compare-card header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.compare-card header a { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.compare-card header a:hover { color: var(--brand); }
.cmp-row { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--muted); }
.cmp-row b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.cmp-row .trend { margin-left: auto; font-size: 12px; }
.cmp-foot { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.bar-track.alt i { background: linear-gradient(90deg, #67e8f9, #06b6d4); }

/* 导出 */
.export-list { display: grid; gap: 10px; }
.export-item {
  display: flex; gap: 12px; align-items: center; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.export-item:hover { border-color: #c7cdf7; background: #fbfcff; }
.export-item .ico { width: 20px; height: 20px; color: var(--brand); flex: none; }
.export-item b { display: block; font-size: 13px; }
.export-item span { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* 管理与维护入口 */
.tool-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tool-link {
  display: flex; flex-direction: column; gap: 3px; padding: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; position: relative;
}
.tool-link:hover { border-color: #c7cdf7; background: #fbfcff; }
.tool-link .ico { width: 18px; height: 18px; color: var(--brand); margin-bottom: 3px; }
.tool-link b { font-size: 13px; color: var(--ink); }
.tool-link span { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* 两步验证 */
.totp-setup { padding: 0 2px; }
.totp-steps { margin: 0 0 10px; padding-left: 20px; font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }
.totp-secret {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 10px; border: 1px dashed #c7cdf7; background: #f8f9ff;
  margin-bottom: 8px;
}
.totp-secret code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px;
  letter-spacing: .14em; color: var(--brand-deep); font-weight: 700; word-break: break-all;
}
.totp-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px !important; letter-spacing: .4em; text-align: center; padding-left: .4em;
}
.sub-block {
  margin: 4px 0 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fcfcff;
}
.sub-block summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.sub-block[open] summary { margin-bottom: 10px; }

/* 站点范围勾选 */
.scope-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px;
  margin: 8px 0 6px;
}
.scope-item {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 12.5px;
}
.scope-item:hover { border-color: #c7cdf7; }

.cell-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.cell-ua { max-width: 260px; font-size: 12px; color: var(--ink-2); }
.btn-mini-danger { color: #b91c1c; border-color: #fecaca; background: #fff; }
.btn-mini-danger:hover { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.small { font-size: 11.5px; }
.muted.small { font-size: 11.5px; }

@media (max-width: 1180px) {
  .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .insight-row { grid-template-columns: 1fr; }
  .alert-channel { flex: 1 1 100%; }
  .alert-channel .link-more { margin-left: 0; }
  .seg { width: 100%; }
  .seg-item { flex: 1; text-align: center; }
}
@media (max-width: 640px) {
  .stat-grid-4 { grid-template-columns: 1fr; }
  .alert-item { flex-wrap: wrap; }
  .alert-op { width: 100%; }
  .cell-bar { display: none; }
  .bar-track.slim { width: 100%; }
  .totp-input { font-size: 19px !important; }
}

/* 打印：报表页直接输出干净的白底文档 */
@media print {
  .sidebar, .topbar .page-actions, .topbar .nav-toggle, .scrim,
  .report-toolbar .btn, .report-toolbar form, .tabs-row, .pager-bar,
  .flash, .hint { display: none !important; }
  body { background: #fff; }
  .shell { display: block; }
  .main { margin: 0; }
  .content { padding: 0; }
  .panel { border: 1px solid #ddd; box-shadow: none; page-break-inside: avoid; }
  .stat-grid { grid-template-columns: repeat(4, 1fr) !important; }
  a { color: #111 !important; text-decoration: none; }
}

/* 表格操作列：多个小按钮不换行，避免竖着堆成一列 */
.w-ops { width: auto; min-width: 120px; }
.w-ops .op-inline { width: auto; flex-wrap: nowrap; justify-content: flex-end; gap: 4px; }
.w-ops .op-inline .btn-mini { white-space: nowrap; }
.diag-item.is-info .diag-dot { background: #f1f5f9; color: #64748b; }

/* 单列时防止长选项（如角色说明）把网格撑出屏幕 */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
.field input, .field select, .field textarea { max-width: 100%; }

/* 空状态插画 */
.empty-art {
  display: block; width: min(250px, 72%); height: auto;
  margin: -6px auto 4px;
}
@media (max-width: 640px) {
  .empty-art { width: min(200px, 64%); }
}

/* 登录页插画 */
.auth-art {
  position: relative; z-index: 1;
  display: block; width: min(100%, 500px); height: auto;
  margin: 6px auto 0 -14px;
  filter: saturate(1.08);
}
@media (max-height: 800px) {
  .auth-art { width: min(100%, 340px); margin-top: 10px; }
}
@media (max-height: 700px), (max-width: 980px) {
  .auth-art { display: none; }
}

/* 体检清单：其余项折叠 */
.health-more summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--brand);
  padding: 12px 2px 2px; list-style: none;
}
.health-more summary::-webkit-details-marker { display: none; }
.health-more summary::before { content: '＋ '; font-weight: 800; }
.health-more[open] summary::before { content: '－ '; }
.health-more[open] summary { padding-bottom: 0; }

/* 三步说明 */
.step-list { list-style: none; counter-reset: step; margin: 0; padding: 4px 2px 6px; }
.step-list li {
  counter-increment: step; position: relative; padding: 10px 0 10px 40px;
  border-bottom: 1px dashed var(--line-2);
}
.step-list li:last-child { border-bottom: none; }
.step-list li::before {
  content: counter(step); position: absolute; left: 0; top: 9px;
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-deep);
  font-size: 12.5px; font-weight: 800;
}
.step-list b { display: block; font-size: 13px; margin-bottom: 2px; }
.step-list span { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }

/* 卡片式表格的合计行 */
@media (max-width: 640px) {
  .table-cards tfoot { display: block; }
  .table-cards tfoot tr { display: block; border: none; background: none; padding: 2px 2px 0; margin: 0; }
  .table-cards tfoot th {
    display: inline-block; border: none; padding: 2px 12px 2px 0;
    font-size: 12.5px; color: var(--muted); font-weight: 700;
  }
  .table-cards tfoot th:empty { display: none; }
  .table-cards tfoot th:first-child { color: var(--ink); }
}

/* 卡片模式下隐藏纯装饰的进度条列（优先级要压过 .table-cards td） */
@media (max-width: 640px) {
  .table-cards td.cell-bar { display: none; }
}

/* 卡片模式：标签列独占一行，避免标签被 space-between 打散 */
@media (max-width: 640px) {
  .table-cards td.cell-tags { display: block; }
  .table-cards td.cell-tags::before { display: block; margin-bottom: 5px; }
  .table-cards td.cell-tags .tag { margin: 0 4px 4px 0; }
}

/* ================= 千站计划进度 ================= */
.goal {
  position: relative; overflow: hidden;
  padding: 20px 22px 17px;
  margin-bottom: 16px;
  border: 1px solid #1b2544;
  border-radius: var(--radius);
  color: #dbe3f5;
  background:
    radial-gradient(560px 210px at 102% -30%, rgba(99, 102, 241, .52), transparent 62%),
    radial-gradient(460px 200px at -8% 130%, rgba(6, 182, 212, .24), transparent 66%),
    linear-gradient(118deg, #0c1224 0%, #131c36 55%, #0f1a30 100%);
  box-shadow: 0 20px 40px -30px rgba(10, 16, 32, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
}
/* 细网格纹理，避免大面积纯色发闷 */
.goal::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(120% 100% at 88% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 100% at 88% 0%, #000 0%, transparent 72%);
}
.goal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; position: relative; z-index: 1;
}
.goal-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.goal-mark {
  flex: none; width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #818cf8 0%, #4f46e5 58%, #0891b2 150%);
  box-shadow: 0 10px 22px -8px rgba(99, 102, 241, .95), inset 0 1px 0 rgba(255, 255, 255, .38);
}
.goal-mark .ico { width: 19px; height: 19px; }
.goal-titles b {
  display: block; font-size: 15px; font-weight: 800; letter-spacing: .02em;
  color: #ffffff;
}
.goal-titles span { display: block; margin-top: 1px; font-size: 12px; color: #8e9aba; }

.goal-count { display: flex; align-items: baseline; gap: 5px; margin-left: auto; position: relative; z-index: 1; }
.goal-count b {
  font-size: 36px; line-height: 1; font-weight: 800; letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(112deg, #e0e7ff 4%, #c7d2fe 38%, #67e8f9 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px rgba(99, 102, 241, .45));
}
.goal-count i {
  font-style: normal; font-size: 14.5px; font-weight: 700; color: rgba(219, 227, 245, .42);
  letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.goal-count em {
  font-style: normal; align-self: center; margin-left: 8px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .01em;
  color: #c7d2fe;
  background: rgba(129, 140, 248, .15);
  border: 1px solid rgba(129, 140, 248, .34);
  font-variant-numeric: tabular-nums;
}

.goal-bar {
  position: relative; height: 12px; margin-top: 16px;
  border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .06);
  z-index: 1;
}
.goal-tick {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: rgba(255, 255, 255, .13);
}
.goal-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--pct, 0%); min-width: 16px;
  border-radius: 999px; overflow: hidden;
  background: linear-gradient(90deg, #818cf8 0%, #a78bfa 42%, #22d3ee 100%);
  box-shadow: 0 0 16px rgba(99, 102, 241, .7), 0 0 4px rgba(34, 211, 238, .8);
  transition: width .9s cubic-bezier(.22, 1, .36, 1);
}
.goal-sheen {
  position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(100deg, transparent 18%, rgba(255, 255, 255, .55) 44%, transparent 68%);
  transform: translateX(-120%);
  animation: goal-sheen 4.2s cubic-bezier(.4, 0, .3, 1) infinite;
}
@keyframes goal-sheen {
  0% { transform: translateX(-120%); }
  45%, 100% { transform: translateX(160%); }
}

.goal-scale {
  display: flex; justify-content: space-between;
  margin-top: 7px; padding: 0 1px;
  font-size: 11px; color: rgba(219, 227, 245, .40);
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
  position: relative; z-index: 1;
}

.goal-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; font-size: 12.5px; color: #b9c3da;
  position: relative; z-index: 1;
}
.goal-foot b { color: #ffffff; font-weight: 800; font-variant-numeric: tabular-nums; }
.goal-foot .c-ok { color: #6ee7b7; }
.goal-sep { width: 1px; height: 11px; background: rgba(255, 255, 255, .16); }
.goal-cta {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 700; color: #a5b4fc;
  padding: 4px 10px; border-radius: 8px;
  background: rgba(129, 140, 248, .13);
  border: 1px solid rgba(129, 140, 248, .26);
}
.goal-cta .ico { width: 14px; height: 14px; }
.goal-cta:hover { color: #fff; background: rgba(129, 140, 248, .26); border-color: rgba(129, 140, 248, .5); }

/* 目标达成 */
.goal.is-done {
  border-color: #12492f;
  background:
    radial-gradient(560px 210px at 102% -30%, rgba(16, 185, 129, .5), transparent 62%),
    radial-gradient(460px 200px at -8% 130%, rgba(6, 182, 212, .22), transparent 66%),
    linear-gradient(118deg, #08130f 0%, #0e2620 55%, #0c1f26 100%);
}
.goal.is-done .goal-mark { background: linear-gradient(135deg, #6ee7b7, #059669); box-shadow: 0 10px 22px -8px rgba(16, 185, 129, .9); }
.goal.is-done .goal-count b { background: linear-gradient(112deg, #d1fae5, #6ee7b7 45%, #67e8f9); -webkit-background-clip: text; background-clip: text; }
.goal.is-done .goal-count em { color: #a7f3d0; background: rgba(16, 185, 129, .16); border-color: rgba(16, 185, 129, .38); }
.goal.is-done .goal-fill { background: linear-gradient(90deg, #34d399, #6ee7b7 45%, #22d3ee); box-shadow: 0 0 16px rgba(16, 185, 129, .7); }

/* 迷你条里的体检入口 */
.mini-health {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--brand);
  padding: 1px 7px; border-radius: 999px; background: var(--brand-soft);
}
.mini-health:hover { color: var(--brand-deep); background: #e6e9fe; }
.mini-health .ico { width: 12px; height: 12px; }

@media (max-width: 640px) {
  .goal { padding: 16px 15px 14px; }
  .goal-mark { width: 34px; height: 34px; border-radius: 11px; }
  .goal-titles b { font-size: 14px; }
  .goal-count b { font-size: 27px; }
  .goal-count i { font-size: 13px; }
  .goal-count em { margin-left: 6px; font-size: 11px; padding: 2px 7px; }
  .goal-bar { height: 10px; margin-top: 14px; }
  .goal-foot { gap: 9px; font-size: 12px; }
  .goal-cta { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .goal-sheen { animation: none; }
  .goal-fill { transition: none; }
}
