/* ============================================================
   心仪数据 · 后台管理端
   设计 token 与前台 www.xinyiidc.com 完全一致，不另起一套
   ============================================================ */

:root {
  /* 品牌色 · 九级 */
  --brand-50:  #eef4fe;
  --brand-100: #d9e6fd;
  --brand-200: #b8d1fb;
  --brand-300: #8ab2f7;
  --brand-400: #5a8ef2;
  --brand-500: #2f6fe8;
  --brand-600: #0b57d0;
  --brand-700: #0846ab;
  --brand-800: #073a8a;
  --brand-900: #062d69;

  /* 中性灰 · 九级 */
  --gray-50:  #fafbfc;
  --gray-100: #f5f7fa;
  --gray-200: #e4e9f0;
  --gray-300: #d3dae5;
  --gray-400: #b6c0cd;
  --gray-500: #8e9bab;
  --gray-600: #7d8a9b;
  --gray-700: #5c6a7c;
  --gray-800: #1d2a3d;

  /* 语义色 */
  --success-soft: #e6f4f1; --success: #0a8f80; --success-deep: #086b60;
  --warn-soft:    #fdf5e6; --warn:    #a86a12; --warn-deep:    #82500a;
  --danger-soft:  #fdecea; --danger:  #c0392b; --danger-deep:  #96261a;
  --info-soft:    #e8f0fe; --info:    #0b57d0; --info-deep:    #0842a0;
  --neutral-soft: #f2f4f7; --neutral: #5c6a7c; --neutral-deep: #34415a;

  /* 辅助强调 · 暖琥珀 */
  --gold-50:  #fff8ec;
  --gold-100: #fdf0d6;
  --gold-200: #f8e0b0;
  --gold-300: #f0c777;
  --gold-400: #e2a93f;
  --gold-500: #c9871a;
  --gold-600: #a86a12;
  --gold-700: #82500a;

  /* 语义别名 */
  --ink: #0d1523;
  --ink-2: var(--gray-800);
  --muted: var(--gray-700);
  --muted-2: var(--gray-600);
  --line: var(--gray-200);
  --line-strong: var(--gray-300);
  --bg: #ffffff;
  --bg-soft: var(--gray-100);
  --bg-softer: var(--gray-50);
  --surface: #ffffff;
  --accent: var(--brand-600);
  --accent-hover: var(--brand-700);
  --accent-weak: var(--brand-50);
  --accent-line: var(--brand-200);
  --accent-solid: var(--brand-600);
  --price: var(--gold-600);

  /* 兼容别名：部分页面的手写样式沿用旧命名，统一映射到上面的语义令牌，
     避免 var() 未定义导致背景透明 / 文字回落继承色（含暗色主题） */
  --card: var(--surface);
  --surface-2: var(--bg-soft);
  --ok: var(--success);
  --ok-bg: var(--success-soft);
  --danger-bg: var(--danger-soft);
  --danger-line: #ffa39e;
  --warn-bg: var(--warn-soft);
  --warn-line: #ffe58f;
  --primary: var(--accent-solid);

  --dark: #08121f;
  --dark-2: #0f1b2b;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(13, 21, 35, .04), 0 12px 28px -18px rgba(13, 21, 35, .22);
  --shadow-lift: 0 2px 4px rgba(13, 21, 35, .04), 0 18px 36px -22px rgba(13, 21, 35, .3);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur-1: 180ms;
  --dur-2: 280ms;
  --dur-3: 360ms;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, "Courier New", monospace;

  --fs-body: 14px;
  --header-h: 56px;
  --sidebar-w: 244px;
  --sidebar-w-min: 64px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9f0f7;
  --ink-2: #cfdae7;
  --muted: #a2b3c6;
  --muted-2: #8598ae;
  --line: #1b2a3d;
  --line-strong: #273a51;
  --bg: #0b1220;
  --bg-soft: #0f1b2b;
  --bg-softer: #0d1726;
  --surface: #0f1b2b;
  --accent: var(--brand-300);
  --accent-hover: var(--brand-200);
  --accent-weak: rgba(90, 142, 242, .14);
  --accent-line: rgba(90, 142, 242, .3);
  --accent-solid: var(--brand-500);
  --success-soft: rgba(79, 207, 180, .12); --success: #4fcfb4; --success-deep: #7ee2c4;
  --warn-soft: rgba(224, 176, 114, .12);   --warn: #e0b072;   --warn-deep: #f0c777;
  --danger-soft: rgba(240, 138, 122, .12); --danger: #f08a7a; --danger-deep: #ffb3a6;
  --info-soft: rgba(90, 142, 242, .14);    --info: #8ab2f7;   --info-deep: #b8d1fb;
  --neutral-soft: rgba(162, 179, 198, .1); --neutral: #a2b3c6; --neutral-deep: #cfdae7;
  --gold-50: rgba(226, 169, 63, .12);
  --gold-100: rgba(226, 169, 63, .18);
  --gold-200: rgba(226, 169, 63, .3);
  --gold-600: #e0b072;
  --gold-700: #f0c777;
  --price: var(--gold-300);
  --danger-line: rgba(240, 138, 122, .45);
  --warn-line: rgba(224, 176, 114, .45);
  --shadow: 0 0 0 1px var(--line-strong);
  --shadow-lift: 0 0 0 1px #2f4560;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.1px; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width var(--dur-2) var(--ease), flex-basis var(--dur-2) var(--ease);
  z-index: 40;
}
.adm.is-collapsed .sidebar { width: var(--sidebar-w-min); flex-basis: var(--sidebar-w-min); }

.sidebar__brand {
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.brand__mark {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 7px;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-800));
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.brand__name { font-size: 13.5px; font-weight: 650; letter-spacing: .2px; }
.brand__sub { font-size: 10.5px; color: var(--muted-2); letter-spacing: .6px; }
.adm.is-collapsed .brand__text { display: none; }

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px 18px;
  scrollbar-width: thin;
  position: relative;
}

/* ---------- 导航搜索 ---------- */
/* 搜索框固定在侧栏顶部：菜单再长也随时可搜，滚到下方时补一条分隔线 */
.nav-top {
  position: sticky;
  top: -10px;
  z-index: 50;
  background: var(--surface);
  padding: 10px 2px 6px;
  margin: 0 -2px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.sidebar__nav.is-scrolled .nav-top {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 10px -10px rgba(0, 0, 0, .28);
}
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 9px;
  margin: 0 2px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-soft);
  color: var(--muted-2);
}
.nav-search svg { width: 14px; height: 14px; flex: 0 0 14px; }
.nav-search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; outline: none;
  color: var(--ink); font-size: 12.5px;
}
.nav-search input::placeholder { color: var(--muted-2); }
.nav-results {
  position: absolute;
  left: 8px; right: 8px;
  top: 44px;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 4px;
  max-height: 320px;
  overflow-y: auto;
}
.nav-results__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--ink-2);
}
.nav-results__item:hover { background: var(--bg-soft); color: var(--ink); }
.nav-results__item svg { width: 13px; height: 13px; opacity: .5; }
.nav-results__code { font-size: 10.5px; color: var(--muted-2); flex: 0 0 34px; }
.nav-results__main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.nav-results__title { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-results__mod { font-size: 10.5px; color: var(--muted-2); }
.nav-results__empty { padding: 10px; font-size: 12px; color: var(--muted-2); text-align: center; }

/* ---------- 常用收藏 ---------- */
.nav-fav { margin-bottom: 8px; }
.nav-fav__label {
  font-size: 10.5px;
  letter-spacing: 1px;
  color: var(--muted-2);
  padding: 5px 8px;
}
.nav-fav__row {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
}
.nav-fav__row:hover { background: var(--bg-soft); }
.nav-fav__row.is-active { background: var(--accent-weak); }
.nav-fav__row.is-active .nav-fav__text { color: var(--accent); font-weight: 600; }
.nav-fav__link {
  flex: 1; min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 12.5px;
}
.nav-fav__code { font-size: 10.5px; color: var(--muted-2); flex: 0 0 auto; }
.nav-fav__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 两级手风琴 ---------- */
.nav-mod { margin-top: 2px; }
.nav-mod__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 35px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-1), color var(--dur-1);
}
.nav-mod__head:hover { background: var(--bg-soft); color: var(--ink); }
.nav-mod.is-active > .nav-mod__head { color: var(--accent); font-weight: 600; }
.nav-mod__icon { width: 16px; flex: 0 0 16px; display: grid; place-items: center; opacity: .9; }
.nav-mod__icon svg { width: 16px; height: 16px; }
.nav-mod__text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-mod__chev { width: 14px; flex: 0 0 14px; display: grid; place-items: center; opacity: .55; transition: transform var(--dur-1); }
.nav-mod__chev svg { width: 13px; height: 13px; }
.nav-mod.is-open .nav-mod__chev { transform: rotate(180deg); }

.nav-mod__body {
  margin: 2px 0 4px 17px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 7px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
  position: relative;
  white-space: nowrap;
}
.nav-sub:hover { background: var(--bg-soft); color: var(--ink); }
.nav-sub.is-active { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.nav-sub.is-active::before {
  content: "";
  position: absolute; left: -10px; top: 7px; bottom: 7px;
  width: 2.5px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-sub__code {
  font-size: 10px;
  color: var(--muted-2);
  flex: 0 0 33px;
  letter-spacing: -.2px;
}
.nav-sub.is-active .nav-sub__code { color: var(--accent); opacity: .8; }
.nav-sub__text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-sub__star {
  width: 18px; flex: 0 0 18px;
  display: grid; place-items: center;
  color: var(--muted-2);
  opacity: 0;
  cursor: pointer;
  border-radius: 4px;
}
.nav-sub__star svg { width: 12px; height: 12px; }
.nav-sub:hover .nav-sub__star { opacity: .7; }
.nav-sub__star:hover { color: var(--warn); opacity: 1 !important; }
.nav-sub__star.is-on { opacity: 1; color: var(--warn); }
.nav-sub__star.is-on svg { fill: currentColor; }

/* 无权限：整项置灰 + 可见「无权限」标签，点击只提示不跳转 */
.nav-sub.is-disabled { opacity: .5; cursor: not-allowed; }
.nav-sub.is-disabled:hover { background: transparent; color: var(--muted-2); }
.nav-sub__deny {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 16px;
  padding: 0 4px;
  border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
  color: var(--danger);
  border-radius: 4px;
  white-space: nowrap;
}
.nav-fav__link.is-disabled { opacity: .5; cursor: not-allowed; }
.nav-results__item.is-disabled { opacity: .5; cursor: not-allowed; }
.nav-results__item.is-disabled:hover { background: transparent; }

/* 折叠态：只留一级模块图标 */
.adm.is-collapsed .nav-search,
.adm.is-collapsed .nav-results,
.adm.is-collapsed .nav-fav,
.adm.is-collapsed .nav-mod__text,
.adm.is-collapsed .nav-mod__chev,
.adm.is-collapsed .nav-mod__body { display: none; }
.adm.is-collapsed .nav-mod__head { justify-content: center; padding: 0; }


/* 全部展开 / 全部收起：固定在侧栏底部，两个动作并列，不随导航滚动 */
.sidebar__bulk {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid var(--line);
}
.sidebar__bulk .btn { padding: 0 6px; }
.adm.is-collapsed .sidebar__bulk { grid-template-columns: 1fr; gap: 4px; padding: 6px; }
.adm.is-collapsed .sidebar__bulk .btn { padding: 0; }
.adm.is-collapsed .sidebar__bulk .btn span { display: none; }

.sidebar__foot {
  border-top: 1px solid var(--line);
  padding: 8px;
}
.adm.is-collapsed .sidebar__foot .btn span { display: none; }

/* ---------- 主区 ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: background var(--dur-1), color var(--dur-1), border-color var(--dur-1);
  position: relative;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn__dot {
  position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--surface);
}

.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted-2);
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
}
.crumb > * { flex: 0 0 auto; white-space: nowrap; }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb__sep { opacity: .45; }

.searchbox {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--muted-2);
  width: 260px;
  transition: border-color var(--dur-1), box-shadow var(--dur-1), width var(--dur-2);
}
.searchbox:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
  width: 320px;
}
.searchbox svg { width: 14px; height: 14px; flex: 0 0 14px; }
.searchbox input { border: 0; background: transparent; outline: none; width: 100%; font-size: 13px; }
.searchbox kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  color: var(--muted-2);
  background: var(--bg-softer);
}

.whoami {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 8px 0 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  transition: background var(--dur-1);
  position: relative;
}
.whoami:hover { background: var(--bg-soft); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-400), var(--brand-700));
  color: #fff; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600;
  flex: 0 0 26px;
}
.whoami__meta { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.whoami__name { font-size: 12.5px; font-weight: 600; }
.whoami__role { font-size: 10.5px; color: var(--muted-2); }

.content {
  flex: 1;
  padding: 20px 22px 48px;
  min-width: 0;
}

/* ============================ 页头 ============================ */
.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.page-head__main { flex: 1; min-width: 0; }
.page-title {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.2px;
  display: flex; align-items: center; gap: 9px;
}
.page-desc { color: var(--muted); font-size: 12.8px; margin-top: 4px; max-width: 780px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
  background: transparent;
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1), transform .12s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent-solid); color: #fff; }
.btn--primary:hover { background: var(--brand-700); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink-2); background: var(--bg); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost.is-active { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn--ghost.is-active:hover { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }
.btn--soft { background: var(--bg-soft); color: var(--ink-2); }
.btn--soft:hover { background: var(--bg-softer); color: var(--accent); }
.btn--sm { height: 27px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn--lg { height: 38px; padding: 0 18px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 14px; height: 14px; }

/* ============================ 危险操作 ============================ */
/* 统一危险色系：所有不可逆操作同一红色，避免四种色相并列出戏
   钱 / 机 / 客 / 敏 只作为角标文字 + 图标区分类型，不再各自换色 */
.dz {
  --dz-c: var(--danger);
  --dz-bg: var(--danger-soft);
  --dz-line: color-mix(in srgb, var(--danger) 30%, transparent);
}
.dz--money,
.dz--machine,
.dz--customer,
.dz--sensitive {
  --dz-c: var(--danger);
  --dz-bg: var(--danger-soft);
  --dz-line: color-mix(in srgb, var(--danger) 30%, transparent);
}
/* 类型角标：同色系，靠字符 + 图标区分类型 */
.dz--money .dz-tag,
.dz--machine .dz-tag,
.dz--customer .dz-tag,
.dz--sensitive .dz-tag {
  font-weight: 700;
  letter-spacing: 0;
}

/* 标签 */
.dz-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 17px; padding: 0 4px;
  border-radius: 4px;
  font-size: 10.5px; font-weight: 700;
  line-height: 1;
  color: var(--dz-c);
  background: var(--dz-bg);
  border: 1px solid var(--dz-line);
  flex: 0 0 auto;
}
.dz-tags { display: inline-flex; gap: 3px; vertical-align: middle; }

/* 危险按钮：与普通按钮刻意区分 —— 左侧色条 + 描边 + 角标 */
.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px 0 11px;
  border-radius: 7px;
  border: 1px solid var(--dz-line);
  background: var(--bg);
  color: var(--dz-c);
  font-size: 13px; font-weight: 550;
  position: relative;
  transition: background var(--dur-1), border-color var(--dur-1), box-shadow var(--dur-1);
}
.btn-danger::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--dz-c);
  opacity: .85;
}
.btn-danger:hover {
  background: var(--dz-bg);
  border-color: var(--dz-c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dz-c) 12%, transparent);
}
.btn-danger.btn--sm { height: 27px; font-size: 12px; padding: 0 9px 0 9px; }
.btn-danger.btn--sm::before { top: 5px; bottom: 5px; }
/* 实心危险按钮：深底 + 左侧色条 + 白字，避免被误读为普通主按钮 */
.btn-danger--solid {
  background: color-mix(in srgb, var(--dz-c) 12%, #101826);
  color: #fff;
  border-color: color-mix(in srgb, var(--dz-c) 46%, transparent);
  box-shadow: inset 3px 0 0 var(--dz-c);
}
.btn-danger--solid::before { display: none; }
.btn-danger--solid .dz-tag { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-danger--solid:hover {
  background: color-mix(in srgb, var(--dz-c) 22%, #101826);
  border-color: var(--dz-c);
  box-shadow: inset 3px 0 0 var(--dz-c), 0 0 0 3px color-mix(in srgb, var(--dz-c) 14%, transparent);
}

/* 危险操作行：表格里出现时整行左侧留出细条，提示这行有危险动作 */
tr.has-danger td:first-child { box-shadow: inset 2.5px 0 0 var(--dz-c); }

/* ============================ 卡片 / 面板 ============================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card__head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.card__title { font-size: 13.5px; font-weight: 640; display: flex; align-items: center; gap: 7px; }
.card__sub { font-size: 11.5px; color: var(--muted-2); }
.card__head-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card__body { padding: 16px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 11px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }

.grid { display: grid; gap: 14px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ============================ KPI ============================ */
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 15px 13px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1);
}
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.kpi__label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi__value {
  font-size: 26px; font-weight: 660; letter-spacing: -.6px;
  margin-top: 6px; line-height: 1.15;
  display: flex; align-items: baseline; gap: 5px;
}
.kpi__value small { font-size: 12px; font-weight: 500; color: var(--muted-2); letter-spacing: 0; }
.kpi__foot { margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 11.5px; color: var(--muted-2); }
.kpi__foot .trend { white-space: nowrap; }
.kpi__spark { position: absolute; right: 12px; top: 12px; opacity: .5; }
.kpi--alert { border-color: color-mix(in srgb, var(--danger) 26%, var(--line)); }
.kpi--alert .kpi__value { color: var(--danger); }
.kpi--warn .kpi__value { color: var(--warn); }
.kpi--ok .kpi__value { color: var(--success); }
.kpi--money .kpi__value { color: var(--price); font-family: var(--mono); letter-spacing: -.8px; }

.trend { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; }
.trend--up { color: var(--success); }
.trend--down { color: var(--danger); }

/* ============================ 徽标 ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px;
  border-radius: 5px;
  font-size: 11.5px; font-weight: 550;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--neutral-deep);
  border: 1px solid transparent;
}
.badge--ok { background: var(--success-soft); color: var(--success-deep); }
.badge--warn { background: var(--warn-soft); color: var(--warn-deep); }
.badge--danger { background: var(--danger-soft); color: var(--danger-deep); }
.badge--info { background: var(--info-soft); color: var(--info-deep); }
.badge--gold { background: var(--gold-50); color: var(--gold-600); }
.badge--line { background: transparent; border-color: var(--line-strong); color: var(--muted); }
.badge__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ============================ 筛选栏 ============================ */
.filters {
  display: flex;
  flex-wrap: wrap;
  /* 对齐基准：输入框 / 下拉框的垂直中线。
     字段格是「10.5px 标签 + 32px 控件」，高度约 52px；若按 center 对齐，
     32px 的按钮会落到标签与控件之间，看起来偏上。改为底边对齐，
     再把栏内小按钮抬到 32px 与控件等高，中线与底边同时对齐。
     仅作用于 .filters 的直接子元素，不影响弹层底部、表格行内与表单提交按钮。 */
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 0;
}
.filters > .btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.filters > .muted-2 { align-self: flex-end; margin-bottom: 8px; }
.filters > .spacer { align-self: stretch; }
/* 字段格一律按块级排：display:flex（不是 inline-flex）。
   inline-flex 会让「标签 + 输入框」缩成内容宽，后面的按钮/第二个字段就挤到同一行，
   A33 账号状态页的「禁用账号」「设置到期 / 清除到期」就是这样错位的。
   筛选行（.filters 为 flex 容器）与 .field-inline 仍按原有行列布局，不受影响。 */
.field { display: flex; flex-direction: column; gap: 3px; }
.field__label { font-size: 10.5px; color: var(--muted-2); letter-spacing: .3px; padding-left: 2px; }
.input, .select {
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  font-size: 13px;
  outline: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
  min-width: 0;
}
.input::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.input--search { width: 220px; }
.select { appearance: none; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 13px) 14px, calc(100% - 9px) 14px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  color: var(--ink);
}
.select:disabled { opacity: .45; cursor: not-allowed; background-color: var(--bg-soft); }
.seg {
  display: inline-flex;
  padding: 2px;
  background: var(--bg-soft);
  border-radius: 7px;
  gap: 2px;
}
.seg__item {
  height: 26px; padding: 0 10px;
  border: 0; background: transparent;
  border-radius: 5px;
  font-size: 12.5px; color: var(--muted);
  transition: background var(--dur-1), color var(--dur-1);
}
.seg__item.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(13,21,35,.08); }

/* ============================ 表格 ============================ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table.data { font-size: 13px; min-width: 900px; }
table.data thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .3px;
  padding: 9px 12px;
  background: var(--bg-softer);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.sortable:hover { color: var(--ink); }
.sort-ind { display: inline-block; margin-left: 3px; opacity: .35; font-size: 9px; }
table.data thead th.is-sorted .sort-ind { opacity: 1; color: var(--accent); }
table.data tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background var(--dur-1); }
table.data tbody tr:hover { background: var(--bg-softer); }
table.data tbody tr.is-selected { background: var(--accent-weak); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); font-size: 12.5px; }
table.data .cell-main { font-weight: 550; color: var(--ink); }
table.data .cell-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 1px; }
table.data .cell-actions { display: flex; gap: 5px; justify-content: flex-end; align-items: center; }

/* 拖动排序：行首手柄 + 拖拽中的视觉反馈 */
table.data th.drag-cell, table.data td.drag-cell { width: 28px; padding-right: 0; }
.drag-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 22px; color: var(--muted-2); cursor: grab;
  user-select: none; letter-spacing: -1px; font-size: 12px;
}
tr[draggable="true"]:hover .drag-handle { color: var(--ink); }
tr.is-dragging { opacity: .45; }
tr.is-drop-target { box-shadow: inset 0 2px 0 var(--accent); }

/* 紧凑变体：抽屉 / 卡片内的辅助明细表，去掉 900px 底宽，靠 .table-scroll 兜底 */
table.data.compact { min-width: 0; font-size: 12px; }
table.data.compact thead th { padding: 6px 8px; font-size: 11px; letter-spacing: .2px; }
table.data.compact tbody td { padding: 6px 8px; }
table.data.compact .cell-actions { gap: 4px; }

.check {
  width: 15px; height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg);
  display: inline-grid; place-items: center;
  cursor: pointer;
  vertical-align: middle;
  transition: background var(--dur-1), border-color var(--dur-1);
}
.check.is-on { background: var(--accent-solid); border-color: var(--accent-solid); }
.check.is-on::after {
  content: ""; width: 7px; height: 4px;
  border-left: 1.6px solid #fff; border-bottom: 1.6px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.check.is-indet { background: var(--accent-solid); border-color: var(--accent-solid); }
.check.is-indet::after { content: ""; width: 7px; height: 1.6px; background: #fff; }

.bulkbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--accent-weak);
  border-bottom: 1px solid var(--accent-line);
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 550;
}

/* 分页 */
.pager {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-wrap: wrap;
}
.pager__pages { display: flex; gap: 3px; margin-left: auto; }
.pager__size { display: inline-flex; align-items: center; gap: 5px; color: var(--muted-2); }
.pager__size select {
  height: 27px;
  padding: 0 22px 0 7px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237d8a9b' stroke-width='2.4'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 6px center;
  font-size: 12px;
  color: var(--ink-2);
  appearance: none;
  cursor: pointer;
}
.pager__size select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.pager__btn {
  min-width: 27px; height: 27px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  font-size: 12.5px;
  padding: 0 7px;
  color: var(--ink-2);
}
.pager__btn:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.pager__btn.is-active { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; font-weight: 600; }
.pager__btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ============================ 表单 ============================ */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-section { }
.form-section__title {
  font-size: 12.5px; font-weight: 650;
  color: var(--ink);
  padding-bottom: 9px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 7px;
}
.form-section__hint { font-weight: 400; font-size: 11.5px; color: var(--muted-2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .col-2 { grid-column: span 2; }
.form-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-item__label { font-size: 12.5px; font-weight: 550; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.form-item__req { color: var(--danger); }
.form-item__hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }
.textarea {
  min-height: 74px;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  font-size: 13px;
  resize: vertical;
  outline: none;
  line-height: 1.55;
}
.textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.input--full, .select--full, .textarea--full { width: 100%; }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 9px; }
.radio-card {
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color var(--dur-1), background var(--dur-1), box-shadow var(--dur-1);
  position: relative;
  background: var(--bg);
}
.radio-card:hover { border-color: var(--accent-line); }
.radio-card.is-on {
  border-color: var(--accent);
  background: var(--accent-weak);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.radio-card__title { font-size: 12.8px; font-weight: 620; display: flex; align-items: center; gap: 6px; }
.radio-card__desc { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.radio-card[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

.switch {
  width: 34px; height: 19px;
  border-radius: 999px;
  background: #d3d8e0;
  box-shadow: inset 0 0 0 1px #b7bec9;
  border: 0;
  position: relative;
  transition: background var(--dur-1), box-shadow var(--dur-1);
  flex: 0 0 34px;
  cursor: pointer;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; transition: transform var(--dur-2) var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch.is-on { background: #17994e; box-shadow: inset 0 0 0 1px #127c3f; }
.switch.is-on::after { transform: translateX(15px); }

/* 开关旁的状态文字：仅靠颜色不够，补「开 / 关」文字避免误读 */
.pay-switch-cell { display: inline-flex; align-items: center; gap: 6px; }
.pay-switch-text { font-size: 11.5px; color: var(--muted); line-height: 1; }
.pay-switch-text.is-on { color: #17994e; font-weight: 600; }

.inline-note {
  display: flex; gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--info-soft);
  color: var(--info-deep);
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid color-mix(in srgb, var(--info) 18%, transparent);
}
.inline-note--warn { background: var(--warn-soft); color: var(--warn-deep); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.inline-note--danger { background: var(--danger-soft); color: var(--danger-deep); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.inline-note--ok { background: var(--success-soft); color: var(--success-deep); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.inline-note svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 2px; }

/* ============================ 抽屉 / 弹层 ============================ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(8, 18, 31, .42);
  backdrop-filter: blur(1.5px);
  z-index: 90;
  opacity: 0;
  animation: fadeIn var(--dur-2) var(--ease) forwards;
}
@keyframes fadeIn { to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px) scale(.995); } to { opacity: 1; transform: none; } }
@keyframes slideLeft { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 94vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  z-index: 91;
  display: flex; flex-direction: column;
  box-shadow: -18px 0 40px -28px rgba(8,18,31,.5);
  animation: slideLeft var(--dur-2) var(--ease);
}
.drawer--wide { width: min(760px, 96vw); }
.drawer__head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto;
}
.drawer__title { font-size: 14px; font-weight: 650; }
/* 抽屉：头部与底部按钮固定，只有正文滚动。min-height:0 让 flex 子项按剩余高度收缩，
   否则长表单会把底部「取消/保存」顶出视口。 */
.drawer__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; }
.drawer__foot { padding: 11px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex: 0 0 auto; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(470px, 94vw);
  /* 弹窗永远不高于视口：超长表单在 .modal__body 内滚动，头尾操作区始终可见 */
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -30px rgba(8,18,31,.55);
  z-index: 92;
  animation: slideUp var(--dur-2) var(--ease);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal--danger { border-color: color-mix(in srgb, var(--dz-c, var(--danger)) 34%, var(--line)); }
.modal__head {
  padding: 15px 18px 0;
  display: flex; align-items: flex-start; gap: 10px;
  flex: 0 0 auto;
}
.modal__icon {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--dz-bg, var(--danger-soft));
  color: var(--dz-c, var(--danger));
}
.modal__icon svg { width: 16px; height: 16px; }
.modal__title { font-size: 14.5px; font-weight: 660; line-height: 1.4; }
.modal__sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal__body { padding: 14px 18px 4px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal__foot { padding: 14px 18px 16px; display: flex; gap: 8px; justify-content: flex-end; flex: 0 0 auto; }

/* 改前 → 改后 */
.diff {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.diff__row { display: grid; grid-template-columns: 82px 1fr; gap: 10px; padding: 8px 11px; border-bottom: 1px solid var(--line); }
.diff__row:last-child { border-bottom: 0; }
.diff__k { color: var(--muted-2); font-size: 11.5px; }
.diff__v { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.diff__before { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.diff__arrow { color: var(--muted-2); }
.diff__after { color: var(--ink); font-weight: 600; }

.irreversible {
  display: flex; gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent);
  color: var(--danger-deep);
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 14px;
}
.irreversible svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; }

.pw-field { position: relative; }
.pw-field .input { width: 100%; padding-right: 58px; letter-spacing: 1px; }
.pw-field__toggle {
  position: absolute; right: 6px; top: 5px;
  height: 22px; padding: 0 6px;
  border: 0; background: transparent;
  font-size: 11px; color: var(--muted-2);
  border-radius: 4px;
}
.pw-field__toggle:hover { background: var(--bg-soft); color: var(--ink); }

/* ============================ Toast ============================ */
.toasts {
  position: fixed;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--dark);
  color: #f2f6fb;
  font-size: 12.8px;
  box-shadow: 0 14px 30px -18px rgba(0,0,0,.6);
  animation: slideUp var(--dur-2) var(--ease);
  pointer-events: auto;
  max-width: min(560px, 92vw);
}
.toast svg { width: 15px; height: 15px; flex: 0 0 15px; }
.toast--ok svg { color: #6fe0c4; }
.toast--err svg { color: #ff9d8c; }
.toast--info svg { color: #9dc0ff; }
html[data-theme="dark"] .toast { background: #16233a; color: var(--ink); }

/* ============================ 空态 / 加载 ============================ */
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted-2);
}
.empty__art {
  width: 46px; height: 46px;
  margin: 0 auto 12px;
  border-radius: 12px;
  border: 1.5px dashed var(--line-strong);
  display: grid; place-items: center;
  color: var(--line-strong);
}
.empty__art svg { width: 20px; height: 20px; }
.empty__title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.empty__desc { font-size: 12px; max-width: 340px; margin: 0 auto 14px; line-height: 1.6; }

.skel {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg-softer) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 5px;
  height: 12px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.spinner {
  width: 15px; height: 15px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 34px; color: var(--muted); font-size: 12.5px; }

/* ============================ 时间线 ============================ */
.timeline { position: relative; padding-left: 18px; }
.timeline::before {
  content: ""; position: absolute; left: 4.5px; top: 5px; bottom: 5px;
  width: 1.5px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 15px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -17.5px; top: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-strong);
}
.tl-item.is-done::before { border-color: var(--success); background: var(--success); }
.tl-item.is-active::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.tl-item.is-fail::before { border-color: var(--danger); background: var(--danger); }
.tl-time { font-size: 11px; color: var(--muted-2); font-family: var(--mono); }
.tl-title { font-size: 12.8px; font-weight: 550; margin-top: 1px; }
.tl-desc { font-size: 11.8px; color: var(--muted); margin-top: 2px; line-height: 1.55; }

/* ============================ 描述列表 ============================ */
.dl { display: grid; grid-template-columns: 96px 1fr; gap: 9px 12px; font-size: 12.8px; }
.dl__k { color: var(--muted-2); font-size: 12px; }
.dl__v { color: var(--ink); min-width: 0; word-break: break-word; }
.dl--wide { grid-template-columns: 118px 1fr; }

/* ============================ 进度 / 健康 ============================ */
.bar { height: 5px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width var(--dur-3) var(--ease); }
.bar__fill--ok { background: var(--success); }
.bar__fill--warn { background: var(--warn); }
.bar__fill--danger { background: var(--danger); }

.health { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.health__dot { width: 6px; height: 6px; border-radius: 50%; }
.health--ok .health__dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.health--warn .health__dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.health--bad .health__dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.health--off .health__dot { background: var(--line-strong); }

/* ============================ 标签页 ============================ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  height: 35px; padding: 0 13px;
  border: 0; background: transparent;
  font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-1), border-color var(--dur-1);
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab__count { font-family: var(--mono); font-size: 10.5px; padding: 0 4px; border-radius: 4px; background: var(--bg-soft); color: var(--muted); }
/* 配置型页签：带通道状态徽标 + 未保存标记（A66） */
.tab__badge { font-size: 10px; padding: 0 5px; line-height: 15px; font-weight: 600; letter-spacing: 0; }
.tab__unsaved { font-size: 10px; padding: 0 5px; line-height: 15px; border-radius: 999px; background: var(--warn-soft); color: var(--warn-deep); }
.tab__unsaved[hidden] { display: none; }
/* 通道总览（不占页签）：四路状态一屏看全 */
.ov-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ov-grid { grid-template-columns: 1fr; } }
.ov { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--bg-softer); }
.ov__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ov__top .badge { flex: 0 0 auto; }
.ov__name { font-size: 12.5px; font-weight: 600; }
.ov__meta { font-size: 11px; color: var(--muted-2); margin-top: 4px; line-height: 1.45; }
/* 未保存提示条与页签面板依赖 hidden 属性控制显隐，需压过 .inline-note 的 display:flex */
[data-dirtybar][hidden], [data-cpanel][hidden] { display: none; }
/* 窄屏页签不换行、改为横向滑动，避免整页被撑出横向滚动 */
@media (max-width: 640px) {
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > .tab { flex: 0 0 auto; }
}

/* 模块内页面页签（顶部平铺，多页签横向滚动，不退回列表页） */
.page-tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.page-tabs::-webkit-scrollbar { height: 4px; }
.page-tabs::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px; }
.page-tabs .tab { flex: 0 0 auto; white-space: nowrap; text-decoration: none; }
.page-tabs .tab__code { font-size: 10.5px; color: var(--muted-2); padding: 0 4px; border-radius: 3px; background: var(--bg-soft); }
.page-tabs .tab.is-active .tab__code { color: var(--accent); background: var(--accent-soft, var(--bg-soft)); }
.page-tabs .tab--hub { margin-left: auto; gap: 4px; color: var(--muted-2); }
.page-tabs .tab--hub svg { width: 13px; height: 13px; }

/* 渠道与上游：软件商只读文本 + 供货方就地编辑 */
.ro-text { font-size: 12.5px; }
.ro-text + .muted-2 { margin-top: 2px; }
.inline-edit { display: flex; align-items: center; gap: 6px; }
.inline-edit .input { height: 28px; font-size: 12px; min-width: 150px; max-width: 220px; padding: 0 8px; }

/* 渠道档案表（A55）：5 列 878px，1180 视口内容区 890px 即可放满，不产生横向滚动；
   仅表头纵向吸顶，不做左右列固定（避免横滚时裁出半列错位） */
.ch-scroll { max-height: 60vh; overflow: auto; }
table.data.ch-table { table-layout: fixed; min-width: 878px; }
.ch-table thead th { z-index: 4; }
.ch-table .inline-edit { align-items: center; }
.ch-table .inline-edit .health { flex: 0 0 auto; }
.ch-table .inline-edit .input {
  flex: 1 1 auto; width: auto; min-width: 0; max-width: none;
  height: 30px; font-size: 12.5px; border-style: dashed;
}
.ch-table .inline-edit .input:hover { border-color: var(--line-strong); }
.ch-table .inline-edit .input:focus { border-style: solid; border-color: var(--accent); }
.ch-ro {
  display: flex; align-items: flex-start; gap: 5px; min-width: 0;
  color: var(--muted); font-size: 12.5px; line-height: 1.35;
}
.ch-ro svg { width: 12px; height: 12px; flex: 0 0 12px; margin-top: 3px; color: var(--muted-2); }
.ch-ro span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ch-table td .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 接入地址：域名 / API 两行，标签弱化、值用等宽字体，超长省略并靠 title 补全 */
.ch-addr { display: flex; align-items: baseline; gap: 5px; min-width: 0; line-height: 1.5; }
.ch-addr__k {
  flex: 0 0 auto; font-size: 10.5px; color: var(--muted-2);
  padding: 0 4px; border-radius: 3px; background: var(--bg-soft); letter-spacing: .2px;
}
.ch-addr .mono {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; color: var(--ink-2);
}
.ch-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.ch-actions .btn { padding-left: 8px; padding-right: 8px; }

/* 只读连通测试：探测步骤表（抽屉内，四列等宽网格，不依赖 table 的最小宽度） */
.ch-steps { font-size: 12px; }
.ch-step {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) 52px 58px;
  gap: 8px; align-items: start;
  padding: 8px 14px; border-top: 1px solid var(--line);
}
.ch-step:first-child { border-top: 0; }
.ch-step--head {
  font-size: 10.5px; color: var(--muted-2); letter-spacing: .3px;
  background: var(--bg-softer); padding-top: 6px; padding-bottom: 6px;
}
.ch-step__name { color: var(--ink-2); font-weight: 550; }
.ch-step__val { color: var(--muted); word-break: break-all; font-size: 11.5px; line-height: 1.5; }
.ch-step__ms { color: var(--muted-2); text-align: right; font-size: 11.5px; }

/* 窄屏：渠道表转卡片式，取消横向滚动，每行一个渠道 */
@media (max-width: 640px) {
  .ch-scroll { max-height: none; overflow: visible; }
  table.data.ch-table { display: block; min-width: 0; table-layout: auto; }
  .ch-table thead { display: none; }
  .ch-table tbody { display: block; }
  .ch-table tbody tr {
    display: block; padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .ch-table tbody tr:last-child { border-bottom: 0; }
  .ch-table tbody td,
  .ch-table tbody td:first-child,
  .ch-table tbody td:last-child {
    display: block; position: static; width: auto !important;
    padding: 6px 0; border: 0; box-shadow: none; background: transparent;
    text-align: left;
  }
  .ch-table tbody td::before {
    content: attr(data-label);
    display: block; margin-bottom: 3px;
    font-size: 10.5px; color: var(--muted-2);
  }
  .ch-table tbody td:first-child::before { display: none; }
  .ch-table tbody td.num { text-align: left; }
  .ch-table tbody td:first-child {
    padding: 0 0 8px; border-bottom: 1px dashed var(--line);
    margin-bottom: 4px;
  }
  .ch-table tbody td:first-child .input { height: 34px; font-size: 13.5px; }
  .ch-table tbody td:first-child .health { margin-top: 0; }
  .ch-table .ch-actions { flex-wrap: wrap; }
}

/* 卡片头：标题不挤压，窄屏允许换行 */
.card__title { white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 640px) {
  .card__head { flex-wrap: wrap; row-gap: 4px; }
  .card__head-actions { margin-left: 0; }
  .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 禁用账号：用户端登录提示预览 */
.ban-preview {
  padding: 10px 12px; border-radius: 8px;
  background: var(--bg-soft); border: 1px dashed var(--line-strong);
  font-size: 12.5px; color: var(--ink); line-height: 1.6;
}

/* 同号历史账户提示（A30 / A31） */
.hist-hint {
  display: inline-block;
  margin-left: 4px;
  font-size: 11.5px;
  font-family: var(--sans);
  color: var(--warn);
  border-bottom: 1px dashed currentColor;
  white-space: nowrap;
}
.hist-hint:hover { color: var(--warn-deep); }

/* ============================ 页脚 ============================ */
.page-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted-2); display: flex; gap: 14px; flex-wrap: wrap; }

/* ============================ 响应式 ============================ */
@media (max-width: 1180px) {
  .searchbox { width: 190px; }
  .searchbox kbd { display: none; }
}
@media (max-width: 980px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: 24px 0 50px -30px rgba(8,18,31,.4);
  }
  .adm.is-mobile-open .sidebar { transform: none; }
  .adm.is-collapsed .sidebar { width: var(--sidebar-w); flex-basis: var(--sidebar-w); transform: translateX(-100%); }
  .adm.is-collapsed.is-mobile-open .sidebar { transform: none; }
  .content { padding: 16px 14px 40px; }
  .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
  .form-grid .col-2 { grid-column: span 1; }
  .page-head { flex-direction: column; }
  .whoami__meta { display: none; }
}
@media (max-width: 640px) {
  .searchbox { display: none; }
  .crumb { font-size: 12px; }
  /* 窄屏面包屑只留当前页 + 页面编号，避免被挤成竖排 */
  .crumb > span:not(.mono) { display: none; }
}

/* ============================ 页面级补充 ============================ */
.btn { white-space: nowrap; }
.table-wrap td.num { white-space: nowrap; }
.table-wrap td:last-child { white-space: nowrap; }
/* 产品页配置：列少且要露出右侧排序/删除按钮，不套用 900px 最小宽度 */
table.data.pg-table { min-width: 0; }
/* 图标尺寸（内联 SVG 默认无宽高） */
.whoami svg { width: 13px; height: 13px; opacity: .5; }
.card__title svg { width: 14px; height: 14px; color: var(--muted); }
.kpi__label svg { width: 13px; height: 13px; color: var(--muted-2); }
.trend svg { width: 11px; height: 11px; }
.page-title svg { width: 19px; height: 19px; color: var(--accent); }
.list-row svg { width: 14px; height: 14px; flex: 0 0 14px; }
.btn svg { flex: 0 0 auto; }
.dl__v svg { width: 14px; height: 14px; vertical-align: -2px; }

/* 表单 + 右侧说明栏 */
.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 1080px) {
  .form-layout { grid-template-columns: 1fr; }
}

/* 紧凑列表 */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.list-row__main { flex: 1; min-width: 0; }
.list-row__title { font-size: 12.8px; font-weight: 560; color: var(--ink); }
.list-row__desc { font-size: 11.6px; color: var(--muted); margin-top: 2px; line-height: 1.55; }

/* 只读 / 说明性字段 */
.input[readonly] { background: var(--bg-soft); color: var(--muted); }
.field-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 到期时刻强调 */
.expiry {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.6px;
  color: var(--ink);
}
.expiry--danger { color: var(--danger); }
.expiry__unit { font-size: 12px; font-weight: 500; color: var(--muted-2); font-family: var(--sans); letter-spacing: 0; }

/* 抽屉里的消息气泡 */
.msg { display: flex; gap: 9px; margin-bottom: 13px; }
.msg__avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  background: var(--bg-soft); color: var(--muted);
}
.msg--mine .msg__avatar { background: var(--accent-weak); color: var(--accent); }
.msg__body {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.6;
  max-width: 92%;
}
.msg--mine .msg__body { background: var(--accent-weak); border-color: var(--accent-line); }
.msg__meta { font-size: 10.5px; color: var(--muted-2); margin-bottom: 3px; }

/* 渠道卡 */
.channel-vs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 11px;
}
.channel-vs__cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg-softer);
  min-width: 0;
}
.channel-vs__k { font-size: 10.5px; color: var(--muted-2); letter-spacing: .3px; }
.channel-vs__v { font-size: 12.3px; font-weight: 560; margin-top: 2px; word-break: break-word; }

.demo-label {
  padding: 7px 10px;
  font-size: 11px;
  color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  background: var(--bg-softer);
}

/* 模块导航页 */
.hub-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.hub-row:hover { border-color: var(--line-strong); background: var(--bg-soft); }
.hub-row__code { font-size: 11.5px; color: var(--muted-2); width: 44px; flex: none; }
.hub-row__title { font-weight: 560; font-size: 13px; flex: 1; min-width: 0; }
.hub-row__type { font-size: 11px; color: var(--muted-2); flex: none; }
.hub-row svg { width: 15px; height: 15px; color: var(--muted-2); flex: none; }

/* 配置型 */
.cfg-list { display: flex; flex-direction: column; }
.cfg-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.cfg-row:last-child { border-bottom: 0; }
.cfg-row__main { flex: 1; min-width: 0; }
.cfg-row__title { font-size: 12.8px; font-weight: 550; }
.cfg-row__desc { font-size: 11.3px; color: var(--muted-2); margin-top: 2px; line-height: 1.55; }
.cfg-row__ctrl { flex: none; display: flex; align-items: center; gap: 8px; }

/* 审核处理型 */
.review {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  align-items: start;
}
.review__queue {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 8px;
  max-height: 72vh;
  overflow: auto;
}
.review__item {
  text-align: left;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 9px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.review__item:hover { background: var(--bg-soft); }
.review__item.is-active {
  background: var(--accent-weak);
  border-color: var(--line);
  border-left-color: var(--accent);
}
.review__item-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.review__item-title { font-size: 12.6px; font-weight: 560; }
.review__item-meta { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; }

.mat-list { display: flex; flex-direction: column; gap: 6px; }
.mat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--bg-softer);
}
.mat__icon svg { width: 15px; height: 15px; color: var(--muted-2); display: block; }
.mat__name { font-size: 12px; font-weight: 520; flex: 1; min-width: 0; }

@media (max-width: 1080px) {
  .review { grid-template-columns: 1fr; }
  .review__queue { max-height: none; }
}

/* ============================================================
   域名价格矩阵（A116 / A117）
   行=后缀，列=动作 × 年限；空格子与有价格子必须一眼可分
   ============================================================ */
.dmx-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-softer);
}
.dmx-tools__spacer { flex: 1; }
.dmx-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.dmx-check input { accent-color: var(--accent); }
.dmx-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.dmx-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.dmx-swatch {
  width: 13px; height: 13px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.dmx-swatch--empty { background: var(--bg-softer); border-style: dashed; }
.dmx-swatch--draft { background: var(--gold-50); border-color: var(--gold-400); }
.dmx-swatch--below { background: var(--danger-soft); border-color: var(--danger); }
.dmx-swatch--temp { background: var(--warn-soft); border-color: var(--warn); }

.dmx-wrap {
  overflow: auto;
  max-height: calc(100vh - 320px);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}
table.dmx {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 12px;
}
table.dmx th, table.dmx td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0;
}
table.dmx thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-align: center;
  padding: 6px 8px;
  white-space: nowrap;
}
table.dmx thead tr:nth-child(2) th { top: 31px; z-index: 3; font-weight: 500; }
table.dmx th.dmx-act { border-bottom: 1px solid var(--line-strong); }
table.dmx .dmx-sfx {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 128px;
  max-width: 150px;
  background: var(--surface);
  border-right: 1px solid var(--line-strong);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
table.dmx thead .dmx-sfx { z-index: 6; background: var(--bg-soft); vertical-align: middle; }
table.dmx .dmx-policy {
  min-width: 96px;
  max-width: 120px;
  padding: 7px 9px;
  vertical-align: top;
  font-size: 11px;
  background: var(--surface);
}
.dmx-sfx-code { font-size: 12.5px; font-weight: 650; letter-spacing: -.2px; }
.dmx-sfx-name { font-size: 10.5px; color: var(--muted-2); margin-bottom: 4px; }
tr.dmx-row-off td.dmx-sfx { opacity: .62; }

.dmx-cell {
  display: block;
  width: 100%;
  min-width: 100px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 6px 8px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.dmx-cell:hover { background: var(--accent-weak); }
.dmx-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dmx-p {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -.2px;
  white-space: nowrap;
}
.dmx-h {
  display: block;
  font-size: 9.8px;
  line-height: 1.45;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 116px;
}
.dmx-cell.is-empty { background: var(--bg-softer); }
.dmx-cell.is-empty .dmx-p { color: var(--muted-2); font-weight: 400; }
.dmx-cell.is-empty:hover { background: var(--accent-weak); }
.dmx-cell.is-draft { background: var(--gold-50); box-shadow: inset 0 0 0 2px var(--gold-400); }
.dmx-cell.is-draft .dmx-p { color: var(--gold-700); }
.dmx-cell.is-below { background: var(--danger-soft); }
.dmx-cell.is-below .dmx-p { color: var(--danger); }
.dmx-cell.is-below .dmx-h { color: var(--danger); white-space: normal; }
.dmx-cell.is-temp { background: var(--warn-soft); }
.dmx-cell.is-temp .dmx-h { color: var(--warn-deep); }
.dmx-cell.is-off { opacity: .5; }
.dmx-tag {
  display: inline-block;
  font-size: 9px;
  line-height: 1.5;
  padding: 0 4px;
  border-radius: 4px;
  margin-right: 3px;
  white-space: nowrap;
}
.dmx-tag--draft { background: var(--gold-100); color: var(--gold-700); }
.dmx-tag--below { background: var(--danger); color: #fff; }
.dmx-tag--temp { background: var(--warn-soft); color: var(--warn-deep); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.dmx-tag--off { background: var(--neutral-soft); color: var(--muted); }

.dmx-preview {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-softer);
  font-size: 12.5px;
}
.dmx-preview b { font-family: var(--mono); }
.dmx-preview.is-bad { border-color: color-mix(in srgb, var(--danger) 34%, var(--line)); background: var(--danger-soft); color: var(--danger-deep); }

.dmr-list { display: flex; flex-direction: column; gap: 8px; }
.dmr-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--surface);
}
.dmr-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.dmr-diff {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.dmr-k {
  display: inline-block;
  min-width: 34px;
  color: var(--muted-2);
  font-size: 10.5px;
  margin-right: 6px;
}
.dmr-after { color: var(--ink); font-weight: 520; }

@media (max-width: 720px) {
  .dmx-wrap { max-height: none; }
}

/* ============================ 统计卡片行（统一规则） ============================
   全站所有「一排统计卡」走同一套：自适应铺满 + 等宽列 + 单卡最小宽度 0（可弹性收缩）。
   - 卡片数 ≤ 6：全部放一行，按实际个数等宽铺满（6 张一行 6 个，5 张一行 5 个），不留空位；
   - 卡片数 ≥ 7：固定 6 列换行，避免卡片被压到读不了；
   - 唯一降级：≤767px 一行最多 2 个（768 及以上一律保持一行铺满）；
   - 无论内容多长，单卡都只在自己的列内换行 / 缩字号，不会撑破整行、也不会挤占相邻卡片。
   页面各自注入的重复列定义（wired-*.js 的 style 标签）在本文件之后加载，
   因此列定义必须 !important 才能被这里统一覆盖。 */
.grid--kpi, #pf-kpis,
.wc-kpis, .wp-kpis, .w45-kpis, .w68-kpis, .w83-kpis, .w10-kpis, .w02-kpis,
.w64-kpis, .wsp-kpis, .wcp-kpis, .w36-kpis, .wa-kpis, .wf-kpis, .wk-kpis,
.wt-kpis, .w93-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: none !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: stretch;
}

/* 单卡可收缩：min-width:0 让长内容不撑列；长串（订单号 / 金额 / 域名）允许任意处换行 */
:is(.grid--kpi, #pf-kpis,
  .wc-kpis, .wp-kpis, .w45-kpis, .w68-kpis, .w83-kpis, .w10-kpis, .w02-kpis,
  .w64-kpis, .wsp-kpis, .wcp-kpis, .w36-kpis, .wa-kpis, .wf-kpis, .wk-kpis,
  .wt-kpis, .w93-kpis) > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 大号数字随列宽缩小，避免 5 列时金额溢出（16px 下限保证可读） */
.kpi__value { font-size: clamp(16px, 1.5vw, 26px); }
.kpi__label { min-width: 0; }

/* 卡片数 ≥ 7：固定 6 列换行（≤6 张仍由上面的 auto-columns 一行铺满） */
:is(.grid--kpi, #pf-kpis,
  .wc-kpis, .wp-kpis, .w45-kpis, .w68-kpis, .w83-kpis, .w10-kpis, .w02-kpis,
  .w64-kpis, .wsp-kpis, .wcp-kpis, .w36-kpis, .wa-kpis, .wf-kpis, .wk-kpis,
  .wt-kpis, .w93-kpis):has(> :nth-child(7)) {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  grid-auto-flow: row;
  grid-auto-columns: auto;
}

/* 容器里带跨列说明行（inline grid-column:1/-1）时改为行流 + 5 列：
   说明行独占下一整行，卡片仍在一行内等宽铺满，不会被说明文字挤成一个槽位。 */
:is(.grid--kpi, #pf-kpis,
  .wc-kpis, .wp-kpis, .w45-kpis, .w68-kpis, .w83-kpis, .w10-kpis, .w02-kpis,
  .w64-kpis, .wsp-kpis, .wcp-kpis, .w36-kpis, .wa-kpis, .wf-kpis, .wk-kpis,
  .wt-kpis, .w93-kpis):has(> [style*="grid-column"]) {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  grid-auto-flow: row;
  grid-auto-columns: auto;
}

/* ≤767px：唯一降级档，一行最多 2 个；不足 2 个仍一行平分 */
@media (max-width: 767px) {
  :is(.grid--kpi, #pf-kpis,
    .wc-kpis, .wp-kpis, .w45-kpis, .w68-kpis, .w83-kpis, .w10-kpis, .w02-kpis,
    .w64-kpis, .wsp-kpis, .wcp-kpis, .w36-kpis, .wa-kpis, .wf-kpis, .wk-kpis,
    .wt-kpis, .w93-kpis):has(> :nth-child(3)) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row;
    grid-auto-columns: auto;
  }
  :is(.grid--kpi, #pf-kpis,
    .wc-kpis, .wp-kpis, .w45-kpis, .w68-kpis, .w83-kpis, .w10-kpis, .w02-kpis,
    .w64-kpis, .wsp-kpis, .wcp-kpis, .w36-kpis, .wa-kpis, .wf-kpis, .wk-kpis,
    .wt-kpis, .w93-kpis):not(:has(> :nth-child(3))) {
    grid-template-columns: none !important;
    grid-auto-flow: column;
  }
}

/* ============================ M01 首页工作台（五块） ============================
   1. KPI 整卡可点击，复合项（待审核）在脚部给三个入口
   2. 待我处理：每行一条、数量右对齐
   3. 到期提醒：7 / 15 / 30 天三组，一 / 二 / 三次提醒徽标
   4. 系统健康：全正常收敛一行，异常行高亮
   5. 最近动态：订单 / 退款 / 开通混排
   一律 min-width:0 + 文本省略，保证 1024 档不横向溢出。 */
.kpi--link { color: inherit; text-decoration: none; cursor: pointer; }
.kpi--link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kpi__nav { color: var(--accent); text-decoration: none; font-weight: 500; }
.kpi__nav:hover { text-decoration: underline; }
.kpi__foot .kpi__nav + .kpi__nav::before { content: "·"; margin: 0 4px; color: var(--muted-2); }

.dash-task { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.dash-task:last-child { border-bottom: 0; }
.dash-task:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.dash-task__icon {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--muted-2) 12%, transparent); color: var(--muted);
}
.dash-task__icon svg { width: 14px; height: 14px; }
.dash-task__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-task__title { font-size: 12.5px; }
.dash-task__hint { font-size: 11px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-task__count { font-family: var(--mono); font-size: 13px; color: var(--muted-2); min-width: 24px; text-align: right; }
.dash-task.is-on .dash-task__count { color: var(--accent); font-weight: 600; }
.dash-task.is-alert .dash-task__count { color: var(--danger); }
.dash-task__arrow { width: 14px; height: 14px; color: var(--muted-2); flex: 0 0 auto; }

.dash-health-one { display: flex; align-items: center; gap: 10px; }
.dash-health-one > svg { width: 18px; height: 18px; color: var(--success); flex: 0 0 auto; }
.dash-health-one__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-health-one__main b { font-size: 13px; }
.dash-health-one__main span { font-size: 11.5px; }
.dash-health-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.dash-health-row:first-child { padding-top: 0; }
.dash-health-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dash-health-row__main { flex: 1; min-width: 0; }
.dash-health-row__title { font-size: 12.5px; }
.dash-health-row__desc { font-size: 11px; color: var(--muted-2); line-height: 1.6; overflow-wrap: anywhere; }
.dash-health-row__err { color: var(--danger); }
.dash-health-row__link { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--accent); text-decoration: none; }
.dash-health-row__link:hover { text-decoration: underline; }
.dash-health-row__link svg { width: 13px; height: 13px; }

.dash-exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.dash-exp { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.dash-exp__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.dash-exp__title { font-size: 12.5px; font-weight: 600; }
.dash-exp__empty { font-size: 11.5px; color: var(--muted-2); padding: 8px 0 2px; }
.dash-exp-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px dashed var(--line); color: inherit; text-decoration: none; }
.dash-exp-item:hover .dash-exp-item__title { color: var(--accent); }
.dash-exp-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-exp-item__title { font-size: 12px; font-family: var(--mono); }
.dash-exp-item__sub { font-size: 10.5px; color: var(--muted-2); line-height: 1.5; overflow-wrap: anywhere; }
.dash-exp-item__remind { font-size: 10.5px; color: var(--warn); }
.dash-exp-item__steps { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.dash-stage {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-family: var(--mono); color: var(--muted-2);
  border: 1px dashed var(--line);
}
.dash-stage.is-sent {
  border-style: solid;
  border-color: color-mix(in srgb, var(--success) 45%, var(--line));
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.dash-act { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.dash-act:last-child { border-bottom: 0; }
.dash-act:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.dash-act .badge { flex: 0 0 auto; white-space: nowrap; }
.dash-act__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-act__title { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-act__sub { font-size: 11px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-act__time { font-size: 11px; color: var(--muted-2); white-space: nowrap; flex: 0 0 auto; }
.dash-act__arrow { width: 14px; height: 14px; color: var(--muted-2); flex: 0 0 auto; }

/* 近 7 天热门产品 Top 5：排名 + 商品名 + 订单数 + 金额，整行可点击到商品列表筛选 */
.dash-hot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.dash-hot:last-child { border-bottom: 0; }
.dash-hot:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.dash-hot__rank {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: color-mix(in srgb, var(--muted-2) 12%, transparent);
}
.dash-hot:first-child .dash-hot__rank { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.dash-hot__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-hot__name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-hot__sub { font-size: 11px; color: var(--muted-2); }
.dash-hot__amount { flex: 0 0 auto; font-size: 12px; white-space: nowrap; }
.dash-hot__arrow { width: 14px; height: 14px; color: var(--muted-2); flex: 0 0 auto; }

/* 首页两列：左「待我处理」，右「系统健康 + 到期提醒」竖排。
   窄屏（≤980px，与侧栏收窄断点一致）自然堆叠为单列。 */
.dash-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}
.dash-cols__right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dash-cols > .card, .dash-cols__right > .card { margin-bottom: 0; }

@media (max-width: 980px) {
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .dash-exp-grid { grid-template-columns: 1fr; }
}

/* 首页推荐位：横向分隔行版式（#/home-featured）
   左侧区块名与状态，右侧直接排条目；用分隔线代替独立方框卡片。 */
.hf-card { overflow: hidden; }
.hf-card__body { padding: 0 !important; }
.hf-list { display: flex; flex-direction: column; }
.hf-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.hf-row:last-child { border-bottom: 0; }
.hf-row__meta { flex: 0 0 260px; min-width: 0; }
.hf-row__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}
.hf-row__anchor { font-size: 11px; font-weight: 400; color: var(--muted-2); }
.hf-row__desc { margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted-2); }
/* 说明文字不再套灰底圆角盒：五个区块左栏统一为「标题 + 描述 + 说明」的纯文字层级 */
.hf-row__reason {
  margin: 6px 0 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hf-row__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.hf-row__controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; }
/* 控件按自身宽度排，不再被拉伸成整条通栏按钮 */
.hf-ctl { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.hf-ctl__label { font-size: 11px; line-height: 1.4; color: var(--muted-2); }
.hf-ctl__input { width: 92px; height: 32px; padding: 4px 8px; }
/* 行内按钮与输入框统一 32px 高：原来按钮 27px、输入框 32px，同一行底边对不齐 */
.hf-row .btn.btn--sm { height: 32px; padding: 0 11px; border-radius: 7px; }
.hf-ctl--items { flex: 1 1 180px; }
.hf-ctl__fixed { font-size: 12px; line-height: 32px; color: var(--muted-2); }
.hf-row__picked { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.hf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--gray-50);
  font-size: 11.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hf-chip b { font-weight: 600; color: var(--muted-2); }
.hf-chip--muted { color: var(--muted-2); border-style: dashed; background: transparent; }
.hf-row__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.hf-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.hf-preview__col { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.hf-preview__idx { font-size: 11px; color: var(--muted-2); }
.hf-preview__name { margin-top: 2px; font-size: 13px; font-weight: 600; }
.hf-preview__meta { margin-top: 4px; font-size: 11px; line-height: 1.5; color: var(--muted-2); }

/* 1024 一档仍保持横向行：收窄左栏，右侧条目继续横排换行 */
@media (max-width: 1180px) {
  .hf-row { gap: 16px; }
  .hf-row__meta { flex: 0 0 208px; }
  .hf-row__reason { -webkit-line-clamp: 2; }
}
@media (max-width: 900px) {
  .hf-row { flex-direction: column; gap: 10px; }
  .hf-row__meta { flex: 0 0 auto; width: 100%; }
  .hf-row__body { width: 100%; }
}
@media (max-width: 720px) {
  .hf-row { padding: 12px; }
  .hf-ctl__input { width: 80px; }
}
