/* ============================================================================
   节电智销 CRM · 响应式设计系统
   桌面端（≥1024px）：左侧导航 + 顶栏 + 内容区
   移动端（≤768px） ：抽屉导航 + 顶部栏 + 底部 Tab + 卡片列表
   ========================================================================== */

:root {
  --primary:       #1d4e89;
  --primary-600:   #2563a8;
  --primary-700:   #17406f;
  --primary-dark:  #0f2f52;
  --cyan:          #06b6d4;
  --accent:        #10b981;
  --gold:          #f59e0b;
  --danger:        #ef4444;
  --purple:        #8b5cf6;

  --bg:            #f4f6fa;
  --bg-soft:       #eef2f7;
  --card:          #ffffff;
  --text:          #1a2233;
  --text-2:        #44506b;
  --muted:         #7c8aa5;
  --border:        #e6ebf2;
  --border-soft:   #f0f3f8;

  --sidebar-w:     244px;
  --topbar-h:      64px;
  --tabbar-h:      58px;
  --radius:        14px;
  --radius-sm:     9px;
  --shadow-sm:     0 1px 2px rgba(16, 34, 61, .05);
  --shadow:        0 2px 4px rgba(16, 34, 61, .04), 0 12px 30px rgba(16, 34, 61, .07);
  --shadow-lg:     0 8px 16px rgba(16, 34, 61, .06), 0 28px 60px rgba(16, 34, 61, .12);
  --safe-b:        env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "微软雅黑", "Segoe UI", -apple-system, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

.only-mobile { display: none !important; }

/* ============================ 登录页 ============================ */
.login-page {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f2f52 0%, #1d4e89 42%, #0e7490 100%);
  overflow: hidden; padding: 20px;
}
.login-bg { position: absolute; inset: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; display: block; }
.orb-1 { width: 620px; height: 620px; top: -220px; left: -140px;
  background: radial-gradient(circle, rgba(6,182,212,.30), transparent 68%); animation: float1 18s ease-in-out infinite; }
.orb-2 { width: 520px; height: 520px; bottom: -180px; right: -120px;
  background: radial-gradient(circle, rgba(16,185,129,.24), transparent 68%); animation: float2 22s ease-in-out infinite; }
.orb-3 { width: 380px; height: 380px; top: 40%; left: 58%;
  background: radial-gradient(circle, rgba(139,92,246,.20), transparent 68%); animation: float1 26s ease-in-out infinite reverse; }
@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,30px) scale(1.08); } }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,-30px) scale(1.06); } }

.login-box {
  position: relative; z-index: 2; width: 428px; max-width: 100%;
  background: rgba(255,255,255,.96); backdrop-filter: blur(18px);
  border-radius: 22px; padding: 46px 42px 34px;
  box-shadow: 0 32px 80px rgba(4, 20, 40, .38); border: 1px solid rgba(255,255,255,.7);
  animation: rise .5s cubic-bezier(.16,1,.3,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo .mark {
  display: inline-flex; align-items: center; justify-content: center; width: 62px; height: 62px;
  background: linear-gradient(135deg, var(--primary-600), var(--cyan)); color: #fff; font-size: 30px;
  border-radius: 19px; margin-bottom: 16px; box-shadow: 0 10px 26px rgba(37, 99, 168, .42);
}
.login-logo h1 { font-size: 27px; color: var(--primary-dark); letter-spacing: 4px; font-weight: 700; }
.login-logo p { color: var(--muted); font-size: 12.5px; margin-top: 7px; letter-spacing: 1.5px; }
.login-box .el-input__wrapper { border-radius: 10px; box-shadow: 0 0 0 1px var(--border) inset; }
.login-box .el-input__wrapper.is-focus { box-shadow: 0 0 0 1px var(--primary-600) inset; }
.login-btn { width: 100%; border-radius: 10px; letter-spacing: 6px; font-weight: 600; height: 44px; margin-top: 4px; }
.login-footer { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.4); font-size: 12px; z-index: 2; }

/* ============================ 布局 ============================ */
.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); display: flex; flex-direction: column; flex-shrink: 0;
  background: linear-gradient(175deg, #16375c 0%, #0f2c4c 55%, #0b2340 100%);
  color: #fff; position: relative; box-shadow: 4px 0 24px rgba(10, 30, 55, .18); z-index: 60;
}
.sidebar::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(520px 260px at 0% 0%, rgba(6,182,212,.16), transparent 70%); }
.sidebar .brand {
  height: 68px; display: flex; align-items: center; padding: 0 22px; font-size: 18px;
  font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.09); letter-spacing: 2px;
  flex-shrink: 0; position: relative;
}
.sidebar .brand .mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--cyan), var(--accent)); border-radius: 10px; margin-right: 11px;
  font-size: 17px; box-shadow: 0 4px 12px rgba(6,182,212,.4); }
.brand-close { display: none; margin-left: auto; cursor: pointer; opacity: .6; font-size: 15px; }
.sidebar .menu { flex: 1; overflow-y: auto; padding: 14px 12px 20px; position: relative; }
.sidebar .menu::-webkit-scrollbar { width: 5px; }
.sidebar .menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); }
.menu-group-title { color: rgba(255,255,255,.36); font-size: 10.5px; padding: 16px 14px 7px;
  letter-spacing: 1.6px; text-transform: uppercase; font-weight: 600; }
.menu-item { display: flex; align-items: center; height: 42px; padding: 0 14px; cursor: pointer; font-size: 13.5px;
  color: rgba(255,255,255,.74); border-radius: 9px; margin-bottom: 2px; transition: all .18s ease; position: relative; }
.menu-item:hover { background: rgba(255,255,255,.09); color: #fff; transform: translateX(2px); }
.menu-item.active { background: linear-gradient(90deg, rgba(6,182,212,.30), rgba(6,182,212,.05));
  color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(6,182,212,.22); }
.menu-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.menu-item .icon { width: 24px; font-size: 15px; text-align: center; opacity: .92; flex-shrink: 0; }
.menu-item .label { flex: 1; }
.menu-item .dot { background: var(--danger); color: #fff; font-size: 10px; min-width: 16px; height: 16px;
  line-height: 16px; text-align: center; border-radius: 8px; padding: 0 5px; font-weight: 700; }
.sidebar .foot { padding: 14px 22px; font-size: 11px; color: rgba(255,255,255,.32);
  border-top: 1px solid rgba(255,255,255,.08); letter-spacing: .5px; }
.drawer-mask { display: none; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.topbar {
  height: var(--topbar-h); background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; padding: 0 26px; flex-shrink: 0; position: relative; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar .title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: .5px;
  display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.topbar .title::before { content: ''; width: 4px; height: 17px; border-radius: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--primary-600)); flex-shrink: 0; }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 10px; border: none; cursor: pointer;
  background: transparent; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center;
  transition: background .18s, color .18s; }
.icon-btn:hover { background: var(--bg-soft); color: var(--primary-600); }
.icon-btn .badge { position: absolute; top: 2px; right: 0; background: var(--danger); color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; padding: 0 4px; font-weight: 700; }
.topbar .user { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px;
  border-radius: 22px; transition: background .18s; }
.topbar .user:hover { background: var(--bg-soft); }
.role-tag { font-size: 11.5px; color: var(--primary-600); background: linear-gradient(135deg, #e8f2fb, #e0f2fe);
  padding: 4px 11px; border-radius: 20px; font-weight: 600; border: 1px solid rgba(37,99,168,.14); }
.topbar .avatar { width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-600), var(--cyan)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(37,99,168,.32); flex-shrink: 0; }
.uname { font-weight: 600; font-size: 13.5px; }
.chev { color: var(--muted); }
.content { flex: 1; overflow-y: auto; padding: 24px 26px 40px; }

/* ============================ 页面区块 ============================ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.page-head h2 { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.page-head .desc { font-size: 13px; color: var(--muted); margin-top: 5px; }
.head-actions { display: flex; gap: 10px; flex-shrink: 0; }

.card { background: var(--card); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px;
  box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9); position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary-600), var(--cyan) 55%, var(--accent)); opacity: .9; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 16px;
  display: flex; align-items: center; gap: 9px; }
.card-title::before { content: ''; width: 4px; height: 15px; border-radius: 2px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--cyan), var(--primary-600)); }
.card-title .more { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; cursor: pointer; }
.card-title .more:hover { color: var(--primary-600); }
.card-title-btn { margin-left: auto; }
.count-pill { background: linear-gradient(135deg, var(--primary-600), var(--cyan)); color: #fff;
  font-size: 11px; padding: 1px 9px; border-radius: 10px; font-weight: 700; }

/* 统计卡 */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { position: relative; border-radius: var(--radius); padding: 19px 20px; color: #fff; overflow: hidden;
  box-shadow: var(--shadow); min-height: 100px; display: flex; flex-direction: column; justify-content: center;
  cursor: pointer; transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card .label { font-size: 12.5px; opacity: .9; letter-spacing: .6px; }
.stat-card .value { font-size: 30px; font-weight: 700; margin-top: 6px; line-height: 1.1; letter-spacing: .5px;
  font-variant-numeric: tabular-nums; }
.stat-card .sub { font-size: 11.5px; opacity: .76; margin-top: 5px; }
.stat-card::after { content: ''; position: absolute; right: -26px; top: -26px; width: 108px; height: 108px;
  border-radius: 50%; background: rgba(255,255,255,.10); }
.stat-card::before { content: ''; position: absolute; right: 8px; bottom: -34px; width: 74px; height: 74px;
  border-radius: 50%; background: rgba(255,255,255,.07); }
.sc-blue   { background: linear-gradient(135deg, #1d4e89, #2f7fc4); }
.sc-cyan   { background: linear-gradient(135deg, #0e7490, #22b8cf); }
.sc-green  { background: linear-gradient(135deg, #047857, #10b981); }
.sc-gold   { background: linear-gradient(135deg, #b45309, #f59e0b); }
.sc-purple { background: linear-gradient(135deg, #5b21b6, #8b5cf6); }
.sc-red    { background: linear-gradient(135deg, #b91c1c, #ef4444); }

.grid-2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1180px) { .grid-2 { grid-template-columns: 1fr; } }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-box { background: linear-gradient(180deg, #fbfdff, #f4f8fc); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px; transition: all .2s; position: relative; overflow: hidden; }
.stat-box:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(37,99,168,.25); }
.stat-box .label { font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.stat-box .value { font-size: 28px; font-weight: 700; color: var(--primary);
  font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.stat-box.warn { background: linear-gradient(180deg, #fffdf5, #fff7ed); border-color: #fde3b4; }
.stat-box.warn .value { color: #d97706; }
.stat-box.sc-blue { background: linear-gradient(180deg, #f7fbff, #eaf3fc); border-color: #d3e4f7; }
.stat-box.sc-blue .value { color: #1d4e89; }
.stat-box.sc-cyan { background: linear-gradient(180deg, #f5fdfe, #e6f7fa); border-color: #c7edf3; }
.stat-box.sc-cyan .value { color: #0e7490; }
.stat-box.sc-green { background: linear-gradient(180deg, #f6fdfa, #e7f8f0); border-color: #c9ecdd; }
.stat-box.sc-green .value { color: #047857; }
.stat-box.sc-purple { background: linear-gradient(180deg, #faf9ff, #f1ecfd); border-color: #ddd2f8; }
.stat-box.sc-purple .value { color: #5b21b6; }
.stat-box.sc-gold { background: linear-gradient(180deg, #fffdf5, #fdf3e0); border-color: #f8e0b0; }
.stat-box.sc-gold .value { color: #b45309; }
.stat-box.sc-red { background: linear-gradient(180deg, #fffafa, #feeeee); border-color: #f7cfcf; }
.stat-box.sc-red .value { color: #b91c1c; }

/* 筛选栏 */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.fb-search { max-width: 300px; }
.fb-item { width: 160px; }

/* 阶段标签 */
.stage-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.stage-tab { padding: 7px 16px; border-radius: 20px; font-size: 13px; cursor: pointer;
  background: #fff; border: 1px solid var(--border); color: var(--text-2); transition: all .18s; user-select: none; }
.stage-tab:hover { border-color: var(--primary-600); color: var(--primary-600); transform: translateY(-1px); }
.stage-tab.active { background: linear-gradient(135deg, var(--primary-600), var(--cyan)); color: #fff;
  border-color: transparent; font-weight: 600; box-shadow: 0 4px 12px rgba(37,99,168,.28); }

/* 漏斗 */
.funnel-row { display: flex; align-items: center; margin-bottom: 11px; }
.funnel-row .fname { width: 78px; font-size: 13px; color: var(--text-2); flex-shrink: 0; }
.funnel-row .bar { flex: 1; height: 30px; background: var(--bg-soft); border-radius: 15px; overflow: hidden; }
.funnel-row .bar i { display: block; height: 100%; border-radius: 15px; transition: width .5s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, var(--primary-600), var(--cyan)); min-width: 4px;
  box-shadow: 0 2px 8px rgba(6,182,212,.3); }
.funnel-row .fcount { width: 52px; text-align: right; font-size: 14px; font-weight: 700; color: var(--primary); }

/* 表格 */
.simple-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.simple-table th { background: linear-gradient(180deg, #f8fafc, #f1f5f9); color: var(--text-2); font-weight: 600;
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
  font-size: 12.5px; letter-spacing: .4px; }
.simple-table th:first-child { border-top-left-radius: 9px; }
.simple-table th:last-child { border-top-right-radius: 9px; }
.simple-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; color: var(--text-2); }
.simple-table tbody tr { transition: background .15s; }
.simple-table tbody tr:hover td { background: #f6fafe; color: var(--text); }
.simple-table tbody tr:last-child td { border-bottom: none; }
.simple-table tr.clickable { cursor: pointer; }
.simple-table td.wrap { white-space: normal; min-width: 200px; word-break: break-all; }
.simple-table td.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; max-width: 260px; }
.simple-table .el-button + .el-button { margin-left: 6px; }
.simple-table .strong { font-weight: 600; color: var(--text); }
.simple-table .num { font-variant-numeric: tabular-nums; }
.simple-table .sub-text { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.table-scroll { overflow-x: auto; width: 100%; border-radius: 10px; }
.table-scroll::-webkit-scrollbar { height: 7px; }
.pager { margin-top: 16px; display: flex; justify-content: flex-end; }

/* 标签 */
.tag-ok { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; font-weight: 600; }
.tag-pending { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px;
  background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; font-weight: 600; }
.tag-danger { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px;
  background: linear-gradient(135deg, #fee2e2, #fecaca); color: #b91c1c; font-weight: 600; }
.tag-info { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4e89; font-weight: 600; }
.money { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.warn-text { color: #d97706; font-weight: 600; }

.st { font-size: 11.5px; padding: 2px 9px; border-radius: 8px; background: #eef2f7; color: #5a6b7f;
  display: inline-block; font-weight: 600; white-space: nowrap; }
.st.ok { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; }
.st.warn { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; }
.st.info { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4e89; }
.st.danger { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #b91c1c; }

/* 快捷操作 */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 16px 10px;
  border-radius: 12px; background: linear-gradient(180deg, #f8fbfe, #f1f6fb);
  border: 1px solid var(--border); cursor: pointer; transition: all .2s; }
.quick-item:hover { transform: translateY(-3px); box-shadow: var(--shadow);
  border-color: rgba(37,99,168,.28); background: linear-gradient(180deg, #f4faff, #eaf4fd); }
.quick-item .qi { font-size: 24px; margin-bottom: 3px; }
.quick-item b { font-size: 13.5px; color: var(--text); font-weight: 600; }
.quick-item i { font-size: 11.5px; color: var(--muted); font-style: normal; }
.quick-links { display: flex; gap: 12px; flex-wrap: wrap; }

/* 排名徽章 */
.rank-badge { display: inline-flex; align-items: center; justify-content: center;
  width: 23px; height: 23px; border-radius: 7px; font-size: 12px; font-weight: 700;
  background: #eef2f7; color: #64748b; }
.rank-badge.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff;
  box-shadow: 0 2px 8px rgba(245,158,11,.4); }
.rank-badge.rank-2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff;
  box-shadow: 0 2px 8px rgba(148,163,184,.36); }
.rank-badge.rank-3 { background: linear-gradient(135deg, #fdba74, #fb923c); color: #fff;
  box-shadow: 0 2px 8px rgba(251,146,60,.36); }

/* 金额横幅 */
.money-banner { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
  padding: 16px 20px; border-radius: 12px; background: linear-gradient(135deg, #f0fdf9, #ecfdf5);
  border: 1px solid #c9ecdd; }
.mb-label { font-size: 13px; color: #047857; }
.mb-value { font-size: 30px; font-weight: 700; color: #059669; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.mb-sub { font-size: 12px; color: var(--muted); }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 46px 0; font-size: 13.5px; }
.empty-ic { display: block; font-size: 34px; margin-bottom: 10px; opacity: .5; }

/* 时间线 */
.timeline { padding-left: 4px; }
.tl-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1px; background: var(--border); }
.tl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--primary-600); margin-top: 5px;
  flex-shrink: 0; z-index: 1; box-shadow: 0 0 0 3px #e8f2fb; }
.tl-dot.VISIT { background: var(--accent); box-shadow: 0 0 0 3px #d1fae5; }
.tl-dot.WECHAT { background: var(--cyan); box-shadow: 0 0 0 3px #e0f2fe; }
.tl-dot.MEETING { background: var(--purple); box-shadow: 0 0 0 3px #ede9fe; }
.tl-body { flex: 1; min-width: 0; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-way { font-size: 11.5px; background: #e8f1fb; color: var(--primary-600); padding: 1px 8px; border-radius: 8px; font-weight: 600; }
.tl-time { font-size: 11.5px; color: var(--muted); }
.tl-sales { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.tl-content { font-size: 13px; margin-top: 5px; line-height: 1.65; color: var(--text-2); word-break: break-word; }
.tl-next { font-size: 11.5px; color: #e17055; margin-top: 4px; }

/* 审批列表 */
.approval-list { display: flex; flex-direction: column; gap: 10px; }
.approval-item { display: flex; align-items: center; gap: 14px; padding: 13px 15px;
  border: 1px solid var(--border); border-radius: 11px; background: linear-gradient(180deg, #fcfdff, #f7fafd);
  transition: all .18s; }
.approval-item:hover { border-color: rgba(37,99,168,.3); box-shadow: var(--shadow-sm); }
.ai-body { flex: 1; min-width: 0; }
.ai-title { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.ai-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; align-items: center; }
.ai-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 客户详情抽屉 */
.detail-drawer .el-drawer__body { padding: 0; }
.dt-wrap { display: flex; flex-direction: column; height: 100%; }
.dt-head { background: linear-gradient(135deg, #1d4e89, #2e75b6); color: #fff; padding: 22px 20px 18px; position: relative; }
.dt-close { position: absolute; right: 14px; top: 14px; background: rgba(255,255,255,.16); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 13px; }
.dt-close:hover { background: rgba(255,255,255,.28); }
.dt-name { font-size: 18px; font-weight: 700; margin-bottom: 10px; padding-right: 30px; }
.dt-tags { display: flex; gap: 7px; flex-wrap: wrap; }
.dt-tags .st { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.dt-tags .st.ok { background: rgba(16,185,129,.32); color: #d1fae5; border-color: rgba(16,185,129,.4); }
.dt-tags .st.warn { background: rgba(245,158,11,.28); color: #fde68a; border-color: rgba(245,158,11,.4); }
.dt-actions { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dt-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.dt-tab { padding: 11px 12px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all .16s; }
.dt-tab:hover { color: var(--primary-600); }
.dt-tab.on { color: var(--primary-600); font-weight: 700; border-bottom-color: var(--primary-600); }
.dt-body { flex: 1; overflow-y: auto; padding: 16px; }
.dt-sec-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 4px 0 10px;
  padding-left: 9px; border-left: 3px solid var(--cyan); }
.kv { display: flex; padding: 8px 0; border-bottom: 1px dashed var(--border-soft); font-size: 13px; }
.kv label { width: 92px; color: var(--muted); flex-shrink: 0; }
.kv span { flex: 1; color: var(--text-2); word-break: break-word; }
.score-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.score-box { background: linear-gradient(135deg, #f0fdf4, #ecfdf5); border: 1px solid #c9ecdd; border-radius: 11px; padding: 13px; text-align: center; }
.score-box.risk { background: linear-gradient(135deg, #fff7ed, #ffedd5); border-color: #fed7aa; }
.sb-label { font-size: 11.5px; color: var(--muted); }
.sb-value { font-size: 26px; font-weight: 700; color: #059669; font-variant-numeric: tabular-nums; }
.score-box.risk .sb-value { color: #ea580c; }
.stage-picker { display: flex; gap: 7px; flex-wrap: wrap; }
.sp-item { padding: 6px 13px; border-radius: 18px; border: 1px solid var(--border); font-size: 12.5px;
  cursor: pointer; color: var(--text-2); background: #fff; transition: all .16s; }
.sp-item:hover { border-color: var(--primary-600); color: var(--primary-600); }
.sp-item.on { background: linear-gradient(135deg, var(--primary-600), var(--cyan)); color: #fff; border-color: transparent; font-weight: 600; }
.contact-item { border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; margin-bottom: 10px; background: #fcfdff; }
.ci-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ci-meta { font-size: 12.5px; color: var(--text-2); }
.ci-concern { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ci-actions { margin-top: 6px; display: flex; gap: 8px; justify-content: flex-end; }

/* 提成模拟 */
.sim-box { background: linear-gradient(135deg, #f0fdf9, #ecfdf5); border: 1px solid #c9ecdd;
  border-radius: 11px; padding: 13px 15px; width: 100%; }
.sim-line { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; color: #047857; }
.sim-line b { color: var(--text); font-variant-numeric: tabular-nums; }
.sim-note { margin-top: 8px; font-size: 11.5px; color: var(--muted); border-top: 1px dashed #c9ecdd; padding-top: 8px; }

/* 结算快照 */
.settle-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
  padding: 15px 18px; border-radius: 12px; background: linear-gradient(135deg, #1d4e89, #2e75b6); color: #fff; flex-wrap: wrap; gap: 10px; }
.sh-no { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.sh-meta { font-size: 12px; opacity: .82; margin-top: 3px; }
.sh-total { text-align: right; }
.sh-total span { font-size: 12px; opacity: .82; display: block; }
.sh-total b { font-size: 26px; font-variant-numeric: tabular-nums; }

/* 消息 */
.notif-list { display: flex; flex-direction: column; }
.notif-item { display: flex; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--border-soft); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: linear-gradient(90deg, rgba(240,249,255,.9), transparent); }
.ni-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-top: 7px; flex-shrink: 0; }
.ni-dot.WARN { background: var(--gold); }
.ni-dot.URGENT { background: var(--danger); }
.ni-dot.INFO { background: var(--cyan); }
.ni-body { flex: 1; min-width: 0; }
.ni-title { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.ni-content { font-size: 12.5px; color: var(--text-2); }
.ni-time { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* 个人中心 */
.profile-card { text-align: left; }
.pf-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.pf-avatar { width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-600), var(--cyan));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(37,99,168,.3); }
.pf-name { font-size: 18px; font-weight: 700; }
.pf-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.pf-perms { display: flex; gap: 7px; flex-wrap: wrap; }
.pf-pos { margin-left: 10px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500;
          background: rgba(6,182,212,.10); color: #0e7490; vertical-align: middle; }
.pf-info { display: grid; gap: 1px; background: #eef2f7; border-radius: 10px; overflow: hidden; }
.pfi-row { display: flex; align-items: center; gap: 16px; padding: 11px 16px; background: #fff; }
.pfi-row label { width: 88px; flex: none; font-size: 13px; color: var(--muted); }
.pfi-row span { font-size: 13.5px; color: var(--text); }

/* 顶部账号下拉菜单 */
.ud-item { display: inline-flex; align-items: center; gap: 8px; }
.ud-item.danger { color: var(--danger, #dc2626); }
.ud-item svg { flex: none; opacity: .8; }
.el-dropdown-menu__item .ud-item { font-size: 13.5px; }
.form-narrow { max-width: 460px; }

/* 导入预览 */
.import-preview { margin-top: 8px; border: 1px solid var(--border); border-radius: 11px; padding: 12px; }
.ip-title { font-size: 13px; font-weight: 600; margin-bottom: 9px; color: var(--text-2); }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mb12 { margin-bottom: 12px; }
.tip-inline { color: var(--muted); font-size: 12.5px; margin-left: 8px; }

/* 字典 */
.dict-types { display: flex; gap: 9px; flex-wrap: wrap; }
.dict-count { background: rgba(0,0,0,.08); border-radius: 8px; padding: 0 6px; margin-left: 6px; font-size: 11px; }

/* ============================ Element Plus 微调 ============================ */
.el-button { font-weight: 500; }
.el-input__wrapper, .el-select__wrapper, .el-textarea__inner { box-shadow: 0 0 0 1px var(--border) inset !important; border-radius: 9px; }
.el-input__wrapper:hover, .el-select__wrapper:hover { box-shadow: 0 0 0 1px var(--primary-600) inset !important; }
.el-input__wrapper.is-focus, .el-select__wrapper.is-focused { box-shadow: 0 0 0 1px var(--primary-600) inset !important; }
.el-card, .el-dialog { border-radius: var(--radius); }
.el-dialog { box-shadow: var(--shadow-lg); }
.el-dialog__title { font-weight: 700; }
.el-radio-button__inner { border-radius: 8px !important; }
.el-tag { border-radius: 6px; font-weight: 600; }
.el-pagination { font-weight: 500; }
.el-form-item__label { font-weight: 500; color: var(--text-2); }
.el-message-box { border-radius: var(--radius); }
.el-drawer__header { margin-bottom: 0; }

/* ============================ 移动端适配 ============================ */
@media (max-width: 768px) {
  .only-mobile { display: block !important; }
  .only-mobile.flex { display: flex !important; }
  .desktop-only { display: none !important; }

  body { font-size: 13.5px; }
  .layout { height: 100vh; }
  .content { padding: 14px 12px calc(20px + var(--tabbar-h) + var(--safe-b)); }

  /* 侧栏变抽屉 */
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px;
    transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1); z-index: 120; }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,.3); }
  .brand-close { display: inline-block; }
  .drawer-mask { display: block; position: fixed; inset: 0; background: rgba(10,25,45,.45);
    z-index: 110; backdrop-filter: blur(2px); }

  /* 顶栏 */
  .topbar { height: 54px; padding: 0 12px; }
  .topbar .title { font-size: 15.5px; }
  .topbar .title::before { height: 15px; }
  .role-tag, .uname, .chev { display: none; }
  .topbar .avatar { width: 30px; height: 30px; font-size: 13px; }
  .icon-btn { width: 34px; height: 34px; }

  /* 底部 Tab */
  .tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,.97); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
    box-shadow: 0 -4px 18px rgba(16,34,61,.07); display: grid !important;
    grid-template-columns: repeat(5, 1fr); padding-bottom: var(--safe-b); }
  .tab-item { position: relative; text-align: center; padding: 7px 0 6px; font-size: 11px;
    color: var(--muted); transition: color .18s; }
  .tab-item .ic { display: block; font-size: 19px; margin-bottom: 1px; filter: grayscale(.55); transition: all .18s; }
  .tab-item.on { color: var(--primary-600); font-weight: 700; }
  .tab-item.on .ic { filter: none; transform: translateY(-1px) scale(1.08); }
  .tab-item .badge { position: absolute; top: 2px; left: 50%; margin-left: 4px; background: var(--danger);
    color: #fff; font-size: 10px; min-width: 15px; height: 15px; line-height: 15px; border-radius: 8px;
    padding: 0 4px; font-weight: 700; }

  /* 页面头 */
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 16px; }
  .page-head h2 { font-size: 18px; }
  .head-actions { display: flex; gap: 8px; }
  .head-actions .el-button { flex: 1; margin-left: 0; }

  /* 卡片 */
  .card { padding: 15px 14px; margin-bottom: 12px; border-radius: 13px; }
  .card-title { font-size: 14px; margin-bottom: 13px; }

  /* 统计卡 */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
  .stat-card { min-height: 86px; padding: 14px 15px; border-radius: 13px; }
  .stat-card .value { font-size: 24px; }
  .stat-card .label { font-size: 11.5px; }
  .stat-card .sub { font-size: 10.5px; }

  /* 筛选 */
  .filter-bar { gap: 8px; }
  .fb-search { max-width: none; flex: 1 1 100%; }
  .fb-item { width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); }
  .filter-bar .el-button { flex: 1 1 auto; margin-left: 0; }

  /* 表格 → 卡片 */
  .m-card-list { display: flex; flex-direction: column; gap: 10px; }
  .m-cust-card { background: #fff; border-radius: 13px; padding: 13px 14px;
    box-shadow: 0 2px 8px rgba(16,34,61,.05); border: 1px solid rgba(255,255,255,.9); }
  .m-cust-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
  .m-cust-top .nm { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-cust-meta { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
  .m-cust-meta .usage { color: var(--primary-600); font-weight: 600; }
  .m-cust-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px;
    font-size: 12px; gap: 8px; }
  .m-cust-foot .next { color: #e17055; }
  .m-task-actions { display: flex; gap: 8px; margin-top: 9px; }
  .m-task-actions .el-button { flex: 1; margin-left: 0; }

  /* 阶段标签横向滚动 */
  .stage-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
  .stage-tabs::-webkit-scrollbar { display: none; }
  .stage-tab { flex-shrink: 0; padding: 6px 13px; font-size: 12.5px; }

  /* 弹窗全屏化 */
  .el-dialog { width: 94% !important; margin-top: 8vh !important; }
  .el-dialog__body { padding: 16px 14px; max-height: 64vh; overflow-y: auto; }
  .el-form-item__label { font-size: 13px; }
  .el-drawer.rtl, .el-drawer { width: 100% !important; }
  .detail-drawer .el-drawer__body { padding: 0; }

  /* 其他 */
  .funnel-row .fname { width: 62px; font-size: 12px; }
  .funnel-row .fcount { width: 38px; font-size: 13px; }
  .money-banner { padding: 13px 15px; gap: 8px; }
  .mb-value { font-size: 25px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-box { padding: 14px 15px; }
  .stat-box .value { font-size: 22px; }
  .pager { justify-content: center; overflow-x: auto; }
  .quick-grid { gap: 10px; }
  .approval-item { flex-direction: column; align-items: stretch; gap: 10px; }
  .ai-actions .el-button { flex: 1; margin-left: 0; }
  .settle-head { flex-direction: column; align-items: flex-start; }
  .sh-total { text-align: left; }
  .el-drawer__body { padding: 0; }
  .toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); }
}

/* 小屏手机 */
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card .value { font-size: 21px; }
  .tab-item { font-size: 10px; }
}

/* 平板 */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-w: 210px; }
  .content { padding: 20px 18px 36px; }
}

/* 打印 */
@media print {
  .sidebar, .topbar, .tabbar, .page-head, .filter-bar { display: none !important; }
  .content { overflow: visible; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}


/* ========== 审计日志 / 系统日志 ========== */
.pager-wrap { display: flex; justify-content: flex-end; padding-top: 14px; }
.sub-key { font-size: 11px; color: var(--text-3); margin-top: 2px; font-weight: 400; }

.log-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.log-list { border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; background: #fff; }
.log-list-title { padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--text-2);
  background: linear-gradient(180deg, #f8fafc, #f1f5f9); border-bottom: 1px solid var(--border-soft); }
.log-item { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); cursor: pointer; transition: background .15s; }
.log-item:last-child { border-bottom: none; }
.log-item:hover { background: #f6fafe; }
.log-item.on { background: linear-gradient(90deg, rgba(29,78,137,.10), rgba(6,182,212,.06)); box-shadow: inset 3px 0 0 var(--primary); }
.log-item .li-name { font-size: 13px; color: var(--text); font-weight: 500; }
.log-item.on .li-name { color: var(--primary); }
.log-item .li-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.log-viewer { border: 1px solid var(--border-soft); border-radius: 10px; background: #fff; overflow: hidden; min-height: 320px; }
.log-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; background: linear-gradient(180deg, #f8fafc, #f1f5f9); border-bottom: 1px solid var(--border-soft); }
.log-viewer-head .lv-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.log-content { margin: 0; padding: 14px; font-size: 12.5px; line-height: 1.75; color: #334155;
  background: #fbfdff; white-space: pre-wrap; word-break: break-all; max-height: 60vh; overflow: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

@media (max-width: 768px) {
  .log-layout { grid-template-columns: 1fr; }
  .log-content { max-height: 46vh; font-size: 12px; }
}


/* ========== 合同扫描件 ========== */
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-item { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 9px; background: #fbfdff; }
.att-item .att-name { font-size: 13px; color: var(--text); word-break: break-all; }
.att-item .att-ops { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.att-item .att-none { font-size: 12px; color: var(--text-3); }
.att-kind { font-size: 11.5px; color: var(--muted); background: #f1f5f9;
  border-radius: 4px; padding: 1px 7px; margin-right: 4px; }

/* ============================ 用电调查 ============================ */
.sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sum-box { background: #f7fafd; border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px; }
.sum-box .label { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.sum-box .value { font-size: 17px; font-weight: 700; color: var(--primary-700); font-variant-numeric: tabular-nums; }
.sum-box .value small { font-size: 11px; font-weight: 400; color: var(--muted); }
.sec-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 16px 0 8px;
  padding-left: 9px; border-left: 3px solid var(--accent); line-height: 1.3; }
.link-box { display: flex; }
.link-box .el-input-group__append { padding: 0; }
.link-box .el-input-group__append .el-button { border-radius: 0 6px 6px 0; margin-left: -1px; }

@media (max-width: 768px) {
  .sum-grid { grid-template-columns: repeat(2, 1fr); }
  .sum-box .value { font-size: 15px; }
}
