/* ============================================================
   暖芽家庭服务 · 客资系统
   视觉：暖绿系 / 柔和圆角 / 充足留白 / 轻量动效
   ============================================================ */

:root {
    /* 品牌色：暖芽绿 */
    --brand: #2f9e6e;
    --brand-dark: #23855a;
    --brand-light: #46b384;
    --brand-soft: #e8f6ef;
    --brand-soft-2: #f2fbf6;
    --brand-ring: rgba(47, 158, 110, .14);

    /* 辅助色 */
    --amber: #e0a02c;
    --amber-soft: #fdf5e6;
    --blue: #3f86c9;
    --blue-soft: #eaf3fb;
    --rose: #d4656f;
    --rose-soft: #fceef0;
    --slate: #8a949e;
    --slate-soft: #f0f2f4;

    /* 中性色 */
    --bg: #f5f8f6;
    --bg-deep: #eef3f0;
    --card: #ffffff;
    --text: #1c2b24;
    --text-2: #55645c;
    --text-3: #8e9b94;
    --text-4: #b3bdb7;
    --line: #e6ecea;
    --line-2: #f0f4f2;

    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 2px rgba(28, 43, 36, .04);
    --shadow: 0 1px 3px rgba(28, 43, 36, .04), 0 8px 24px -12px rgba(28, 43, 36, .10);
    --shadow-lg: 0 12px 48px -12px rgba(28, 43, 36, .18);
    --sidebar-w: 232px;
    --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
svg { flex-shrink: 0; }

::selection { background: #cdeadd; color: #14513a; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d5dfda; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #bfcbc5; background-clip: content-box; }

/* ================= 登录页（无侧边栏） ================= */

.auth-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(1000px 700px at 12% 8%, #e3f4eb 0%, transparent 55%),
        radial-gradient(900px 620px at 88% 92%, #e4eefc 0%, transparent 55%),
        linear-gradient(160deg, #f6f8fb 0%, #edf2f7 100%);
}

/* 居中悬浮卡片：左品牌右表单，大屏不再空旷 */
.auth-card {
    display: grid; grid-template-columns: 1.12fr 1fr;
    width: 100%; max-width: 1040px;
    background: #fff; border-radius: 24px; overflow: hidden;
    box-shadow: 0 32px 80px -24px rgba(23, 58, 94, .20), 0 4px 18px rgba(23, 58, 94, .06);
}

.auth-art {
    position: relative;
    background:
        radial-gradient(900px 600px at 15% 10%, #dff3e8 0%, transparent 55%),
        radial-gradient(700px 500px at 85% 85%, #e6f4ec 0%, transparent 60%),
        linear-gradient(160deg, #f3faf6 0%, #eaf6f0 100%);
    display: flex; flex-direction: column;
    justify-content: center;
    padding: 64px 60px;
    overflow: hidden;
}

.auth-art::before,
.auth-art::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(47,158,110,.10) 0%, transparent 70%);
}
.auth-art::before { width: 520px; height: 520px; top: -180px; right: -160px; }
.auth-art::after { width: 380px; height: 380px; bottom: -140px; left: -100px; }

.auth-brand {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 40px; position: relative; z-index: 2;
}
.auth-logo {
    width: 52px; height: 52px; border-radius: 16px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 28px -10px rgba(23, 58, 94, .18);
}
.auth-brand-text h1 {
    margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.3px;
    color: #1a3d2e;
}
.auth-brand-text p {
    margin: 2px 0 0; font-size: 12.5px; color: #6d8a7c; letter-spacing: 2px;
}

.auth-headline {
    position: relative; z-index: 2;
    font-size: 34px; font-weight: 700; line-height: 1.35;
    color: #17402e; letter-spacing: -.5px;
    margin: 0 0 16px;
}
.auth-headline em {
    font-style: normal;
    background: linear-gradient(120deg, var(--brand) 0%, #4fc08b 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-desc {
    position: relative; z-index: 2;
    font-size: 14.5px; color: #6b8779; line-height: 1.9;
    max-width: 420px; margin: 0 0 44px;
}

.auth-feats { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 18px; }
.auth-feat { display: flex; align-items: flex-start; gap: 13px; }
.auth-feat-ico {
    width: 38px; height: 38px; border-radius: 11px;
    background: rgba(255,255,255,.9); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px -4px rgba(28,43,36,.12);
    flex-shrink: 0;
}
.auth-feat b { display: block; font-size: 14px; font-weight: 600; color: #22392e; }
.auth-feat span { font-size: 12.5px; color: #7d9488; }

.auth-form-side {
    display: flex; align-items: center; justify-content: center;
    padding: 48px 44px;
    background: #fff;
}
.auth-box { width: 100%; max-width: 380px; }

.auth-box h2 {
    margin: 0 0 6px; font-size: 25px; font-weight: 700; letter-spacing: -.4px;
}
.auth-box .auth-sub {
    margin: 0 0 32px; font-size: 13.5px; color: var(--text-3);
}

.auth-field { margin-bottom: 18px; }
.auth-field label {
    display: block; font-size: 12.5px; color: var(--text-2);
    margin-bottom: 7px; font-weight: 500;
}
.auth-input-wrap { position: relative; }
.auth-input-wrap .ico {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text-4); pointer-events: none;
}
.auth-input {
    width: 100%; height: 46px; padding: 0 14px 0 42px;
    border: 1.5px solid var(--line); border-radius: 11px;
    background: #fbfcfb; outline: none;
    transition: all .18s var(--ease);
}
.auth-input:focus {
    border-color: var(--brand); background: #fff;
    box-shadow: 0 0 0 4px var(--brand-ring);
}
.auth-input::placeholder { color: var(--text-4); }

.auth-btn {
    width: 100%; height: 47px; border: none; border-radius: 11px;
    background: linear-gradient(135deg, #45b884, var(--brand));
    color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px;
    margin-top: 8px;
    box-shadow: 0 8px 22px -8px rgba(47, 158, 110, .65);
    transition: all .2s var(--ease);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(47,158,110,.7); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

.auth-tip {
    margin-top: 26px; padding: 13px 15px;
    background: var(--brand-soft-2); border: 1px solid #dcefe5;
    border-radius: 10px; font-size: 12.5px; color: #4d7160; line-height: 1.8;
}
.auth-tip b { color: var(--brand-dark); }

/* 登录页：使用手册入口 */
.auth-manual {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    margin-top: 16px; padding: 11px 14px;
    border: 1.5px solid #cfe0f5; border-radius: 10px;
    background: #f5f9ff; color: #2f6bbf;
    font-size: 13.5px; font-weight: 600; text-decoration: none;
    transition: background .16s, border-color .16s, transform .16s;
}
.auth-manual:hover { background: #e9f2ff; border-color: #a9c9ee; transform: translateY(-1px); }

.auth-foot {
    margin-top: 30px; text-align: center;
    font-size: 11.5px; color: var(--text-4);
}

@media (max-width: 980px) {
    .auth-wrap { padding: 0; align-items: stretch; }
    .auth-card { grid-template-columns: 1fr; max-width: 480px; border-radius: 0; box-shadow: none; min-height: 100vh; }
    .auth-art { display: none; }
    .auth-form-side { padding: 44px 28px; }
}

/* ================= 应用布局 ================= */

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
}

.brand {
    display: flex; align-items: center; gap: 11px;
    padding: 12px 18px 9px;
}
.nav { padding: 2px 10px; flex: 1; overflow-y: auto; }
.brand-logo {
    width: 36px; height: 36px; border-radius: 11px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 36px;
    box-shadow: 0 4px 12px -4px rgba(23, 58, 94, .12);
}
.brand-name { font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; line-height: 1.25; }
.brand-name small {
    display: block; font-size: 11px; font-weight: 500;
    color: var(--text-3); letter-spacing: 1.5px; margin-top: 1px;
}


.nav-title {
    font-size: 10.5px; color: var(--text-4); letter-spacing: 1.2px;
    padding: 18px 10px 7px; font-weight: 600;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border-radius: 9px;
    color: var(--text-2); font-size: 13.5px;
    margin-bottom: 2px; cursor: pointer;
    transition: background .16s var(--ease), color .16s var(--ease);
    position: relative;
}
.nav-item:hover { background: var(--brand-soft-2); color: var(--brand-dark); }
.nav-item.active {
    background: var(--brand-soft); color: var(--brand-dark); font-weight: 600;
}
.nav-item.active::before {
    content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-item svg { opacity: .8; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
    margin-left: auto; font-size: 11px; font-weight: 600;
    background: var(--rose-soft); color: var(--rose);
    padding: 1px 7px; border-radius: 20px; min-width: 20px; text-align: center;
}

.sidebar-foot { padding: 10px; border-top: 1px solid var(--line-2); }
.me {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: 10px; cursor: pointer;
    transition: background .16s;
}
.me:hover { background: var(--brand-soft-2); }
.avatar {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13.5px; font-weight: 600; flex: 0 0 34px;
    letter-spacing: .3px;
}
.avatar.round { border-radius: 50%; }
.avatar.sm { width: 28px; height: 28px; flex: 0 0 28px; font-size: 12px; border-radius: 8px; }
.avatar.xs { width: 21px; height: 21px; flex: 0 0 21px; font-size: 10px; border-radius: 6px; }

/* ---------- 侧边栏收起 / 展开 ---------- */

.sidebar { transition: width .2s var(--ease), flex-basis .2s var(--ease), transform .26s var(--ease); }
.sidebar .brand { overflow: hidden; }
.sidebar .brand-name,
.sidebar .nav-item span,
.sidebar .me-text,
.sidebar .me-edit { transition: opacity .14s var(--ease); }

/* 折叠按钮：贴在侧边栏右下角 */
.sb-toggle {
    display: flex; align-items: center; gap: 7px;
    margin: 0 10px 10px; padding: 7px 10px;
    border: 1px solid var(--line); background: #fff; border-radius: 9px;
    color: var(--text-3); font-size: 12px; cursor: pointer;
    font-family: inherit; width: calc(100% - 20px);
    transition: background .16s, color .16s, border-color .16s;
}
.sb-toggle:hover { background: var(--brand-soft-2); color: var(--brand-dark); border-color: var(--brand); }
.sb-toggle-ico { display: inline-flex; flex: none; }
.sb-ico-expand { display: none; }

/* 收起态（桌面 / 平板） */
.app.sb-mini .sidebar { width: 66px; flex-basis: 66px; }
.app.sb-mini .main { margin-left: 66px; }
.app.sb-mini .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.app.sb-mini .brand-name,
.app.sb-mini .nav-item span,
.app.sb-mini .me-text,
.app.sb-mini .me-edit { display: none; }
.app.sb-mini .nav-title { text-align: center; padding-left: 0; padding-right: 0; overflow: hidden; font-size: 0; }
.app.sb-mini .nav-title::after { content: '···'; font-size: 11px; letter-spacing: 1px; }
.app.sb-mini .nav-item { justify-content: center; padding: 10px 0; }
.app.sb-mini .nav-item.active::before { left: -10px; }
.app.sb-mini .sidebar-foot { padding: 8px; }
.app.sb-mini .me { justify-content: center; padding: 6px; }
.app.sb-mini .me-out { display: none; }
.app.sb-mini .sb-toggle { justify-content: center; padding: 7px 0; margin-left: 8px; margin-right: 8px; width: calc(100% - 16px); }
.app.sb-mini .sb-toggle-text { display: none; }
.app.sb-mini .sb-ico-collapse { display: none; }
.app.sb-mini .sb-ico-expand { display: inline-flex; }

/* 收起后顶栏出现展开按钮 */
.sb-reopen { display: none; }
.app.sb-mini .sb-reopen { display: inline-flex; }

/* 分组卡片内的成员胶囊 */
.mem-list { display: flex; flex-wrap: wrap; gap: 5px; }
.mem {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px 2px 2px; border-radius: 99px;
    background: #f4f8f6; border: 1px solid var(--line);
    font-size: 11.5px; color: var(--text-2); white-space: nowrap;
}
.mem-more { padding: 3px 9px; color: var(--text-3); background: #fafcfb; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
.me-name { font-size: 13px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 11px; color: var(--text-3); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 66px; background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 14px;
    padding: 0 26px; position: sticky; top: 0; z-index: 40;
}
.page-title { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.3px; }
.page-desc { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.content { padding: 22px 26px 60px; }

/* ================= 卡片 ================= */

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: box-shadow .2s var(--ease);
}
.card:hover { box-shadow: var(--shadow); }
.card-head {
    display: flex; align-items: center; gap: 9px;
    padding: 15px 18px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 {
    margin: 0; font-size: 13.5px; font-weight: 650; color: var(--text);
    display: flex; align-items: center; gap: 7px;
}
.card-head h3 svg { color: var(--brand); }
.card-head .hint { font-size: 12px; color: var(--text-3); margin-left: auto; }
.card-body { padding: 18px; }

.grid { display: grid; gap: 15px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-1 { grid-template-columns: 1fr 1fr; }
.g-1-1-1 { grid-template-columns: 1fr 1fr 1fr; }
.g-3-2 { grid-template-columns: 3fr 2fr; }
.g-2-3 { grid-template-columns: 2fr 3fr; }

/* ================= KPI 卡 ================= */

.kpi {
    background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 17px 18px;
    position: relative; overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.kpi-ico {
    width: 30px; height: 30px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand);
}
.kpi-label { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.kpi-value {
    font-size: 27px; font-weight: 700; letter-spacing: -1px;
    line-height: 1.15; font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 2px; letter-spacing: 0; }
.kpi-foot { font-size: 12px; color: var(--text-3); margin-top: 7px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi-glow {
    position: absolute; right: -28px; top: -28px; width: 90px; height: 90px;
    border-radius: 50%; background: var(--brand-soft); opacity: .7; pointer-events: none;
}

.trend-up { color: var(--brand); font-weight: 650; display: inline-flex; align-items: center; gap: 2px; }
.trend-down { color: var(--rose); font-weight: 650; display: inline-flex; align-items: center; gap: 2px; }
.trend-flat { color: var(--text-3); font-weight: 600; }

/* ================= 按钮 ================= */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 14px;
    border-radius: 9px; border: 1px solid var(--line);
    background: #fff; color: var(--text-2);
    font-size: 13.5px; font-weight: 500;
    transition: all .16s var(--ease); white-space: nowrap;
}
.btn:hover { border-color: #d3ded8; background: #fbfdfc; color: var(--text); }
.btn:active { transform: translateY(.5px); }
.btn-primary {
    background: var(--brand); border-color: var(--brand); color: #fff;
    box-shadow: 0 4px 12px -4px rgba(47, 158, 110, .5);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; box-shadow: 0 6px 16px -4px rgba(47,158,110,.6); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-3); }
/* 客资列表行内操作列：纯图标按钮收窄为 27px，保证 5 个按钮在操作列宽内完整显示 */
.row-act .btn { width: 27px; padding: 0; flex: none; }
/* 复制成功后的短暂绿色反馈 */
.btn.btn-ok { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.btn-ghost:hover { background: var(--line-2); color: var(--text); }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-sm svg { width: 14px; height: 14px; }
/* 超小按钮：跟进记录上的「撤销推荐」等行内操作 */
.btn-xs { height: 23px; padding: 0 8px; font-size: 11.5px; border-radius: 6px; gap: 4px; line-height: 1; }
.btn-xs svg { width: 11px; height: 11px; }
.tl-undo { color: var(--rose, #c0392b); border: 1px solid #f0d6d3; background: #fdf3f2; margin-left: 4px; }
.tl-undo:hover { background: #fbe7e5; border-color: #e8c4c0; color: #a93226; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14.5px; border-radius: 10px; }
.btn-danger { color: var(--rose); border-color: #f2d9dc; background: #fff; }
.btn-danger:hover { background: var(--rose-soft); border-color: #e8c3c8; color: #b8484f; }
.btn-soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }
.btn-soft:hover { background: #dcf0e6; border-color: transparent; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn .spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 分段控件 */
.seg {
    display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; gap: 2px;
}
.seg a, .seg button {
    padding: 5px 13px; border-radius: 7px; font-size: 12.5px;
    color: var(--text-3); border: none; background: transparent;
    transition: all .16s var(--ease); font-weight: 500;
}
.seg a:hover, .seg button:hover { color: var(--text); }
.seg a.on, .seg button.on {
    background: #fff; color: var(--brand-dark); font-weight: 600;
    box-shadow: 0 1px 3px rgba(28,43,36,.10);
}

/* 时间段按钮（今天/昨天/近7天…共 7 个）：窄屏允许换行，不撑破容器 */
.seg.seg-wrap {
    flex-wrap: wrap;
    max-width: 100%;
}
.seg.seg-wrap button { white-space: nowrap; }

/* 筛选区紧凑化：搜索栏一行排布 */
.filter-bar { gap: 4px; }
.filter-bar .filter-search { min-width: 118px; max-width: 132px; flex: 1 1 132px; }
.filter-bar .filter-search .input { max-width: none; width: 100%; }
.filter-bar .seg { padding: 3px; gap: 2px; }
.filter-bar .seg button { padding: 5px 13px; font-size: 12.5px; white-space: nowrap; flex: none; }
/* 日期弹层：快捷项 + 自定义区间上下排布 */
.dr-panel { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; max-width: calc(100vw - 16px); }
.dr-panel .dr-quick { flex-wrap: wrap; }
.dr-panel .dr-quick button { padding: 5px 13px; }
.dr-panel .dr-row { display: flex; align-items: center; gap: 8px; }
.filter-bar .seg { margin-left: 0; }
.filter-bar .seg { margin-left: 8px; }
.filter-bar .chip { padding: 5px 6px; font-size: 12px; white-space: nowrap; flex: none; }
.filter-bar .chip label, .filter-bar label.chip { flex: none; }
.filter-bar .chip .fs11 { font-size: 12px; }
/* 手机端：快捷日期项强制一行，横向滑动查看 */
@media (max-width: 900px) {
    .seg { max-width: 100%; }
    .seg.seg-sm, .filter-bar .seg, .toolbar .seg, .card-head .seg {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .seg.seg-sm::-webkit-scrollbar, .filter-bar .seg::-webkit-scrollbar { display: none; }
    .seg.seg-sm button, .filter-bar .seg button, .toolbar .seg button, .card-head .seg button { white-space: nowrap; flex: none; }
    .filter-bar .filter-search { max-width: 100%; flex: 1 1 100%; }
}

/* ================= 表单 ================= */

.field { margin-bottom: 16px; }
.field > label {
    display: block; font-size: 12.5px; color: var(--text-2);
    margin-bottom: 6px; font-weight: 500;
}
.field .req { color: var(--rose); margin-left: 2px; }
.input, .select, .textarea {
    width: 100%; height: 38px; padding: 0 12px;
    border: 1.5px solid var(--line); border-radius: 9px;
    background: #fff; color: var(--text); outline: none;
    transition: border-color .16s, box-shadow .16s, background .16s;
}
.textarea { height: auto; min-height: 82px; padding: 10px 12px; resize: vertical; line-height: 1.65; }
.input:hover, .select:hover, .textarea:hover { border-color: #d8e2dd; }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-ring); background: #fff;
}
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e9b94' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center;
    padding-right: 32px;
}
.field-hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.6; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }

.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
    padding: 6px 13px; border-radius: 20px; font-size: 12.5px;
    border: 1.5px solid var(--line); background: #fff; color: var(--text-2);
    cursor: pointer; transition: all .16s var(--ease);
}
.chip:hover { border-color: #cfe3d8; color: var(--brand-dark); }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }

/* 复选开关行 */
.switch-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 11px;
    background: #fbfdfc; cursor: pointer; transition: all .18s var(--ease);
}
.switch-row:hover { border-color: #cfe3d8; background: #fff; }
.switch-row .switch-t { display: block; font-size: 13px; font-weight: 600; color: var(--text-1); }
.switch-row .switch-d { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.5; color: var(--text-3); }
.switch-row .sw { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-row .sw-ui {
    position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px;
    background: #dde5e1; transition: background .2s var(--ease);
}
.switch-row .sw-ui::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    transition: transform .2s var(--ease);
}
.switch-row .sw:checked + .sw-ui { background: var(--brand); }
.switch-row .sw:checked + .sw-ui::after { transform: translateX(18px); }
.switch-row .sw:focus-visible + .sw-ui { box-shadow: 0 0 0 3px var(--brand-ring); }

/* ================= 表格 ================= */

.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tb.fixed { table-layout: fixed; }
/* 固定布局下保证单元格内容不撑破列宽 */
table.tb[style*="table-layout:fixed"] td,
table.tb.fixed td { overflow: hidden; text-overflow: ellipsis; }
table.tb[style*="table-layout:fixed"] td > div,
table.tb.fixed td > div { min-width: 0; }
table.tb th {
    text-align: left; font-weight: 600; color: var(--text-3); font-size: 12px;
    padding: 11px 14px; background: #fafcfb;
    border-bottom: 1px solid var(--line); white-space: nowrap;
    position: sticky; top: 0; z-index: 2;
}
table.tb td {
    padding: 12px 14px; border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
}
table.tb tbody tr { transition: background .14s; }
table.tb tbody tr:hover { background: #fafdfb; }
table.tb tbody tr:last-child td { border-bottom: none; }
table.tb tr.checked { background: var(--brand-soft-2); }

.td-name { font-weight: 600; color: var(--text); }
.td-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 客户名后的来源小标签 */
.src-tag {
    flex: none; display: inline-flex; align-items: center; gap: 2px;
    height: 17px; padding: 0 5px; border-radius: 5px;
    background: var(--brand-soft-2); color: var(--brand);
    font-size: 11px; font-weight: 600; line-height: 1;
    white-space: nowrap;
}
.src-tag svg { opacity: .85; }

/* 数据统计首屏加载骨架 */
.stats-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 90px 20px;
    background: #fff; border: 1px solid var(--line-2); border-radius: 14px;
}
.stats-loading b { font-size: 15px; color: var(--text); }
.stats-loading span { font-size: 12.5px; color: var(--text-3); }
.stats-loading .spinner {
    width: 30px; height: 30px; border-radius: 50%;
    border: 3px solid var(--brand-soft-2); border-top-color: var(--brand);
    animation: ny-spin .8s linear infinite;
}
@keyframes ny-spin { to { transform: rotate(360deg); } }
.td-num { font-variant-numeric: tabular-nums; font-weight: 600; }
.num-pos { color: var(--brand); font-weight: 650; }
.num-neg { color: var(--rose); font-weight: 650; }

/* 复选框 */
.cbx {
    appearance: none; width: 16px; height: 16px; border-radius: 5px;
    border: 1.5px solid #ccd6d1; background: #fff; cursor: pointer;
    position: relative; transition: all .14s; vertical-align: middle; margin: 0;
}
.cbx:hover { border-color: var(--brand); }
.cbx:checked { background: var(--brand); border-color: var(--brand); }
.cbx:checked::after {
    content: ''; position: absolute; left: 5px; top: 1.5px;
    width: 4px; height: 8px; border: 2px solid #fff;
    border-top: none; border-left: none; transform: rotate(42deg);
}

/* ================= 标签 / 徽章 ================= */

.tag {
    display: inline-flex; align-items: center; gap: 4px;
    height: 23px; padding: 0 9px; border-radius: 7px;
    font-size: 12px; font-weight: 550; white-space: nowrap;
}
.tag svg { width: 12px; height: 12px; }
.tag-gray  { background: var(--slate-soft); color: #6b7780; }
.tag-blue  { background: var(--blue-soft);  color: var(--blue); }
.tag-green { background: var(--brand-soft); color: var(--brand-dark); }
.tag-amber { background: var(--amber-soft); color: #a87413; }
.tag-brand { background: #e2f5eb; color: var(--brand-dark); }
.tag-slate { background: #f1f3f4; color: #8a949e; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.flag {
    display: inline-flex; align-items: center; height: 21px; padding: 0 8px;
    border-radius: 6px; font-size: 11.5px; font-weight: 650;
    white-space: nowrap; flex: none;
}
.flag-1 { background: #fdecef; color: #c2454f; }
.flag-2 { background: var(--amber-soft); color: #a87413; }
.flag-3 { background: var(--slate-soft); color: #79838c; }

.pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
}
.pill-urgent { background: #fdecef; color: #c2454f; animation: pulse 2.4s infinite; }
.pill-today { background: var(--amber-soft); color: #a87413; }
.pill-soon { background: var(--blue-soft); color: var(--blue); }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(194, 69, 79, .22); }
    50% { box-shadow: 0 0 0 5px rgba(194, 69, 79, 0); }
}

/* ================= 筛选栏 ================= */

.filter-bar {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    padding: 13px 16px; border-bottom: 1px solid var(--line-2);
}
.filter-bar .input, .filter-bar .select { height: 34px; width: auto; min-width: 78px; max-width: 118px; padding: 0 8px; border-radius: 8px; font-size: 12.5px; }
.filter-bar .select { padding: 0 22px 0 10px; background-position: right 8px center; background-size: 13px; width: 92px; min-width: 92px; max-width: 92px; flex: none; font-size: 13px; }
.filter-search { position: relative; flex: 1; min-width: 150px; max-width: 200px; }
.filter-search .input { width: 100%; padding-left: 35px; }
.filter-search .ico {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-4); pointer-events: none;
}
.filter-count {
    font-size: 12.5px; color: var(--text-3);
    padding: 0 16px 12px; display: flex; align-items: center; gap: 8px;
    white-space: nowrap;
}
.filter-count b { color: var(--brand-dark); font-size: 13.5px; }

/* 批量操作条 */
.bulk-bar {
    display: none; align-items: center; gap: 10px;
    padding: 10px 16px; background: var(--brand-soft);
    border-bottom: 1px solid #d3ebdf; font-size: 13px; color: var(--brand-dark);
}
.bulk-bar.on { display: flex; animation: slideDown .2s var(--ease); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ================= 进度条 / 图表 ================= */

.bar-row { display: flex; align-items: center; gap: 11px; padding: 8px 0; }
.bar-label {
    width: 82px; font-size: 12.5px; color: var(--text-2); flex: 0 0 82px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track { flex: 1; height: 8px; background: var(--line-2); border-radius: 20px; overflow: hidden; }
.bar-fill {
    height: 100%; border-radius: 20px;
    background: linear-gradient(90deg, var(--brand-light), var(--brand));
    transition: width .6s var(--ease);
}
.bar-val { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; min-width: 48px; text-align: right; white-space: nowrap; }

/* 柱状趋势图 */
.chart-bars {
    display: flex; align-items: stretch; gap: 3px;
    height: 168px; padding: 8px 0 0; position: relative;
}
.chart-col {
    flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
    gap: 2px; min-width: 2px; position: relative; cursor: pointer;
    border-radius: 3px 3px 0 0;
}
.chart-col .b-new {
    background: linear-gradient(180deg, #7dd3ab, #4fbb8a);
    border-radius: 3px 3px 0 0; min-height: 2px;
    transition: height .5s var(--ease), opacity .16s;
}
.chart-col .b-won {
    background: linear-gradient(180deg, #f0b45e, #e0a02c);
    border-radius: 3px 3px 0 0; min-height: 2px;
    transition: height .5s var(--ease);
}
.chart-col:hover .b-new { opacity: .78; }
.chart-x { display: flex; gap: 3px; margin-top: 7px; }
.chart-x span {
    flex: 1; font-size: 9.5px; color: var(--text-4);
    text-align: center; overflow: hidden; white-space: nowrap;
}
.chart-legend { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--text-3); }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

.chart-tip {
    position: absolute; background: #22392e; color: #fff;
    padding: 6px 10px; border-radius: 7px; font-size: 11.5px;
    pointer-events: none; opacity: 0; transform: translate(-50%, -120%);
    transition: opacity .14s; white-space: nowrap; z-index: 20;
    box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.chart-col:hover .chart-tip { opacity: 1; }

/* 环形图 */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut {
    width: 138px; height: 138px; border-radius: 50%;
    position: relative; flex: 0 0 138px;
    transition: transform .3s var(--ease);
}
.donut:hover { transform: scale(1.03); }
.donut::after {
    content: ''; position: absolute; inset: 26px; background: #fff; border-radius: 50%;
    box-shadow: inset 0 1px 4px rgba(28,43,36,.05);
}
.donut-center {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 2;
}
.donut-center b { font-size: 22px; font-weight: 700; letter-spacing: -1px; }
.donut-center span { font-size: 10.5px; color: var(--text-3); }
.legend { flex: 1; min-width: 150px; }
.legend-item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 0; font-size: 12.5px;
}
.legend-dot { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }
.legend-item .lv { color: var(--text-2); flex: 1; }
.legend-item .lc { font-variant-numeric: tabular-nums; color: var(--text-3); font-size: 12px; }
.legend-item .lp { font-variant-numeric: tabular-nums; color: var(--text-4); font-size: 11.5px; width: 40px; text-align: right; }

/* 漏斗 */
.funnel { display: flex; flex-direction: column; gap: 2px; }
.funnel-step {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 14px; border-radius: 9px;
    background: var(--brand-soft-2); position: relative;
    transition: all .2s var(--ease);
}
.funnel-step:hover { background: var(--brand-soft); }
.funnel-ico {
    width: 28px; height: 28px; border-radius: 8px;
    background: #fff; color: var(--brand); display: flex;
    align-items: center; justify-content: center; flex: 0 0 28px;
    box-shadow: var(--shadow-xs);
}
.funnel-info { flex: 1; min-width: 0; }
.funnel-info b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-info span { font-size: 12px; color: var(--text-3); margin-left: 6px; }
.funnel-bar {
    height: 5px; background: var(--line); border-radius: 10px;
    margin-top: 5px; overflow: hidden;
}
.funnel-bar i {
    display: block; height: 100%; border-radius: 10px;
    background: linear-gradient(90deg, var(--brand-light), var(--brand));
    transition: width .7s var(--ease);
}
.funnel-conv {
    font-size: 11.5px; font-weight: 650; color: var(--brand-dark);
    background: #fff; padding: 2px 8px; border-radius: 20px;
    flex-shrink: 0;
}
.funnel-drop { font-size: 11px; color: var(--rose); }

/* 热力图 */
.heatmap { display: flex; gap: 3px; }
.heat-week { display: flex; flex-direction: column; gap: 3px; }
.heat-cell {
    width: 13px; height: 13px; border-radius: 3px;
    background: var(--line-2); transition: transform .14s;
    position: relative;
}
.heat-cell:hover { transform: scale(1.25); outline: 1.5px solid var(--brand); z-index: 2; }
.heat-cell.l1 { background: #d8efe2; }
.heat-cell.l2 { background: #a8dcc1; }
.heat-cell.l3 { background: #6cc59b; }
.heat-cell.l4 { background: var(--brand); }
.heat-cell.empty { background: transparent; }
.heat-legend {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--text-4); margin-top: 12px;
}
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* 交叉表 */
.cross-table { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12.5px; }
.cross-table th {
    font-size: 11.5px; color: var(--text-3); font-weight: 600;
    padding: 4px 6px; text-align: center;
}
.cross-table th:first-child { text-align: left; }
.cross-table td {
    text-align: center; padding: 9px 6px; border-radius: 7px;
    font-variant-numeric: tabular-nums; font-weight: 600;
    background: var(--line-2); color: var(--text-3);
    transition: transform .14s;
}
.cross-table td:hover { transform: scale(1.04); }
.cross-table td:first-child { text-align: left; background: transparent; font-weight: 500; color: var(--text-2); }
.cross-table td.zero { color: var(--text-4); font-weight: 400; background: #fafcfb; }

/* ================= 时间线（跟进记录） ================= */

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
    content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px;
    width: 2px; background: linear-gradient(180deg, var(--brand-soft), var(--line));
}
.tl-item { position: relative; padding-bottom: 20px; animation: fadeUp .3s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tl-item::before {
    content: ''; position: absolute; left: -24px; top: 6px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 2.5px solid var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft-2);
}
.tl-item.sys::before { border-color: var(--text-4); }
.tl-head { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.tl-head b { color: var(--text); font-weight: 600; font-size: 13px; }
.tl-head .tag { height: 20px; font-size: 11px; }
.tl-body {
    margin-top: 6px; font-size: 13.5px; line-height: 1.75;
    color: var(--text-2); white-space: pre-wrap; word-break: break-word;
    background: #fafcfb; border: 1px solid var(--line-2);
    border-radius: 10px; padding: 10px 13px;
}
.tl-plan {
    margin-top: 6px; font-size: 12px; color: var(--brand-dark);
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--brand-soft); padding: 3px 10px; border-radius: 20px;
}

/* ================= 迷你日历 ================= */

.mini-cal { font-size: 12px; }
.mini-cal-head {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.mini-cal-head b { font-size: 13px; font-weight: 650; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mini-cal-dow {
    text-align: center; font-size: 10.5px; color: var(--text-4);
    font-weight: 600; padding: 3px 0;
}
.mini-cal-day {
    aspect-ratio: 1; border-radius: 7px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 11.5px; color: var(--text-2); position: relative;
    cursor: default; background: #fbfcfb;
    transition: all .14s;
}
.mini-cal-day.blank { background: transparent; }
.mini-cal-day.has { background: var(--brand-soft); color: var(--brand-dark); font-weight: 650; }
.mini-cal-day.has-plan { background: var(--amber-soft); color: #a87413; font-weight: 650; }
.mini-cal-day.today { outline: 2px solid var(--brand); outline-offset: -2px; }
.mini-cal-day:hover { transform: scale(1.08); }
.mini-cal-day .cnt {
    position: absolute; bottom: 1px; font-size: 8px; opacity: .8;
}

/* ================= 状态流转条 ================= */

.status-flow {
    display: flex; align-items: center; gap: 0;
    flex-wrap: wrap; margin: 2px 0 16px;
    padding: 12px 14px; background: #fafcfb;
    border-radius: 11px; border: 1px solid var(--line-2);
}
.sf-step { display: flex; align-items: center; font-size: 12px; color: var(--text-4); }
.sf-dot {
    width: 22px; height: 22px; border-radius: 50%;
    background: #eef2f0; display: flex; align-items: center; justify-content: center;
    font-size: 10.5px; color: #a9b5ae; margin-right: 5px; font-weight: 700;
    transition: all .2s;
}
.sf-step.done .sf-dot { background: var(--brand); color: #fff; }
.sf-step.cur .sf-dot {
    background: var(--amber); color: #fff;
    box-shadow: 0 0 0 4px var(--amber-soft);
}
.sf-step.done, .sf-step.cur { color: var(--text); font-weight: 600; }
.sf-line { width: 18px; height: 2px; background: var(--line); margin: 0 6px; border-radius: 2px; }
.sf-line.done { background: var(--brand); }

/* ================= 详情 ================= */

.detail-list { display: grid; grid-template-columns: 88px 1fr; gap: 12px 14px; font-size: 13.5px; }
.detail-list dt { color: var(--text-3); font-size: 12.5px; }
.detail-list dd { margin: 0; color: var(--text); word-break: break-word; }

.info-row {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 0; border-bottom: 1px dashed var(--line-2);
}
.info-row:last-child { border-bottom: none; }
.info-row .ico { color: var(--text-4); flex: 0 0 16px; }
.info-row .k { font-size: 12.5px; color: var(--text-3); width: 74px; flex: 0 0 74px; }
.info-row .v { font-size: 13.5px; color: var(--text); flex: 1; min-width: 0; word-break: break-all; }

.copy-btn {
    opacity: 0; padding: 2px; border: none; background: transparent;
    color: var(--text-4); border-radius: 4px; transition: all .14s;
    display: inline-flex; align-items: center;
}
.info-row:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--brand); background: var(--brand-soft); }

.hero-card {
    background: linear-gradient(135deg, #f4fbf7 0%, #eef8f2 100%);
    border: 1px solid #dcefe5;
}

/* 订单文案（发群用） */
.order-box {
    background: #fff; border: 1px solid #dcefe5; border-radius: 11px;
    padding: 10px 12px 12px;
}
.order-box-head { display: flex; align-items: center; gap: 6px; padding-bottom: 7px; }
.order-box-head svg { color: var(--brand); }
.order-text {
    width: 100%; box-sizing: border-box;
    border: 1px dashed #cfe3d8; border-radius: 9px; background: #fbfefc;
    padding: 10px 12px; resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px; line-height: 1.75; color: var(--text-2);
    outline: none;
}
.order-text:focus { border-style: solid; border-color: var(--brand); background: #fff; }

/* ================= 空状态 ================= */

.empty { padding: 60px 20px; text-align: center; color: var(--text-3); }
.empty-ico {
    width: 64px; height: 64px; margin: 0 auto 14px;
    border-radius: 20px; background: var(--brand-soft-2);
    display: flex; align-items: center; justify-content: center;
    color: var(--brand);
}
.empty h4 { margin: 0 0 5px; font-size: 14px; color: var(--text-2); font-weight: 600; }
.empty p { margin: 0; font-size: 12.5px; color: var(--text-3); }

/* ================= 分页 ================= */

.pager {
    display: flex; align-items: center; gap: 5px;
    padding: 13px 16px; border-top: 1px solid var(--line-2);
}
.pager .info { font-size: 12.5px; color: var(--text-3); margin-right: auto; }
.pager a, .pager span.pg {
    min-width: 31px; height: 31px; padding: 0 9px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--text-2); border: 1px solid var(--line);
    transition: all .14s;
}
.pager a:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft-2); }
.pager .cur {
    background: var(--brand); border-color: var(--brand);
    color: #fff; font-weight: 600;
}
.pager .dis { color: #d3dbd7; pointer-events: none; background: #fafcfb; }

/* ================= 提示条 ================= */

.alert {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 11px 15px; border-radius: 10px; font-size: 13px;
    margin-bottom: 15px; line-height: 1.65;
    animation: slideDown .24s var(--ease);
}
.alert svg { margin-top: 1px; }
.alert-ok { background: var(--brand-soft); color: #1e6b4a; border: 1px solid #cfeade; }
.alert-err { background: var(--rose-soft); color: #a83f48; border: 1px solid #f2d5d8; }
.alert-info { background: var(--blue-soft); color: #2a6398; border: 1px solid #d5e6f4; }
.alert-warn { background: var(--amber-soft); color: #8f6210; border: 1px solid #f5e3c2; }

/* ================= 弹窗 / 抽屉 ================= */

.mask {
    position: fixed; inset: 0; background: rgba(24, 40, 33, .38);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    z-index: 200; display: none;
    align-items: center; justify-content: center; padding: 24px;
}
.mask.on { display: flex; }
.modal {
    background: #fff; border-radius: var(--radius-xl);
    width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: pop .22s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-head {
    padding: 20px 22px 0; display: flex; align-items: center; gap: 10px;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.modal-head .x {
    margin-left: auto; width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); background: transparent; border: none;
    transition: all .14s;
}
.modal-head .x:hover { background: var(--line-2); color: var(--text); }
.modal-body { padding: 18px 22px; }
.modal-foot {
    padding: 0 22px 20px; display: flex; justify-content: flex-end; gap: 9px;
}

/* 抽屉：线索快速查看 */
.drawer-mask {
    position: fixed; inset: 0; background: rgba(24, 40, 33, .32);
    backdrop-filter: blur(2px); z-index: 210; display: none;
}
.drawer-mask.on { display: block; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 440px; max-width: 94vw; background: #fff;
    box-shadow: -12px 0 48px rgba(20,36,29,.16);
    z-index: 211; transform: translateX(100%);
    transition: transform .28s var(--ease);
    display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head {
    padding: 18px 20px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 10px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }

/* ================= Toast ================= */

.toast-wrap {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 300; display: flex; flex-direction: column; gap: 8px;
    align-items: center; pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 17px; border-radius: 11px;
    background: #22392e; color: #fff; font-size: 13.5px;
    box-shadow: 0 10px 32px -8px rgba(20, 36, 29, .4);
    animation: toastIn .26s var(--ease);
    max-width: 90vw;
}
.toast.err { background: #b8484f; }
.toast svg { flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .22s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.96); } }

/* ================= 加载态 ================= */

.skeleton {
    background: linear-gradient(90deg, #f2f6f4 25%, #e9f0ec 37%, #f2f6f4 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease infinite;
    border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.loading-overlay {
    position: absolute; inset: 0; background: rgba(255,255,255,.62);
    backdrop-filter: blur(1px); z-index: 10;
    display: none; align-items: center; justify-content: center;
    border-radius: inherit;
}
.loading-overlay.on { display: flex; }
.loader {
    width: 26px; height: 26px; border-radius: 50%;
    border: 2.5px solid var(--brand-soft);
    border-top-color: var(--brand);
    animation: spin .7s linear infinite;
}
.pos-rel { position: relative; }

/* ================= 工具类 ================= */

.mt0{margin-top:0}.mt4{margin-top:4px}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt20{margin-top:20px}.mt24{margin-top:24px}
.mb0{margin-bottom:0}.mb4{margin-bottom:4px}.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}.mb20{margin-bottom:20px}
.flex{display:flex}.items-center{align-items:center}.items-start{align-items:flex-start}
.justify-between{justify-content:space-between}.flex-col{flex-direction:column}
.gap4{gap:4px}.gap6{gap:6px}.gap8{gap:8px}.gap10{gap:10px}.gap12{gap:12px}.gap16{gap:16px}
.ml-auto{margin-left:auto}
.text-3{color:var(--text-3)}.text-2{color:var(--text-2)}.text-brand{color:var(--brand)}
.fs11{font-size:11px}.fs12{font-size:12px}.fs13{font-size:13px}.fs14{font-size:14px}
.fw6{font-weight:600}.fw7{font-weight:700}
.tabular{font-variant-numeric:tabular-nums}
.nowrap{white-space:nowrap}
.hide{display:none!important}
.w-full{width:100%}
.tr{text-align:right}.tc{text-align:center}

/* ================= 响应式 ================= */

@media (max-width: 1280px) {
    .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g-2-1, .g-1-1, .g-1-1-1, .g-3-2, .g-2-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    :root { --sidebar-w: 0px; }
    .sidebar {
        transform: translateX(-100%); width: 240px; flex-basis: 240px;
        transition: transform .26s var(--ease);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: none; }
    .main { margin-left: 0; }
    .content { padding: 15px 13px 50px; }
    .topbar { padding: 0 13px; height: 60px; }
    .g2, .g3, .g4, .g5, .g6 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .menu-toggle { display: inline-flex !important; }
    .sb-reopen { display: none !important; }
    .page-desc { display: none; }
    /* 手机/平板防横向溢出兜底 */
    html, body { overflow-x: hidden; }
    .card { max-width: 100%; min-width: 0; }
    .card, .card-body { overflow-wrap: break-word; word-break: break-word; }
    .card-body .flex { flex-wrap: wrap; }
    .chart-tip { display: none !important; }
    .drawer { width: 100%; }
    /* 手机端抽屉式，不受收起态影响，统一 240px 全宽显示 */
    .app.sb-mini .sidebar { width: 240px; flex-basis: 240px; }
    .app.sb-mini .main { margin-left: 0; }
    .app.sb-mini .brand-name,
    .app.sb-mini .nav-item span,
    .app.sb-mini .me-text,
    .app.sb-mini .me-edit { display: block; }
    .app.sb-mini .nav-title { font-size: 10.5px; text-align: left; padding-left: 10px; }
    .app.sb-mini .nav-title::after { content: none; }
    .app.sb-mini .nav-item { justify-content: flex-start; padding: 9px 11px; }
    .app.sb-mini .me { justify-content: flex-start; }
    .app.sb-mini .sb-toggle,
    .app.sb-mini .sb-reopen { display: none; }
    .app.sb-mini .me-out { display: inline-flex; }

    /* —— 手机端适配增强 —— */
    /* KPI 统计卡两列排布，避免单列卡片把页面拉得过长 */
    .g4, .g5, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .g4 .kpi, .g5 .kpi, .g6 .kpi { padding: 12px; }
    /* 筛选条允许换行，日期分段条可横向滑动；按钮文字保持一行 */
    .filter-bar { flex-wrap: wrap; row-gap: 8px; }
    .filter-bar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex: none; }
    .filter-bar .seg::-webkit-scrollbar { display: none; }
    .seg a, .seg button, .seg .seg-btn { white-space: nowrap; flex: none; padding: 5px 9px; font-size: 12px; }
    .seg { flex: none; gap: 1px; padding: 3px; }
    /* 跟进日历：7 列太挤，改为固定宽度横向滑动；每天只显示 1 条预约，避免两行堆叠 */
    [data-cal-grid] .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    [data-cal-grid] .card-body > div[style*="repeat(7"] { min-width: 620px !important; }
    [data-cal-grid] .cal-ev:nth-of-type(n+2) { display: none !important; }
    [data-cal-grid] .cal-more { white-space: nowrap; }
    /* 列表行收紧为单行：隐藏次要子行（昵称/编号等），信息滑动或进详情可见 */
    .table-wrap td .td-sub { display: none; }
    .table-wrap td { padding-top: 9px; padding-bottom: 9px; }
    /* 表格文字绝不一字一行竖排：内容自然宽度 + 单行 + 整表横向滑动 */
    .table-wrap { overflow-x: auto !important; }
    .table-wrap table { table-layout: auto !important; width: max-content !important; min-width: 100%; }
    .table-wrap th, .table-wrap td { white-space: nowrap; }
    .table-wrap td div, .table-wrap td span { white-space: nowrap; }
    /* 弹窗不超出屏幕 */
    .modal { width: min(94vw, 560px) !important; max-width: 94vw; }
    .modal-body { padding: 14px 16px; max-height: 70vh; overflow-y: auto; }
    /* 表格内按钮不换行溢出 */
    .table-wrap { -webkit-overflow-scrolling: touch; }
    /* 顶部通知下拉/抽屉宽度 */
    .drawer { max-width: 100vw; }
    /* 卡片标题不折行，说明文字换到下一行整行显示 */
    .card-head { flex-wrap: wrap; row-gap: 3px; }
    .card-head h3 { white-space: nowrap; }
    .card-head .hint { margin-left: 0; width: 100%; line-height: 1.6; flex-wrap: wrap !important; }
    /* 工具条/按钮组允许换行，按钮文字不压缩 */
    .toolbar { flex-wrap: wrap; row-gap: 8px; justify-content: flex-start; }
    .toolbar .btn, .btn { white-space: nowrap; }
    .flex.gap8 { flex-wrap: wrap; }
    /* 标签不压缩折行 */
    .tag { white-space: nowrap; }
    /* 页面大标题过长时省略 */
    .topbar .page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62vw; }
}
.menu-toggle { display: none; }

/* 中屏（笔记本小屏 / 分屏）：默认收起为图标栏，可手动展开 */
@media (min-width: 901px) and (max-width: 1180px) {
    :root { --sidebar-w: 66px; }
    .app:not(.sb-open) .brand { justify-content: center; padding-left: 0; padding-right: 0; }
    .app:not(.sb-open) .brand-name,
    .app:not(.sb-open) .nav-item span,
    .app:not(.sb-open) .me-text,
    .app:not(.sb-open) .me-edit { display: none; }
    .app:not(.sb-open) .nav-title { font-size: 0; text-align: center; padding-left: 0; padding-right: 0; overflow: hidden; }
    .app:not(.sb-open) .nav-title::after { content: '···'; font-size: 11px; letter-spacing: 1px; }
    .app:not(.sb-open) .nav-item { justify-content: center; padding: 10px 0; }
    .app:not(.sb-open) .sidebar-foot { padding: 8px; }
    .app:not(.sb-open) .me { justify-content: center; padding: 6px; }
    .app:not(.sb-open) .me-out { display: none; }
    .app:not(.sb-open) .sb-toggle { justify-content: center; padding: 7px 0; margin-left: 8px; margin-right: 8px; width: calc(100% - 16px); }
    .app:not(.sb-open) .sb-toggle-text { display: none; }
    .app:not(.sb-open) .sb-ico-collapse { display: none; }
    .app:not(.sb-open) .sb-ico-expand { display: inline-flex; }
    /* 手动展开时覆盖为完整宽度（优先级需高于 .app:not(.sb-open) 系列） */
    .app.sb-open.sb-open .sidebar { width: 232px; flex-basis: 232px; }
    .app.sb-open.sb-open .main { margin-left: 232px; }
    .app.sb-open.sb-open .brand-name,
    .app.sb-open.sb-open .nav-item span,
    .app.sb-open.sb-open .me-text,
    .app.sb-open.sb-open .me-edit { display: block; }
    .app.sb-open.sb-open .nav-title { font-size: 10.5px; text-align: left; padding-left: 10px; }
    .app.sb-open.sb-open .nav-title::after { content: none; }
    .app.sb-open.sb-open .nav-item { justify-content: flex-start; padding: 9px 11px; }
    .app.sb-open.sb-open .me { justify-content: flex-start; }
    .app.sb-open.sb-open .sidebar-foot { padding: 10px; }
    .app.sb-open.sb-open .me-out { display: inline-flex; }
    .app.sb-open.sb-open .sb-toggle { justify-content: flex-start; padding: 7px 10px; margin-left: 10px; margin-right: 10px; width: calc(100% - 20px); }
    .app.sb-open.sb-open .sb-toggle-text { display: inline; }
    .app.sb-open.sb-open .sb-ico-collapse { display: inline-flex; }
    .app.sb-open.sb-open .sb-ico-expand { display: none; }
}

@media print {
    .sidebar, .topbar, .filter-bar, .pager, .btn, .bulk-bar { display: none !important; }
    .main { margin-left: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    .content { padding: 0; }
}

/* ============================================================
   新客资通知（位置由后台配置：ny-bottom-right 等）
   ============================================================ */

.ny-pop {
    position: fixed; z-index: 320; pointer-events: none;
    display: flex; flex-direction: column; gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
}
.ny-bottom-right { right: 22px; bottom: 22px; }
.ny-bottom-left  { left: 22px; bottom: 22px; }
.ny-top-right    { right: 22px; top: 82px; }
.ny-top-center   { left: 50%; top: 22px; transform: translateX(-50%); }
.ny-center       { left: 50%; top: 50%; transform: translate(-50%, -50%); }

.ny-card {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 11px;
    width: 100%; padding: 13px 14px;
    background: #fff; border-radius: 14px;
    border: 1px solid #dcefe5;
    box-shadow: 0 14px 40px -14px rgba(20, 46, 34, .32), 0 2px 6px rgba(20, 46, 34, .06);
    text-decoration: none; color: inherit;
    opacity: 0; transform: translateY(14px) scale(.97);
    transition: opacity .28s var(--ease), transform .28s var(--ease);
    position: relative; overflow: hidden;
}
.ny-top-right .ny-card, .ny-top-center .ny-card { transform: translateY(-14px) scale(.97); }
.ny-card.in { opacity: 1; transform: none; }
.ny-card.out { opacity: 0; transform: translateY(8px) scale(.97); }
.ny-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, #56c795, var(--brand));
}
.ny-card:hover { border-color: #c6e7d6; box-shadow: 0 16px 44px -12px rgba(20, 46, 34, .38); }

.ny-ico {
    width: 36px; height: 36px; border-radius: 11px; flex: 0 0 36px;
    background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    animation: nyRing 1.6s ease .2s 1;
}
@keyframes nyRing {
    0%, 100% { transform: rotate(0); }
    12% { transform: rotate(11deg); }
    24% { transform: rotate(-9deg); }
    36% { transform: rotate(6deg); }
    48% { transform: rotate(-3deg); }
}
.ny-main { flex: 1; min-width: 0; }
.ny-title { font-size: 13.5px; font-weight: 650; color: var(--text); line-height: 1.4; }
.ny-body {
    font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ny-meta { font-size: 11px; color: var(--text-4); margin-top: 4px; }
.ny-close {
    border: none; background: transparent; color: var(--text-4);
    padding: 2px; border-radius: 6px; display: flex; align-items: center;
    transition: all .14s; flex: 0 0 auto;
}
.ny-close:hover { background: var(--line-2); color: var(--text-2); }

/* ---------- 顶栏铃铛 ---------- */

.bell-wrap { position: relative; }
.bell {
    width: 34px; height: 34px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff;
    color: var(--text-2); display: flex; align-items: center; justify-content: center;
    transition: all .16s var(--ease); position: relative;
}
.bell:hover { border-color: #cfe3d8; color: var(--brand-dark); background: var(--brand-soft-2); }
.bell-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 9px; background: var(--rose); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
    border: 2px solid #fff; box-sizing: content-box;
}
/* 有未读未查看时，每 30 秒让角标「跳一下」，配合提示音做持续提醒 */
@keyframes ny-ping {
    0%   { transform: scale(1); }
    22%  { transform: scale(1.45); }
    45%  { transform: scale(.95); }
    68%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.bell-badge.ping { animation: ny-ping .9s var(--ease); }

.notice-pop {
    position: absolute; right: 0; top: 46px;
    width: 326px; max-height: 460px; overflow: hidden;
    background: #fff; border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    display: none; z-index: 120;
    animation: pop .18s var(--ease);
}
.notice-pop.on { display: block; }
.notice-head {
    display: flex; align-items: center; gap: 7px;
    padding: 12px 14px; border-bottom: 1px solid var(--line-2);
}
.notice-head b { font-size: 13.5px; font-weight: 650; }
.notice-list { max-height: 400px; overflow-y: auto; }
.notice-item {
    display: flex; gap: 9px; padding: 11px 14px;
    border-bottom: 1px solid var(--line-2);
    text-decoration: none; color: inherit;
    transition: background .14s; position: relative;
}
.notice-item:hover { background: #fafdfb; }
.notice-item.unread { background: var(--brand-soft-2); }
.notice-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: transparent; margin-top: 6px; flex: 0 0 7px;
}
.notice-item.unread .notice-dot { background: var(--brand); }
.notice-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.45; }
.notice-body {
    font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.55;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.notice-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 11px; color: var(--text-4); }

/* ---------- 后台：位置选择 / 试听 ---------- */

.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 420px; }
.pos-card {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; height: 62px; border-radius: 10px;
    border: 1.5px solid var(--line); background: #fbfcfb;
    cursor: pointer; transition: all .16s var(--ease); color: var(--text-3);
}
.pos-card:hover { border-color: #cfe3d8; }
.pos-card.on {
    border-color: var(--brand); background: var(--brand-soft);
    color: var(--brand-dark); box-shadow: 0 0 0 3px var(--brand-ring);
}
.range {
    -webkit-appearance: none; appearance: none; width: 100%; height: 5px;
    border-radius: 6px; background: var(--line); outline: none; margin: 8px 0;
}
.range::-webkit-slider-thumb {
    -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%;
    background: var(--brand); border: 2.5px solid #fff;
    box-shadow: 0 2px 7px rgba(47, 158, 110, .45); cursor: pointer;
}
.range::-moz-range-thumb {
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--brand); border: 2.5px solid #fff; cursor: pointer;
}

.notify-demo {
    position: relative; padding: 20px; border-radius: 12px;
    background: repeating-linear-gradient(45deg, #fafcfb, #fafcfb 10px, #f6f9f7 10px, #f6f9f7 20px);
    border: 1px dashed var(--line);
    display: flex; justify-content: center;
}
.nd-card {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border-radius: 13px; padding: 12px 14px;
    border: 1px solid #dcefe5; box-shadow: 0 10px 30px -14px rgba(20,46,34,.3);
    max-width: 340px; width: 100%;
}
.nd-ico {
    width: 32px; height: 32px; border-radius: 10px; flex: 0 0 32px;
    background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
}
.nd-title { font-size: 13px; font-weight: 650; }
.nd-body { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.nd-time { font-size: 11px; color: var(--text-4); }

/* ============================================================
   分页（重做：选中态更清晰、点击区域更大）
   ============================================================ */

.pager {
    display: flex; align-items: center; gap: 6px;
    padding: 14px 16px; border-top: 1px solid var(--line-2);
    flex-wrap: wrap;
}
.pager .info {
    font-size: 12.5px; color: var(--text-3); margin-right: auto;
    font-variant-numeric: tabular-nums;
}
.pager .info b { color: var(--text); font-weight: 650; }

.pager a, .pager span.pg {
    min-width: 34px; height: 34px; padding: 0 10px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13.5px; font-weight: 500;
    color: var(--text-2); background: #fff;
    border: 1.5px solid var(--line);
    transition: all .16s var(--ease);
    font-variant-numeric: tabular-nums;
    user-select: none;
}
.pager a:hover {
    border-color: var(--brand); color: var(--brand-dark);
    background: var(--brand-soft-2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -6px rgba(47, 158, 110, .5);
}
.pager a:active { transform: translateY(0); }

/* 当前页：实心品牌色 + 扩散光环，一眼可辨（加宽增加存在感） */
.pager .cur {
    min-width: 44px; height: 36px; padding: 0 14px;
    background: var(--brand); border-color: var(--brand);
    color: #fff; font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    box-shadow: 0 0 0 3px var(--brand-ring), 0 6px 16px -6px rgba(47, 158, 110, .75);
    cursor: default;
    font-variant-numeric: tabular-nums;
}
.pager .cur::after {
    content: ''; position: absolute; inset: -3px; border-radius: 12px;
    border: 1.5px solid rgba(47, 158, 110, .28); pointer-events: none;
}
.pager .cur { position: relative; }

/* 上一页/下一页：箭头更醒目 */
.pager a[data-page] svg { width: 15px; height: 15px; }
.pager .arrow { font-weight: 600; }

/* 省略号 */
.pager .dis {
    min-width: 22px; border: none; background: transparent;
    color: var(--text-4); letter-spacing: 1px; padding: 0 2px;
}

/* 禁用态 */
.pager a.dis {
    color: #d3dbd7; background: #fafcfb;
    border-color: var(--line-2); pointer-events: none; box-shadow: none;
}

/* 每页条数 */
.pager .per {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12.5px; color: var(--text-3); margin-left: 6px;
}
.pager .per select {
    height: 30px; border-radius: 8px; border: 1.5px solid var(--line);
    background: #fff; font-size: 12.5px; padding: 0 22px 0 8px; color: var(--text-2);
    appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e9b94' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 6px center;
}
.pager .per select:hover { border-color: #cfe3d8; }
.pager .per select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

@media (max-width: 640px) {
    .pager { gap: 4px; }
    .pager a, .pager span.pg { min-width: 30px; height: 30px; font-size: 12.5px; }
    .pager .info { width: 100%; margin-bottom: 4px; }
    .ny-pop { max-width: calc(100vw - 20px); }
    .ny-bottom-right, .ny-bottom-left { right: 10px; left: 10px; bottom: 10px; }
    .ny-bottom-left { right: auto; }
}

/* ================= 全站水印（防截图外传） ================= */
.wm-layer {
    position: fixed; inset: 0; z-index: 3000;
    pointer-events: none;            /* 完全不挡操作 */
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    opacity: .55;
}
.wm-layer .wm-inner {
    position: absolute; inset: 0;
    background-repeat: repeat;
    background-position: 0 0;
}
/* 打印时水印加深，纸质外流同样可追溯 */
@media print {
    .wm-layer { opacity: .85; }
}

/* ============================================================
   本轮 UI 优化
   ============================================================ */

/* 侧栏底部：头像信息 + 退出按钮同行不换行 */
.sidebar-foot {
    display: flex; align-items: center; gap: 6px;
}
.sidebar-foot .me { flex: 1; min-width: 0; }
.sidebar-foot .me .me-name,
.sidebar-foot .me .me-role {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-foot .me-out {
    flex: none; width: 34px; height: 34px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; color: var(--text-3);
}
.sidebar-foot .me-out:hover { color: var(--rose); background: var(--rose-soft); }

/* 侧栏：使用手册入口（常驻，收起时只显示图标） */
.sb-manual {
    display: flex; align-items: center; gap: 8px;
    margin: 0 10px 10px; padding: 8px 12px;
    border-radius: 9px; background: #f2f7fe; border: 1px solid #dbe9fa;
    color: #2f6bbf; font-size: 13px; font-weight: 600; text-decoration: none;
    transition: background .16s, border-color .16s;
}
.sb-manual:hover { background: #e6f0fe; border-color: #b9d3f2; }
.sb-manual svg { flex: none; }
.app.sb-mini .sb-manual {
    margin: 0 8px 8px; padding: 9px 0; justify-content: center;
}
.app.sb-mini .sb-manual span { display: none; }

/* 账号弹窗：配置权限开关（开启/关闭状态一目了然） */
.perm-box {
    display: flex; align-items: center; gap: 16px;
    border: 1.5px solid var(--line); border-radius: 12px;
    background: #fbfdfc; padding: 13px 15px;
}
.perm-box .perm-info { flex: 1; min-width: 0; }
.perm-box .perm-t {
    display: flex; align-items: center; gap: 6px;
    font-size: 13.5px; font-weight: 700; color: var(--text-1);
}
.perm-box .perm-t svg { color: var(--brand); }
.perm-box .perm-d { margin-top: 4px; font-size: 11.5px; line-height: 1.6; color: var(--text-3); }
.perm-switch {
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; flex: none; user-select: none;
}
.perm-switch .perm-ck { position: absolute; opacity: 0; width: 0; height: 0; }
.perm-switch .perm-track {
    position: relative; width: 46px; height: 26px; border-radius: 99px;
    background: #d8e0dc; transition: background .2s var(--ease); flex: none;
}
.perm-switch .perm-dot {
    position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.22);
    transition: transform .2s var(--ease);
}
.perm-switch .perm-ck:checked + .perm-track { background: var(--brand); }
.perm-switch .perm-ck:checked + .perm-track .perm-dot { transform: translateX(20px); }
.perm-switch .perm-ck:focus-visible + .perm-track { box-shadow: 0 0 0 3px var(--brand-ring); }
.perm-switch .perm-state {
    font-size: 13px; color: var(--text-3); font-weight: 600; min-width: 46px;
}

/* 抽屉详情：详情页是按主区宽度设计的，塞进抽屉必须收成单列 */
.drawer { width: 600px; }
.drawer-body .grid { grid-template-columns: 1fr !important; }
.drawer-body .grid.g4 { grid-template-columns: repeat(4, minmax(0,1fr)) !important; }
.drawer-body .card { break-inside: avoid; }
@media (max-width: 700px) {
    .drawer { width: 100%; }
    .drawer-body .grid.g4 { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}

/* ============================================================
   线索快速预览卡片
   ============================================================ */
.pv-mask {
    position: fixed; inset: 0; z-index: 260;
    background: rgba(20, 36, 29, .32);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    animation: fadeIn .18s;
}
.pv-card {
    width: 560px; max-width: 96vw; max-height: 86vh;
    background: #fff; border-radius: 16px;
    box-shadow: 0 24px 70px -18px rgba(20, 36, 29, .45);
    display: flex; flex-direction: column; overflow: hidden;
    animation: pvIn .22s var(--ease);
}
@keyframes pvIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.pv-head {
    padding: 16px 18px 13px; border-bottom: 1px solid var(--line);
    display: flex; align-items: flex-start; gap: 11px;
}
.pv-head .avatar { flex: none; }
.pv-head-main { flex: 1; min-width: 0; }
.pv-name {
    font-size: 16px; font-weight: 700; color: var(--text-1);
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.pv-sub { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.pv-close {
    flex: none; width: 30px; height: 30px; border-radius: 8px;
    border: none; background: #f4f7f5; color: var(--text-3);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.pv-close:hover { background: var(--rose-soft); color: var(--rose); }

.pv-body { padding: 14px 18px 4px; overflow-y: auto; flex: 1; }

.pv-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 16px; margin-bottom: 12px;
}
.pv-item {
    display: flex; align-items: baseline; gap: 7px;
    font-size: 12.8px; min-width: 0;
}
.pv-item .k { color: var(--text-3); flex: none; width: 62px; }
.pv-item .v {
    color: var(--text-1); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-item .v.mono { font-variant-numeric: tabular-nums; }
.pv-item.wide { grid-column: 1 / -1; }
.pv-item.wide .v { white-space: normal; word-break: break-all; }

.pv-stat {
    display: flex; gap: 10px; margin: 0 0 13px;
}
.pv-stat > div {
    flex: 1; border-radius: 10px; padding: 9px 12px;
    background: #f7faf8; border: 1px solid var(--line-2);
}
.pv-stat b { display: block; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pv-stat span { font-size: 11px; color: var(--text-3); }

.pv-sec-title {
    font-size: 11.5px; font-weight: 700; color: var(--text-3);
    letter-spacing: .5px; margin: 0 0 7px; display: flex; align-items: center; gap: 5px;
}
.pv-follow {
    border-left: 2px solid var(--brand-soft);
    padding: 0 0 0 10px; margin-bottom: 9px;
}
.pv-follow .t { font-size: 11px; color: var(--text-4); }
.pv-follow .c {
    font-size: 12.5px; color: var(--text-2); line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pv-remark {
    background: #fbfcfb; border: 1px dashed var(--line);
    border-radius: 9px; padding: 9px 11px;
    font-size: 12.5px; line-height: 1.6; color: var(--text-2);
    margin-bottom: 12px;
}

.pv-foot {
    padding: 12px 18px; border-top: 1px solid var(--line);
    display: flex; gap: 8px; justify-content: flex-end; background: #fcfdfc;
}

/* 加急单标签 */
.tag-rose { background: var(--rose-soft); color: var(--rose); font-weight: 600; }
/* 上户时间小标签（附在业务类型后） */
.when-tag { white-space: nowrap; }

/* ============ 聊天记录截图 ============ */
.photo-upload-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-item { position: relative; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fafbfa; }
.photo-thumb { display: block; aspect-ratio: 1 / 1; overflow: hidden; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .18s var(--ease); cursor: zoom-in; }
.photo-thumb:hover img { transform: scale(1.06); }
.photo-del {
    position: absolute; top: 5px; right: 5px; width: 22px; height: 22px;
    border: none; border-radius: 6px; background: rgba(255,255,255,.92); color: var(--rose);
    display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0;
    transition: opacity .15s var(--ease); box-shadow: 0 1px 4px rgba(0,0,0,.14);
}
.photo-item:hover .photo-del { opacity: 1; }
.photo-del:hover { background: var(--rose-soft); }
.photo-meta { font-size: 10.5px; color: var(--text-3); padding: 4px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 灯箱 */
.lightbox { position: fixed; inset: 0; z-index: 210; background: rgba(15,23,20,.86);
    display: none; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.4); cursor: default; }

.lightbox-close{position:fixed;top:18px;right:22px;width:40px;height:40px;border-radius:50%;border:0;cursor:pointer;background:rgba(255,255,255,.16);color:#fff;font-size:26px;line-height:1;display:flex;align-items:center;justify-content:center;transition:.15s}
.lightbox-close:hover{background:rgba(255,255,255,.3)}

.page-back{display:flex;align-items:center;gap:8px;margin:0 0 14px}
.page-back .btn{background:var(--card);border:1px solid var(--line);color:var(--ink-2);border-radius:9px;padding:6px 12px;display:inline-flex;align-items:center;gap:5px;text-decoration:none;font-size:13px;transition:.15s}
.page-back .btn:hover{background:var(--brand-soft);border-color:var(--brand-line);color:var(--brand-dark)}

/* ---------- 跟进内嵌截图 ---------- */
.follow-photo-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px}
.follow-photo-pick{display:inline-flex;align-items:center;gap:5px;border:1px dashed var(--brand-line,#cfe3d8);background:var(--brand-soft,#f2f9f5);color:var(--brand-dark,#1f4a35);border-radius:9px;padding:7px 12px;font-size:13px;cursor:pointer;transition:.15s}
.follow-photo-pick:hover{background:var(--brand-soft2,#e6f4ec);border-color:var(--brand,#3f9e65)}
.follow-photo-preview{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.follow-photo-preview:empty{display:none}
.fp-cell{position:relative;width:76px;height:76px;border-radius:10px;overflow:hidden;border:1px solid var(--line,#e3ebe6);background:#f7faf8}
.fp-cell img{width:100%;height:100%;object-fit:cover;display:block}
.fp-del{position:absolute;top:3px;right:3px;width:19px;height:19px;border-radius:50%;border:0;background:rgba(20,30,25,.62);color:#fff;font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.fp-del:hover{background:rgba(200,50,50,.9)}
.fp-tip{width:100%;font-size:12px;color:var(--ink-3,#8a9a92)}

/* 时间线内的截图缩略图 */
.tl-photos{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}
.tl-photo{width:80px;height:80px;border-radius:10px;overflow:hidden;border:1px solid var(--line,#e3ebe6);display:block;background:#f7faf8;transition:.15s}
.tl-photo:hover{border-color:var(--brand,#3f9e65);transform:translateY(-1px);box-shadow:0 4px 12px rgba(31,74,53,.12)}
.tl-photo img{width:100%;height:100%;object-fit:cover;display:block}

/* 文件选择框：视觉隐藏但保留在无障碍树与点击链中
   注意：不能用 display:none，部分浏览器内核下 label 点击无法唤起文件选择 */
.sr-only-file{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;opacity:0}

/* 灯箱：左右切换箭头 + 张数计数 */
.lb-nav{position:fixed;top:50%;transform:translateY(-50%);width:52px;height:52px;border-radius:50%;
    border:0;cursor:pointer;background:rgba(255,255,255,.14);color:#fff;font-size:34px;line-height:1;
    display:flex;align-items:center;justify-content:center;padding-bottom:6px;transition:.15s;user-select:none}
.lb-nav:hover{background:rgba(255,255,255,.28)}
.lb-prev{left:24px}
.lb-next{right:24px}
.lb-counter{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);
    padding:5px 14px;border-radius:999px;background:rgba(0,0,0,.42);color:#fff;
    font-size:13px;letter-spacing:.5px;font-variant-numeric:tabular-nums}
@media (max-width:640px){
    .lb-nav{width:42px;height:42px;font-size:28px}
    .lb-prev{left:8px}
    .lb-next{right:8px}
}

/* ============ 城市级联（国家 → 省份 → 城市） ============ */
.city-cascade { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.city-cascade .select { min-width: 0; }
@media (max-width: 720px) {
    .city-cascade { grid-template-columns: 1fr; }
}

/* ============ 推广数据录入 ============ */
.ad-sec-title {
    font-size: 12px; font-weight: 650; color: var(--text-3);
    letter-spacing: .4px; margin: 4px 0 10px;
    display: flex; align-items: center; gap: 8px;
}
.ad-sec-title::after {
    content: ''; flex: 1; height: 1px; background: var(--line-2, #eef3f0);
}
.ad-sec-title:not(:first-child) { margin-top: 18px; }

.ad-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0 14px; margin-bottom: 4px;
}
.ad-grid .field { margin-bottom: 10px; }
.ad-grid .field-hint { font-size: 11.5px; line-height: 1.5; margin-top: 3px; }

/* 数字输入：去掉浏览器上下箭头，前缀 ¥ 绝对定位 */
.ad-input-wrap { position: relative; display: flex; align-items: center; }
.ad-input-wrap i {
    position: absolute; left: 11px; font-style: normal;
    font-size: 12.5px; color: var(--text-3); pointer-events: none;
}
.ad-input-wrap i ~ .input { padding-left: 24px; }
.ad-input-wrap input[type="number"] { font-variant-numeric: tabular-nums; font-weight: 600; }
.ad-input-wrap input::-webkit-outer-spin-button,
.ad-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ad-input-wrap input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* 批量粘贴弹窗 */
[data-batch-modal] {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(18, 32, 26, .42);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(2px);
}
[data-batch-modal] > form,
[data-batch-modal] > .modal-head {
    background: #fff;
}
[data-batch-modal] > .modal-head {
    position: absolute; top: calc(50% - 260px); left: 50%; transform: translateX(-50%);
    width: min(680px, calc(100vw - 40px)); border-radius: 14px 14px 0 0;
    display: flex; align-items: center; padding: 14px 18px; gap: 8px;
}
[data-batch-modal] > form {
    width: min(680px, calc(100vw - 40px)); border-radius: 0 0 14px 14px;
    margin-top: 48px;
}

/* 推广报表：KPI 内的状态标签留白 */
.kpi-foot .tag { font-size: 11px; padding: 1px 7px; }

/* ================= 顶部工具栏（统计 / 推广报表） =================
   需求：时间段 + 筛选 + 按钮全部排成一行，不允许折行。
   宽度不够时容器内横向滚动，而不是把按钮挤到第二行。 */
.toolbar {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: nowrap;
    max-width: 100%;
    margin-bottom: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    padding-bottom: 2px;   /* 给横向滚动条留位置 */
}
.toolbar::-webkit-scrollbar { height: 6px; }
.toolbar::-webkit-scrollbar-thumb { background: #d6e0da; border-radius: 3px; }
.toolbar::-webkit-scrollbar-thumb:hover { background: #bfcdc6; }
.toolbar > * { flex: 0 0 auto; }   /* 子元素不收缩、不折行 */
.toolbar .grow { flex: 1 1 auto; min-width: 8px; }

/* 工具栏里的分段控件：单行、按钮更紧凑 */
.toolbar .seg {
    flex-wrap: nowrap;
    padding: 3px;
    gap: 1px;
}
.toolbar .seg a, .toolbar .seg button {
    padding: 5px 10px;
    white-space: nowrap;
    font-size: 12.5px;
}

/* 工具栏里的筛选项：单行紧凑 */
.toolbar .filters {
    display: flex; align-items: center; gap: 6px;
    flex-wrap: nowrap;
}
.toolbar .filters .select { max-width: 122px; height: 32px; font-size: 12.5px; padding-left: 9px; padding-right: 24px; }
.toolbar .filters .input[type="date"] { width: 138px; height: 32px; font-size: 12.5px; padding: 0 8px; }
.toolbar .btn { height: 32px; padding: 0 11px; font-size: 12.5px; white-space: nowrap; }
.toolbar .text-3 { white-space: nowrap; font-size: 12px; }

@media (max-width: 1100px) {
    .toolbar .filters .select { max-width: 108px; }
    .toolbar .filters .input[type="date"] { width: 128px; }
}
@media (max-width: 820px) {
    .toolbar .seg a, .toolbar .seg button { padding: 5px 8px; font-size: 12px; }
    .toolbar .filters .select { max-width: 96px; }
    .toolbar .filters .input[type="date"] { width: 118px; }
}

/* ================= 权限矩阵表 ================= */
.perm-table { width: 100%; }
.perm-table th, .perm-table td { vertical-align: middle; }
.perm-table tbody tr:hover { background: #fafcfb; }
.perm-table tbody tr:hover td:first-child .td-name { color: var(--brand-dark); }

.perm-cbx { display: inline-flex; cursor: pointer; position: relative; padding: 6px; margin: -6px; }
.perm-cbx input { position: absolute; opacity: 0; width: 0; height: 0; }
.perm-cbx span {
    width: 18px; height: 18px; border-radius: 5px;
    border: 1.5px solid #cdd8d2; background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .14s var(--ease);
}
.perm-cbx:hover span { border-color: var(--brand); }
.perm-cbx input:checked + span {
    background: var(--brand); border-color: var(--brand);
}
.perm-cbx input:checked + span::after {
    content: ''; width: 9px; height: 5px;
    border-left: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}
.perm-cbx input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }

/* ============================================================
   跟进提醒浮层（右下角，独立于新客资通知）
   ============================================================ */

.rm-pop {
    position: fixed; right: 22px; bottom: 22px; z-index: 300;
    width: min(360px, calc(100vw - 28px));
    background: #fff; border: 1px solid #ffe0c4;
    border-radius: 16px;
    box-shadow: 0 18px 50px -16px rgba(80, 46, 10, .34), 0 2px 8px rgba(80, 46, 10, .07);
    overflow: hidden;
    opacity: 0; transform: translateY(18px) scale(.97); pointer-events: none;
    transition: opacity .26s cubic-bezier(.2,.8,.3,1), transform .26s cubic-bezier(.2,.8,.3,1);
}
.rm-pop.on { opacity: 1; transform: none; pointer-events: auto; }

.rm-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 13px 11px;
    background: linear-gradient(180deg, #fffaf4, #fff);
    border-bottom: 1px solid #fdf0e2;
}
.rm-ico {
    width: 32px; height: 32px; border-radius: 10px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: #fff2e2; color: #e08a2b;
}
.rm-ico svg { width: 17px; height: 17px; }
.rm-hd-txt { flex: 1; min-width: 0; }
.rm-title { font-size: 13.5px; font-weight: 700; color: #3d2a14; letter-spacing: .2px; }
.rm-sub { font-size: 11.5px; color: #9a8062; margin-top: 2px; }
.rm-sub b { font-weight: 700; }
.rm-n-late { color: #d9534f; }
.rm-n-today { color: #2f9e6e; }
.rm-x {
    border: 0; background: transparent; color: #b9a58c; cursor: pointer;
    width: 24px; height: 24px; border-radius: 7px; display: flex;
    align-items: center; justify-content: center; flex: none; padding: 0;
}
.rm-x:hover { background: #f6ece0; color: #7a5f42; }
.rm-x svg { width: 13px; height: 13px; }

.rm-list { max-height: min(52vh, 380px); overflow: auto; padding: 4px 0; }
.rm-list::-webkit-scrollbar { width: 6px; }
.rm-list::-webkit-scrollbar-thumb { background: #e6d7c5; border-radius: 3px; }

.rm-item { padding: 10px 13px 11px; border-bottom: 1px solid #faf1e7; transition: opacity .24s, transform .24s; }
.rm-item:last-child { border-bottom: 0; }
.rm-item:hover { background: #fffcf8; }
.rm-item.rm-out { opacity: 0; transform: translateX(16px); }

.rm-line1 { display: flex; align-items: center; gap: 6px; }
.rm-name { font-size: 13px; font-weight: 650; color: #1c2b23; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-tag {
    font-size: 10px; font-weight: 700; line-height: 1.7; padding: 0 5px; border-radius: 4px;
    background: #fdeeee; color: #d9534f; flex: none;
}
.rm-badge {
    margin-left: auto; font-size: 10.5px; font-weight: 700; line-height: 1.75;
    padding: 0 6px; border-radius: 20px; flex: none;
}
.rm-badge.rm-late { background: #fdeeee; color: #d9534f; }
.rm-badge.rm-now  { background: #eaf6f0; color: #2f9e6e; }

.rm-line2 { font-size: 11.5px; color: #9a8f7f; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-ops { display: flex; gap: 6px; margin-top: 8px; }
.rm-btn {
    font-family: inherit; font-size: 11.5px; font-weight: 600; line-height: 1;
    padding: 6px 10px; border-radius: 8px; cursor: pointer; text-decoration: none;
    border: 1px solid #ecdfd0; background: #fff; color: #6b5949;
    transition: .15s; display: inline-flex; align-items: center;
}
.rm-btn:hover { background: #fdf6ee; border-color: #e5d0b9; }
.rm-btn-p { background: #2f9e6e; border-color: #2f9e6e; color: #fff; }
.rm-btn-p:hover { background: #278a5f; border-color: #278a5f; }
.rm-btn-g { color: #8a7a68; }

.rm-more { padding: 9px 13px 11px; font-size: 11.5px; color: #a89880; text-align: center; background: #fffdfa; }

/* 已跟进小面板 */
.rm-mask {
    position: fixed; inset: 0; z-index: 400; background: rgba(24, 34, 29, .34);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; transition: opacity .2s;
}
.rm-mask.on { opacity: 1; }
.rm-dlg {
    width: min(400px, 100%); background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 24px 60px -18px rgba(20, 40, 30, .4);
    transform: translateY(10px) scale(.98); transition: transform .2s;
}
.rm-mask.on .rm-dlg { transform: none; }
.rm-dlg-h { padding: 15px 18px 12px; font-size: 14.5px; font-weight: 700; color: #1c2b23; border-bottom: 1px solid #f1f5f3; }
.rm-dlg-b { padding: 14px 18px 6px; }
.rm-f { display: block; margin-bottom: 12px; }
.rm-f > span { display: block; font-size: 12px; color: #7b8b84; margin-bottom: 5px; }
.rm-in {
    width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px;
    padding: 8px 10px; border: 1px solid #e0eae5; border-radius: 9px; background: #fdfefd; color: #1c2b23;
}
.rm-in:focus { outline: 0; border-color: #2f9e6e; box-shadow: 0 0 0 3px rgba(47, 158, 110, .1); background: #fff; }
.rm-ta { resize: vertical; min-height: 62px; line-height: 1.6; }
.rm-tip { font-size: 11.5px; color: #a89880; margin-bottom: 8px; }
.rm-dlg-f { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 16px; }
.rm-dlg-f .rm-btn { padding: 8px 16px; font-size: 12.5px; }

@media (max-width: 560px) {
    .rm-pop { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
    .rm-list { max-height: 44vh; }
}

/* ============================================================
   新客资 · 页面居中大提示
   ============================================================ */

.ny-center-mask {
    position: fixed; inset: 0; z-index: 380;
    display: flex; align-items: center; justify-content: center;
    background: rgba(16, 32, 24, .30);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    opacity: 0; transition: opacity .22s ease;
    padding: 20px;
}
.ny-center-mask.in { opacity: 1; }

.ny-center-card {
    position: relative; overflow: hidden;
    width: min(400px, 100%);
    background: #fff; border-radius: 20px;
    padding: 26px 26px 20px;
    text-align: center;
    box-shadow: 0 30px 70px -20px rgba(10, 34, 22, .48), 0 3px 10px rgba(10, 34, 22, .1);
    transform: translateY(16px) scale(.94);
    transition: transform .28s cubic-bezier(.18,.9,.3,1.1);
}
.ny-center-mask.in .ny-center-card { transform: none; }

.ny-cc-ico {
    width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #e8f8f0, #d5f0e2);
    color: #2f9e6e;
    box-shadow: 0 8px 20px -8px rgba(47, 158, 110, .5);
    animation: ccPulse 1.6s ease-in-out infinite;
}
.ny-cc-ico svg { width: 26px; height: 26px; }
@keyframes ccPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(47, 158, 110, .35); }
    60%      { box-shadow: 0 0 0 14px rgba(47, 158, 110, 0); }
}

.ny-cc-h { font-size: 13px; font-weight: 600; color: #8fa89b; letter-spacing: 1.6px; }
.ny-cc-name {
    font-size: 21px; font-weight: 800; color: #14261d; margin-top: 8px;
    line-height: 1.35; word-break: break-all;
}
.ny-cc-body { font-size: 13.5px; color: #5d7268; margin-top: 7px; line-height: 1.65; }
.ny-cc-meta {
    font-size: 12px; color: #9aaba2; margin-top: 6px;
    background: #f5faf7; display: inline-block; padding: 3px 10px; border-radius: 20px;
}
.ny-cc-acts { display: flex; gap: 9px; justify-content: center; margin-top: 18px; }
.ny-cc-btn {
    font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1;
    padding: 10px 22px; border-radius: 10px; cursor: pointer; text-decoration: none;
    border: 1px solid #e2ebe6; background: #fff; color: #5d7268; transition: .16s;
    display: inline-flex; align-items: center;
}
.ny-cc-btn:hover { background: #f5faf7; border-color: #cfe3d8; }
.ny-cc-go {
    background: linear-gradient(135deg, #35a877, #2f9e6e); border-color: transparent; color: #fff;
    box-shadow: 0 8px 18px -8px rgba(47, 158, 110, .7);
}
.ny-cc-go:hover { background: linear-gradient(135deg, #2f9e6e, #278a5f); border-color: transparent; }

.ny-cc-bar {
    position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
    background: #eef5f1; overflow: hidden;
}
.ny-cc-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #35a877, #7ad0a4); }

/* 跟进提醒底部「今日不提醒」 */
.rm-foot {
    padding: 9px 13px 11px;
    border-top: 1px solid #faf1e7;
    background: #fffdfa;
    text-align: center;
}
.rm-mute-day {
    font-family: inherit; font-size: 12px; font-weight: 600;
    padding: 6px 18px; border-radius: 8px; cursor: pointer;
    border: 1px solid #ecdcc9; background: #fff; color: #9a8062;
    transition: .16s;
}
.rm-mute-day:hover { background: #fdf3e6; border-color: #e2c9ac; color: #7a5f42; }

/* ================= 日期区间浮层 =================
   点击「日历」按钮弹出，起止日期 + 查询固定一行；点空白处 / Esc 收起 */
.daterange{position:fixed;z-index:120;display:none;align-items:center;gap:8px;
    padding:10px 12px;background:#fff;border:1px solid var(--line);border-radius:11px;
    box-shadow:0 14px 36px rgba(15,23,42,.16);white-space:nowrap}
.daterange.on{display:inline-flex}
.daterange .sep{font-size:12px;color:var(--text-3);flex:none}
.daterange .input-sm{height:32px;padding:0 9px;font-size:12.5px;border:1px solid var(--line);
    border-radius:8px;background:#fff;width:138px;box-shadow:none;flex:none}
.daterange .input-sm:focus{outline:0;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-ring)}
.daterange .dr-done{flex:none}

/* ================= 速览抽屉（人才简历库 / 客户线索共用） ================= */
.pk-mask{position:fixed;inset:0;background:rgba(24,40,33,.30);backdrop-filter:blur(2px);
  z-index:300;opacity:0;pointer-events:none;transition:opacity .2s}
.pk-mask.on{opacity:1;pointer-events:auto}
.pk-drawer{position:fixed;top:0;right:0;bottom:0;width:min(620px,92vw);background:#fff;z-index:301;
  box-shadow:-12px 0 40px -12px rgba(24,40,33,.28);display:flex;flex-direction:column;
  transform:translateX(100%);transition:transform .26s cubic-bezier(.32,.72,0,1)}
.pk-drawer.on{transform:none}
.pk-bar{display:flex;align-items:center;gap:10px;padding:14px 18px;border-bottom:1px solid var(--line);flex-shrink:0}
.pk-bar b{font-size:15px;color:var(--text)}
.pk-x{margin-left:auto;width:30px;height:30px;border-radius:8px;border:none;background:transparent;
  color:var(--text-3);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.14s}
.pk-x:hover{background:var(--line-2);color:var(--text)}
.pk-body{flex:1;overflow-y:auto;padding:16px 18px 24px}
.pk-loading{padding:60px 0;text-align:center;color:var(--text-3);font-size:13px}
.pk-head{display:flex;gap:14px;align-items:flex-start;padding-bottom:14px;border-bottom:1px dashed var(--line)}
.pk-ava{width:56px;height:56px;border-radius:14px;overflow:hidden;flex-shrink:0;
  background:linear-gradient(135deg,#5b8def,#7db4ff);color:#fff;display:flex;align-items:center;
  justify-content:center;font-size:22px;font-weight:700}
.pk-ava img{width:100%;height:100%;object-fit:cover}
/* 客户线索用绿色系头像，与老师（蓝色）区分开 */
.pk-ava-lead{background:linear-gradient(135deg,#3fb27f,#68d3a6)}
.pk-id{min-width:0;flex:1}
.pk-nm{display:flex;align-items:center;gap:7px;font-size:17px;font-weight:650;color:var(--text);flex-wrap:wrap}
.pk-nm em{font-size:12px;font-weight:400;color:var(--text-3);font-style:normal}
.pk-meta{font-size:12.5px;color:var(--text-3);margin-top:4px}
.pk-contact{display:flex;gap:8px;margin-top:7px;flex-wrap:wrap}
.pk-ct{font-size:12.5px;color:var(--brand-dark);background:var(--brand-soft);padding:2px 9px;
  border-radius:6px;display:inline-flex;align-items:center;gap:4px}
.pk-facts{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:14px 0}
.pk-fact{background:#f7faf8;border:1px solid var(--line);border-radius:9px;padding:8px 10px;text-align:center}
.pk-fact span{display:block;font-size:11px;color:var(--text-3)}
.pk-fact b{display:block;font-size:13px;color:var(--text);margin-top:2px}
.pk-sec{margin-top:16px}
.pk-sec-h{display:flex;align-items:center;gap:6px;font-size:12.5px;font-weight:650;
  color:var(--text-2);margin-bottom:8px}
.pk-sec-h svg{color:var(--brand)}
.pk-sec-h em{margin-left:auto;font-size:11px;font-weight:400;color:var(--text-3);font-style:normal}
.pk-hl{font-size:12.5px;line-height:1.7;color:#5a4fb0;background:#f6f4ff;border:1px solid #e6e0ff;
  border-radius:8px;padding:6px 10px;margin-bottom:6px}
.pk-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:6px 14px}
.pk-kv{display:flex;gap:8px;font-size:12.5px;padding:3px 0;border-bottom:1px dashed var(--line-2)}
.pk-kv span{color:var(--text-3);flex-shrink:0;min-width:66px}
.pk-kv b{color:var(--text);font-weight:500;word-break:break-all}
.pk-tags{display:flex;flex-wrap:wrap;gap:6px}
.pk-exp{background:#fafcfb;border:1px solid var(--line);border-radius:9px;padding:9px 11px;margin-bottom:7px}
.pk-exp-h{display:flex;justify-content:space-between;gap:10px;font-size:12.5px}
.pk-exp-h b{color:var(--text)}
.pk-exp-h span{color:var(--text-3);font-size:11.5px;flex-shrink:0}
.pk-exp p{margin:5px 0 0;font-size:12px;line-height:1.7;color:var(--text-2)}
.pk-p{margin:0 0 8px;font-size:12.5px;line-height:1.75;color:var(--text-2)}
.pk-iv{display:flex;gap:10px;font-size:12px;padding:5px 0;border-bottom:1px dashed var(--line-2)}
.pk-iv-r{color:var(--brand-dark);font-weight:600}
.pk-foot{display:flex;gap:9px;margin-top:20px;padding-top:14px;border-top:1px solid var(--line)}
@media (max-width:900px){
  .pk-facts{grid-template-columns:repeat(2,1fr)}
  .pk-grid{grid-template-columns:1fr}
}

/* 线索筛选栏：排序下拉收窄，保证 1440px 一行排布 */

/* 桌面端筛选栏锁定单行，极端窄时横向滚动兜底 */
@media (min-width: 1200px) {
    .filter-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
}

/* ===== 手机端最终覆盖（必须置于文件末尾，优先级最高） ===== */
@media (max-width: 900px) {
    .toolbar {
        flex-wrap: wrap;
        overflow-x: visible;
        overflow-y: visible;
        row-gap: 8px;
        justify-content: flex-start;
    }
    .toolbar > * { flex: 0 0 auto; }
    .toolbar .seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
    .toolbar .seg::-webkit-scrollbar { display: none; }
}

/* ============ 退款提示条（客资编辑 / 详情通用） ============ */
.refund-banner {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px; margin-bottom: 16px;
    border: 1px solid #f3c9cd; border-left: 4px solid var(--rose);
    border-radius: 12px; background: #fdf2f3;
}
.refund-banner .rb-icon {
    flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: #f9dde0; color: #c2454f;
}
.refund-banner .rb-main { flex: 1 1 auto; min-width: 0; }
.refund-banner .rb-title {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 13.5px; font-weight: 700; color: #a8333c;
}
.refund-banner .rb-tag {
    font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
    background: #f6d3d7; color: #a8333c;
}
.refund-banner .rb-nums {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 6px; font-size: 13px; color: #7a4a4e;
}
.refund-banner .rb-nums b { font-weight: 700; color: #3c3336; }
.refund-banner .rb-nums .rb-red { color: #c2454f; }
.refund-banner .rb-minus { color: #b98e92; }
.refund-banner .rb-list {
    display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap;
    margin-top: 7px; font-size: 11.5px; color: #8d6468;
}
.refund-banner .rb-item { white-space: nowrap; }
.refund-banner .rb-item b { color: #c2454f; font-weight: 650; margin-left: 2px; }
.refund-banner .rb-item i { font-style: normal; color: #a58285; }
.refund-banner .rb-btn { flex: 0 0 auto; align-self: center; white-space: nowrap; }
@media (max-width: 720px) {
    .refund-banner { flex-wrap: wrap; }
    .refund-banner .rb-btn { margin-left: 42px; }
}

/* ============ 速览抽屉：退款块 ============ */
.pk-refund{
    margin-top:6px;padding:9px 10px;border-radius:10px;
    background:#fdf2f3;border:1px solid #f3c9cd;
}
.pk-refund-sum{
    display:flex;align-items:center;gap:6px;flex-wrap:wrap;
    font-size:12px;color:#7a4a4e;margin-bottom:6px;
}
.pk-refund-sum b{font-weight:700;color:#3c3336}
.pk-refund-sum b.rb-red{color:#c2454f}
.pk-refund-sum .rb-minus{color:#b98e92}
.pk-refund-item{
    display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;
    font-size:11.5px;color:#8d6468;padding:3px 0;
    border-top:1px dashed #f0cdd0;
}
.pk-refund-amt{color:#c2454f;font-weight:650;flex:0 0 auto}
.pk-refund-time{color:#a58285;flex:0 0 auto;font-variant-numeric:tabular-nums}
.pk-refund-rs{color:#7a4a4e;word-break:break-all}

/* ============================================================
   移动端客资列表（≤640px）：与「数据分析 · 待跟进清单」同款
   —— 保留一行一客资的行式表格，表头可见，整体在 .table-wrap
   里横向滑动；不做表格转卡片。
   ============================================================ */
@media (max-width: 640px) {
    /* 侧边栏默认收起时的内容区留白 */
    .main { padding: 12px 10px 90px !important; }

    /* 行式列表：压缩内边距与字号，行更紧凑（对齐待跟进清单的观感） */
    .leads-table td { padding: 8px 8px; }
    .leads-table .td-name { font-size: 14px; }
    .leads-table .tag, .leads-table .flag, .leads-table .pill, .leads-table .src-tag { font-size: 10.5px; }
    .leads-table .btn { padding: 5px 9px; font-size: 12px; white-space: nowrap; }

    /* 表单/弹层在手机上铺满且不被软键盘顶出 */
    .form-grid { grid-template-columns: 1fr !important; }
    .mask .modal, [id$="Modal"] > div { width: 100% !important; }
    .input, select.input, textarea.input { font-size: 16px; } /* 防 iOS 聚焦自动放大 */

    /* 批量操作条避开底部安全区 */
    .bulk-bar { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; }

    /* 数据统计 · 城市分布：行式横滑表，压缩行高与列宽 */
    .city-tb td, .city-tb th { padding: 7px 6px; font-size: 12.5px; }
    .city-tb .td-name { font-size: 13px; white-space: nowrap; }
    .city-tb .bar-row { gap: 5px; }
    .city-tb .bar-row .fs11 { width: 36px !important; }

    /* 售后退款：网格强制单列，卡片铺满不超宽 */
    .rf-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .rf-card { padding: 13px 13px 11px !important; }
    .rf-card .fs11, .rf-card .fs12 { overflow-wrap: anywhere; }
    .rf-card .td-sub { white-space: normal; overflow-wrap: anywhere; }
    /* 底部时间/录入人/删除行：允许换行且不留孤字 */
    .rf-card > div:last-child { flex-wrap: wrap; row-gap: 6px; }
    .rf-card > div:last-child > span { flex: 1 1 auto; min-width: 0; }
}

/* ============ 订单弹层：客资搜索下拉 ============ */
.om-lead-list {
    display: none;
    position: absolute; left: 0; right: 0; top: calc(100% + 4px);
    z-index: 20; max-height: 240px; overflow-y: auto;
    background: #fff; border: 1px solid var(--line-2); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(30, 50, 40, .12);
}
.om-lead-list.show { display: block; }
.om-lead-item { padding: 8px 11px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.om-lead-item:last-child { border-bottom: 0; }
.om-lead-item:hover { background: var(--brand-soft); }
.om-lead-nm { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.om-lead-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.om-lead-item.is-dis { cursor: not-allowed; opacity: .62; }
.om-lead-item.is-dis:hover { background: #fff; }
.om-lead-badge {
    font-size: 10px; font-weight: 500; padding: 1px 6px; border-radius: 999px;
    background: var(--slate-soft); color: #6b7780;
}
.om-lead-empty { padding: 14px; text-align: center; font-size: 12.5px; color: var(--text-3); }

/* ============ 阿姨服务履历（订单） ============ */
.ot-list { display: flex; flex-direction: column; gap: 7px; max-height: 240px; overflow-y: auto; }
.ot-item {
    border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 10px;
    background: #fff; position: relative;
}
.ot-item.is-live { border-color: var(--brand); background: var(--brand-soft); }
.ot-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.ot-seq {
    font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px;
    background: var(--slate-soft); color: #5c6a63; flex: none;
}
.ot-item.is-live .ot-seq { background: var(--brand); color: #fff; }
.ot-sub { font-size: 11.5px; color: var(--text-3); }
.ot-live { color: var(--brand-dark); font-weight: 600; }
.ot-days { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.ot-note { font-size: 11.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.ot-empty { font-size: 12px; color: var(--text-3); padding: 8px 0; }

/* ================= 订单列表：单行两栏卡片 ================= */
.olist { display: flex; flex-direction: column; gap: 10px; }

.ocard {
    display: flex; align-items: stretch; gap: 0;
    background: #fff; border: 1px solid var(--line-2); border-radius: 14px;
    overflow: hidden; transition: box-shadow .18s, border-color .18s;
}
.ocard:hover { box-shadow: 0 4px 18px rgba(28, 43, 35, .07); border-color: var(--brand-soft); }

/* 左：客户 + 上户信息 */
.ocard-l { flex: 1 1 auto; min-width: 0; padding: 14px 16px; }
.ocard-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ocard-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ocard-name { font-size: 15px; color: var(--text); }
.ocard-city { font-size: 11.5px; color: var(--text-3); background: var(--bg); border-radius: 6px; padding: 1px 7px; }
.ocard-no { color: var(--text-3); background: var(--bg); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }

.ocard-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 14px;
}
.ocard-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ocard-k { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.ocard-v { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ocard-badge {
    display: inline-block; font-size: 10.5px; line-height: 1.5;
    background: var(--brand-soft); color: var(--brand-dark);
    border-radius: 5px; padding: 0 5px; margin-left: 4px; vertical-align: 1px;
}
.ocard-badge--gray { background: var(--bg); color: var(--text-3); }

/* 右：合同金额 + 换师次数 */
.ocard-r {
    flex: 0 0 300px; display: flex; flex-direction: column; gap: 10px;
    padding: 14px 16px; border-left: 1px dashed var(--line-2); background: #fcfdfc;
}
.ocard-money { display: flex; flex-direction: column; gap: 4px; }
.ocard-mrow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ocard-mv { font-size: 14px; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.ocard-mv2 { font-size: 12px; font-variant-numeric: tabular-nums; }
.ocard-mrow--sub { padding-top: 4px; border-top: 1px dotted var(--line-2); }

.ocard-chg { display: flex; flex-direction: column; gap: 6px; }
.ocard-chg-hd { display: flex; align-items: baseline; gap: 5px; }
.ocard-chg-num { font-size: 16px; color: #c2410c; font-variant-numeric: tabular-nums; }

.ocard-seqs { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.ocard-seq {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
    background: var(--bg); color: var(--text-3); border: 1px solid var(--line-2);
}
.ocard-seq.is-live { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); }
.ocard-arrow { font-size: 10px; color: var(--line); }
.ocard-seq-nm { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ocard-ops { display: flex; gap: 8px; margin-top: auto; }
.ocard-ops .btn { flex: 1; justify-content: center; }

/* 换老师弹层里的合同块 */
.oc-box { background: var(--brand-soft); border: 1px solid rgba(31, 122, 77, .18); border-radius: 11px; padding: 11px 12px; margin: 4px 0 12px; }
.oc-box-hd { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--brand-dark); margin-bottom: 9px; }

/* 移动端：卡片竖排 */
@media (max-width: 900px) {
    .ocard { flex-direction: column; }
    .ocard-r { flex: 0 0 auto; border-left: 0; border-top: 1px dashed var(--line-2); }
    .ocard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ocard-ops .btn { flex: 1; }
}

/* 履历里的合同行 */
.ot-ct {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-top: 5px; padding: 4px 8px; border-radius: 7px;
    background: var(--brand-soft); font-size: 11.5px;
}
.ot-ct.is-void { background: var(--bg); }
.ot-ct-k { color: var(--brand-dark); font-weight: 600; }
.ot-ct.is-void .ot-ct-k { color: var(--text-3); }
.ot-ct-amt { color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.ot-ct.is-void .ot-ct-amt { color: var(--text-3); text-decoration: line-through; }

/* ================= 经营盈亏 · 移动端优化 ================= */

/* 盈亏阶梯行：给 label/金额加类名便于小屏控制 */
.pstep { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.pstep.is-strong { padding: 8px 0; border-top: 1px dashed var(--line-2); }
.pstep-k { width: 6.5em; flex: none; font-size: 12px; color: var(--text-2); }
.pstep.is-strong .pstep-k { font-size: 13px; font-weight: 700; color: var(--text); }
.pstep-k .sub { font-weight: 400; font-size: 11px; color: var(--text-3); }
.pstep-v { flex: 1; text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pstep.is-strong .pstep-v { font-size: 18px; font-weight: 800; }

@media (max-width: 720px) {
    /* 顶部：标题与切换按钮纵向排 */
    .page-hd { display: block; }
    .page-hd > div:last-child { margin-top: 10px; }

    /* 盈亏一览 + 成本构成：双栏改单列 */
    .pgrid { grid-template-columns: 1fr !important; }

    /* 卡片标题在小屏允许换行、缩小字号 */
    .pcard-head h3, .card-head h3 { font-size: 14px; line-height: 1.5; }
    .card-head { flex-wrap: wrap; row-gap: 2px; }
    .card-head .hint { font-size: 11px; width: 100%; }

    /* 盈亏阶梯：label 收窄、注释隐藏（信息太挤时优先保数字可读） */
    .pstep { gap: 6px; }
    .pstep-k { width: 4.8em; font-size: 12px; }
    .pstep-k .sub { display: none; }
    .pstep-v { font-size: 14px; }
    .pstep.is-strong .pstep-v { font-size: 17px; }

    /* 保本进度两行说明改纵向 */
    .pbreakeven { flex-direction: column !important; align-items: flex-start !important; gap: 2px; }

    /* 趋势图：横向滚动 + 每列保底宽度，避免 12 根柱挤成一条缝 */
    .ptrend-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .ptrend { min-width: 620px; }
    .ptrend .pcol { min-width: 50px; }
    .pv-amt { font-size: 9px; }
    .pv-cost { font-size: 8.5px; }
    .pv-pf { font-size: 9.5px; }

    /* 每月结余明细：保持 table-wrap 横向滚动即可，但给个视觉暗示 */
    .pledger-wrap { position: relative; }
    .pledger-wrap::after {
        content: '← 左右滑动查看 →';
        position: absolute; right: 0; top: -20px;
        font-size: 10px; color: var(--text-3);
    }
}

@media (max-width: 400px) {
    .pstep-k { width: 4.2em; }
    .pstep.is-strong .pstep-v { font-size: 16px; }
}

/* 卡片标题过长时允许收缩换行（flex 子项默认不收缩导致溢出） */
.card-head h3 { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.card-head { min-width: 0; }

/* ================= 费用统计 · 移动端优化 ================= */

/* 分类/项目统计行：桌面一行排开（名称+bar+金额+占比+笔数） */
.estat-row { display: flex; align-items: center; gap: 8px; }
.estat-k {
    width: 7em; flex: none; font-size: 13px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.estat-amt { flex: none; width: 6.5em; text-align: right; font-weight: 700; }
.estat-pct { flex: none; width: 3.5em; text-align: right; font-size: 12px; }
.estat-cnt { flex: none; width: 2.6em; text-align: right; font-size: 12px; }

@media (max-width: 720px) {
    /* 分类统计 | 趋势/录入人 双栏 → 单列 */
    .egrid { grid-template-columns: 1fr !important; }

    /*
     * 统计行两行化：第一行「名称 ……… 金额」，第二行「进度条 占比 笔数」。
     * 用 order 重排（HTML 顺序不变），一行硬塞五个元素是手机上碎掉的主因。
     */
    .estat-row {
        flex-wrap: wrap;
        padding: 7px 0 !important;
        row-gap: 5px;
    }
    .estat-k        { order: 1; width: auto; flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 600; }
    .estat-amt      { order: 2; width: auto; font-size: 13.5px; }
    /* 进度条：第二行开头，与占比/笔数同行（bar 前面插了 .estat-brk，所以是第 3 个子元素） */
    .estat-row > span:nth-child(3) { order: 4; height: 8px !important; min-width: 0 !important; }
    .estat-pct      { order: 5; width: auto; }
    .estat-cnt      { order: 6; width: auto; }
    /* 强制换行元素：把 bar 挤到第二行 */
    .estat-brk { order: 3; flex: 1 1 100%; width: 100%; height: 0; border: 0; padding: 0; }
}

@media (max-width: 720px) {
    /* 月份汇总卡：合计数字换行更醒目 */
    .ecard-sum { flex-direction: column; align-items: flex-start !important; gap: 8px !important; }
}

/* ============================================================
   经营盈亏 · 近 12 个月趋势图（收入 / 固定成本 / 日常开支 / 盈亏）
   数字统一两位小数，垂直排列，柱子只表达比例。
   ============================================================ */
.pv-amt {
    font-size: 10.5px; line-height: 1.25; font-weight: 700;
    color: var(--text-2); font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.pv-amt--inc { color: #3b6fd4; }
.pv-bar {
    display: block; width: 30%; max-width: 13px; flex: none;
    border-radius: 3px 3px 0 0;
}
.pv-bar--inc { background: linear-gradient(180deg, #5aa0ff, #3b6fd4); }
.pv-bar--fix { background: #f2994a; }
.pv-bar--run { background: #f2d15a; }
.pv-mon--cur { font-weight: 700; color: var(--text); }
.pv-cost {
    font-size: 9.5px; line-height: 1.35; font-variant-numeric: tabular-nums;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pv-cost--fix { color: #d97b2b; }
.pv-cost--run { color: #b8912c; }
.pv-pf {
    font-size: 10.5px; line-height: 1.3; font-weight: 700;
    font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ============================================================
   看板 · 业务类型热度：右侧「成单 N · X%」自适应不换行
   原先固定 width:74px，成单数变两位数时会折行撑高整行。
   ============================================================ */
.svc-meta {
    flex: 0 0 auto;            /* 不参与压缩 */
    width: auto !important;    /* 覆盖内联固定宽度 */
    min-width: 74px;           /* 一位数时保持列对齐 */
    text-align: right;
    white-space: nowrap;       /* 两位数也不折行 */
    font-variant-numeric: tabular-nums;
}

/* ===== 侧边栏菜单拖拽排序 ===== */
.nav-title .nav-sort-hint { opacity:.45; margin-left:4px; cursor:grab; }
.nav-item[data-nav-key] { cursor:grab; }
.nav-item.nav-dragging { opacity:.45; }
.nav-item.nav-drop-above { box-shadow: inset 0 2px 0 0 var(--brand, #6d9776); }
.nav-item.nav-drop-below { box-shadow: inset 0 -2px 0 0 var(--brand, #6d9776); }
