/* =========================================================
   多聚AI — 全局样式（简洁风格：中性灰底、白色卡片、单一强调色）
   结构：设计变量 → 基础 → 布局 → 组件 → 登录页 → 响应式
   ========================================================= */

/* ---------- 1. 设计变量（浅色） ---------- */
:root {
  color-scheme: light;
  --brand: #0071e3;          /* 唯一强调色 */
  --brand-hover: #0077ed;
  --brand-soft: rgba(0, 113, 227, .08);
  --accent: #0071e3;

  --bg: #f5f5f7;             /* 页面底色 */
  --surface: #ffffff;        /* 卡片 */
  --surface-2: #f5f5f7;      /* 次级区域 / 输入底 */
  --fill: rgba(120, 120, 128, .12);   /* 灰色填充（次按钮、分段控件轨道） */
  --border: rgba(0, 0, 0, .08);
  --border-strong: rgba(0, 0, 0, .16);

  --text: #1d1d1f;
  --text-2: #424245;
  --text-3: #86868b;

  --good: #248a3d;   --good-bg: rgba(52, 199, 89, .12);
  --warn: #b25000;   --warn-bg: rgba(255, 159, 10, .14);
  --bad:  #d70015;   --bad-bg:  rgba(255, 59, 48, .10);
  --info: #0066cc;   --info-bg: rgba(0, 113, 227, .08);

  /* 图表分类色（已用校验脚本验证，勿随意改动） */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #7a5af8;
  --grid: rgba(0, 0, 0, .06);
  --axis: #86868b;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, .14);
  --sidebar-w: 232px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.25, .1, .25, 1);
}

/* ---------- 深色（跟随系统，可被手动切换覆盖） ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #2997ff; --brand-hover: #47a6ff; --brand-soft: rgba(41, 151, 255, .14); --accent: #2997ff;
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e;
    --fill: rgba(118, 118, 128, .24);
    --border: rgba(255, 255, 255, .08); --border-strong: rgba(255, 255, 255, .16);
    --text: #f5f5f7; --text-2: #d2d2d7; --text-3: #8e8e93;
    --good: #30d158; --good-bg: rgba(48, 209, 88, .14); --warn: #ff9f0a; --warn-bg: rgba(255, 159, 10, .14);
    --bad: #ff453a; --bad-bg: rgba(255, 69, 58, .14); --info: #64d2ff; --info-bg: rgba(100, 210, 255, .12);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #8b70ff;
    --grid: rgba(255, 255, 255, .07); --axis: #8e8e93;
    --shadow: none; --shadow-pop: 0 12px 40px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #2997ff; --brand-hover: #47a6ff; --brand-soft: rgba(41, 151, 255, .14); --accent: #2997ff;
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e;
  --fill: rgba(118, 118, 128, .24);
  --border: rgba(255, 255, 255, .08); --border-strong: rgba(255, 255, 255, .16);
  --text: #f5f5f7; --text-2: #d2d2d7; --text-3: #8e8e93;
  --good: #30d158; --good-bg: rgba(48, 209, 88, .14); --warn: #ff9f0a; --warn-bg: rgba(255, 159, 10, .14);
  --bad: #ff453a; --bad-bg: rgba(255, 69, 58, .14); --info: #64d2ff; --info-bg: rgba(100, 210, 255, .12);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #8b70ff;
  --grid: rgba(255, 255, 255, .07); --axis: #8e8e93;
  --shadow: none; --shadow-pop: 0 12px 40px rgba(0, 0, 0, .6);
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -.005em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 3. 布局 ---------- */
.app { display: flex; min-height: 100vh; }

/* 侧边栏：与页面同底色，无边框 */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 22px 18px;
  font-weight: 600; font-size: 16px; letter-spacing: -.02em;
}
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg);
}
.brand-logo svg { width: 17px; height: 17px; stroke: currentColor; }
.brand small { display: none; }

.nav { padding: 4px 12px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11px; color: var(--text-3); padding: 16px 10px 6px; font-weight: 500; }
.nav > .nav-group:first-child { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin: 1px 0; border-radius: 8px;
  color: var(--text-2); font-weight: 450; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-item svg.icon { width: 17px; height: 17px; color: var(--text-3); }
.nav-item:hover { background: var(--fill); color: var(--text); }
.nav-item.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.nav-item.active svg.icon { color: var(--brand); }
.nav-item .badge-dot { margin-left: auto; font-size: 11px; background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; }

.sidebar-foot { padding: 16px 22px 22px; }
.plan-card b { display: flex; flex-direction: column; font-size: 12px; font-weight: 400; color: var(--text-3); }
.plan-card b .num { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -.02em; margin-top: 2px; }
.plan-card b .num.delta-down { color: var(--bad); }
.plan-card p { font-size: 12px; color: var(--text-3); margin: 2px 0 12px; }

/* 主区域 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 15px; font-weight: 600; }
.topbar .crumb { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search {
  display: flex; align-items: center; gap: 6px;
  background: var(--fill);
  border-radius: 10px; padding: 6px 10px; width: 220px; color: var(--text-3);
}
.search svg.icon { width: 15px; height: 15px; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--text); font-size: 13px; }
.search input::-webkit-search-cancel-button { display: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--text-2); cursor: pointer; position: relative;
  transition: background .2s var(--ease);
}
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); border: 1.5px solid var(--bg); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; font-size: 13px; color: #fff;
  background: #8e8e93;
  cursor: pointer; flex: none; margin-left: 4px;
}
.menu-toggle { display: none; }

.content { padding: 8px 32px 56px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page { display: none; animation: fade .35s var(--ease); }
.page.active { display: block; }
@keyframes fade { from { opacity: .5; } to { opacity: 1; } }

/* ---------- 4. 组件 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--text-3); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt { margin-top: 16px; }

/* 按钮：胶囊形；主按钮蓝底，次按钮灰色填充 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px; border-radius: 980px;
  border: 0; background: var(--fill); color: var(--text);
  font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .2s var(--ease), opacity .2s var(--ease), transform .1s;
}
.btn svg.icon { width: 15px; height: 15px; }
.btn:hover { background: color-mix(in srgb, var(--fill) 100%, var(--text) 6%); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }

/* 分段控件 */
.segmented { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { flex: none; white-space: nowrap; border: 0; background: transparent; padding: 4px 12px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: background .2s var(--ease); }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
:root[data-theme="dark"] .segmented button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button.on { background: #636366; } }

/* 标签 */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.tag-good { background: var(--good-bg); color: var(--good); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-bad  { background: var(--bad-bg);  color: var(--bad); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-gray { background: var(--fill); color: var(--text-2); }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input, .select, .textarea {
  height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface);
  outline: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); width: 100%;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.input::placeholder { color: var(--text-3); }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--brand); }

/* 统计卡片：去掉彩色图标，只留标签 + 大数字 */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-top { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; font-weight: 400; }
.stat-icon { display: none; }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.stat-value small { font-size: 14px; font-weight: 400; color: var(--text-3); margin-left: 2px; letter-spacing: 0; }
.stat-foot { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta-up { color: var(--good); font-weight: 500; }
.delta-down { color: var(--bad); font-weight: 500; }

/* 图表 */
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.legend { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.legend-row .val { margin-left: auto; font-weight: 500; }
.legend-row .pct { width: 44px; text-align: right; color: var(--text-3); }
.donut-wrap { display: flex; flex-direction: column; }
.donut-wrap .chart-box { height: 180px; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; text-align: center; }
.donut-center b { font-size: 22px; font-weight: 600; display: block; letter-spacing: -.02em; }
.donut-center span { font-size: 12px; color: var(--text-3); }
.view-toggle { font-size: 12px; color: var(--brand); cursor: pointer; background: none; border: 0; padding: 0; }

/* 表格：无表头底色，只有细分隔线 */
.table-wrap { overflow-x: auto; margin: 0 -24px -22px; }
table.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { padding: 12px 24px; text-align: left; border-top: 1px solid var(--border); white-space: nowrap; }
.table th { font-size: 12px; font-weight: 500; color: var(--text-3); background: transparent; border-top: 0; padding-top: 4px; padding-bottom: 10px; }
.table tr:hover td { background: color-mix(in srgb, var(--fill) 40%, transparent); }
.table .r { text-align: right; }
.cell-main { display: flex; align-items: center; gap: 10px; }
.subject-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.pager { display: flex; align-items: center; gap: 8px; padding: 16px 0 0; justify-content: flex-end; color: var(--text-3); font-size: 13px; }

/* 进度条 */
.progress { height: 4px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }

/* 工具栏 / 筛选标签 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; height: 34px; }
.toolbar .spacer { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 0; background: var(--fill); border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-2); transition: background .2s var(--ease); }
.chip.on { background: var(--text); color: var(--bg); }

/* 弹窗 & 提示 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .32);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal-mask.show { display: flex; }
.modal { background: var(--surface); border-radius: 20px; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-pop); animation: pop .25s var(--ease); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 22px 24px 4px; display: flex; align-items: center; }
.modal-head h3 { font-size: 17px; font-weight: 600; }
.modal-head .icon-btn { margin-left: auto; width: 28px; height: 28px; background: var(--fill); }
.modal-head .icon-btn svg.icon { width: 14px; height: 14px; }
.modal-body { padding: 16px 24px; }
.modal-foot { padding: 8px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; }

.toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  color: var(--text); padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-pop); animation: pop .25s var(--ease); max-width: calc(100vw - 32px);
}

/* 下拉菜单 */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop);
  min-width: 220px; padding: 6px; display: none; z-index: 50;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu .head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-menu .head b { display: block; font-weight: 600; }
.dropdown-menu .head span { font-size: 12px; color: var(--text-3); }
.dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px; color: var(--text); cursor: pointer; }
.dropdown-menu a svg.icon { width: 16px; height: 16px; color: var(--text-3); }
.dropdown-menu a:hover { background: var(--brand); color: #fff; }
.dropdown-menu a:hover svg.icon { color: #fff; }
.notice-item { padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.notice-item:hover { background: var(--fill); }
.notice-item small { display: block; color: var(--text-3); }

/* 设置 */
.settings-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.settings-row:first-of-type { border-top: 0; }
.settings-row .txt { flex: 1; }
.settings-row .txt b { display: block; font-size: 14px; font-weight: 500; }
.settings-row .txt span { font-size: 12px; color: var(--text-3); }
.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--fill); position: relative; cursor: pointer; border: 0; flex: none; transition: background .25s var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch.on { background: #34c759; }
.switch.on::after { transform: translateX(18px); }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.profile-head .avatar { width: 60px; height: 60px; font-size: 24px; margin: 0; }

.empty { text-align: center; padding: 40px 0; color: var(--text-3); }

/* 代码块 / 等宽 / 复制行 */
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.code {
  position: relative; margin: 0;
  background: var(--surface-2); border-radius: 12px;
  padding: 14px 16px; overflow-x: auto; white-space: pre; line-height: 1.65;
  font-family: var(--mono); font-size: 12.5px; color: var(--text); letter-spacing: 0;
}
.code .c { color: var(--text-3); }
.code .k { color: var(--brand); }
.code-wrap { position: relative; }
.code-wrap .copy-btn { position: absolute; top: 8px; right: 8px; }
.copy-row { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 5px 5px 5px 12px; min-width: 0; }
.copy-row .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 页面大标题行 */
.welcome { display: flex; align-items: flex-end; gap: 16px; margin: 16px 0 24px; flex-wrap: wrap; }
.welcome h2 { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.welcome p { color: var(--text-3); margin-top: 4px; }
.welcome .right { margin-left: auto; display: flex; gap: 8px; }

/* ---------- 5. 登录页：居中单列 ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 48px 16px; position: relative; }
.auth-aside { display: none; }
.auth-main { width: 100%; display: flex; justify-content: center; }
.auth-form { width: 100%; max-width: 360px; }
.auth-form .auth-mobile-brand { display: flex; justify-content: center; padding: 0; margin-bottom: 20px; }
.auth-form .auth-mobile-brand .brand-logo { width: 48px; height: 48px; border-radius: 12px; }
.auth-form .auth-mobile-brand .brand-logo svg { width: 26px; height: 26px; }
.auth-form .auth-mobile-brand > span:last-child { display: none; }
.auth-form h1 { font-size: 30px; font-weight: 700; text-align: center; letter-spacing: -.03em; }
.auth-form > p { color: var(--text-3); margin: 8px 0 28px; text-align: center; font-size: 15px; }
.tabs { display: flex; gap: 2px; background: var(--fill); border-radius: 10px; padding: 2px; margin-bottom: 24px; }
.tabs button { flex: 1; border: 0; background: transparent; height: 30px; border-radius: 8px; font-weight: 500; font-size: 13px; color: var(--text-2); cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
:root[data-theme="dark"] .tabs button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tabs button.on { background: #636366; } }
.auth .input { height: 44px; border-radius: 12px; font-size: 15px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick label { border: 1px solid var(--border-strong); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 13px; color: var(--text); }
.role-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-size: 13px; color: var(--text-2); }
.form-row label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.err { color: var(--bad); font-size: 12px; min-height: 18px; margin-top: -6px; margin-bottom: 8px; }
.auth-foot { text-align: center; margin-top: 24px; color: var(--text-3); font-size: 13px; }

/* ---------- 6. 响应式 ---------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .grid-2-1, .grid-1-1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-pop); background: var(--surface); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 35; }
  .menu-toggle { display: grid; }
  .search { display: none; }
  .topbar { padding: 0 12px; }
  .content { padding: 4px 16px 40px; }
  .welcome h2 { font-size: 24px; }
}
@media (max-width: 560px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-4 > .card { padding: 16px; }
  .card { padding: 18px; border-radius: 16px; }
  .table-wrap { margin: 0 -18px -18px; }
  .table th, .table td { padding-left: 18px; padding-right: 18px; }
  .stat-value { font-size: 22px; }
  .stat-top { font-size: 12px; }
  .toolbar .input, .toolbar .select { min-width: 0; flex: 1; }
  .welcome .right { margin-left: 0; }
}
/* 手机 / 触屏：输入框字号不小于 16px，否则 iOS Safari 聚焦输入框时会自动放大整页 */
@media (max-width: 860px), (pointer: coarse) {
  input, select, textarea, .input, .select, .textarea, .auth .input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
