/* ============================================================================
 * 情感咨询 CRM — 婚恋高级视觉 + Theme System（CRM 1.2 视觉升级）
 * ----------------------------------------------------------------------------
 * 架构：UI 组件 → var(--theme-*)（Theme Tokens）→ 当前主题（html[data-theme]）
 *   默认主题 = 温柔婚恋 Warm Relationship（:root）
 *   其余主题：premium 高级咨询 / rose 暖柔女性 / dark 专业深色
 *   新增主题 = 增加一组 [data-theme] Token，无需修改任何组件或业务代码。
 *
 * 兼容层：旧变量名（--bg/--card/--text-2/--red/--green/--yellow/--primary/
 *   --border/--sidebar-* 等）统一映射到 Theme Tokens，业务内联引用零改动。
 *
 * 约束：颜色只存在于 Token 定义区；组件区禁止出现硬编码色值（阴影除外）。
 *   动画时长 150–250ms；主题切换由 .theme-fade 提供平滑过渡。
 * ============================================================================ */

/* ===== 一、Theme Tokens：基础参考「温柔婚恋」（应用默认主题 = 简约纯白，见 themes.js / index.html） ===== */
:root {
  --theme-bg: #F7F3EE;              /* 页面背景：暖米白 */
  --theme-surface: #FFFDFC;         /* 卡片：非纯白奶油 */
  --theme-surface-soft: #F2ECE5;    /* 表头 / 次级底 */
  --theme-primary: #8F695D;         /* 玫瑰棕（WCAG 4.76:1 强化版） */
  --theme-primary-dark: #705047;
  --theme-primary-soft: #E8D9D2;
  --theme-on-primary: #FFFDFC;      /* 主按钮 / 强底上的文字 */
  --theme-accent: #B89A70;          /* 香槟金 */
  --theme-text: #3F3935;
  --theme-text-secondary: #756A61;
  --theme-text-muted: #A49A91;
  --theme-border: #E8DED5;
  --theme-border-soft: #F0E9E1;
  --theme-success: #718B72;
  --theme-warning: #B88769;
  --theme-danger: #A96863;
  --theme-sidebar: #F1EAE3;
  --theme-sidebar-active: #E5D7CE;
  --theme-sidebar-text: #6E5F55;
  --theme-sidebar-border: #E4D8CC;
  --theme-topbar: #FFFDFC;
  --theme-hover: #F5EEE7;           /* 行 hover */
  --theme-input-bg: #FFFDFC;
  --theme-mask: rgba(63, 57, 53, .42);
  --theme-card-shadow: 0 4px 20px rgba(80, 60, 50, 0.05);
  --theme-radius-sm: 10px;
  --theme-radius-md: 14px;
  --theme-radius-lg: 18px;
  --theme-transition: 180ms ease;

  /* 低饱和语义色族（badge / tag 专用：底色 + 前景） */
  --tint-gold-bg: #F3E8D7;  --tint-gold-fg: #7E5E37;
  --tint-rose-bg: #EFE0DA;  --tint-rose-fg: #82524A;
  --tint-sage-bg: #E4EAE4;  --tint-sage-fg: #56695A;
  --tint-green-bg: #E4EAD9; --tint-green-fg: #556B59;
  --tint-gray-bg: #EFE9E2;  --tint-gray-fg: #6F6560;
  --tint-mauve-bg: #EAE2E6; --tint-mauve-fg: #705868;
}

/* ===== 主题二「高级咨询 Premium Consulting」：奶咖 · 深棕 · 香槟金 ===== */
[data-theme="premium"] {
  --theme-bg: #F3EFE9;
  --theme-surface: #FDFBF8;
  --theme-surface-soft: #EDE7DE;
  --theme-primary: #6B4F3A;
  --theme-primary-dark: #503A2A;
  --theme-primary-soft: #E5D9CB;
  --theme-on-primary: #FDFBF8;
  --theme-accent: #A98B5F;
  --theme-text: #33291F;
  --theme-text-secondary: #6F6455;
  --theme-text-muted: #9C9082;
  --theme-border: #E0D8CC;
  --theme-border-soft: #EAE3D8;
  --theme-success: #6F8165;
  --theme-warning: #A8763F;
  --theme-danger: #9C5F52;
  --theme-sidebar: #2E2620;
  --theme-sidebar-active: #42342A;
  --theme-sidebar-text: #C9BBAA;
  --theme-sidebar-border: #3D332B;
  --theme-topbar: #FDFBF8;
  --theme-hover: #F0EBE2;
  --theme-input-bg: #FDFBF8;
  --theme-mask: rgba(51, 41, 31, .46);
  --theme-card-shadow: 0 4px 20px rgba(60, 45, 32, 0.06);

  --tint-gold-bg: #EFE3CD;  --tint-gold-fg: #7D5E2C;
  --tint-rose-bg: #EDE0D6;  --tint-rose-fg: #75503F;
  --tint-sage-bg: #E2E6DD;  --tint-sage-fg: #5E6B54;
  --tint-green-bg: #E1E8D9; --tint-green-fg: #5C704F;
  --tint-gray-bg: #EDE8E0;  --tint-gray-fg: #6B6156;
  --tint-mauve-bg: #E7DFD8; --tint-mauve-fg: #6E5A4A;
}

/* ===== 主题三「暖柔女性 Soft Rose」：低饱和粉 · 奶油白 · 暖灰 ===== */
[data-theme="rose"] {
  --theme-bg: #FAF4F2;
  --theme-surface: #FFFBFA;
  --theme-surface-soft: #F4EAE7;
  --theme-primary: #95655B;
  --theme-primary-dark: #82544C;
  --theme-primary-soft: #EFDBD6;
  --theme-on-primary: #FFFBFA;
  --theme-accent: #C0A185;
  --theme-text: #403835;
  --theme-text-secondary: #7A6E68;
  --theme-text-muted: #A89C96;
  --theme-border: #EBDFDB;
  --theme-border-soft: #F2E9E5;
  --theme-success: #7D8F7C;
  --theme-warning: #B58A6E;
  --theme-danger: #AC6E68;
  --theme-sidebar: #F5EBE7;
  --theme-sidebar-active: #EBD9D3;
  --theme-sidebar-text: #746259;
  --theme-sidebar-border: #E8DAD4;
  --theme-topbar: #FFFBFA;
  --theme-hover: #F7EFEB;
  --theme-input-bg: #FFFBFA;
  --theme-mask: rgba(64, 56, 53, .40);
  --theme-card-shadow: 0 4px 20px rgba(120, 80, 72, 0.05);

  --tint-gold-bg: #F4E6D8;  --tint-gold-fg: #82613F;
  --tint-rose-bg: #F2DEDA;  --tint-rose-fg: #87534E;
  --tint-sage-bg: #E5E9E2;  --tint-sage-fg: #647260;
  --tint-green-bg: #E2EAD9; --tint-green-fg: #62735A;
  --tint-gray-bg: #F1E9E5;  --tint-gray-fg: #736861;
  --tint-mauve-bg: #EDE1E6; --tint-mauve-fg: #6F5662;
}

/* ===== 主题四「专业深色 Professional Dark」：深咖 · 炭黑 · 暖灰 · 香槟金 ===== */
[data-theme="dark"] {
  --theme-bg: #201C19;
  --theme-surface: #2A2521;
  --theme-surface-soft: #332D28;
  --theme-primary: #C09A6C;        /* 香槟金作为深色主题的主操作色 */
  --theme-primary-dark: #A8835A;
  --theme-primary-soft: #3D362F;
  --theme-on-primary: #241D14;
  --theme-accent: #9C8563;
  --theme-text: #EDE6DD;
  --theme-text-secondary: #B4A99C;
  --theme-text-muted: #8A7F73;
  --theme-border: #3A342E;
  --theme-border-soft: #322D27;
  --theme-success: #8FAE8C;
  --theme-warning: #C99A6B;
  --theme-danger: #C97F76;
  --theme-sidebar: #1A1613;
  --theme-sidebar-active: #302821;
  --theme-sidebar-text: #B4A99C;
  --theme-sidebar-border: #2C2620;
  --theme-topbar: #262019;
  --theme-hover: #312B25;
  --theme-input-bg: #332D28;
  --theme-mask: rgba(0, 0, 0, .55);
  --theme-card-shadow: 0 4px 22px rgba(0, 0, 0, 0.28);

  --tint-gold-bg: #3B3225;  --tint-gold-fg: #D5B67E;
  --tint-rose-bg: #3D2F2B;  --tint-rose-fg: #D19A90;
  --tint-sage-bg: #2C332C;  --tint-sage-fg: #9DB89A;
  --tint-green-bg: #2C342A; --tint-green-fg: #9CB98F;
  --tint-gray-bg: #332E29;  --tint-gray-fg: #B4A99C;
  --tint-mauve-bg: #362E33; --tint-mauve-fg: #C0A6B5;
}

/* ===== 主题五「简约纯白 Minimal Pure White」：纯白 · 浅灰边框 · 深绿主操作 ===== */
[data-theme="white"] {
  --theme-bg: #F5F6F8;              /* 页面背景：极浅灰 */
  --theme-surface: #FFFFFF;         /* 卡片 / 表格 / 表单：纯白 */
  --theme-surface-soft: #F2F4F6;    /* 表头 / 次级底 */
  --theme-primary: #1B6E45;         /* 深绿主操作色 */
  --theme-primary-dark: #155A38;    /* hover / 按下 */
  --theme-primary-soft: #E3F0E9;    /* 选择 / 软底 */
  --theme-on-primary: #FFFFFF;      /* 主按钮文字 */
  --theme-accent: #2E8B5E;          /* 辅助绿 */
  --theme-text: #2B2F36;            /* 主要文字：深灰 */
  --theme-text-secondary: #5C6470;  /* 辅助文字：中灰 */
  --theme-text-muted: #9AA1AC;      /* 占位 / 弱化 */
  --theme-border: #E5E7EB;          /* 浅灰边框 */
  --theme-border-soft: #EEF0F2;     /* 更浅边框 */
  --theme-success: #3E9B6B;         /* 成功（与主绿区分的青绿） */
  --theme-warning: #C98A2B;         /* 警告琥珀 */
  --theme-danger: #D64545;          /* 错误：清晰红 */
  --theme-sidebar: #FFFFFF;          /* 侧栏：纯白 */
  --theme-sidebar-active: #EAF4EE;  /* 激活项：浅绿底 */
  --theme-sidebar-text: #4A5159;    /* 侧栏文字 */
  --theme-sidebar-border: #E5E7EB;  /* 侧栏分隔线 */
  --theme-topbar: #FFFFFF;          /* 顶栏：纯白 */
  --theme-hover: #F2F4F6;           /* 行 hover */
  --theme-input-bg: #FFFFFF;        /* 输入框底 */
  --theme-mask: rgba(43, 47, 54, .40);
  --theme-card-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);

  --tint-gold-bg: #F3EFE6;  --tint-gold-fg: #7E5E37;
  --tint-rose-bg: #FBEDEA;  --tint-rose-fg: #9A524A;
  --tint-sage-bg: #E7F0E9;  --tint-sage-fg: #4F6B57;
  --tint-green-bg: #E6F1EA; --tint-green-fg: #1B6E45;
  --tint-gray-bg: #F0F1F3;  --tint-gray-fg: #5C6470;
  --tint-mauve-bg: #EFEAF0; --tint-mauve-fg: #6E5668;
}

/* ===== 二、兼容别名层（旧变量名 → Theme Tokens；业务内联引用零改动） ===== */
:root {
  --bg: var(--theme-bg);
  --card: var(--theme-surface);
  --border: var(--theme-border);
  --text: var(--theme-text);
  --text-2: var(--theme-text-secondary);
  --red: var(--theme-danger);
  --green: var(--theme-success);
  --yellow: var(--theme-warning);
  --primary: var(--theme-primary);
  --primary-hover: var(--theme-primary-dark);
  --sidebar-bg: var(--theme-sidebar);
  --sidebar-text: var(--theme-sidebar-text);
  --sidebar-active: var(--theme-sidebar-active);
  --radius: var(--theme-radius-md);
  --shadow: var(--theme-card-shadow);
}

/* ===== 三、基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--theme-bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--theme-bg); color: var(--theme-text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--theme-primary); text-decoration: none; transition: color var(--theme-transition); }
a:hover { color: var(--theme-primary-dark); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--theme-text); }
::placeholder { color: var(--theme-text-muted); }
::selection { background: var(--theme-primary-soft); color: var(--theme-primary-dark); }
h1, h2, h3 { letter-spacing: .2px; }

/* 主题切换平滑过渡（themes.js 切换时挂载 260ms） */
html.theme-fade, html.theme-fade body,
html.theme-fade .sidebar, html.theme-fade .topbar, html.theme-fade .card, html.theme-fade .stat-card,
html.theme-fade .btn, html.theme-fade .tbl th, html.theme-fade input, html.theme-fade select,
html.theme-fade textarea, html.theme-fade .badge, html.theme-fade .tab, html.theme-fade .modal,
html.theme-fade .login-wrap, html.theme-fade .login-card, html.theme-fade .login-brand {
  transition: background-color var(--theme-transition), border-color var(--theme-transition),
              color var(--theme-transition), box-shadow var(--theme-transition);
}

/* ===== 四、登录页（品牌分栏） ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: stretch; justify-content: center;
  background: var(--theme-bg);
}
.login-brand {
  flex: 1 1 52%; position: relative; overflow: hidden; display: flex; flex-direction: column;
  justify-content: center; padding: 64px 72px; color: var(--theme-on-primary);
  background: linear-gradient(160deg, var(--theme-primary) 0%, var(--theme-primary-dark) 100%);
}
.login-brand::before, .login-brand::after {
  content: ""; position: absolute; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .16);
}
.login-brand::before { width: 460px; height: 460px; right: -160px; top: -120px; }
.login-brand::after { width: 300px; height: 300px; left: -110px; bottom: -110px; border-color: rgba(255,255,255,.10); }
.login-brand .lb-mark { position: relative; display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.login-brand .lb-mark .brand-mark { background: rgba(255, 255, 255, .16); color: var(--theme-on-primary); }
.login-brand .lb-mark .lb-name { font-size: 21px; font-weight: 600; letter-spacing: 1px; }
.login-brand .lb-mark .lb-en { display: block; font-size: 10.5px; letter-spacing: 3.5px; opacity: .72; margin-top: 2px; }
.login-brand .lb-quote { position: relative; font-size: 30px; font-weight: 500; line-height: 1.55; letter-spacing: 1px; max-width: 17em; }
.login-brand .lb-lines { position: relative; margin-top: 30px; font-size: 14.5px; line-height: 2.15; opacity: .88; letter-spacing: .5px; }
.login-brand .lb-lines b { font-weight: 600; }
.login-brand .lb-foot { position: relative; margin-top: 48px; font-size: 12px; opacity: .55; letter-spacing: 1.5px; }
.login-panel {
  flex: 1 1 48%; display: flex; align-items: center; justify-content: center; padding: 40px 32px;
  background: var(--theme-bg);
}
.login-card {
  width: 400px; max-width: 100%; background: var(--theme-surface);
  border: 1px solid var(--theme-border); border-radius: var(--theme-radius-lg);
  padding: 44px 40px; box-shadow: var(--theme-card-shadow);
}
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .sub { color: var(--theme-text-secondary); font-size: 13px; margin-bottom: 30px; }
.login-card label { display: block; font-size: 13px; color: var(--theme-text-secondary); margin: 16px 0 6px; }
.login-card input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--theme-border); border-radius: var(--theme-radius-sm);
  outline: none; background: var(--theme-input-bg); transition: border-color var(--theme-transition), box-shadow var(--theme-transition);
}
.login-card input:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px var(--theme-primary-soft);
}
.login-btn {
  width: 100%; margin-top: 26px; padding: 12px; background: var(--theme-primary); color: var(--theme-on-primary);
  border: none; border-radius: var(--theme-radius-sm); font-size: 15px; font-weight: 600; letter-spacing: 6px;
  transition: background var(--theme-transition), transform var(--theme-transition);
}
.login-btn:hover { background: var(--theme-primary-dark); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-error { color: var(--theme-danger); font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }
.login-accounts { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--theme-border-soft); font-size: 12px; color: var(--theme-text-muted); }
.login-accounts code { background: var(--theme-surface-soft); padding: 1px 6px; border-radius: 4px; }
@media (max-width: 860px) {
  .login-wrap { flex-direction: column; }
  .login-brand { flex: none; padding: 34px 28px; min-height: 190px; }
  .login-brand .lb-quote { font-size: 20px; }
  .login-brand .lb-lines { margin-top: 14px; font-size: 12.5px; line-height: 1.9; }
  .login-brand .lb-foot { display: none; }
  .login-panel { padding: 26px 18px 40px; }
  .login-card { padding: 30px 24px; }
}

/* ===== 五、布局 / Sidebar / 顶栏 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; background: var(--theme-sidebar); color: var(--theme-sidebar-text);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
  border-right: 1px solid var(--theme-sidebar-border);
  transition: transform 220ms ease, background-color var(--theme-transition);
}
.sidebar .brand {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--theme-sidebar-border);
  display: flex; align-items: center; gap: 11px;
}
.sidebar .brand .b-name { font-size: 16.5px; font-weight: 600; color: var(--theme-text); letter-spacing: .5px; }
.sidebar .brand .b-en { display: block; font-size: 9px; letter-spacing: 2.6px; color: var(--theme-text-muted); margin-top: 1px; }
.nav { padding: 10px 10px 8px; flex: 1; overflow-y: auto; }
.nav-group {
  padding: 14px 12px 5px; font-size: 10.5px; color: var(--theme-text-muted);
  letter-spacing: 1.2px; text-transform: uppercase;
}
.nav-group:first-child { padding-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8.5px 12px;
  border-radius: var(--theme-radius-sm); color: var(--theme-sidebar-text);
  font-size: 13.5px; margin-bottom: 2px; cursor: pointer;
  transition: background var(--theme-transition), color var(--theme-transition);
}
.nav-item:hover { background: var(--theme-sidebar-active); color: var(--theme-text); }
.nav-item.active { background: var(--theme-primary); color: var(--theme-on-primary); font-weight: 500; }
.nav-item .icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; border-radius: 6px; flex-shrink: 0;
}
.sidebar .foot { padding: 12px 20px; font-size: 11px; color: var(--theme-text-muted); border-top: 1px solid var(--theme-sidebar-border); letter-spacing: .5px; }

/* Sidebar 底部当前用户块（真实用户数据 + 外观入口） */
.side-user { border-top: 1px solid var(--theme-sidebar-border); padding: 14px 14px 16px; }
.side-user .su-row { display: flex; align-items: center; gap: 10px; }
.side-user .su-info { flex: 1; min-width: 0; }
.side-user .su-name { font-size: 13px; font-weight: 600; color: var(--theme-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .su-role { font-size: 11px; color: var(--theme-text-muted); }
.side-user .su-theme {
  margin-top: 10px; width: 100%; display: flex; align-items: center; gap: 7px; justify-content: center;
  padding: 6.5px 10px; border-radius: var(--theme-radius-sm); font-size: 12px;
  border: 1px solid var(--theme-sidebar-border); background: transparent; color: var(--theme-sidebar-text);
  transition: background var(--theme-transition), color var(--theme-transition);
}
.side-user .su-theme:hover { background: var(--theme-sidebar-active); color: var(--theme-text); }

.main { flex: 1; margin-left: 224px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: var(--theme-topbar); border-bottom: 1px solid var(--theme-border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 20;
}
.nav-toggle {
  display: none; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 1px solid var(--theme-border); border-radius: var(--theme-radius-sm);
  background: var(--theme-surface); color: var(--theme-text);
}
.topbar .search { flex: 0 1 360px; position: relative; }
.topbar .search input {
  width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-sm); background: var(--theme-surface-soft); outline: none;
  transition: border-color var(--theme-transition), background var(--theme-transition);
}
.topbar .search input:focus { border-color: var(--theme-primary); background: var(--theme-input-bg); }
.topbar .search::before {
  content: ""; position: absolute; left: 12px; top: 11px; width: 11px; height: 11px;
  border: 1.6px solid var(--theme-text-muted); border-radius: 50%;
  box-shadow: 4.5px 4.5px 0 -1.1px var(--theme-text-muted);
}
.topbar .spacer { flex: 1; }
.bell { position: relative; cursor: pointer; padding: 7px; border-radius: var(--theme-radius-sm); color: var(--theme-text-secondary); display: flex; align-items: center; transition: background var(--theme-transition); }
.bell:hover { background: var(--theme-hover); }
.bell .dot {
  position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; background: var(--theme-danger);
  color: var(--theme-on-primary); font-size: 10px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 5px 9px; border-radius: var(--theme-radius-sm); transition: background var(--theme-transition); }
.user-chip:hover { background: var(--theme-hover); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--theme-primary); color: var(--theme-on-primary);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.user-chip .role { font-size: 11px; color: var(--theme-text-muted); }
.dropdown {
  position: absolute; top: 54px; right: 20px; background: var(--theme-surface);
  border: 1px solid var(--theme-border); border-radius: var(--theme-radius-md);
  box-shadow: 0 10px 32px rgba(50, 38, 30, .14); min-width: 172px; padding: 6px; z-index: 60;
}
.dropdown .item { padding: 8px 12px; border-radius: var(--theme-radius-sm); cursor: pointer; font-size: 13px; transition: background var(--theme-transition); }
.dropdown .item:hover { background: var(--theme-hover); }
.dropdown .item.danger { color: var(--theme-danger); }

.content { padding: 26px 28px 40px; flex: 1; max-width: 1440px; width: 100%; margin: 0 auto; }
.page-title { font-size: 19px; font-weight: 600; margin-bottom: 4px; letter-spacing: .3px; }
.page-sub { color: var(--theme-text-secondary); font-size: 13px; margin-bottom: 20px; }

/* ===== 六、卡片 / KPI / 统计 ===== */
.card {
  background: var(--theme-surface); border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-md); box-shadow: var(--theme-card-shadow);
}
.card .card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--theme-border-soft); font-weight: 600; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.card .card-body { padding: 14px 18px; }
.card .card-sub { font-size: 12px; color: var(--theme-text-muted); font-weight: 400; }
.section-gap { margin-bottom: 18px; }

/* Dashboard 问候区 */
.dash-hero {
  background: linear-gradient(135deg, var(--theme-primary-soft) 0%, var(--theme-surface) 70%);
  border: 1px solid var(--theme-border); border-radius: var(--theme-radius-lg);
  padding: 24px 28px; margin-bottom: 18px; position: relative; overflow: hidden;
}
.dash-hero::after {
  content: ""; position: absolute; right: -70px; top: -90px; width: 260px; height: 260px;
  border-radius: 50%; border: 1.5px solid var(--theme-primary-soft);
}
.hero-greet { font-size: 24px; font-weight: 600; letter-spacing: .5px; }
.hero-quote { margin-top: 6px; color: var(--theme-text-secondary); font-size: 13.5px; letter-spacing: .3px; }
.hero-date { margin-top: 10px; color: var(--theme-text-muted); font-size: 12.5px; letter-spacing: 1px; }

/* KPI 卡（小标签 + 大数字 + 辅助信息） */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card {
  background: var(--theme-surface); border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-md); padding: 16px 18px 15px; box-shadow: var(--theme-card-shadow);
  transition: transform var(--theme-transition), box-shadow var(--theme-transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(80, 60, 50, .08); }
.kpi-card .kpi-label { font-size: 12px; color: var(--theme-text-secondary); letter-spacing: .5px; }
.kpi-card .kpi-value { font-size: 27px; font-weight: 700; margin-top: 5px; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.kpi-card .kpi-value.good { color: var(--theme-success); }
.kpi-card .kpi-value.warn { color: var(--theme-danger); }
.kpi-card .kpi-value.gold { color: var(--theme-accent); }
.kpi-card .kpi-sub { margin-top: 4px; font-size: 12px; color: var(--theme-text-muted); }
.kpi-card .kpi-sub b { color: var(--theme-text-secondary); font-weight: 600; }

/* 今日重点客户 */
.focus-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1200px) { .focus-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .focus-grid { grid-template-columns: 1fr; } }
.focus-card {
  background: var(--theme-surface); border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-md); padding: 15px 16px; cursor: pointer;
  transition: border-color var(--theme-transition), transform var(--theme-transition), box-shadow var(--theme-transition);
}
.focus-card:hover { border-color: var(--theme-primary); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(80, 60, 50, .09); }
.focus-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.focus-no { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11px; color: var(--theme-text-muted); margin-top: 2px; }
.focus-need { margin-top: 9px; font-size: 12.5px; color: var(--theme-text-secondary); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.focus-need .fk { color: var(--theme-text-muted); }
.focus-next {
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--theme-border);
  font-size: 12.5px; color: var(--theme-primary); font-weight: 500;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.focus-next .ft { color: var(--theme-text-muted); font-weight: 400; font-size: 11.5px; }

/* 兼容统计卡（旧结构） */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--theme-surface); border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-md); padding: 16px 18px; box-shadow: var(--theme-card-shadow);
}
.stat-card .label { font-size: 12px; color: var(--theme-text-secondary); margin-bottom: 6px; }
.stat-card .value { font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card .value.warn { color: var(--theme-danger); }
.stat-card .value.good { color: var(--theme-success); }
.stat-card .value.blue { color: var(--theme-primary); }
.stat-card .value.purple { color: var(--tint-mauve-fg); }
.stat-card .value.gold { color: var(--theme-accent); }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-grid-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1200px) { .stat-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .stat-grid-4 { grid-template-columns: repeat(2, 1fr); } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
/* Grid 子项防溢出：宽内容（如表格）在窄视口下收敛到容器内横向滚动，而非撑破页面 */
.kpi-grid > *, .focus-grid > *, .stat-grid > *, .grid-2 > *,
.cd-strip > *, .profile-grid > *, .form-grid > *, .theme-grid > * { min-width: 0; }

/* ===== 七、表格 ===== */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 10px 12px; background: var(--theme-surface-soft);
  color: var(--theme-text-secondary); font-weight: 500; letter-spacing: .3px;
  border-bottom: 1px solid var(--theme-border); white-space: nowrap; user-select: none;
}
.tbl th.sortable { cursor: pointer; transition: color var(--theme-transition); }
.tbl th.sortable:hover { color: var(--theme-text); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--theme-border-soft); white-space: nowrap; }
.tbl tbody tr { cursor: pointer; transition: background var(--theme-transition); }
.tbl tbody tr:hover { background: var(--theme-hover); }
.tbl .num { font-variant-numeric: tabular-nums; }
.row-danger td { background: var(--tint-rose-bg); }
.row-muted td { color: var(--theme-text-muted); background: var(--theme-surface-soft); }
.overdue { color: var(--theme-danger); font-weight: 500; }

/* ===== 八、徽章（低饱和语义色族） ===== */
.badge {
  display: inline-block; padding: 2.5px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: .2px;
  transition: background var(--theme-transition), color var(--theme-transition);
}
/* 意向等级（低饱和：S 香槟金 / A 玫瑰棕 / B 鼠尾草 / C 暖灰） */
.badge-S, .badge-VIP { background: var(--tint-gold-bg); color: var(--tint-gold-fg); }
.badge-A { background: var(--tint-rose-bg); color: var(--tint-rose-fg); }
.badge-B { background: var(--tint-sage-bg); color: var(--tint-sage-fg); }
.badge-C { background: var(--tint-gray-bg); color: var(--tint-gray-fg); }
/* 语义族 */
.badge-HIGH, .badge-INTENT, .badge-QUOTED, .badge-IN_POOL,
.badge-ADMIN, .badge-MANAGER_ASSIGN, .badge-ADMIN_ASSIGN,
.badge-ft-ONLINE, .badge-ft-ONLINE_CHAT, .badge-ft-VIDEO { background: var(--tint-mauve-bg); color: var(--tint-mauve-fg); }
.badge-UNPAID, .badge-RED, .badge-OVERDUE, .badge-DELETED, .badge-LOST,
.badge-fr-REJECTED, .badge-fr-LOST_CONTACT, .badge-LOST_CONTACT { background: var(--tint-rose-bg); color: var(--tint-rose-fg); }
.badge-OPEN, .badge-NEW, .badge-TODAY, .badge-IN_SERVICE, .badge-EMPLOYEE,
.badge-fr-CONSIDERING, .badge-MANUAL_RELEASE, .badge-NORMAL { background: var(--tint-sage-bg); color: var(--tint-sage-fg); }
.badge-WON, .badge-ACTIVE, .badge-CUSTOMER, .badge-GREEN, .badge-DONE,
.badge-fr-TALKED, .badge-fr-INTERESTED, .badge-fr-WON, .badge-CLAIMED,
.badge-CONSULTANT, .badge-ft-WECHAT, .badge-ft-LINE, .badge-ft-WHATSAPP { background: var(--tint-green-bg); color: var(--tint-green-fg); }
.badge-MEDIUM, .badge-YELLOW, .badge-DORMANT, .badge-PAID, .badge-PARTIAL,
.badge-ENDING_SOON, .badge-AUTO_RECYCLE, .badge-fr-NO_ANSWER,
.badge-IN_PROGRESS, .badge-fr-READ_NO_REPLY, .badge-MANAGER { background: var(--tint-gold-bg); color: var(--tint-gold-fg); }
.badge-LOW, .badge-ARCHIVED, .badge-TODO, .badge-CANCELLED, .badge-ENDED,
.badge-NONE, .badge-REFUNDED, .badge-PENDING, .badge-fr-OTHER,
.badge-ft-OTHER { background: var(--tint-gray-bg); color: var(--tint-gray-fg); }
/* 角色与收款 */
.badge.g { background: var(--tint-green-bg); color: var(--tint-green-fg); }
.badge.r { background: var(--tint-rose-bg); color: var(--tint-rose-fg); }
/* 跟进方式色族 */
.badge-ft-PHONE, .badge-ft-EMAIL { background: var(--tint-sage-bg); color: var(--tint-sage-fg); }
.badge-ft-SMS, .badge-ft-IN_PERSON { background: var(--tint-gold-bg); color: var(--tint-gold-fg); }
/* 健康圆点（兼容保留） */
.dot-health { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.dot-GREEN { background: var(--theme-success); }
.dot-YELLOW { background: var(--theme-warning); }
.dot-RED { background: var(--theme-danger); }

/* ===== 九、按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: var(--theme-radius-sm); border: 1px solid var(--theme-border);
  background: var(--theme-surface); color: var(--theme-text); font-size: 13px; font-weight: 500;
  transition: background var(--theme-transition), border-color var(--theme-transition), color var(--theme-transition);
}
.btn:hover { background: var(--theme-hover); border-color: var(--theme-primary-soft); }
.btn-primary { background: var(--theme-primary); border-color: var(--theme-primary); color: var(--theme-on-primary); }
.btn-primary:hover { background: var(--theme-primary-dark); border-color: var(--theme-primary-dark); color: var(--theme-on-primary); }
.btn-danger { color: var(--theme-danger); border-color: var(--tint-rose-bg); }
.btn-danger:hover { background: var(--tint-rose-bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ===== 十、筛选栏 / 分页 ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.filter-bar input[type=text], .filter-bar input[type=number], .filter-bar select {
  padding: 7px 10px; border: 1px solid var(--theme-border); border-radius: var(--theme-radius-sm);
  background: var(--theme-input-bg); outline: none;
  transition: border-color var(--theme-transition);
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--theme-primary); }
.filter-bar .spacer { flex: 1; }
.filter-bar .chk { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--theme-text-secondary); white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 12px; padding: 12px 18px; justify-content: flex-end; color: var(--theme-text-secondary); font-size: 13px; }
.pager button {
  padding: 4px 10px; border: 1px solid var(--theme-border); background: var(--theme-surface);
  border-radius: var(--theme-radius-sm); color: var(--theme-text);
  transition: background var(--theme-transition);
}
.pager button:hover:not(:disabled) { background: var(--theme-hover); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ===== 十一、客户详情：关系档案 Header ===== */
.detail-head { padding: 22px 24px 18px; }
.cd-eyebrow { font-size: 11px; letter-spacing: 3px; color: var(--theme-text-muted); margin-bottom: 6px; }
.detail-head h2 { font-size: 21px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; letter-spacing: .3px; }
.detail-meta { display: flex; gap: 20px; margin-top: 12px; flex-wrap: wrap; color: var(--theme-text-secondary); font-size: 13px; }
.detail-meta b { color: var(--theme-text); font-weight: 600; }
.detail-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* 关系档案核心信息条（核心需求 / 期望结果 / 下一步） */
/* R8.1-E 第一屏：核心区 + 微信/二维码区双栏布局 */
.cd-hero { display: grid; grid-template-columns: 1fr 220px; gap: 16px; margin-top: 12px; align-items: start; }
@media (max-width: 900px) { .cd-hero { grid-template-columns: 1fr; } }
.cd-hero-main { min-width: 0; }
.cd-hero-wechat {
  background: var(--theme-surface-soft); border: 1px solid var(--theme-border-soft);
  border-radius: var(--theme-radius-md); padding: 12px 15px;
}
.cd-hero-wechat .k { font-size: 11px; color: var(--theme-text-muted); letter-spacing: 1.5px; margin-bottom: 4px; }
.cd-hero-wechat .v { font-size: 13.5px; color: var(--theme-text); word-break: break-all; }
.qr-slot {
  margin-top: 10px; width: 108px; height: 108px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--theme-border); border-radius: var(--theme-radius-md);
  font-size: 11px; color: var(--theme-text-muted); text-align: center; line-height: 1.5;
}
/* R8.1-E 第二屏：最近跟进 + 行动条 */
.dh-recent-list { padding: 6px 18px 2px; }
.dh-recent-list .empty { padding: 14px 0; }
.dh-action-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px 18px 16px; }
@media (max-width: 900px) { .dh-action-strip { grid-template-columns: 1fr; } }
.cd-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
@media (max-width: 900px) { .cd-strip { grid-template-columns: 1fr; } }
.cd-cell {
  background: var(--theme-surface-soft); border: 1px solid var(--theme-border-soft);
  border-radius: var(--theme-radius-md); padding: 12px 15px;
}
.cd-cell .k { font-size: 11px; color: var(--theme-text-muted); letter-spacing: 1.5px; margin-bottom: 4px; }
.cd-cell .v { font-size: 13.5px; line-height: 1.6; color: var(--theme-text); white-space: pre-wrap; word-break: break-word; }
.cd-cell .v.muted { color: var(--theme-text-muted); }
.cd-cell.next .v { color: var(--theme-primary); font-weight: 500; }
/* R8.1 P4：审计值字段级渲染 */
.av-row { display: flex; gap: 6px; align-items: baseline; line-height: 1.5; }
.av-k { color: var(--text-2); font-size: 12px; min-width: 70px; font-family: var(--mono-font, monospace); }
.av-v { word-break: break-all; }

/* R8.1 A-3：客户列表批量入池多选 + 结果报告 */
.batch-pick-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow-y: auto; }
.batch-pick {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--theme-surface-soft); border: 1px solid var(--theme-border-soft);
  color: var(--theme-text-2, var(--theme-text));
}
.bp-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bp-stat { text-align: center; padding: 12px 8px; border-radius: var(--theme-radius-md);
  background: var(--theme-surface-soft); border: 1px solid var(--theme-border-soft); }
.bp-stat .n { font-size: 24px; font-weight: 600; }
.bp-stat .n.ok { color: #16a34a; }
.bp-stat .n.skip { color: #d97706; }
.bp-stat .n.err { color: var(--danger, #dc2626); }
.bp-stat .l { font-size: 12px; color: var(--theme-text-muted); margin-top: 2px; }
.tbl-sm { font-size: 12px; }
.tbl-sm th, .tbl-sm td { padding: 5px 8px; }
.tag-mini { font-size: 10px; padding: 1px 6px; border-radius: 4px; margin-left: 4px;
  background: var(--theme-surface-soft); border: 1px solid var(--theme-border-soft); color: var(--theme-text-muted); }

/* 关系进程（真实 current_status + 服务周期状态可视化，仅视觉） */
.stage-flow { display: flex; align-items: flex-start; gap: 0; margin-top: 18px; flex-wrap: wrap; }
.stage-step { display: flex; flex-direction: column; align-items: center; min-width: 76px; flex: 1; }
.stage-step .sd {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; background: var(--theme-surface-soft); color: var(--theme-text-muted);
  border: 1.5px solid var(--theme-border); transition: all var(--theme-transition);
}
.stage-step.done .sd { background: var(--theme-primary-soft); border-color: var(--theme-primary-soft); color: var(--theme-primary-dark); }
.stage-step.active .sd { background: var(--theme-primary); border-color: var(--theme-primary); color: var(--theme-on-primary); font-weight: 600; }
.stage-step .sl { margin-top: 6px; font-size: 11.5px; color: var(--theme-text-muted); text-align: center; }
.stage-step.active .sl { color: var(--theme-primary); font-weight: 600; }
.stage-step.done .sl { color: var(--theme-text-secondary); }
.stage-line { flex: 1; height: 1.5px; background: var(--theme-border); margin-top: 13px; min-width: 14px; }
.stage-line.done { background: var(--theme-primary-soft); }
.stage-term { margin-left: auto; align-self: center; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--theme-border); padding: 0 18px; margin-top: 10px; overflow-x: auto; }
.tab {
  padding: 10px 16px; cursor: pointer; font-size: 14px; color: var(--theme-text-secondary);
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--theme-transition), border-color var(--theme-transition);
}
.tab:hover { color: var(--theme-text); }
.tab.active { color: var(--theme-primary); border-bottom-color: var(--theme-primary); font-weight: 500; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0; }
.profile-item { padding: 12px 18px; border-bottom: 1px solid var(--theme-border-soft); }
.profile-item .k { font-size: 12px; color: var(--theme-text-muted); margin-bottom: 3px; }
.profile-item .v { font-size: 14px; word-break: break-all; }
.profile-item.wide { grid-column: 1 / -1; }

/* ===== 十二、时间线 / 跟进记录 ===== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--theme-border); }
.tl-item { position: relative; padding: 10px 0 10px 8px; border-bottom: 1px solid var(--theme-border-soft); }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 16px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--theme-surface); border: 2px solid var(--theme-primary);
}
.tl-item .t { font-size: 12px; color: var(--theme-text-muted); }
.tl-item .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-item .actor { font-weight: 600; }
.tl-item .etype { font-size: 12px; color: var(--theme-primary); background: var(--theme-primary-soft); padding: 1px 8px; border-radius: 999px; }
.tl-item .change { color: var(--theme-text-secondary); font-size: 13px; }
.tl-item .change b { color: var(--theme-text); }
.tl-item .body { margin-top: 3px; color: var(--theme-text); }

.fu-item { border-bottom: 1px solid var(--theme-border-soft); padding: 13px 0; }
.fu-item:last-child { border-bottom: none; }
.fu-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.fu-head .fu-time { margin-left: auto; }
.fu-content { margin: 8px 0 4px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; }
.fu-line { font-size: 12px; color: var(--theme-text-secondary); margin-top: 4px; }
.fu-line .fu-tag { display: inline-block; background: var(--theme-surface-soft); border-radius: 5px; padding: 1px 7px; margin-right: 6px; font-size: 11px; color: var(--theme-text-secondary); }
.fu-line.fu-next .fu-tag { background: var(--theme-primary-soft); color: var(--theme-primary-dark); }
.fu-line.fu-next { color: var(--theme-primary-dark); }

/* ===== 十三、弹窗 / 表单 ===== */
.modal-mask {
  position: fixed; inset: 0; background: var(--theme-mask); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
  animation: maskIn 200ms ease;
}
.modal {
  background: var(--theme-surface); border-radius: var(--theme-radius-lg); width: 640px; max-width: 100%;
  border: 1px solid var(--theme-border); box-shadow: 0 24px 60px rgba(30, 22, 16, .22);
  animation: modalIn 220ms ease;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { padding: 16px 22px; border-bottom: 1px solid var(--theme-border-soft); display: flex; justify-content: space-between; align-items: center; }
.modal-head .t { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 18px; color: var(--theme-text-muted); transition: color var(--theme-transition); }
.modal-close:hover { color: var(--theme-text); }
.modal-body { padding: 20px 22px; max-height: 65vh; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--theme-border-soft); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.form-item label { display: block; font-size: 12px; color: var(--theme-text-secondary); margin-bottom: 4px; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-sm); outline: none; background: var(--theme-input-bg);
  transition: border-color var(--theme-transition), box-shadow var(--theme-transition);
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--theme-primary); box-shadow: 0 0 0 3px var(--theme-primary-soft);
}
.form-item textarea { resize: vertical; min-height: 64px; }
.form-item .req { color: var(--theme-danger); }

/* ===== 十四、Toast ===== */
#toast-root { position: fixed; top: 20px; right: 20px; z-index: 220; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--theme-text); color: var(--theme-bg); padding: 10px 18px;
  border-radius: var(--theme-radius-sm); font-size: 13px; box-shadow: 0 8px 26px rgba(30, 22, 16, .18);
  animation: slideIn 200ms ease;
}
.toast.success { background: var(--theme-success); color: var(--theme-on-primary); }
.toast.error { background: var(--theme-danger); color: var(--theme-on-primary); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== 十五、外观设置（主题卡） ===== */
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .theme-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .theme-grid { grid-template-columns: 1fr; } }
.theme-card {
  position: relative; border: 1.5px solid var(--theme-border); border-radius: var(--theme-radius-md);
  background: var(--theme-surface); padding: 18px 16px 16px; cursor: pointer; text-align: left;
  transition: border-color var(--theme-transition), transform var(--theme-transition), box-shadow var(--theme-transition);
}
.theme-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(80, 60, 50, .10); }
.theme-card.current { border-color: var(--theme-primary); box-shadow: 0 0 0 3px var(--theme-primary-soft); }
.theme-swatch {
  height: 86px; border-radius: var(--theme-radius-sm); margin-bottom: 13px;
  border: 1px solid var(--theme-border-soft); display: flex; align-items: flex-end; padding: 10px; gap: 6px;
}
.theme-swatch .sw { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .55); }
.theme-name { font-size: 15px; font-weight: 600; }
.theme-en { font-size: 11px; color: var(--theme-text-muted); letter-spacing: 1px; margin-top: 2px; }
.theme-desc { font-size: 12px; color: var(--theme-text-secondary); margin-top: 7px; }
.theme-cur {
  margin-top: 11px; font-size: 12px; color: var(--theme-primary); font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}
.app-note { padding: 12px 16px; border-radius: var(--theme-radius-md); background: var(--theme-surface-soft); font-size: 12.5px; color: var(--theme-text-secondary); line-height: 1.8; }

/* ===== 十六、其他 ===== */
.empty { padding: 40px; text-align: center; color: var(--theme-text-muted); font-size: 13px; }
.loading { padding: 40px; text-align: center; color: var(--theme-text-muted); }
.warn-box {
  background: var(--tint-gold-bg); border: 1px solid var(--theme-border); border-radius: var(--theme-radius-sm);
  padding: 12px 16px; margin-bottom: 14px; font-size: 13px; color: var(--theme-text);
}
.warn-box .t { font-weight: 600; color: var(--tint-gold-fg); margin-bottom: 6px; }
.funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.funnel-row .name { width: 70px; color: var(--theme-text-secondary); text-align: right; }
.funnel-row .bar { height: 18px; background: var(--theme-primary); border-radius: 5px; min-width: 2px; opacity: .85; }
.funnel-row .cnt { font-weight: 600; font-variant-numeric: tabular-nums; }
.note-box { display: flex; gap: 10px; margin-bottom: 16px; }
.note-box textarea {
  flex: 1; padding: 8px 12px; border: 1px solid var(--theme-border); border-radius: var(--theme-radius-sm);
  resize: vertical; min-height: 42px; outline: none; background: var(--theme-input-bg);
}
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; }
.diff-old { color: var(--theme-danger); text-decoration: line-through; }
.diff-new { color: var(--theme-success); }
.rule-pts { padding: 4px 8px; border: 1px solid var(--theme-border); border-radius: var(--theme-radius-sm); font-size: 13px; }
.ellip { overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
td.ellip { display: table-cell; white-space: nowrap; }

/* 品牌标识（统一线性风格，无 emoji 依赖） */
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--theme-radius-sm);
  background: var(--theme-primary); color: var(--theme-on-primary);
  font-size: 15px; font-weight: 700; flex-shrink: 0;
}
.brand-mark.big { width: 46px; height: 46px; border-radius: var(--theme-radius-md); font-size: 23px; }
.nav-item.active .icon { opacity: .9; }

/* 联系方式条 */
.contact-bar { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--theme-border-soft); }
.contact-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--theme-border); border-radius: var(--theme-radius-sm);
  background: var(--theme-surface-soft); font-size: 13px;
}
.contact-item .contact-label { color: var(--theme-text-secondary); font-size: 12px; }
.contact-item .contact-value { font-weight: 500; font-variant-numeric: tabular-nums; }
.ci {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px; color: var(--theme-on-primary);
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.ci-phone { background: var(--tint-sage-fg); }
.ci-wechat, .ci-line, .ci-wa { background: var(--tint-green-fg); }
.ci-email { background: var(--tint-mauve-fg); }
.ci-other { background: var(--theme-text-muted); }
.contact-chip {
  display: inline-block; background: var(--tint-green-bg); border: 1px solid var(--theme-border-soft);
  color: var(--tint-green-fg); border-radius: 999px; padding: 1px 9px; font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ===== 十七、响应式（移动端保证核心页面可用） ===== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  body.side-open .sidebar { transform: translateX(0); box-shadow: 12px 0 40px rgba(30, 22, 16, .18); }
  .side-backdrop {
    display: none; position: fixed; inset: 0; background: var(--theme-mask); z-index: 25;
  }
  body.side-open .side-backdrop { display: block; }
  .main { margin-left: 0; }
  .nav-toggle { display: inline-flex; }
  .topbar .search { display: none; }
  .content { padding: 18px 14px 32px; }
  .page-title { font-size: 17px; }
  .dash-hero { padding: 18px 18px; }
  .hero-greet { font-size: 19px; }
  .stage-flow { gap: 4px; }
  .stage-step { min-width: 64px; }
  .theme-grid { gap: 12px; }
}
@media (min-width: 901px) {
  .side-backdrop { display: none !important; }
}
