/* 浅色护眼主题。基础字号 16px，表格 15px，关键数字 26px。 */
:root {
  --bg: #F4F6F9;
  --bg-deep: #F4F6F9;
  --panel: #FFFFFF;
  --panel-2: #FFFFFF;
  --panel-3: #F8FAFC;
  --sidebar: #F8FAFC;
  --line: #DCE3EC;
  --line-soft: #E6EBF2;
  --text: #111827;
  --muted: #4B5563;
  --faint: #6B7280;
  --accent: #2563EB;
  --accent-deep: #1D4ED8;
  --accent-soft: #EFF4FF;
  --green: #0F7B4F;
  --green-soft: #E8F6EF;
  --red: #B42318;
  --red-soft: #FDECEC;
  --amber: #B45309;
  --amber-soft: #FDF4E3;
  --violet: #6D28D9;
  --violet-soft: #F3EEFF;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --mono: "Cascadia Mono", "Consolas", "PingFang SC", "Microsoft YaHei", monospace;
}

* { box-sizing: border-box; }
html { min-width: 360px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border: 1px solid #D8E3FB;
  border-radius: 6px;
  padding: 1px 6px;
}
.hidden { display: none !important; }
::selection { background: #D7E4FF; color: #0B1220; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C7D0DC; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- boot */
.boot-screen {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background: var(--bg);
}
.boot-mark {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  color: #FFFFFF; font-weight: 700; font-size: 26px;
  background: linear-gradient(135deg, #2563EB, #4F8BF7);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.24);
}
.boot-line { width: 160px; height: 3px; background: #E2E8F0; overflow: hidden; border-radius: 99px; }
.boot-line span { display: block; width: 42%; height: 100%; background: var(--accent); animation: boot 1.1s ease-in-out infinite; }
.boot-screen p { margin: 0; color: var(--faint); font-size: 15px; }
@keyframes boot { 0% { transform: translateX(-110%); } 100% { transform: translateX(350%); } }

/* --------------------------------------------------------------- brand */
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  color: #FFFFFF; font-weight: 700; font-size: 17px;
  background: linear-gradient(135deg, #2563EB, #4F8BF7);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  flex: 0 0 auto;
}
.brand-type { font-weight: 700; font-size: 18px; letter-spacing: 0.01em; }
.brand-large .brand-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 22px; }
.brand-large .brand-type { font-size: 23px; }

/* --------------------------------------------------------------- login */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.95fr);
  background: var(--bg);
}
.login-art {
  position: relative; overflow: hidden;
  min-height: 100vh;
  padding: 56px clamp(36px, 6vw, 88px);
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(160deg, #EEF3FB 0%, #F7F9FC 58%, #FFFFFF 100%);
}
.art-copy { position: relative; z-index: 1; max-width: 620px; }
.art-kicker {
  margin: 46px 0 18px;
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.16em;
  font-weight: 600;
}
.art-copy h1 {
  margin: 0;
  font-size: clamp(40px, 4.6vw, 62px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.art-copy h1 em { font-style: normal; color: var(--accent); }
.art-lede { max-width: 520px; margin: 24px 0 0; color: var(--muted); font-size: 17px; line-height: 1.85; }
.art-metrics {
  display: flex; gap: 32px; flex-wrap: wrap;
  margin-top: 44px; padding-top: 24px;
  border-top: 1px solid var(--line);
}
.art-metrics div { display: flex; flex-direction: column; gap: 5px; }
.art-metrics strong { font-size: 16px; color: var(--text); font-weight: 700; }
.art-metrics span { font-size: 14px; color: var(--faint); }
.login-main {
  min-height: 100vh;
  padding: 44px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--panel);
}
.login-card { width: 100%; max-width: 420px; }
.login-card-head { margin-bottom: 26px; }
.eyebrow { display: block; color: var(--accent); font-size: 13px; letter-spacing: 0.14em; font-weight: 600; }
.login-card h2 { margin: 10px 0 8px; font-size: 27px; font-weight: 700; }
.login-card-head p { margin: 0; color: var(--muted); font-size: 15px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 17px; }
.field > span { color: var(--muted); font-size: 15px; font-weight: 600; }
.field > span b { color: var(--faint); font-weight: 400; font-size: 13px; margin-left: 6px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text);
  padding: 11px 13px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
input::placeholder { color: #9AA5B4; }
input:focus, select:focus {
  border-color: #7EA7F5;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
#loginPassword { padding: 14px; font-size: 17px; }
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  color: var(--text);
  background: transparent;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn-primary { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-ghost { background: #FFFFFF; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { border-color: #B9C6DA; color: var(--text); background: #FAFBFD; }
.btn-block { width: 100%; justify-content: space-between; padding: 14px 16px; margin-top: 6px; }
.btn-arrow { font-size: 17px; }
.btn-small { padding: 8px 12px; font-size: 14px; border-radius: 9px; }
.btn-icon { width: 42px; height: 42px; padding: 0; font-size: 19px; }
.form-error { min-height: 22px; margin: 10px 0 0; color: var(--red); font-size: 14px; }
.login-note {
  display: flex; gap: 9px; margin-top: 26px; padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint); font-size: 14px; line-height: 1.7;
}
.lock-mini { color: var(--accent); font-size: 17px; line-height: 1.2; }
.login-foot { margin: 46px 0 0; color: var(--faint); font-size: 13px; letter-spacing: 0.05em; }

/* ---------------------------------------------------------------- shell */
.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 26px 18px 18px;
  display: flex; flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line-soft);
  z-index: 20;
}
.side-label { margin: 40px 12px 10px; color: var(--faint); font-size: 13px; letter-spacing: 0.1em; }
.side-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  text-align: left;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.nav-item:hover { color: var(--text); background: #EFF3F8; }
.nav-item.active {
  color: var(--accent-deep);
  background: #FFFFFF;
  border-color: #D8E3FB;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  font-weight: 600;
}
.nav-icon { width: 20px; text-align: center; color: var(--faint); font-size: 16px; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-item i { margin-left: auto; font-style: normal; font-size: 13px; color: #9AA5B4; }
.side-spacer { flex: 1; }
.side-status { padding: 13px 12px; border: 1px solid var(--line-soft); border-radius: 11px; background: #FFFFFF; }
.side-status-label { color: var(--faint); font-size: 13px; margin-bottom: 8px; }
.source-pill { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; }
.source-pill.bad .live-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12); }
.source-pill.ok .live-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(15, 123, 79, 0.12); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.source-meta { margin-top: 6px; color: var(--faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  margin-top: 10px; padding: 10px 12px;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--faint); text-align: left; font-size: 15px;
}
.logout-btn:hover { color: var(--red); background: var(--red-soft); }
.side-version { margin: 14px 12px 0; color: #9AA5B4; font-size: 12px; }

.main { min-width: 0; padding: 30px clamp(20px, 3vw, 46px) 46px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.title-wrap h1 { margin: 8px 0 6px; font-size: clamp(26px, 2.2vw, 34px); line-height: 1.2; font-weight: 700; }
.title-wrap p { margin: 0; color: var(--muted); font-size: 15px; }
.top-actions { display: flex; align-items: center; gap: 10px; padding-top: 8px; }
.range-tabs {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #FFFFFF;
}
.range-tabs button {
  border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  padding: 8px 13px; font-size: 15px; transition: background 0.16s, color 0.16s;
}
.range-tabs button:hover { color: var(--text); background: #F1F4F9; }
.range-tabs button.active { color: #FFFFFF; background: var(--accent); font-weight: 600; }

/* --------------------------------------------------------------- alerts */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; margin-bottom: 18px;
  border: 1px solid #F2DFBE; border-radius: 11px;
  background: var(--amber-soft);
  color: #7A4B08; font-size: 15px; line-height: 1.65;
}
.alert::before {
  content: "!"; display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #FBE6C4; color: var(--amber); font-weight: 700; font-size: 13px;
  flex: 0 0 auto; margin-top: 2px;
}
.alert.danger { border-color: #F6C9C4; background: var(--red-soft); color: #8C2C21; }
.alert.danger::before { background: #FAD9D5; color: var(--red); }
.alert.info { border-color: #D8E3FB; background: var(--accent-soft); color: #1E4FA8; }
.alert.info::before { content: "i"; background: #DCE7FD; color: var(--accent); }

/* --------------------------------------------------------------- filters */
.filter-row { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-group { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field > span, .date-field > span { color: var(--faint); font-size: 14px; }
.filter-field select { min-width: 176px; padding: 9px 34px 9px 12px; font-size: 15px; }
.range-note { margin-left: auto; color: var(--faint); font-size: 14px; padding-bottom: 10px; }
.custom-range { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.date-field { display: flex; flex-direction: column; gap: 6px; }
.date-field input { width: 150px; padding: 9px 10px; font-size: 15px; }
.date-sep { color: var(--faint); padding-bottom: 10px; font-size: 15px; }

/* ------------------------------------------------------------------ kpis */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi {
  position: relative; min-width: 0;
  padding: 18px 18px 16px;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 15px; }
.kpi-mark { color: var(--faint); font-size: 13px; }
.kpi strong {
  display: block; margin: 10px 0 5px;
  color: var(--text); font-size: 26px; line-height: 1.2; font-weight: 700;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.kpi p { margin: 0; color: var(--faint); font-size: 14px; min-height: 18px; }
.kpi-hero { border-color: #D8E3FB; background: linear-gradient(160deg, #F5F8FF, #FFFFFF 62%); }
.kpi-hero strong { color: var(--accent-deep); }
.kpi-profit strong { color: var(--green); }
.kpi-profit.negative strong { color: var(--red); }
.kpi-warn { border-color: #F2DFBE; background: linear-gradient(160deg, #FFFBF2, #FFFFFF 68%); }
.kpi-warn strong { color: var(--amber); }
.kpi-warn.zero { border-color: var(--line-soft); background: var(--panel); }
.kpi-warn.zero strong { color: var(--muted); }

/* ---------------------------------------------------------------- tables */
.panel { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.table-panel { overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px 15px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2, .panel-head h3 { margin: 4px 0 4px; font-size: 20px; font-weight: 700; }
.panel-head h3 { font-size: 18px; }
.panel-head p { margin: 0; color: var(--faint); font-size: 14px; line-height: 1.6; }
.table-head { align-items: center; flex-wrap: wrap; }
.table-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box span { position: absolute; left: 12px; color: var(--faint); font-size: 16px; pointer-events: none; }
.search-box input { width: 230px; padding: 9px 12px 9px 32px; font-size: 15px; border-radius: 9px; }
.check-field { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 15px; white-space: nowrap; cursor: pointer; }
.check-field input, .toggle-field input { width: 17px; height: 17px; accent-color: var(--accent); }
.table-wrap { overflow-x: auto; }
.table-panel .table-wrap { max-height: 640px; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 1080px; }
.data-table th {
  position: sticky; top: 0; z-index: 2;
  padding: 13px 14px; border-bottom: 1px solid var(--line);
  background: #F7F9FC;
  color: var(--muted); font-size: 15px; font-weight: 600;
  text-align: left; white-space: nowrap;
}
.data-table th.num { text-align: right; }
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--accent); }
.sort-ind { display: inline-block; width: 10px; color: #9AA5B4; font-size: 12px; margin-left: 4px; }
th.sorted { color: var(--accent-deep); }
th.sorted .sort-ind { color: var(--accent); }
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
  color: var(--text); font-size: 15px; vertical-align: middle;
}
.data-table tbody tr:hover { background: #F8FAFD; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td.num { text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table td.money { font-weight: 600; }
.data-table td.negative { color: var(--red); font-weight: 600; }
.data-table td.positive { color: var(--green); font-weight: 600; }
.data-table tr.missing-row { background: #FFFCF5; box-shadow: inset 3px 0 var(--amber); }
.channel-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.channel-avatar {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft); border: 1px solid #D8E3FB;
  color: var(--accent-deep); font-size: 13px; font-weight: 600;
  flex: 0 0 auto;
}
.channel-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.channel-name b { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.channel-name small { font-size: 13px; color: var(--faint); }
.model-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 15px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border: 1px solid var(--line); border-radius: 7px;
  color: var(--muted); background: #FFFFFF; font-size: 13px; white-space: nowrap;
}
.badge.exact { color: var(--accent-deep); border-color: #C9DAFB; background: var(--accent-soft); }
.badge.channel { color: #1E6B8C; border-color: #C4E2EF; background: #EDF7FB; }
.badge.model { color: var(--violet); border-color: #DDD0FA; background: var(--violet-soft); }
.badge.missing { color: var(--amber); border-color: #F2DFBE; background: var(--amber-soft); }
.badge.multiplier { color: #9C2A6B; border-color: #F3D2E4; background: #FDF0F7; }
.missing-text { color: var(--amber); font-size: 14px; font-weight: 600; }
.loading-row { padding: 40px 16px !important; text-align: center !important; color: var(--faint) !important; font-size: 15px !important; }
.table-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--line-soft);
  color: var(--faint); font-size: 14px;
}
.foot-sep { color: #C3CBD8; }

/* ----------------------------------------------------------------- empty */
.empty { padding: 50px 20px; text-align: center; }
.empty-mark {
  width: 46px; height: 46px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--faint); font-size: 16px; background: #FFFFFF;
}
.empty h3 { margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0; color: var(--faint); font-size: 15px; }
.empty.compact { padding: 26px 14px; }
.page-footnote { margin: 14px 2px 0; color: var(--faint); font-size: 14px; line-height: 1.75; }

/* --------------------------------------------------------------- config */
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head.subhead h2 { margin: 0 0 4px; font-size: 24px; font-weight: 700; }
.section-head.subhead p { margin: 0; color: var(--muted); font-size: 15px; }
.section-desc { max-width: 1080px; line-height: 1.7; }
.config-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-top: 4px; }
.mini-select { width: auto; padding: 8px 30px 8px 11px; font-size: 14px; border-radius: 9px; }
.config-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 16px; overflow-x: auto; }
.config-tabs button {
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); padding: 11px 14px 12px; font-size: 15px; white-space: nowrap;
}
.config-tabs button:hover { color: var(--text); }
.config-tabs button.active { color: var(--accent-deep); border-bottom-color: var(--accent); font-weight: 600; }
.config-tabs button span {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 6px; background: #EEF2F8; color: var(--faint); font-size: 13px;
}
.config-panel { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.config-table { min-width: 980px; }
.config-table td { padding-top: 11px; padding-bottom: 11px; }
.config-table .actions-col { text-align: right; width: 112px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  border: 1px solid var(--line); background: #FFFFFF; color: var(--muted);
  border-radius: 8px; width: 32px; height: 31px;
  display: grid; place-items: center; font-size: 15px;
}
.icon-btn:hover { color: var(--accent); border-color: #AEC6F4; }
.icon-btn.danger:hover { color: var(--red); border-color: #EFBDB8; }
.note-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: 14px; }
.version-time { font-size: 14px; color: var(--muted); white-space: nowrap; }
.version-time small { display: block; color: var(--faint); font-size: 13px; }
.state-tag { display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 13px; font-weight: 600; }
.state-tag.now { color: var(--green); background: var(--green-soft); border: 1px solid #C4E7D6; }
.state-tag.past { color: var(--faint); background: #F2F4F8; border: 1px solid var(--line-soft); }
.billing-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr); gap: 16px; }
.form-panel, .security-panel { padding-bottom: 20px; }
.form-panel > .field, .form-panel > .toggle-field, .form-panel > .btn, .form-panel > .detected-box { margin-left: 20px; margin-right: 20px; }
.form-panel > .field { margin-bottom: 14px; }
.form-panel .panel-head { margin-bottom: 18px; }
.toggle-field { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; margin-bottom: 4px; color: var(--muted); font-size: 15px; cursor: pointer; }
.toggle-field span { display: flex; flex-direction: column; gap: 3px; }
.toggle-field b { color: var(--text); font-weight: 600; }
.toggle-field small { color: var(--faint); font-size: 14px; line-height: 1.55; }
.detected-box {
  padding: 11px 12px; margin-bottom: 14px;
  border: 1px dashed #C9D6E5; border-radius: 9px;
  color: var(--faint); font-size: 14px; line-height: 1.7; background: #FAFBFD;
}
.detected-box strong { color: var(--accent-deep); font-weight: 600; }
.detected-box button { margin-top: 6px; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 14px; }
.stack-form { padding: 0 20px; }
.security-note {
  display: flex; gap: 8px; margin: 14px 20px 0; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint); font-size: 14px; line-height: 1.7;
}
.password-banner { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 13px 18px; border-color: #F2DFBE; background: var(--amber-soft); color: var(--muted); font-size: 15px; }
.password-banner strong { color: var(--amber); white-space: nowrap; }

/* ------------------------------------------------------------- snapshots */
.snapshot-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.snapshot-meta .meta-card {
  flex: 1 1 220px; padding: 14px 16px;
  border: 1px solid var(--line-soft); border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow);
}
.snapshot-meta span { display: block; color: var(--faint); font-size: 14px; }
.snapshot-meta strong { display: block; margin-top: 5px; font-size: 17px; font-weight: 600; color: var(--text); }
#snapshotsView .panel + .panel { margin-top: 16px; }

/* --------------------------------------------------------------- schema */
.schema-warnings { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.schema-warning {
  display: flex; gap: 9px; padding: 11px 14px;
  border: 1px solid #F2DFBE; border-radius: 9px;
  background: var(--amber-soft); color: #7A4B08; font-size: 15px;
}
.schema-warning::before { content: "!"; color: var(--amber); font-weight: 700; }
.schema-ok {
  padding: 11px 14px; border: 1px solid #C4E7D6; border-radius: 9px;
  background: var(--green-soft); color: #136445; font-size: 15px;
}
.schema-ok::before { content: "●"; margin-right: 8px; color: var(--green); }
.schema-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.schema-card {
  padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow);
}
.schema-card span { display: block; color: var(--faint); font-size: 14px; }
.schema-card strong {
  display: block; margin-top: 6px; color: var(--text); font-size: 16px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.schema-lower { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 16px; margin-top: 16px; }
.schema-table { min-width: 700px; }
.schema-table td { font-size: 15px; }
.status-ok { color: var(--green); font-size: 14px; font-weight: 600; }
.status-no { color: var(--faint); font-size: 14px; }
.code-block {
  margin: 0; padding: 16px 18px; max-height: 260px; overflow: auto;
  color: #1F2937; background: #F7F9FC;
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
}
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 18px; }
.type-chip {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); font-size: 14px; background: #FFFFFF;
}
.type-chip b { color: var(--accent-deep); }

/* ---------------------------------------------------------------- modal */
.modal {
  width: min(660px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: #FFFFFF;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.18);
}
.modal::backdrop { background: rgba(17, 24, 39, 0.32); }
.modal form { padding: 22px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.modal-head h2 { margin: 6px 0 0; font-size: 22px; font-weight: 700; }
.modal-hint { margin: 9px 0 18px; color: var(--faint); font-size: 15px; line-height: 1.65; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.form-grid .field[hidden] { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 10px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
#ruleError { margin-bottom: 0; }
.icon-btn[aria-label="关闭"] { font-size: 19px; line-height: 1; border: 0; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 100;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 16px;
  border: 1px solid #C4E7D6; border-radius: 10px;
  background: #F1FAF5; color: #136445;
  font-size: 15px; box-shadow: var(--shadow);
  transform: translateY(12px); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: #EFBDB8; background: var(--red-soft); color: #8C2C21; }
.noscript { padding: 20px; color: var(--red); font-size: 16px; }

/* --------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1360px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .schema-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 216px minmax(0, 1fr); }
  .sidebar { padding-left: 13px; padding-right: 13px; }
  .billing-grid, .schema-lower { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr 430px; }
  .login-art { padding-left: 40px; padding-right: 40px; }
}
@media (max-width: 880px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .app-shell { display: block; }
  .sidebar {
    position: static; height: auto; padding: 16px 16px 12px;
    border-right: 0; border-bottom: 1px solid var(--line-soft);
  }
  .side-label, .side-status, .side-version, .side-spacer { display: none; }
  .side-nav { flex-direction: row; gap: 6px; margin-top: 14px; overflow-x: auto; }
  .nav-item { width: auto; flex: 0 0 auto; padding: 9px 12px; font-size: 15px; }
  .nav-item i { display: none; }
  .logout-btn { position: absolute; top: 16px; right: 14px; margin: 0; width: 42px; height: 36px; padding: 0; text-align: center; font-size: 0; }
  .logout-btn span { font-size: 16px; }
  .main { padding: 22px 16px 34px; }
  .topbar { flex-direction: column; gap: 14px; }
  .top-actions { padding-top: 0; width: 100%; justify-content: space-between; }
  .range-tabs { flex-wrap: wrap; }
  .range-note { margin-left: 0; padding-bottom: 0; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-head { flex-direction: column; align-items: flex-start; }
  .table-tools { width: 100%; justify-content: flex-start; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
  .section-head { flex-direction: column; }
  .config-actions { padding-top: 0; justify-content: flex-start; }
}
@media (max-width: 620px) {
  .login-main { padding: 32px 22px; }
  .kpi-grid { gap: 10px; }
  .kpi { padding: 14px 14px 12px; }
  .kpi strong { font-size: 22px; }
  .topbar h1 { font-size: 25px; }
  .custom-range { width: 100%; }
  .date-field { flex: 1; }
  .date-field input { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .modal form { padding: 18px; }
  .schema-grid { grid-template-columns: 1fr; }
}
