/* ============================================================
   商铺工程条件管理 · tokens.css
   设计系统：字体 / 令牌 / reset / 原子组件
   所有页面共用。禁止在页面内重定义颜色与字号。
   ============================================================ */

/* ---------- Fonts (self-hosted, offline) ---------- */
@font-face {
  font-family: 'InstrumentSans';
  src: url('../assets/fonts/InstrumentSans-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'InstrumentSans';
  src: url('../assets/fonts/InstrumentSans-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'BigShoulders';
  src: url('../assets/fonts/BigShoulders-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrainsMono';
  src: url('../assets/fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* 画布与面板 */
  --void: #07080A;
  --bg: #0A0C0F;
  --surface: #14181D;
  --surface-2: #1B2026;
  --surface-3: #232A31;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);

  /* 文字 */
  --text: #F1F5F8;
  --text-sub: #98A4B0;
  --text-muted: #66707B;
  --text-faint: #444D57;

  /* 品牌与数据 */
  --brand: #2DD4BF;
  --brand-hover: #5EEAD4;
  --brand-press: #14A997;
  --brand-soft: rgba(45, 212, 191, .14);
  --brand-ink: #041E1A;
  --data: #4CC9F0;
  --data-soft: rgba(76, 201, 240, .14);

  /* 语义 */
  --success: #35D07F;
  --warning: #F2C14E;
  --danger: #F5533D;
  --success-soft: rgba(53, 208, 127, .14);
  --warning-soft: rgba(242, 193, 78, .14);
  --danger-soft: rgba(245, 83, 61, .14);

  --overlay: rgba(4, 6, 8, .72);
  --scrim: rgba(4, 6, 8, .58);
  --glass-nav: rgba(12, 15, 19, .92);
  --glass-top: rgba(10, 12, 15, .88);
  --glass-adm: rgba(9, 11, 14, .86);

  /* 实底之上的文字与媒体层 */
  --ink-inverse: #FFFFFF;
  --media-black: #000000;
  --media-a: #14181D;
  --media-b: #0A0C0F;
  --nav-deep: #0C0F13;

  /* 中性阶（滚动条）与类型色（文件类型图标） */
  --surface-4: #2E363E;
  --type-doc: #A8B4C0;
  --type-audio: #B79CF5;
  --success-ink: #06210F;

  /* 字体 */
  --font-display: 'BigShoulders', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'InstrumentSans', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  --font-mono: 'JetBrainsMono', ui-monospace, Consolas, 'Microsoft YaHei', monospace;

  --fs-caption: 11px;
  --fs-label: 12px;
  --fs-body: 14px;
  --fs-title: 16px;
  --fs-h3: 20px;
  --fs-h2: 26px;
  --fs-display: 34px;

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* 投影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .40);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);

  /* 间距 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;

  /* 布局 */
  --phone-w: 430px;
  --sidebar-w: 240px;
  --admin-max: 1440px;

  /* 图标 */
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;

  /* 动效 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 260ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; background: none; border: none; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { width: 100%; border-collapse: collapse; table-layout: auto; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brand-soft); color: var(--text); }

/* 滚动条（仪器感：细、暗、hover 提亮） */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--r-pill); }
*::-webkit-scrollbar-thumb:hover { background: var(--surface-4); }

/* ---------- 氛围罩层（不得用纯色平铺） ---------- */
.tex {
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(45, 212, 191, .07), transparent 62%),
    radial-gradient(90% 60% at 100% 100%, rgba(76, 201, 240, .05), transparent 62%),
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px, 24px 24px;
  background-position: center top, center bottom, center center, center center;
}

/* ---------- 排版 ---------- */
.t-caption { font-size: var(--fs-caption); color: var(--text-muted); letter-spacing: .04em; }
.t-label { font-size: var(--fs-label); color: var(--text-sub); }
.t-sub { font-size: var(--fs-body); color: var(--text-sub); }
.t-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.t-disp { font-family: var(--font-display); font-weight: 700; letter-spacing: .01em; }
.t-title { font-size: var(--fs-title); font-weight: 700; }
.t-h3 { font-size: var(--fs-h3); font-weight: 700; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 图标 ----------
   lucide.createIcons() 会把 <span data-lucide="x"> 原地替换为
   <svg class="lucide lucide-x" data-lucide="x">（原元素的 class 会一并保留）。
   因此尺寸/颜色用 .lucide 或 svg.lucide 都可以；
   需要底色、圆形底或定位的图标容器，仍建议用独立包裹元素承载样式，避免语义混淆。
------------------------------------------------------------ */
svg.lucide { display: inline-block; vertical-align: middle; stroke-width: 1.75; flex: none; }
.lucide { width: var(--icon-md); height: var(--icon-md); }
.ico-16 .lucide, .lucide.ico-16 { width: 16px; height: 16px; }
.ico-18 .lucide, .lucide.ico-18 { width: 18px; height: 18px; }
.ico-20 .lucide, .lucide.ico-20 { width: 20px; height: 20px; }
.ico-24 .lucide, .lucide.ico-24 { width: 24px; height: 24px; }
.ico-28 .lucide, .lucide.ico-28 { width: 28px; height: 28px; }
.ico-32 .lucide, .lucide.ico-32 { width: 32px; height: 32px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 36px; padding: 0 var(--s4);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: transparent; color: var(--text);
  font-size: var(--fs-body); font-weight: 700; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--surface-2); }
.btn:active { background: var(--surface-3); transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { color: var(--text-faint); border-color: var(--border); pointer-events: none; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--primary:active { background: var(--brand-press); border-color: var(--brand-press); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: var(--ink-inverse); }
.btn--ghost { border-color: transparent; color: var(--text-sub); }
.btn--ghost:hover { color: var(--text); background: var(--surface-2); }
.btn--sm { height: 30px; padding: 0 var(--s3); font-size: var(--fs-label); font-weight: 400; }
.btn--lg { height: 44px; padding: 0 var(--s5); font-size: var(--fs-title); }
.btn--block { width: 100%; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-pill);
  color: var(--text-sub);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn:active { background: var(--surface-3); }
.iconbtn--sm { width: 28px; height: 28px; }
.iconbtn--on { color: var(--brand); }

/* ---------- 表单 ---------- */
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 var(--s3);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); font-size: var(--fs-body);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.textarea { height: auto; padding: var(--s3); resize: vertical; min-height: 88px; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.input[disabled], .select[disabled] { background: var(--surface); color: var(--text-faint); }
.select {
  appearance: none; padding-right: var(--s7); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-sub) 50%),
                    linear-gradient(135deg, var(--text-sub) 50%, transparent 50%);
  background-position: right 14px center, right 19px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field { display: flex; flex-direction: column; gap: var(--s2); }
.field__lb { font-size: var(--fs-label); color: var(--text-sub); }
.field__hint { font-size: var(--fs-caption); color: var(--text-muted); }

/* ---------- 商铺选择器（可输入筛选 + 可下拉） ---------- */
.spick { position: relative; }
.spick__ctl {
  display: flex; align-items: center; gap: var(--s2);
  height: 38px; padding: 0 var(--s2) 0 var(--s3);
  background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}
.spick__ctl:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.spick__ctl svg { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.spick__in {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-family: inherit; font-size: var(--fs-body); color: var(--text);
}
.spick__in::placeholder { color: var(--text-muted); }
.spick__tg {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer; padding: 2px;
  color: var(--text-muted); border-radius: var(--r-sm);
}
.spick__tg:hover { color: var(--brand); background: var(--surface); }
.spick__pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  max-height: 264px; overflow: auto; padding: var(--s1);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
}
.spick__i {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: var(--s2) var(--s3);
  background: transparent; border: 0; border-radius: var(--r-sm); cursor: pointer;
  color: var(--text); font-family: inherit;
}
.spick__i.is-hi, .spick__i:hover { background: var(--brand-soft); }
.spick__i.is-on { box-shadow: inset 2px 0 0 var(--brand); }
.spick__i b { font-size: var(--fs-label); font-weight: 700; }
.spick__i em {
  font-style: normal; font-size: var(--fs-caption); color: var(--text-muted);
  font-family: var(--font-mono);
}
.spick__empty { padding: var(--s3); text-align: center; font-size: var(--fs-caption); color: var(--text-muted); }
.field__err { font-size: var(--fs-caption); color: var(--danger); }
.switch {
  position: relative; width: 40px; height: 22px; flex: none;
  background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); cursor: pointer;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: var(--text-muted); border-radius: 50%;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.switch[aria-checked="true"] { background: var(--brand-soft); border-color: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--brand); }

/* ---------- 标签 / 状态 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 var(--s2);
  background: var(--surface-3); border-radius: var(--r-sm);
  font-size: var(--fs-caption); color: var(--text-sub); white-space: nowrap;
}
.tag--brand { background: var(--brand-soft); color: var(--brand); }
.tag--data { background: var(--data-soft); color: var(--data); }
.tag--ok { background: var(--success-soft); color: var(--success); }
.tag--warn { background: var(--warning-soft); color: var(--warning); }
.tag--err { background: var(--danger-soft); color: var(--danger); }

.st { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); color: var(--text-sub); }
.st::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); flex: none; }
.st--ok::before { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.st--warn::before { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.st--err::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.st--run::before { background: var(--data); box-shadow: 0 0 0 3px var(--data-soft); animation: pulse 1.6s var(--ease) infinite; }

/* ---------- 进度条 ---------- */
.bar { height: 4px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.bar__fill { height: 100%; background: var(--data); border-radius: var(--r-pill); transition: width var(--dur) var(--ease); }
.bar--brand .bar__fill { background: var(--brand); }
.bar--ok .bar__fill { background: var(--success); }
.bar--err .bar__fill { background: var(--danger); }
.bar--warn .bar__fill { background: var(--warning); }
.bar--lg { height: 8px; }

/* ---------- 头像 ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-pill);
  background: linear-gradient(140deg, var(--brand-soft), var(--surface-3));
  border: 1px solid var(--border-strong);
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-title); color: var(--brand);
  flex: none; overflow: hidden;
}
.avatar--sm { width: 28px; height: 28px; font-size: var(--fs-label); }
.avatar--lg { width: 64px; height: 64px; font-size: var(--fs-h2); }

/* ---------- 搜索输入（App 与后台共用） ---------- */
.searchbar { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.searchbar__f {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2);
  height: 38px; padding: 0 var(--s3);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.searchbar__f:hover { border-color: var(--border-strong); }
.searchbar__f:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.searchbar__f input { flex: 1; min-width: 0; font-size: var(--fs-body); outline: none; }
.searchbar__f .lucide { color: var(--text-muted); width: 18px; height: 18px; }

/* ---------- 磁盘占用条与图例（App 与后台共用，此前只写在 app.css 导致后台不可见） ---------- */
.diskbar { display: flex; height: 12px; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-3); }
.diskbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s3); }
.legend__i { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-caption); color: var(--text-sub); }
.legend__sw { width: 8px; height: 8px; border-radius: var(--r-sm); flex: none; }
/* ---------- 卡片 / 面板 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s4);
}
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.panel__hd {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s4); border-bottom: 1px solid var(--border); flex: none;
}
.panel__t { font-size: var(--fs-title); font-weight: 700; }
.panel__bd { padding: var(--s4); flex: 1 1 auto; min-height: 0; }
.panel__bd--flush { padding: 0; }

.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2);
}
.kpi__lb { font-size: var(--fs-label); color: var(--text-muted); }
.kpi__v { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h2); line-height: 1.1; }
.kpi__v small { font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.kpi__d { font-size: var(--fs-caption); color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.kpi__d--up { color: var(--success); }
.kpi__d--down { color: var(--danger); }

/* ---------- 表格 ---------- */
.tbl { font-size: var(--fs-body); }
.tbl th, .tbl td {
  padding: var(--s3); text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--border); overflow-wrap: anywhere;
}
.tbl thead th {
  background: var(--surface-2); color: var(--text-muted);
  font-size: var(--fs-label); font-weight: 400; letter-spacing: .04em;
  position: sticky; top: 0; z-index: 2;
}
.tbl tbody tr { transition: background var(--dur-fast) var(--ease); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tbl .col-act { width: 1%; white-space: nowrap; text-align: right; }
.tbl input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

.toolbar {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border);
}
.toolbar__sp { margin-left: auto; }

.pager { display: flex; align-items: center; gap: var(--s2); justify-content: flex-end; padding: var(--s3) var(--s4); }
.pager__info { margin-right: auto; font-size: var(--fs-label); color: var(--text-muted); font-family: var(--font-mono); }
.pager__btn {
  min-width: 30px; height: 30px; padding: 0 var(--s2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-sub); font-size: var(--fs-label);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.pager__btn:hover { background: var(--surface-2); color: var(--text); }
.pager__btn.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: var(--r-md); }
.seg__i {
  padding: 5px var(--s3); border-radius: 7px; font-size: var(--fs-label); color: var(--text-sub);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); white-space: nowrap;
}
.seg__i:hover { color: var(--text); }
.seg__i.is-on { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow-sm); }

/* ---------- 空态 / 骨架 / 加载 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s8) var(--s4); text-align: center; }
.empty__ic { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-faint); margin-bottom: var(--s1); }
.empty__ic .lucide { width: 24px; height: 24px; }
.empty__t { font-size: var(--fs-body); color: var(--text-sub); }
.empty__d { font-size: var(--fs-label); color: var(--text-muted); max-width: 34ch; }
.empty .btn { margin-top: var(--s2); }

.skel { background: var(--surface-3); border-radius: var(--r-sm); animation: breathe 1.4s var(--ease) infinite; }
.skel--line { height: 10px; }
.skel--row { height: 44px; border-radius: var(--r-md); }
.skel--card { height: 96px; border-radius: var(--r-lg); }

.spin { animation: spin 900ms linear infinite; }

/* ---------- Toast ---------- */
.toast-host {
  position: fixed; left: 50%; bottom: var(--s8); transform: translateX(-50%);
  z-index: 900; display: flex; flex-direction: column; gap: var(--s2); align-items: center;
  pointer-events: none; width: max-content; max-width: min(92vw, 420px);
}
.toast {
  display: flex; align-items: center; gap: var(--s2);
  padding: 10px var(--s4); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-md); font-size: var(--fs-label); color: var(--text);
  animation: rise var(--dur) var(--ease) both;
}
.toast--ok [data-lucide] { color: var(--success); }
.toast--err [data-lucide] { color: var(--danger); }

/* ---------- 遮罩 / 模态 / 抽屉 ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 800; background: var(--overlay);
  display: flex; align-items: center; justify-content: center; padding: var(--s5);
  animation: fade var(--dur) var(--ease) both;
}
.scrim--bottom { align-items: flex-end; padding: 0; }
.modal {
  width: 100%; max-width: 560px; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: rise var(--dur) var(--ease) both;
}
.modal__hd {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s4); border-bottom: 1px solid var(--border);
}
.modal__t { font-size: var(--fs-title); font-weight: 700; }
.modal__bd { padding: var(--s4); overflow-y: auto; }
.modal__ft {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--s3);
  padding: var(--s3) var(--s4); border-top: 1px solid var(--border);
}
.sheet {
  width: 100%; max-width: 560px; max-height: 82vh; display: flex; flex-direction: column;
  background: var(--surface); border-top: 1px solid var(--border-strong);
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: slide-up var(--dur-slow) var(--ease) both;
}
.sheet__grip { width: 36px; height: 4px; background: var(--surface-3); border-radius: var(--r-pill); margin: 10px auto 4px; flex: none; }
.sheet__hd { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s4); }
.sheet__t { font-size: var(--fs-title); font-weight: 700; }
.sheet__bd { padding: 0 var(--s4) var(--s5); overflow-y: auto; }

/* 抽屉行 / 菜单行 */
.row-opt {
  display: flex; align-items: center; gap: var(--s3); width: 100%;
  padding: var(--s3) 0; border-bottom: 1px solid var(--border); text-align: left;
  transition: opacity var(--dur-fast) var(--ease);
}
.row-opt:last-child { border-bottom: none; }
.row-opt:hover { opacity: .82; }
.row-opt__ic { color: var(--text-sub); }
.row-opt__tx { flex: 1; min-width: 0; }
.row-opt__tx b { display: block; font-size: var(--fs-body); font-weight: 400; }
.row-opt__tx em { display: block; font-style: normal; font-size: var(--fs-caption); color: var(--text-muted); margin-top: 2px; }
.row-opt[danger] .row-opt__tx b { color: var(--danger); }

.menu-pop {
  position: fixed; z-index: 850; min-width: 168px; padding: var(--s1);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  animation: rise var(--dur-fast) var(--ease) both;
}
.menu-pop__i {
  display: flex; align-items: center; gap: var(--s3); width: 100%;
  padding: var(--s2) var(--s3); border-radius: var(--r-sm);
  font-size: var(--fs-label); color: var(--text); text-align: left;
}
.menu-pop__i:hover { background: var(--surface-3); }
.menu-pop__i[danger] { color: var(--danger); }
.menu-pop__sep { height: 1px; background: var(--border); margin: var(--s1) 0; }

/* ---------- 工具类 ---------- */
.flex { display: flex; }
.col { display: flex; flex-direction: column; }
.ai-c { align-items: center; }
.ai-s { align-items: flex-start; }
.jc-b { justify-content: space-between; }
.jc-c { justify-content: center; }
.wrap { flex-wrap: wrap; }
.g1 { gap: var(--s1); } .g2 { gap: var(--s2); } .g3 { gap: var(--s3); }
.g4 { gap: var(--s4); } .g5 { gap: var(--s5); } .g6 { gap: var(--s6); }
.mt2 { margin-top: var(--s2); } .mt3 { margin-top: var(--s3); } .mt4 { margin-top: var(--s4); }
.mt5 { margin-top: var(--s5); } .mt6 { margin-top: var(--s6); }
.mb2 { margin-bottom: var(--s2); } .mb3 { margin-bottom: var(--s3); } .mb4 { margin-bottom: var(--s4); }
.grow { flex: 1; min-width: 0; }
.hr { height: 1px; background: var(--border); border: none; }
/* ---------- 布局工具：面板主体纵向填充 / 把元素推到面板底部 ---------- */
.panel__bd--fill { display: flex; flex-direction: column; }
.panel__bd--fill > * { min-height: 0; }
.panel__bd--fill > .textarea { min-height: 88px; }
.push-bottom { margin-top: auto; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 动效 ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes breathe { 0%, 100% { opacity: .55; } 50% { opacity: .95; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 页面载入错峰浮现 */
.reveal > * { animation: rise var(--dur-slow) var(--ease) both; }
.reveal > *:nth-child(1) { animation-delay: 0ms; }
.reveal > *:nth-child(2) { animation-delay: 60ms; }
.reveal > *:nth-child(3) { animation-delay: 120ms; }
.reveal > *:nth-child(4) { animation-delay: 180ms; }
.reveal > *:nth-child(5) { animation-delay: 240ms; }
.reveal > *:nth-child(6) { animation-delay: 300ms; }
.reveal > *:nth-child(7) { animation-delay: 360ms; }
.reveal > *:nth-child(8) { animation-delay: 420ms; }
.reveal > *:nth-child(n+9) { animation-delay: 480ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
