/* ========== 设计变量（浅色 / 深色） ========== */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --text: #1d2129;
  --text-2: #4e5969;
  --muted: #86909c;
  --border: #e5e6eb;
  --border-strong: #c9cdd4;
  --primary: #3370ff;
  --primary-hover: #245bdb;
  --primary-weak: #e8efff;
  --danger: #f53f3f;
  --danger-weak: #ffece8;
  --success: #00a33a;
  --success-weak: #e8ffea;
  --warning: #f77200;
  --warning-weak: #fff4e6;
  --warning-strong: #f77200;
  --danger-strong: #f53f3f;
  --radius: 12px;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .18);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141416;
    --surface: #1e1e21;
    --surface-2: #26262a;
    --text: #eceef1;
    --text-2: #c2c6cd;
    --muted: #8a8f99;
    --border: #2f2f34;
    --border-strong: #4a4a52;
    --primary: #4d84ff;
    --primary-hover: #6b98ff;
    --primary-weak: #1c2742;
    --danger: #f76560;
    --danger-weak: #3a2121;
    --success: #2fc25b;
    --success-weak: #17301f;
    --warning: #ff9a2e;
    --warning-weak: #3a2a17;
    --warning-strong: #b85a00;
    --danger-strong: #c43333;
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .5);
  }
}

/* ========== 基础 ========== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.m-only { display: none; }
.ic { display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s; font-weight: 500;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(.95); }
.btn-danger-text { color: var(--danger); }
.btn-text { background: transparent; border-color: transparent; color: var(--primary); padding: 0 8px; }
.btn-text:hover { background: var(--primary-weak); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent;
  color: var(--text-2); cursor: pointer; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger-weak); }
.spinner {
  width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 表单 ========== */
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 140px; padding: 10px 12px; resize: vertical; line-height: 1.6; font-family: var(--mono); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 20px; }
.input-unit { display: flex; align-items: center; gap: 8px; flex: none; }
.input-unit input { width: 96px !important; text-align: right; }
.input-unit span { color: var(--muted); min-width: 28px; }
.radio { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  height: 30px; min-width: 44px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 13px; color: var(--text-2);
}
.chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); font-weight: 500; }

/* ========== 登录 ========== */
.login-view { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 24px 24px;
}
.login-logo {
  width: 48px; height: 48px; border-radius: 14px; background: var(--primary); color: #fff;
  display: grid; place-items: center; margin-bottom: 18px;
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); }
img.login-logo { width: 56px; height: 56px; border-radius: 50%; background: none; }
img.brand-mark { border-radius: 50%; background: none; }

/* ========== 顶栏 / 导航 ========== */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--surface);
  border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top);
}
@supports (backdrop-filter: blur(1px)) {
  .topbar { background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: saturate(180%) blur(14px); }
}
.topbar-inner { max-width: 1120px; margin: 0 auto; height: 56px; display: flex; align-items: center; gap: 24px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; flex: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.page-title { display: none; margin: 0; font-size: 17px; font-weight: 600; }
.topnav { display: flex; gap: 2px; flex: 1; }
.topnav a {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.active { background: var(--primary-weak); color: var(--primary); }
.account-btn {
  display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--text-2);
  padding: 4px 10px 4px 4px; border-radius: 20px; cursor: pointer; flex: none; font-weight: 500;
}
.account-btn:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-weak); color: var(--primary); display: grid; place-items: center; }
.tabbar { display: none; }
.main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 64px; }

/* ========== 卡片 ========== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 30px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .muted { font-size: 13px; }

/* ========== 概览 ========== */
.alert {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin-bottom: 16px;
  border-radius: var(--radius); border: 1px solid transparent;
}
.alert > svg { flex: none; }
.alert-warning { background: var(--warning-weak); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-warning > svg { color: var(--warning); }
.alert-danger { background: var(--danger-weak); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-danger > svg { color: var(--danger); }
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; }
.alert-text { font-size: 13px; color: var(--text-2); }
.kpis { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 30px; font-weight: 700; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.hero { background: var(--primary); border-color: var(--primary); color: #fff; }
.kpi.hero .kpi-label, .kpi.hero .kpi-sub { color: rgba(255, 255, 255, .8); }
.kpi.hero.warn { background: var(--warning-strong); border-color: var(--warning-strong); }
.kpi.hero.danger { background: var(--danger-strong); border-color: var(--danger-strong); }
.activity { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.act {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; text-align: left;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; cursor: pointer; transition: border-color .15s;
}
.act:hover { border-color: var(--primary); }
.act-num { font-size: 24px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.act-num.warn { color: var(--warning); }
.act-label { font-size: 12px; color: var(--muted); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.quick-btn {
  display: flex; align-items: center; gap: 14px; padding: 16px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s, transform .1s;
}
.quick-btn:hover { border-color: var(--primary); }
.quick-btn:active { transform: scale(.99); }
.quick-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-weak); color: var(--primary); flex: none; }
.quick-title { font-weight: 600; font-size: 15px; }
.quick-sub { font-size: 12px; color: var(--muted); }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 170px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.chart-bar { width: 100%; max-width: 44px; border-radius: 6px 6px 3px 3px; min-height: 3px; background: color-mix(in srgb, var(--primary) 40%, transparent); transition: height .4s ease; }
.chart-col.today .chart-bar { background: var(--primary); }
.chart-val { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.chart-col.today .chart-label { color: var(--primary); font-weight: 600; }

/* ========== 工具栏 ========== */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 180px; }
.search { position: relative; }
.search > .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 34px !important; }
.segmented {
  display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; flex: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  border: 0; background: transparent; padding: 4px 12px; border-radius: 6px; color: var(--text-2);
  cursor: pointer; white-space: nowrap; font-size: 13px; height: 28px;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); font-weight: 600; }
.segmented .count { color: var(--muted); font-weight: 400; margin-left: 3px; font-size: 12px; }

/* ========== 数据列表（电脑表格 / 手机卡片） ========== */
.dl-head, .dl-row { display: grid; grid-template-columns: var(--cols); gap: 14px; align-items: center; padding: 12px 6px; }
.dl-head { font-size: 12px; color: var(--muted); padding-top: 0; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-weight: 500; }
.dl-row { border-bottom: 1px solid var(--border); position: relative; transition: background .12s; }
.dl-row:last-child { border-bottom: 0; }
.dl-row.selectable { cursor: pointer; }
.dl-row.selectable:hover { background: var(--surface-2); }
.dl-row.selected, .dl-row.selected:hover { background: var(--primary-weak); }
.dl-row.inactive .dl-title { color: var(--muted); }
.dl-cell { min-width: 0; overflow-wrap: anywhere; }
.dl-title { font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dl-sub { font-size: 12px; color: var(--muted); }
.dl-actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.dl-check { display: flex; }
.check {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; color: #fff; transition: background .12s, border-color .12s;
}
.check svg { opacity: 0; }
.selected .check { background: var(--primary); border-color: var(--primary); }
.selected .check svg { opacity: 1; }
.check.disabled { opacity: .3; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag-success { background: var(--success-weak); color: var(--success); }
.tag-primary { background: var(--primary-weak); color: var(--primary); }
.tag-muted { background: var(--surface-2); color: var(--muted); }
.tag-warn { background: var(--warning-weak); color: var(--warning); }
.btn.on { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }
.pwd { font-family: var(--mono); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-size: 13px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; }
.pager:empty { display: none; }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); }
.empty-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 12px; }
.empty p { margin: 0 0 16px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 40px; color: var(--muted); }

/* ========== 上传 ========== */
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 28px 16px; text-align: center; transition: background .15s, border-color .15s; }
.dropzone.over { border-color: var(--primary); background: var(--primary-weak); }
.dropzone p { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 16px 0 8px; }
.progress > div { height: 100%; width: 0; background: var(--primary); border-radius: 3px; transition: width .2s; }
.upload-status { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
.upload-fail { margin-top: 8px; font-size: 13px; color: var(--danger); overflow-wrap: anywhere; }

/* ========== 多选操作条 ========== */
body.selecting .main { padding-bottom: 120px; }
.selbar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); white-space: nowrap;
}
.selbar .sel-count { margin-right: 6px; }
.selbar .btn { height: 34px; }
.selbar .btn-ghost { background: transparent; border-color: transparent; color: inherit; opacity: .85; }
.selbar .btn-ghost:hover { opacity: 1; background: rgba(127, 127, 127, .2); }

/* ========== 设置 ========== */
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-row:first-child { padding-top: 0; }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row > div:first-child { min-width: 0; }
.setting-label { font-weight: 500; }
.setting-desc { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; margin-top: 16px; }

/* ========== 弹窗 / 底部面板 ========== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity .18s;
}
.modal-backdrop.show { opacity: 1; }
.modal {
  background: var(--surface); border-radius: 16px; width: 100%; max-width: 500px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.98); transition: transform .2s ease;
}
.modal-backdrop.show .modal { transform: none; }
.modal.sm { max-width: 400px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 0 20px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 16px 20px 8px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 20px; }
.confirm-msg { margin: 0; color: var(--text-2); line-height: 1.7; }
.sheet-list { display: flex; flex-direction: column; margin: -4px -10px 8px; }
.sheet-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 12px; border: 0; background: transparent;
  border-radius: 10px; cursor: pointer; text-align: left; font-size: 15px; color: var(--text); width: 100%;
}
.sheet-item:hover { background: var(--surface-2); }
.sheet-item svg { color: var(--text-2); }
.sheet-item.danger, .sheet-item.danger svg { color: var(--danger); }
.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 10px; margin-bottom: 18px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 7px 0; border-radius: 8px; color: var(--text-2); cursor: pointer; font-weight: 500; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* ========== 账号密码结果 ========== */
.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.result-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--success-weak); color: var(--success); display: grid; place-items: center; flex: none; }
.result-title { font-weight: 600; font-size: 15px; }
.result-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.cred { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.cred-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 6px 0; }
.cred-row + .cred-row { border-top: 1px dashed var(--border); }
.cred-row > span { color: var(--muted); flex: none; }
.cred-row > b { font-family: var(--mono); font-weight: 600; font-size: 15px; text-align: right; overflow-wrap: anywhere; }
.cred-row > b.url { font-family: inherit; font-weight: 400; font-size: 13px; }
.code-hero {
  font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: 2px; text-align: center;
  background: var(--primary-weak); color: var(--primary); border-radius: 12px; padding: 16px 8px; margin-bottom: 12px;
}
.cred-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.cred-list { border: 1px solid var(--border); border-radius: 12px; max-height: 320px; overflow-y: auto; }
.cred-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.cred-item + .cred-item { border-top: 1px solid var(--border); }
.cred-item .mono { font-size: 13px; }
.note { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

/* ========== 提示 ========== */
.toast-host {
  position: fixed; left: 0; right: 0; top: calc(68px + env(safe-area-inset-top)); z-index: 1000;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.toast {
  display: flex; align-items: center; gap: 8px; background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 100%;
  animation: toast-in .2s ease; transition: opacity .2s, transform .2s;
}
.toast.success svg { color: var(--success); }
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* ========== 手机 ========== */
@media (max-width: 767px) {
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px; height: 42px; } /* 防止 iOS 聚焦时自动放大 */
  textarea { height: auto; }
  .m-only { display: inline; }
  .hide-m { display: none !important; }

  .topbar-inner { height: 52px; padding: 0 8px 0 16px; gap: 12px; }
  .brand, .topnav, .account-name { display: none; }
  .page-title { display: block; flex: 1; }
  .account-btn { padding: 4px; }
  .main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 5px; color: var(--muted); font-size: 11px; }
  .tabbar a.active { color: var(--primary); font-weight: 500; }

  .card { padding: 16px; border-radius: 14px; margin-bottom: 12px; }
  .kpis { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
  .kpi { padding: 12px; }
  .kpi.hero { grid-column: span 3; padding: 16px 18px; }
  .kpi-value { font-size: 24px; }
  .kpi.hero .kpi-value { font-size: 34px; }
  .quick { gap: 10px; margin-bottom: 12px; }
  .activity { gap: 8px; }
  .act { padding: 12px; }
  .quick-btn { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .alert { flex-wrap: wrap; margin-bottom: 12px; }
  .alert .btn { margin-left: 32px; }
  .chart { gap: 6px; height: 150px; }

  .toolbar > * { flex: 1 1 100%; }
  .toolbar .segmented { width: 100%; }
  .toolbar .segmented button { flex: 1; }
  .toolbar .grow { min-width: 0; }

  .dl-head { display: none; }
  .dl-row { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 14px 4px; align-items: flex-start; }
  .dl-cell { flex: 1 1 100%; }
  .dl-cell[data-label] { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; align-items: center; }
  .dl-cell[data-label]::before { content: attr(data-label); color: var(--muted); flex: none; }
  .dl-main { order: -1; flex: 1 1 0; padding-right: var(--act-w, 0px); margin-bottom: 4px; }
  .dl-check { order: -2; flex: 0 0 auto; padding-top: 2px; }
  .dl-actions { position: absolute; top: 9px; right: 0; }

  body.selecting .main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .selbar { left: 12px; right: 12px; transform: none; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .selbar .sel-count { flex: 1; }

  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    max-width: none !important; border-radius: 18px 18px 0 0; max-height: 92vh; max-height: 92dvh;
    padding-bottom: env(safe-area-inset-bottom); transform: translateY(100%);
  }
  .modal::before { content: ""; width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
  .modal-head { padding-top: 8px; }
  .modal-foot .btn { flex: 1; height: 46px; font-size: 15px; }
  .sheet-item { padding: 14px 12px; font-size: 16px; }
  .setting-row .input-unit input { width: 76px !important; }
  .setting-row .input-unit span { min-width: 0; }
  .setting-row > .btn { flex: none; }
}

/* ========== 启动页 ========== */
.splash { position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--bg); }
.splash img { width: 72px; height: 72px; border-radius: 50%; }
.splash-msg { color: var(--muted); font-size: 14px; min-height: 22px; display: flex; align-items: center; gap: 8px; }
.splash-msg a, .splash-msg button { color: inherit; font-weight: 600; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; }
