/* =====================================================================
 * 净序洗护 · 后台管理平台  —  设计系统
 * 视觉基线：喜将·洗护管家 管理端（1:1 复刻）
 *
 * 本文件分两大部分：
 *   PART A  设计系统（令牌 + 布局 + 组件）—— 新页面用这套类名
 *   PART B  Bootstrap 兼容覆写层 —— 让尚未迁移的旧页面也保持一致视觉
 * ===================================================================== */

/* =====================================================================
 * PART A · 设计系统
 * ===================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-2: #64748b;
    --text-3: #94a3b8;
    --text-4: #cbd5e1;
    --green: #16a34a;
    --green-bg: #f0fdf4;
    --red: #dc2626;
    --red-bg: #fef2f2;
    --orange: #ea580c;
    --orange-bg: #fff7ed;
    --blue: #2563eb;
    --blue-bg: #eff6ff;
    --purple: #7c3aed;
    --purple-bg: #f5f3ff;
    --cyan: #0891b2;
    --cyan-bg: #ecfeff;
    --yellow: #ca8a04;
    --yellow-bg: #fefce8;
    --gray: #64748b;
    --gray-bg: #f1f5f9;
    --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, .12), 0 4px 10px -4px rgba(15, 23, 42, .08);
    --radius: 10px;
    /* 布局尺寸 */
    --sidebar-width: 232px;
    --topbar-height: 60px;
}

/* ---------- 2. 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

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

a { text-decoration: none; color: inherit; }
a:hover { color: inherit; }
img { max-width: 100%; }

/* ---------- 3. 布局骨架 ---------- */
.layout, .wrapper { display: flex; min-height: 100vh; }

#sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: margin-left .2s;
}

#main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .2s;
}

.wrapper.collapsed #sidebar { margin-left: calc(var(--sidebar-width) * -1); }
.wrapper.collapsed #main { margin-left: 0; }

/* ---------- 4. 侧边栏 ---------- */
.sidebar-header, .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, .15);
    flex-shrink: 0;
}
.logo-img {
    width: 36px; height: 36px;
    object-fit: contain; flex-shrink: 0;
}
.logo-text { color: #fff; font-size: 15px; font-weight: 600; line-height: 1.3; }
.logo-sub { font-size: 10px; color: var(--sidebar-text); font-weight: 400; letter-spacing: 1px; }

/* 兼容旧写法 */
.sidebar-header .logo { padding: 0; border: none; }
.sidebar-header .logo i, .sidebar-header .logo .bi { color: #60a5fa; font-size: 22px; }
.sidebar-header .logo span { color: #fff; font-size: 16px; font-weight: 600; }

.sidebar-nav, #sidebar .nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px;
    display: block;
}
#sidebar .nav::-webkit-scrollbar-thumb { background: #475569; }

.nav-group { margin-bottom: 6px; }
.nav-group-title, .nav-section {
    font-size: 11px;
    color: #64748b;
    padding: 10px 12px 6px;
    letter-spacing: 1px;
    list-style: none;
}

.nav-item, .sidebar-nav .nav-link, #sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 13.5px;
    margin-bottom: 2px;
    transition: all .15s;
    user-select: none;
    list-style: none;
}
.nav-item:hover, .sidebar-nav .nav-link:hover {
    background: rgba(148, 163, 184, .12);
    color: #e2e8f0;
}
.nav-item.active, .sidebar-nav .nav-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 10px -2px rgba(37, 99, 235, .5);
}
.nav-item .ni { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .bi, .sidebar-nav .nav-link .bi { width: 20px; font-size: 15px; text-align: center; flex-shrink: 0; }

.badge-mini {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-foot {
    padding: 14px 20px;
    border-top: 1px solid rgba(148, 163, 184, .15);
    font-size: 11px;
    color: #64748b;
    flex-shrink: 0;
}

/* 二级导航 */
.nav-sub { display: none; margin: 1px 0 6px 8px; padding-left: 12px; border-left: 1px solid rgba(148, 163, 184, .18); }
.nav-sub.open { display: block; }
.nav-sub-item {
    display: flex; align-items: center; gap: 7px;
    padding: 6.5px 10px; border-radius: 7px;
    color: #8aa0b8; font-size: 12.5px; cursor: pointer;
    transition: all .15s; user-select: none;
}
.nav-sub-item:hover { background: rgba(148, 163, 184, .12); color: #e2e8f0; }
.nav-sub-item.active { color: #fff; background: rgba(37, 99, 235, .38); font-weight: 600; }
.nav-sub-item .nd { width: 5px; height: 5px; border-radius: 50%; background: #52627a; flex-shrink: 0; }
.nav-sub-item.active .nd { background: #fff; }
.nav-item .arrow { margin-left: auto; font-size: 9px; opacity: .65; transition: transform .2s; }
.nav-item.open .arrow { transform: rotate(180deg); }

/* ---------- 5. 顶栏 ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.topbar-left { min-width: 0; }
.page-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.crumb { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.top-search { flex: 1; max-width: 360px; margin-left: auto; }
.top-search input {
    width: 100%; height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px 0 34px;
    font-size: 13px;
    background: #f8fafc 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='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center;
    outline: none;
    transition: all .15s;
    color: var(--text);
    font-family: inherit;
}
.top-search input:focus {
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.topbar-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; color: var(--text-2);
    position: relative; transition: all .15s;
    font-family: inherit;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.icon-btn .dot {
    position: absolute; top: 7px; right: 8px;
    width: 7px; height: 7px; background: var(--red);
    border-radius: 50%; border: 1.5px solid #fff;
}

.admin-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 12px 5px 5px;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer; transition: all .15s;
    position: relative;
}
.admin-chip:hover { border-color: var(--primary); }
.admin-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; flex-shrink: 0;
}
.admin-chip .an { font-size: 13px; font-weight: 500; line-height: 1.25; }
.admin-chip .ar { font-size: 10px; color: var(--text-3); line-height: 1.25; }

.admin-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 168px; background: #fff;
    border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow-lg); padding: 6px;
    display: none; z-index: 120;
}
.admin-menu.show { display: block; }
.admin-menu a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 7px;
    font-size: 13px; color: var(--text); transition: background .12s;
}
.admin-menu a:hover { background: var(--bg); color: var(--primary); }
.admin-menu .sep { height: 1px; background: var(--border); margin: 5px 8px; }

/* ---------- 6. 内容区 ---------- */
.content { padding: 24px 28px 40px; flex: 1; }
.page-enter { animation: pageIn .25s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 兼容旧的页头写法 */
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.page-header h1 { font-size: 20px; margin: 0; font-weight: 600; }

/* ---------- 7. 卡片 ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 0;
}
.card-h {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-h h3 { font-size: 15px; font-weight: 600; }
.card-h .sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 8px; }
.card-b { padding: 20px; }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 16px 20px; font-weight: 600; font-size: 15px;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card-body { padding: 20px; }

.mb-16 { margin-bottom: 16px; }
.mt-16 { margin-top: 16px; }
.mb-20 { margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.half-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.section-title {
    font-size: 15px; font-weight: 600; margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.section-title::before {
    content: ''; width: 4px; height: 16px;
    border-radius: 2px; background: var(--primary);
}

/* ---------- 8. 统计卡片 ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .sc-icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 12px;
}
.stat-card .sc-label { font-size: 12.5px; color: var(--text-2); }
.stat-card .sc-value { font-size: 26px; font-weight: 700; margin: 2px 0 6px; letter-spacing: -.5px; }
.stat-card .sc-delta { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.stat-card .sc-bg {
    position: absolute; right: -16px; bottom: -16px;
    font-size: 80px; opacity: .05; font-weight: 800;
}
/* 涨红跌绿（中国习惯）：指标上升用红色 */
.sc-delta .up { color: var(--red); font-weight: 600; }
.sc-delta .down { color: var(--green); font-weight: 600; }

/* 图标底色 */
.ic-blue   { background: var(--blue-bg);   color: var(--blue); }
.ic-green  { background: var(--green-bg);  color: var(--green); }
.ic-orange { background: var(--orange-bg); color: var(--orange); }
.ic-red    { background: var(--red-bg);    color: var(--red); }
.ic-purple { background: var(--purple-bg); color: var(--purple); }
.ic-cyan   { background: var(--cyan-bg);   color: var(--cyan); }
.ic-yellow { background: var(--yellow-bg); color: var(--yellow); }
.ic-gray   { background: var(--gray-bg);   color: var(--gray); }
.ic-solid-blue   { background: #3b82f6; color: #fff; }
.ic-solid-green  { background: #10b981; color: #fff; }
.ic-solid-orange { background: #f59e0b; color: #fff; }
.ic-solid-red    { background: #ef4444; color: #fff; }
.ic-solid-purple { background: #8b5cf6; color: #fff; }
.ic-solid-cyan   { background: #06b6d4; color: #fff; }
.ic-solid-gray   { background: #6b7280; color: #fff; }

/* ---------- 9. Tab ---------- */
.tabs {
    display: flex; gap: 2px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 0 8px;
    overflow-x: auto;
}
.tabs .tab {
    padding: 13px 16px; font-size: 13.5px; color: var(--text-2);
    cursor: pointer; border-bottom: 2px solid transparent;
    white-space: nowrap; user-select: none;
    transition: all .15s; font-weight: 500;
}
.tabs .tab:hover { color: var(--primary); }
.tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.subtabs, .sub-tabs {
    display: flex; gap: 2px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    padding: 0 8px;
    overflow-x: auto;
    border-radius: var(--radius) var(--radius) 0 0;
}
.sub-tabs { margin-bottom: 14px; }
.subtabs .subtab, .sub-tabs .sub-tab {
    padding: 10px 16px; font-size: 13px; color: var(--text-2);
    cursor: pointer; border-bottom: 2px solid transparent;
    white-space: nowrap; user-select: none;
    transition: all .15s; font-weight: 500;
}
.sub-tabs .sub-tab { padding: 12px 14px; }
.subtabs .subtab:hover, .sub-tabs .sub-tab:hover { color: var(--primary); }
.subtabs .subtab.active, .sub-tabs .sub-tab.active {
    color: var(--primary); border-bottom-color: var(--primary); font-weight: 600;
}
/* 药丸式子 Tab */
.pill-tabs { display: flex; gap: 8px; padding: 14px 20px 0; flex-wrap: wrap; }
.pill-tab {
    display: inline-block;
    padding: 6px 14px; border-radius: 20px;
    font-size: 12.5px; background: var(--bg); color: var(--text-2);
    cursor: pointer; border: 1px solid var(--border);
    transition: all .15s; user-select: none;
}
.pill-tab:hover { border-color: var(--primary); color: var(--primary); }
.pill-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.sub-panel { display: none; }
.sub-panel.active { display: block; }
.panel-head { display: flex; justify-content: flex-end; padding: 10px 2px 2px; }

/* 模块子页签条：用一张独立窄卡承载设计稿的 .tabs（多页共用，无需侵入各页面模板） */
.mod-card { margin-bottom: 16px; overflow: hidden; }
.mod-card .tabs { border-bottom: none; border-radius: 0; }
.mod-card .tab { color: var(--text-2); text-decoration: none; }
.mod-card .tab:hover { color: var(--primary); }

/* ---------- 10. 筛选栏 ---------- */
.filter-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}
.filter-bar .fb { display: flex; align-items: center; gap: 6px; }
.filter-bar label { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="date"],
.filter-bar input[type="month"] {
    height: 32px; border: 1px solid var(--border); border-radius: 7px;
    padding: 0 8px; font-size: 12.5px; background: #fff;
    outline: none; color: var(--text); min-width: 110px; font-family: inherit;
}
.filter-bar select:focus,
.filter-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.fb-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* 兼容旧筛选条（包一层 card 的 form） */
.filter-bar form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- 11. 按钮 ---------- */
.btn {
    height: 32px; padding: 0 14px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px; color: var(--text);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: all .15s;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1;
    text-decoration: none;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:focus, .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; box-shadow: 0 4px 10px -2px rgba(37, 99, 235, .4); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-warning { background: #fff; border-color: #fed7aa; color: var(--orange); }
.btn-warning:hover { background: var(--orange-bg); border-color: var(--orange); color: var(--orange); }
.btn-outline-primary { background: #fff; border-color: #bfdbfe; color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.btn-outline-secondary, .btn-outline-dark { background: #fff; border-color: var(--border); color: var(--text-2); }
.btn-outline-secondary:hover, .btn-outline-dark:hover { border-color: var(--primary); color: var(--primary); background: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { height: 38px; padding: 0 20px; font-size: 14px; }
.btn-icon { width: 26px; height: 26px; padding: 0; justify-content: center; font-size: 13px; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }

.action-btns, .action-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.action-btns .btn { padding: 0 10px; }

/* ---------- 12. 表格 ---------- */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
thead th {
    background: #f8fafc;
    color: var(--text-2);
    font-weight: 600;
    text-align: left;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-size: 12.5px;
}
tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
tbody tr { transition: background .1s; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

td .cell-main { font-weight: 500; color: var(--text); }
td .cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
td .strong { font-weight: 600; }
td .money { font-weight: 600; color: #0f172a; }
td .red-text { color: var(--red); font-weight: 600; }
td .green-text { color: var(--green); font-weight: 600; }
td .link { color: var(--primary); cursor: pointer; }
td .link:hover { text-decoration: underline; }
.text-nowrap { white-space: nowrap; }

.avatar-sm {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600; vertical-align: middle; margin-right: 8px;
}
.avatar-sm.o { background: var(--orange-bg); color: var(--orange); }
.avatar-sm.g { background: var(--green-bg); color: var(--green); }
.avatar-sm.p { background: var(--purple-bg); color: var(--purple); }
.avatar-sm.c { background: var(--cyan-bg); color: var(--cyan); }
.avatar-sm.r { background: var(--red-bg); color: var(--red); }

/* 行高亮 */
tr.row-red { background: rgba(239, 68, 68, .06) !important; }
tr.row-red:hover { background: rgba(239, 68, 68, .12) !important; }
tr.row-yellow { background: rgba(245, 158, 11, .06) !important; }
tr.row-yellow:hover { background: rgba(245, 158, 11, .12) !important; }

/* ---------- 13. Badge ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.5;
}
.badge .bd-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
/* 设计稿 B() 徽章助手固定带圆点（.badge 均为 inline-flex，用 ::before 统一补齐） */
.badge::before {
    content: '';
    width: 5px; height: 5px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}
.badge.blue   { background: var(--blue-bg);   color: var(--blue); }
.badge.green  { background: var(--green-bg);  color: var(--green); }
.badge.orange { background: var(--orange-bg); color: var(--orange); }
.badge.red    { background: var(--red-bg);    color: var(--red); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.badge.cyan   { background: var(--cyan-bg);   color: var(--cyan); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge.gray   { background: var(--gray-bg);   color: var(--gray); }
.badge.dark   { background: #e2e8f0; color: #334155; }

/* ---------- 14. 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    margin: 0;
    list-style: none;
    flex-wrap: wrap;
}
.pagination .pg-info { font-size: 12px; color: var(--text-3); margin-right: auto; }
.pagination > li { list-style: none; }
.pagination button, .pagination .page-link {
    min-width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 8px;
    border: 1px solid var(--border);
    background: #fff; border-radius: 6px;
    font-size: 12.5px; cursor: pointer; color: var(--text-2);
    transition: all .15s; font-family: inherit; text-decoration: none;
}
.pagination button:hover:not(:disabled), .pagination .page-link:hover {
    border-color: var(--primary); color: var(--primary);
}
.pagination button.active, .pagination .page-item.active .page-link,
.pagination .page-link.active {
    background: var(--primary); border-color: var(--primary); color: #fff;
}
.pagination button:disabled, .pagination .page-item.disabled .page-link,
.pagination .page-link.disabled {
    opacity: .4; cursor: not-allowed;
}
.pagination .page-link.disabled:hover { border-color: var(--border); color: var(--text-2); }
.pagination select {
    height: 30px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 12.5px; padding: 0 6px; color: var(--text-2); outline: none;
}

/* ---------- 15. 进度条 ---------- */
.progress {
    height: 7px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    min-width: 90px;
    display: block;
}
.progress .bar, .progress .progress-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    display: block;
}
.progress .bar.g, .progress .progress-bar.g { background: linear-gradient(90deg, #4ade80, #16a34a); }
.progress .bar.o, .progress .progress-bar.o { background: linear-gradient(90deg, #fb923c, #ea580c); }
.progress .bar.p, .progress .progress-bar.p { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.progress .bar.r, .progress .progress-bar.r { background: linear-gradient(90deg, #f87171, #dc2626); }
.progress .bar.c, .progress .progress-bar.c { background: linear-gradient(90deg, #22d3ee, #0891b2); }

/* ---------- 16. 时间线 ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
    content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px;
    width: 2px; background: #e2e8f0;
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: ''; position: absolute; left: -22px; top: 5px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary); border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-light);
}
.tl-item.done::before { background: var(--green); box-shadow: 0 0 0 2px var(--green-bg); }
.tl-item.warn::before { background: var(--orange); box-shadow: 0 0 0 2px var(--orange-bg); }
.tl-item.err::before { background: var(--red); box-shadow: 0 0 0 2px var(--red-bg); }
.tl-item .tl-time { font-size: 11.5px; color: var(--text-3); }
.tl-item .tl-text { font-size: 13px; margin-top: 1px; }
.tl-item .tl-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ---------- 17. 柱状图 / 图例 ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding: 12px 8px 0; }
.bar-chart .bc-col {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    height: 100%; justify-content: flex-end; gap: 6px;
}
.bar-chart .bc-bar {
    width: 70%; max-width: 38px; min-height: 4px;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    transition: height .4s ease; position: relative;
}
.bar-chart .bc-bar.hover:hover { opacity: .85; }
.bar-chart .bc-bar.g { background: linear-gradient(180deg, #4ade80, #16a34a); }
.bar-chart .bc-bar.o { background: linear-gradient(180deg, #fb923c, #ea580c); }
.bar-chart .bc-bar.p { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.bar-chart .bc-label { font-size: 11px; color: var(--text-3); }
.bar-chart .bc-val { font-size: 11px; font-weight: 600; color: var(--text-2); }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 12px; }
.chart-legend .lg { display: flex; align-items: center; gap: 6px; }
.chart-legend .lg-dot { width: 10px; height: 10px; border-radius: 3px; }
/* Chart.js 容器：固定高度，勿用 flex-grow（会无限增高） */
.chart-box { height: 300px; }
.chart-box-sm { height: 220px; }

/* ---------- 18. 排行 / KPI ---------- */
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-item { display: flex; align-items: center; gap: 10px; }
.rank-num {
    width: 22px; height: 22px; border-radius: 6px;
    background: var(--bg); color: var(--text-2);
    font-size: 11.5px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-item:nth-child(1) .rank-num { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.rank-item:nth-child(2) .rank-num { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-item:nth-child(3) .rank-num { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }
.rank-item .rank-name { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-item .rank-val { font-size: 12.5px; font-weight: 600; }

.kpi-mini {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px dashed var(--border);
}
.kpi-mini:last-child { border-bottom: none; }
.kpi-mini .km-label { font-size: 13px; color: var(--text-2); }
.kpi-mini .km-val { font-size: 15px; font-weight: 600; }

/* ---------- 19. 消息 ---------- */
.notice-item {
    display: flex; gap: 12px; padding: 13px 20px;
    border-bottom: 1px solid var(--border); transition: background .12s;
}
.notice-item:hover { background: #f8fafc; }
.notice-item .nt-icon {
    width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.notice-item .nt-title { font-size: 13.5px; font-weight: 500; }
.notice-item .nt-time { font-size: 11.5px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
.notice-item .nt-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ---------- 20. 弹窗 ---------- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 200;
    display: none;
    align-items: flex-start; justify-content: center;
    padding: 60px 20px; overflow-y: auto;
    backdrop-filter: blur(2px);
}
.modal-overlay.show { display: flex; }
.modal {
    background: #fff; border-radius: 14px;
    width: 100%; max-width: 560px;
    box-shadow: var(--shadow-lg);
    animation: modalIn .2s ease;
    border: none;
}
.modal.wide { max-width: 920px; }
/* Bootstrap 5 全局样式带 .modal { display:none }，会让通用弹窗本体不可见 —— 显式覆盖 */
.modal-overlay .modal { position: static; margin: 0; }
.modal-overlay.show .modal { display: block; }
@keyframes modalIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-h {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-h h3 { font-size: 16px; font-weight: 600; }
.modal-x {
    width: 30px; height: 30px; border: none; background: var(--bg);
    border-radius: 7px; cursor: pointer; font-size: 14px;
    color: var(--text-2); font-family: inherit;
}
.modal-x:hover { background: #e2e8f0; color: var(--text); }
.modal-b { padding: 22px; }
.modal-f {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 22px; border-top: 1px solid var(--border);
}

/* ---------- 21. 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.form-item input, .form-item select, .form-item textarea {
    border: 1px solid var(--border); border-radius: 8px;
    padding: 9px 12px; font-size: 13px; outline: none;
    font-family: inherit; color: var(--text); background: #fff;
    transition: all .15s; width: 100%;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.form-item textarea { resize: vertical; min-height: 70px; }
.form-item .hint { font-size: 11px; color: var(--text-3); }
.form-item .req::after, .form-item label.req::after { content: ' *'; color: var(--red); }
.form-item-static { font-size: 13px; padding: 9px 0; color: var(--text); }

.req, label.req { color: var(--text-2); }
.req::after, label.req::after { content: ' *'; color: var(--red); }

/* ---------- 22. 配置卡片 ---------- */
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.config-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px;
    box-shadow: var(--shadow); transition: all .15s;
}
.config-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow-lg); }
.config-card .cc-icon {
    width: 40px; height: 40px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; margin-bottom: 12px;
}
.config-card h4 { font-size: 14px; margin-bottom: 4px; }
.config-card p { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.config-card .cc-meta { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }

/* ---------- 23. 开关 ---------- */
.switch { position: relative; width: 40px; height: 22px; display: inline-block; flex-shrink: 0; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl {
    position: absolute; inset: 0; background: #cbd5e1;
    border-radius: 20px; cursor: pointer; transition: .2s;
}
.switch .sl::before {
    content: ''; position: absolute; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; top: 3px; left: 3px;
    transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.switch input:checked + .sl { background: var(--primary); }
.switch input:checked + .sl::before { transform: translateX(18px); }

/* ---------- 24. 空态 / 提示 ---------- */
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty .empty-ico { font-size: 40px; margin-bottom: 10px; opacity: .5; }
.empty-tip { padding: 44px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-state i, .empty-state .bi { font-size: 48px; margin-bottom: 10px; display: block; }

.toast {
    position: fixed; top: 74px; left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #0f172a; color: #fff;
    padding: 10px 18px; border-radius: 8px;
    font-size: 13px; box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none;
    transition: all .25s; z-index: 300;
    max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.alert {
    border: 1px solid var(--border); border-radius: 8px;
    padding: 12px 16px; font-size: 13px; background: #fff; margin-bottom: 16px;
}
.alert-success { background: var(--green-bg); border-color: #bbf7d0; color: #15803d; }
.alert-danger { background: var(--red-bg); border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: var(--orange-bg); border-color: #fed7aa; color: #c2410c; }
.alert-info { background: var(--blue-bg); border-color: #bfdbfe; color: #1d4ed8; }

/* ---------- 25. 分类树 ---------- */
.cat-tree { display: flex; flex-direction: column; gap: 12px; }
.cat-tree-node { background: #f5f7fa; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.cat-tree-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.cat-tree-head .ct-icon { font-size: 18px; }
.cat-tree-children { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
    display: inline-block; padding: 4px 12px; border-radius: 14px;
    background: #fff; border: 1px solid var(--border);
    font-size: 12px; color: var(--text-2);
}

/* ---------- 26. 详情页组件 ---------- */
.detail-section { margin-bottom: 20px; }
.detail-section-title {
    font-size: 13px; font-weight: 600; color: var(--primary);
    margin-bottom: 10px; padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-light);
    display: flex; align-items: center; gap: 6px;
}
.detail-section-title::before {
    content: ''; width: 3px; height: 14px;
    background: var(--primary); border-radius: 2px;
}
.detail-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px; }
.detail-info-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.detail-info-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.detail-info-item { display: flex; align-items: baseline; gap: 4px; font-size: 12.5px; min-width: 0; }
.detail-info-item .label { color: var(--text-3); white-space: nowrap; min-width: 70px; flex-shrink: 0; }
.detail-info-item .value { color: var(--text); font-weight: 500; word-break: break-all; }
.detail-info-item .value.red { color: var(--red); }
.detail-info-item .value.orange { color: var(--orange); }
.detail-info-item .value.green { color: var(--green); }
.detail-info-item .value.blue { color: var(--primary); }
.detail-info-item .value.strong { font-weight: 700; }

.detail-timeline { display: flex; align-items: center; gap: 0; margin: 12px 0; flex-wrap: wrap; }
.detail-timeline-step { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 80px; }
.detail-timeline-dot {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #fff; font-weight: 600;
}
.detail-timeline-dot.done { background: var(--green); }
.detail-timeline-dot.current { background: var(--primary); }
.detail-timeline-dot.pending { background: #dcdfe6; color: var(--text-3); }
.detail-timeline-dot.err { background: var(--red); }
.detail-timeline-label { font-size: 11px; color: var(--text-2); }
.detail-timeline-time { font-size: 10px; color: var(--text-4); }
.detail-timeline-arrow { flex: 1; min-width: 20px; height: 2px; background: #e4e7ed; margin: 0 -4px; position: relative; top: -14px; }
.detail-timeline-arrow.done { background: var(--green); }

.detail-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 8px 0; }
.detail-table th {
    background: #f5f7fa; color: var(--text-3); font-weight: 500;
    padding: 8px 10px; text-align: left;
    border-bottom: 1px solid var(--border); white-space: nowrap;
}
.detail-table td { padding: 8px 10px; border-bottom: 1px solid #f0f0f0; color: var(--text); }
.detail-table tr:last-child td { border-bottom: none; }
.detail-table .red { color: var(--red); }
.detail-table .orange { color: var(--orange); }
.detail-table .green { color: var(--green); }
.detail-table .blue { color: var(--primary); }

/* 流程条 */
.flow-diagram { display: flex; align-items: center; gap: 0; flex-wrap: wrap; padding: 16px; background: #fafafa; border-radius: 8px; margin: 12px 0; }
.flow-node {
    padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 500;
    white-space: nowrap; text-align: center; min-width: 80px;
}
.flow-node.start { background: var(--primary-light); color: var(--primary); border: 1px solid #bfdbfe; }
.flow-node.process { background: var(--orange-bg); color: var(--orange); border: 1px solid #fed7aa; }
.flow-node.success { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.flow-node.fail { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }
.flow-arrow { color: var(--text-4); font-size: 16px; margin: 0 4px; display: flex; align-items: center; }

/* 评估卡 */
.assessment-card { background: linear-gradient(135deg, #f0f9eb 0%, #fdf6ec 100%); border: 1px solid #e1f3d8; border-radius: 8px; padding: 14px 16px; margin: 12px 0; }
.assessment-card .ac-title { font-size: 13px; font-weight: 600; color: #67c23a; margin-bottom: 8px; display: flex; align-items: center; gap: 4px; }
.assessment-card .ac-items { display: flex; flex-direction: column; gap: 6px; }
.assessment-card .ac-item { font-size: 12px; color: var(--text-2); display: flex; align-items: flex-start; gap: 6px; }
.assessment-card .ac-item::before { content: '▸'; color: #67c23a; font-size: 10px; margin-top: 2px; }

/* 操作胶囊 */
.action-chip {
    padding: 4px 10px; border-radius: 4px; font-size: 11px;
    cursor: pointer; border: 1px solid #dcdfe6;
    color: var(--text-2); background: #fff; transition: all .2s;
}
.action-chip:hover { border-color: var(--primary); color: var(--primary); }
.action-chip.danger { color: var(--red); border-color: #fecaca; }
.action-chip.danger:hover { background: var(--red-bg); }
.action-chip.warning { color: var(--orange); border-color: #fed7aa; }
.action-chip.warning:hover { background: var(--orange-bg); }

/* 联系人面板 */
.contact-panel { background: #f0f9ff; border: 1px solid #d0e8ff; border-radius: 8px; padding: 14px; margin: 12px 0; }
.contact-panel .cp-title { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 10px; }
.contact-panel .cp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.contact-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 6px; font-size: 12px;
    cursor: pointer; border: 1px solid #dcdfe6; background: #fff;
    color: var(--text-2); transition: all .2s;
}
.contact-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* 照片墙 */
.detail-photos-title {
    font-size: 13px; font-weight: 600; color: var(--text);
    margin: 14px 0 10px; padding-left: 10px; border-left: 3px solid var(--primary);
}
.detail-photos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.detail-photo {
    position: relative; border: 1px solid var(--border); border-radius: 8px;
    overflow: hidden; cursor: pointer;
    transition: transform .15s, box-shadow .15s; background: #f7f8fa;
}
.detail-photo:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, .18); border-color: var(--primary); }
.detail-photo img { display: block; width: 100%; height: 72px; object-fit: cover; }
.photo-emoji { display: block; text-align: center; font-size: 30px; line-height: 72px; height: 72px; }
.detail-photo:nth-child(1) .photo-emoji { background: linear-gradient(135deg, #eaf2ff, #d6e4ff); }
.detail-photo:nth-child(2) .photo-emoji { background: linear-gradient(135deg, #e8f7ef, #d1f0e0); }
.detail-photo:nth-child(3) .photo-emoji { background: linear-gradient(135deg, #f3e8ff, #e5d5ff); }
.detail-photo:nth-child(4) .photo-emoji { background: linear-gradient(135deg, #fff4e6, #ffe3c2); }
.detail-photo:nth-child(5) .photo-emoji { background: linear-gradient(135deg, #fff0f5, #ffd9e3); }
.photo-tag { display: block; text-align: center; font-size: 11px; color: var(--text-2); padding: 4px 0 6px; background: #fff; white-space: nowrap; }
.photo-badge { position: absolute; top: 4px; right: 4px; font-size: 10px; padding: 1px 6px; border-radius: 8px; color: #fff; z-index: 2; }
.photo-badge.before { background: #86909c; }
.photo-badge.after { background: var(--primary); }
.photo-viewer-overlay {
    position: fixed; inset: 0; background: rgba(15, 23, 42, .88);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    flex-direction: column; animation: fadeIn .2s ease;
}
.photo-viewer-box {
    background: #fff; border-radius: 12px; padding: 24px;
    max-width: 560px; width: 90%; text-align: center;
    position: relative; box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}
.photo-viewer-img { font-size: 110px; line-height: 1; margin: 16px 0 18px; border-radius: 10px; padding: 34px 20px; }
.photo-viewer-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.photo-viewer-desc { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.photo-viewer-close {
    position: absolute; top: -14px; right: -14px;
    width: 32px; height: 32px; border-radius: 50%;
    background: #fff; color: var(--text-2); font-size: 16px;
    border: none; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); z-index: 3;
}
.photo-viewer-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, .15); color: #fff; font-size: 22px;
    border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 3;
}
.photo-viewer-nav:hover { background: rgba(255, 255, 255, .35); }
.photo-viewer-prev { left: -58px; }
.photo-viewer-next { right: -58px; }
.photo-viewer-counter { color: rgba(255, 255, 255, .85); font-size: 13px; margin-top: 14px; letter-spacing: 1px; }

/* 详情弹窗（大） */
.detail-modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
    z-index: 9999; display: flex; align-items: flex-start; justify-content: center;
    overflow-y: auto; padding: 20px 0;
}
.detail-modal {
    background: #fff; border-radius: 10px; width: 880px; max-width: 95%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .15); margin: 0 auto;
}
.detail-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; border-bottom: 1px solid #ebeef5;
}
.detail-modal-head h3 { font-size: 16px; font-weight: 600; color: var(--text); margin: 0; }
.detail-modal-close {
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-3); font-size: 18px; border: none; background: none;
}
.detail-modal-close:hover { background: #f5f5f5; color: var(--red); }
.detail-modal-body { padding: 20px 24px; max-height: 75vh; overflow-y: auto; }

/* ---------- 27. 详情列表（旧写法兼容） ---------- */
.detail-list { background: #fff; border-radius: var(--radius); overflow: hidden; }
.detail-list .detail-row {
    display: flex; border-bottom: 1px solid #f0f0f0;
    padding: 10px 16px; font-size: 13.5px;
}
.detail-list .detail-row:last-child { border-bottom: none; }
.detail-list .detail-label { width: 130px; color: var(--text-2); flex-shrink: 0; }
.detail-list .detail-value { flex: 1; color: var(--text); word-break: break-all; }

/* ---------- 28. 工具类 ---------- */
.text-truncate-2 {
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.text-muted { color: var(--text-2) !important; }
.text-mut-3 { color: var(--text-3); }
.small, .fs-sm { font-size: 12px; }
.nowrap { white-space: nowrap; }
.w-100 { width: 100%; }
.tr { text-align: right; }
.tc { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.grow { flex: 1; }
.text-red { color: var(--red) !important; }
.text-green { color: var(--green) !important; }
.text-blue { color: var(--primary) !important; }
.text-orange { color: var(--orange) !important; }
.fw-600 { font-weight: 600; }
.fs-20 { font-size: 20px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-0 { margin-bottom: 0 !important; }

/* ---------- 29. 登录页 ---------- */
.login-page {
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-box {
    background: #fff; border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    padding: 40px; width: 100%; max-width: 420px;
}
.login-box h1 { text-align: center; font-size: 22px; margin-bottom: 6px; color: var(--text); }
.login-box .subtitle { text-align: center; color: var(--text-2); font-size: 13px; margin-bottom: 28px; }
.login-box .form-control { padding: 10px 14px; font-size: 14px; height: 44px; }
.login-box .btn-primary {
    width: 100%; height: 44px; font-size: 15px; font-weight: 600;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8); border: none;
    border-radius: 8px;
}
.login-box .default-tip {
    background: var(--bg); border-radius: 8px; padding: 10px;
    font-size: 12px; color: var(--text-2); margin-top: 18px; text-align: center;
}
.login-logo {
    width: 120px; height: 116px; margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
}
.login-logo img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- 30. 响应式 ---------- */
@media (max-width: 1280px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
    .half-grid, .form-grid { grid-template-columns: 1fr; }
    .dash-2, .dash-3 { grid-template-columns: 1fr; }
    .content { padding: 18px 16px 32px; }
    .topbar { padding: 0 16px; }
    .top-search { max-width: 200px; }
}
@media (max-width: 768px) {
    #sidebar { margin-left: calc(var(--sidebar-width) * -1); }
    #main { margin-left: 0; }
    .wrapper.mobile-show #sidebar { margin-left: 0; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
    .top-search { display: none; }
    .stat-grid { grid-template-columns: 1fr; }
    .detail-photos { grid-template-columns: repeat(2, 1fr); }
    .detail-info-grid, .detail-info-grid.cols-3, .detail-info-grid.cols-4 { grid-template-columns: 1fr; }
    .contact-panel .cp-grid { grid-template-columns: 1fr; }
    .admin-chip .an, .admin-chip .ar { display: none; }
    .admin-chip { padding: 4px; }
    .crumb { display: none; }
}


/* =====================================================================
 * PART B · Bootstrap 兼容覆写层
 * 目的：未迁移的旧页面（表单页/详情页）与第三方组件保持一致视觉
 * ===================================================================== */

/* Bootstrap 主题变量跟随本项目令牌 */
:root {
    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-body-color: #1e293b;
    --bs-body-bg: #f1f5f9;
    --bs-border-color: #e2e8f0;
    --bs-link-color: #2563eb;
    --bs-link-hover-color: #1d4ed8;
    --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

/* 卡片 */
.card.border-0, .card.shadow-sm, .card.h-100 { border: 1px solid var(--border) !important; box-shadow: var(--shadow) !important; }
.card.border-0 { border-radius: var(--radius) !important; }
.card-body { padding: 20px; }
.card-title { font-size: 15px; font-weight: 600; }
.card > .table { margin-bottom: 0; }

/* 按钮 */
.btn-check:focus + .btn, .btn:focus { box-shadow: none; }
.btn-check:focus + .btn-primary, .btn-primary:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); }
.btn-outline-primary:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--text-2); }
.btn-secondary:hover { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn-light { background: #fff; border-color: var(--border); color: var(--text-2); }
.btn-light:hover { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn-link { border: none; background: none; color: var(--primary); height: auto; padding: 0; }
.btn-link:hover { background: none; text-decoration: underline; }

/* 徽标：Bootstrap 语义色 → 本项目配色（订单状态用 bg-{class}） */
.badge.bg-secondary { background: var(--gray-bg) !important; color: var(--gray) !important; }
.badge.bg-primary { background: var(--blue-bg) !important; color: var(--blue) !important; }
.badge.bg-info { background: var(--cyan-bg) !important; color: var(--cyan) !important; }
.badge.bg-warning { background: var(--orange-bg) !important; color: var(--orange) !important; }
.badge.bg-success { background: var(--green-bg) !important; color: var(--green) !important; }
.badge.bg-danger { background: var(--red-bg) !important; color: var(--red) !important; }
.badge.bg-dark { background: #e2e8f0 !important; color: #334155 !important; }
.badge.bg-purple { background: var(--purple-bg) !important; color: var(--purple) !important; }
.badge.bg-light { background: var(--gray-bg) !important; color: var(--gray) !important; }
.badge.text-bg-primary { background: var(--blue-bg) !important; color: var(--blue) !important; }
.badge.text-bg-secondary { background: var(--gray-bg) !important; color: var(--gray) !important; }
.badge.text-bg-success { background: var(--green-bg) !important; color: var(--green) !important; }
.badge.text-bg-warning { background: var(--orange-bg) !important; color: var(--orange) !important; }
.badge.text-bg-danger { background: var(--red-bg) !important; color: var(--red) !important; }

/* 表格 */
.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #f8fafc;
    --bs-table-border-color: #f1f5f9;
    width: 100%;
    margin-bottom: 0;
    font-size: 13px;
    vertical-align: middle;
    border-color: #f1f5f9;
    color: var(--text);
}
.table > thead th {
    background: #f8fafc;
    color: var(--text-2);
    font-weight: 600;
    font-size: 12.5px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table > tbody > tr > td { padding: 11px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table > tbody > tr:last-child > td { border-bottom: none; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f8fafc; box-shadow: none; }
.table-responsive { border-radius: 0; }

/* 分页（Bootstrap 结构） */
.pagination.pagination-sm { gap: 6px; padding: 14px 0; border-top: 1px solid var(--border); justify-content: flex-end !important; }
.pagination.pagination-sm .page-link { border-radius: 6px; }
.pagination.pagination-sm .page-item:first-child .page-link,
.pagination.pagination-sm .page-item:last-child .page-link { border-radius: 6px; }

/* 表单控件 */
.form-label { font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    padding: 8px 12px;
    background-color: #fff;
    font-family: inherit;
}
.form-control-sm, .form-select-sm { padding: 6px 10px; font-size: 12.5px; border-radius: 7px; }
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
    background-color: #fff;
    color: var(--text);
}
.form-control::placeholder { color: var(--text-4); }
.input-group-text {
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text-2); font-size: 13px; border-radius: 8px;
}
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.form-text { font-size: 11.5px; color: var(--text-3); }

/* 下拉菜单 */
.dropdown-menu {
    border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow-lg); padding: 6px; font-size: 13px;
}
.dropdown-item { border-radius: 7px; padding: 8px 12px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--bg); color: var(--primary); }
.dropdown-divider { border-color: var(--border); }

/* 提示条 */
.alert-dismissible .btn-close { padding: 1rem; }
.alert.auto-close { transition: opacity .3s, transform .3s; }

/* Bootstrap 弹窗（轮播图等页面仍用 data-bs-toggle / bootstrap.Modal） */
.modal-content { border: none; border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 22px; }
.modal-body label { font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; display: block; font-weight: 500; }
.modal-body .mb-2, .modal-body .mb-3 { margin-bottom: 14px !important; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); gap: 10px; }
.modal-backdrop.show { opacity: .5; }

/* 进度（Bootstrap 结构） */
.progress-stacked { display: flex; height: 7px; }

/* =====================================================================
 * 二级弹窗层补充（订单详情 / 超时跟进 / 洗护异常 / 分拣信息 / 退款审核）
 * 基础组件（detail-modal / detail-section / detail-table / detail-photos /
 * photo-viewer / contact-panel）已在 Part A 就绪，此处仅补缺失件
 * ===================================================================== */

/* 列表页提示条（异常订单 / 超时预警） */
.xj-alert { padding: 8px 16px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.xj-alert.danger { background: var(--red-bg); color: var(--red); }
.xj-alert.warn { background: var(--orange-bg); color: var(--orange); }

/* 弹窗底部与加载态 */
.detail-modal-foot {
    padding: 12px 24px; border-top: 1px solid #ebeef5;
    display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
}
.xj-modal-loading { padding: 60px 0; text-align: center; color: var(--text-3); font-size: 13px; }

/* 详情项灰值 / 弹窗表格内链接 / 备注块 */
.detail-info-item .value.gray { color: var(--text-3); }
.detail-table a.link { color: var(--primary); cursor: pointer; text-decoration: none; }
.detail-table a.link:hover { text-decoration: underline; }
.detail-note { background: #f5f7fa; border-radius: 6px; padding: 10px; font-size: 12px; color: #606266; line-height: 1.6; }

/* 照片查看器：真实图片模式 */
.photo-viewer-img img { max-width: 100%; max-height: 320px; border-radius: 10px; display: block; margin: 0 auto; }

/* 弹窗内表单排版（控件复用 Bootstrap .form-control / .form-select） */
.xj-form-row { margin-bottom: 14px; }
.xj-form-row > label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.xj-form-row > label .req { color: var(--red); }
.xj-form-row .hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.xj-radio-group { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.xj-radio-group label { display: flex; align-items: center; gap: 5px; cursor: pointer; font-weight: 400; margin: 0; }

/* ===== 二级页面表单弹窗（设计稿 .form-modal 体系） ===== */
.form-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9999;
    display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: 20px 0; }
.form-modal { background: #fff; border-radius: 10px; width: 520px; max-width: 95%;
    box-shadow: 0 8px 32px rgba(0,0,0,.15); margin: auto; }
.form-modal-head { padding: 16px 20px; border-bottom: 1px solid #ebeef5; font-size: 15px;
    font-weight: 600; color: #1a1a1a; }
.form-modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.form-modal-foot { padding: 12px 20px; border-top: 1px solid #ebeef5; display: flex;
    justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.form-group { margin-bottom: 16px; }
.form-group > label { display: block; font-size: 12px; color: #606266; margin-bottom: 6px; font-weight: 500; }
.form-group > label .req { color: #f56c6c; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 12px;
    border: 1px solid #dcdfe6; border-radius: 4px; font-size: 13px; color: #1a1a1a; background: #fff;
    box-sizing: border-box; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #409eff; }
.form-group input[type="checkbox"], .form-group input[type="radio"] { width: auto; padding: 0; }
.form-group .hint { font-size: 11px; color: #909399; margin-top: 4px; }
.form-group textarea { resize: vertical; }
.xj-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.xj-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
/* 商品规格行（体验问题 用户端 序号4：每行右侧「×」可删除加多的规格） */
.xj-spec-rows { display: block; }
.xj-spec-row { display: grid; grid-template-columns: 1fr 1fr 1fr 34px; gap: 0 12px;
    align-items: end; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px dashed #ebeef5; }
.xj-spec-row:last-child { border-bottom: 0; }
.xj-spec-del { width: 30px; height: 30px; margin-bottom: 16px; border: 1px solid #e4e7ed;
    border-radius: 4px; background: #fff; color: #909399; font-size: 16px; line-height: 1;
    cursor: pointer; padding: 0; }
.xj-spec-del:hover { border-color: #f56c6c; color: #f56c6c; background: #fef0f0; }
/* 门店列表：门店图片单元格（体验问题 用户端 序号15，点击本地上传，仅作用户端背景图） */
.mch-logo-cell { display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 36px; overflow: hidden; border: 1px dashed #dcdfe6; border-radius: 4px;
    background: #fafafa; cursor: pointer; }
.mch-logo-cell img { width: 100%; height: 100%; object-fit: cover; }
.mch-logo-cell:hover { border-color: #409eff; }
.mch-logo-empty { font-size: 14px; color: #c0c4cc; line-height: 1; }
.xj-span-2 { grid-column: 1 / span 2; }
.xj-span-3 { grid-column: 1 / span 3; }
.xj-form-section { font-size: 13px; font-weight: 600; color: #1a1a1a; border-left: 3px solid #409eff;
    padding-left: 8px; margin: 6px 0 14px; }
.xj-tag-chip { display: inline-flex; align-items: center; gap: 6px; background: #ecf5ff; color: #409eff;
    border: 1px solid #d9ecff; border-radius: 4px; padding: 3px 8px; font-size: 12px; margin: 0 6px 6px 0; }
.xj-tag-x { cursor: pointer; color: #a0cfff; font-size: 13px; }
.xj-icon-upload { display: flex; gap: 12px; align-items: center; }
.xj-icon-slot { width: 80px; height: 80px; flex: none; border: 1px dashed #dcdfe6; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 34px; cursor: pointer; background: #fafbfc; }
.xj-upload-hint { font-size: 11px; color: #909399; line-height: 1.8; }
.xj-upload-box { border: 1px dashed var(--border); border-radius: 8px; padding: 22px 16px; text-align: center;
    color: var(--text-3); font-size: 13px; cursor: pointer; }
.xj-poster-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 12px; position: relative; }
.xj-poster-x { position: absolute; top: 6px; right: 12px; font-size: 16px; color: var(--text-3);
    cursor: pointer; line-height: 1; }
.xj-rec-list { border: 1px solid #ebeef5; border-radius: 6px; padding: 8px 12px; max-height: 150px; overflow: auto; }
.xj-rec-list label { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0;
    color: #1a1a1a; cursor: pointer; font-weight: 400; }
.xj-check-row { display: flex; gap: 20px; font-size: 13px; color: #1a1a1a; flex-wrap: wrap; }
.xj-check-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 400; }
.xj-empty { padding: 28px 12px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ===== 营销管理：添加推广员弹层（设计稿 promoter-add-tip / promoter-av 1:1） ===== */
.promoter-add-tip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px;
    border-radius: 10px; background: linear-gradient(120deg, #eff6ff 0%, #eef2ff 100%);
    border: 1px solid #dbeafe; position: relative; overflow: hidden; }
.promoter-add-tip::after { content: ''; position: absolute; right: -24px; top: -38px; width: 104px; height: 104px;
    border-radius: 50%; background: rgba(37, 99, 235, .07); }
.pat-ico { width: 36px; height: 36px; flex: none; border-radius: 10px; background: #fff; display: flex;
    align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 1px 3px rgba(37, 99, 235, .14); }
.pat-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.pat-title { display: block; font-size: 13px; font-weight: 600; color: #1a1a1a; }
.pat-title b { color: var(--primary); font-weight: 700; }
.pat-sub { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.promoter-av-row { display: flex; align-items: center; gap: 14px; }
.promoter-av { width: 72px; height: 72px; flex: none; border-radius: 50%; border: 1px dashed #dcdfe6;
    background: #fafbfc; display: flex; align-items: center; justify-content: center; font-size: 28px;
    cursor: pointer; overflow: hidden; transition: .15s; }
.promoter-av:hover { border-color: var(--primary); background: #f5f8ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.promoter-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promoter-av-txt { font-size: 12px; color: var(--text-2); line-height: 1.8; }
.promoter-av-txt b { color: var(--primary); font-weight: 600; }
img.avatar-sm { object-fit: cover; background: none; display: inline-block; padding: 0; }

/* ===== 客服系统（设计稿 1:1：左侧用户列表 + 右侧聊天窗口） ===== */
.cs-wrap { display: flex; height: calc(100vh - 210px); min-height: 520px; border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.cs-side { width: 290px; flex: none; border-right: 1px solid var(--border); display: flex; flex-direction: column;
    background: #fafbfc; min-height: 0; }
.cs-side-head { padding: 12px; border-bottom: 1px solid var(--border); background: #fff; }
.cs-side-title { display: flex; align-items: center; justify-content: space-between; font-size: 13px;
    font-weight: 700; color: var(--text); margin-bottom: 9px; }
.cs-side-title .cs-cnt { font-weight: 400; font-size: 11.5px; color: var(--text-3); }
.cs-search { width: 100%; height: 32px; padding: 0 10px 0 30px; border: 1px solid var(--border);
    border-radius: 16px; font-size: 12.5px; outline: none; background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E") no-repeat 10px center; transition: .15s; }
.cs-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.cs-tabs { display: flex; gap: 6px; padding: 8px 12px 0; }
.cs-tab { flex: 1; text-align: center; font-size: 12px; padding: 5px 0; border-radius: 6px; color: var(--text-2);
    cursor: pointer; background: #fff; border: 1px solid var(--border); transition: .15s; }
.cs-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.cs-ul { flex: 1; overflow: auto; padding: 6px 0; min-height: 0; }
.cs-u { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer;
    border-left: 3px solid transparent; transition: .12s; }
.cs-u:hover { background: #f1f5f9; }
.cs-u.active { background: var(--blue-bg); border-left-color: var(--primary); }
.cs-av { width: 38px; height: 38px; flex: none; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; justify-content: center; position: relative; }
.cs-av .cs-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
    border: 2px solid #fff; background: #cbd5e1; }
.cs-av .cs-dot.on { background: var(--green); }
.cs-u-main { flex: 1; min-width: 0; }
.cs-u-top { display: flex; align-items: baseline; gap: 6px; }
.cs-u-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; flex: 1; }
.cs-u-time { font-size: 11px; color: var(--text-3); flex: none; }
.cs-u-bot { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.cs-u-msg { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; flex: 1; }
.cs-unread { flex: none; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--red);
    color: #fff; font-size: 11px; line-height: 17px; text-align: center; font-weight: 600; }
.cs-empty { padding: 34px 12px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.cs-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px;
    border-bottom: 1px solid var(--border); background: #fff; flex: none; }
.cs-head-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cs-head-name { font-size: 14px; font-weight: 700; color: var(--text); }
.cs-head-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.cs-head-r { display: flex; gap: 8px; flex: none; }
.cs-hbtn { font-size: 12px; padding: 4px 11px; border: 1px solid var(--border); border-radius: 6px;
    background: #fff; color: var(--text-2); cursor: pointer; transition: .15s; }
.cs-hbtn:hover { border-color: var(--primary); color: var(--primary); }
.cs-body { flex: 1; overflow: auto; padding: 16px 18px; background: #f5f7fa; min-height: 0; }
.cs-day { text-align: center; font-size: 11.5px; color: var(--text-3); margin: 4px 0 14px; }
.cs-msg { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 14px; }
.cs-msg.me { flex-direction: row-reverse; }
.cs-msg .cs-av { width: 32px; height: 32px; font-size: 12.5px; }
.cs-mcol { max-width: 64%; min-width: 0; }
.cs-bubble { padding: 9px 12px; border-radius: 9px; font-size: 13px; line-height: 1.65; word-break: break-word;
    background: #fff; border: 1px solid var(--border); color: var(--text); border-top-left-radius: 2px;
    display: inline-block; }
.cs-msg.me .cs-bubble { background: var(--primary); border-color: var(--primary); color: #fff;
    border-top-left-radius: 9px; border-top-right-radius: 2px; }
.cs-mtime { font-size: 11px; color: var(--text-3); margin-top: 4px; display: block; }
.cs-msg.me .cs-mtime { text-align: right; }
.cs-sys { text-align: center; margin: 6px 0 14px; }
.cs-sys span { display: inline-block; font-size: 11.5px; color: var(--text-2); background: #e8edf3;
    border-radius: 11px; padding: 3px 11px; }
.cs-foot { flex: none; border-top: 1px solid var(--border); padding: 10px 14px; background: #fff; }
.cs-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cs-chip { font-size: 12px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 12px;
    background: #fff; color: var(--text-2); cursor: pointer; transition: .15s; }
.cs-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cs-row { display: flex; gap: 9px; align-items: flex-end; }
.cs-input { flex: 1; min-height: 38px; max-height: 110px; padding: 8px 11px; border: 1px solid var(--border);
    border-radius: 7px; font-size: 13px; line-height: 1.5; resize: none; outline: none; font-family: inherit;
    transition: .15s; }
.cs-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.cs-send { flex: none; height: 38px; padding: 0 18px; border: none; border-radius: 7px; background: var(--primary);
    color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; }
.cs-send:hover { background: var(--primary-dark); }
/* 图片 / 视频发送 */
.cs-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cs-tool { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 11px;
    border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--text-2);
    cursor: pointer; font-family: inherit; transition: .15s; }
.cs-tool:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cs-tool-hint { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.cs-mcol-wide { max-width: 76%; }
.cs-media { display: inline-block; max-width: 100%; line-height: 0; border-radius: 9px; overflow: hidden; }
.cs-media-img img { display: block; max-width: 100%; max-height: 230px; border-radius: 9px; cursor: zoom-in;
    border: 1px solid var(--border); }
.cs-media-vid video { display: block; max-width: 100%; max-height: 230px; border-radius: 9px; background: #000; }
.cs-mname { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 5px; word-break: break-all;
    line-height: 1.5; }
.cs-vid-demo { width: 224px; height: 126px; background: linear-gradient(135deg, #1e293b, #334155); display: flex;
    flex-direction: column; align-items: center; justify-content: center; gap: 7px; cursor: pointer; }
.cs-play { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #2563eb;
    font-size: 14px; display: flex; align-items: center; justify-content: center; padding-left: 3px; }
.cs-vid-meta { font-size: 11px; color: rgba(255, 255, 255, .85); padding: 0 8px; text-align: center; }
/* 图片放大预览 */
.cs-zoom { position: fixed; inset: 0; z-index: 4000; background: rgba(15, 23, 42, .82); display: flex;
    align-items: center; justify-content: center; padding: 40px; cursor: zoom-out; }
.cs-zoom img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
/* 客服页外层卡片（设计稿 P.cs：card padding:0 包裹 cs-wrap） */
.cs-card { padding: 0; }
.cs-card-pad { padding: 16px; }

/* ===== 骑手管理：服务区域 · 电子围栏数据（设计稿 fence-sec 1:1） ===== */
.fence-sec { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 14px; }
.fence-sec-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
    color: var(--text); margin-bottom: 2px; }
.fence-sec-title .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.fence-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.7; margin-bottom: 12px; }
.fence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.fence-grid textarea, .fence-sec textarea { width: 100%; }
#fence-point-count { color: var(--primary); }

/* ===== 骑手管理：服务区域 · 分配骑手弹框（设计稿 assign-* 1:1） ===== */
.assign-hero { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: -4px -4px 14px;
    border-radius: 10px; background: linear-gradient(120deg, #2563eb 0%, #4f46e5 55%, #7c3aed 100%);
    color: #fff; position: relative; overflow: hidden; }
.assign-hero:after { content: ""; position: absolute; right: -30px; top: -46px; width: 130px; height: 130px;
    border-radius: 50%; background: rgba(255, 255, 255, .12); }
.assign-hero .ah-icon { width: 40px; height: 40px; flex: none; border-radius: 11px;
    background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.assign-hero .ah-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.assign-hero .ah-title { font-size: 15px; font-weight: 700; letter-spacing: .2px; display: block; }
.assign-hero .ah-sub { font-size: 11.5px; opacity: .85; margin-top: 3px; display: block; }
.assign-hero .ah-count { flex: none; text-align: center; position: relative; z-index: 1; padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, .28); }
.assign-hero .ah-count b { display: block; font-size: 22px; line-height: 1.1; font-weight: 800; }
.assign-hero .ah-count span { font-size: 11px; opacity: .85; }
.assign-tip { display: flex; align-items: center; gap: 7px; padding: 8px 11px; margin-bottom: 14px;
    border-radius: 8px; background: var(--primary-light); border: 1px solid #dbeafe; color: #3b6fd4;
    font-size: 11.5px; line-height: 1.6; }
.assign-tip .at-ico { flex: none; font-size: 13px; }
.assign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.assign-panel { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff;
    box-shadow: var(--shadow); }
.assign-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px;
    font-size: 13px; font-weight: 700; color: var(--text); background: #fafbfc;
    border-bottom: 1px solid var(--border); }
.assign-panel-head .ah-left { display: flex; align-items: center; gap: 7px; }
.assign-panel-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.assign-panel-head.p-out .dot { background: var(--text-3); }
.assign-panel-head .cnt { flex: none; font-weight: 600; font-size: 11px; color: var(--text-2); background: #fff;
    border: 1px solid var(--border); border-radius: 10px; padding: 2px 9px; }
.assign-list { max-height: 290px; overflow: auto; padding: 7px; background: #fcfdfe; }
.assign-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-bottom: 6px;
    border: 1px solid var(--border); border-radius: 8px; background: #fff; transition: .15s; }
.assign-item:last-child { margin-bottom: 0; }
.assign-item:hover { border-color: #bfdbfe; background: #f8fbff; box-shadow: 0 2px 6px rgba(37, 99, 235, .08); }
.assign-item.bump { animation: aiBump .28s ease; }
@keyframes aiBump { 0% { transform: scale(.96); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }
.ai-avatar { width: 30px; height: 30px; flex: none; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; }
.ai-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-line1 { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ai-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; }
.ai-id { flex: none; font-size: 10.5px; color: var(--text-2); background: var(--gray-bg); border-radius: 4px;
    padding: 1px 6px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.ai-tel { font-size: 11.5px; color: var(--text-3); letter-spacing: .2px; }
.ai-op { width: 28px; height: 28px; flex: none; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 13px; line-height: 1; cursor: pointer; border: 1px solid var(--border);
    background: #fff; transition: .15s; }
.ai-op.plus { color: var(--green); border-color: #bbf7d0; background: var(--green-bg); }
.ai-op.plus:hover { background: var(--green); color: #fff; border-color: var(--green); transform: scale(1.08); }
.ai-op.minus { color: var(--red); border-color: #fecaca; background: var(--red-bg); }
.ai-op.minus:hover { background: var(--red); color: #fff; border-color: var(--red); transform: scale(1.08); }
.assign-empty { padding: 30px 12px; text-align: center; color: var(--text-3); font-size: 12.5px; line-height: 1.8; }
.assign-empty .ae-ico { display: block; font-size: 22px; opacity: .5; margin-bottom: 6px; }
.btn-cancel { height: 34px; padding: 0 20px; border-radius: 7px; border: 1px solid var(--border); background: #fff;
    font-size: 13px; color: var(--text-2); cursor: pointer; font-family: inherit; transition: .15s; }
.btn-cancel:hover { border-color: #cbd5e1; background: #f8fafc; color: var(--text); }
.btn-confirm { height: 34px; padding: 0 26px; border-radius: 7px; border: 1px solid var(--primary);
    background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: .15s; box-shadow: 0 2px 6px rgba(37, 99, 235, .25); }
.btn-confirm:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* 只读输入框（骑手/区域弹窗中不可修改字段，设计稿统一口径） */
.readonly-input { background: #f5f6f8 !important; color: var(--text-2) !important; cursor: not-allowed; }

/* 运营活动弹层：图片本地上传预览框（点击选图，上传后即时预览） */
.banner-up { position: relative; width: 100%; height: 150px; border: 1px dashed #cbd5e1; border-radius: 8px;
    background: #f8fafc; cursor: pointer; overflow: hidden; display: flex; align-items: center; justify-content: center;
    transition: .15s; }
.banner-up:hover { border-color: var(--primary); background: #eff6ff; }
.banner-up.uploading::after { content: '上传中…'; position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: center; background: rgba(255,255,255,.78); color: var(--primary); font-size: 13px; font-weight: 600; }
.banner-up img { display: none; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.banner-up-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; }
.banner-up-empty .ico { font-size: 26px; line-height: 1; }
.banner-up-empty .sub { font-size: 11px; color: #94a3b8; }

/* ===== 商品弹窗：优品推荐卡片 + 图标上传（设计稿 rec-grid / goodsIconUploadBlock 1:1） ===== */
.rec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 240px; overflow: auto; padding: 2px; }
.rec-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #ebeef5;
    border-radius: 8px; cursor: pointer; background: #fff; transition: .15s; position: relative; }
.rec-card:hover { border-color: #c6d9f5; background: #fafcff; }
.rec-card.active { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px rgba(37, 99, 235, .08); }
.rec-card .rc-icon { width: 36px; height: 36px; flex: none; border-radius: 8px; background: #f4f6f9;
    display: flex; align-items: center; justify-content: center; font-size: 18px; overflow: hidden; }
.rec-card .rc-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-card .rc-body { flex: 1; min-width: 0; line-height: 1.35; }
.rec-card .rc-name { font-size: 13px; color: #1a1a1a; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-card .rc-price { font-size: 12px; color: #909399; }
.rec-card .rc-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #dcdfe6; flex: none;
    color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; transition: .15s; }
.rec-card.active .rc-check { background: var(--primary); border-color: var(--primary); }
.rec-empty { padding: 18px 12px; text-align: center; color: var(--text-3); font-size: 12.5px; line-height: 1.7;
    border: 1px dashed var(--border); border-radius: 8px; background: #fafbfc; }
.xj-icon-slot { overflow: hidden; transition: .15s; }
.xj-icon-slot:hover { border-color: var(--primary); background: #f5f8ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.xj-icon-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 商品海报图位：3:4 竖版 */
.xj-icon-slot.xj-poster-slot { width: 90px; height: 120px; font-size: 30px; }
/* 门店主图位（16:9 横版）与图集 */
.xj-icon-slot.mch-slot { width: 120px; height: 80px; font-size: 28px; }
.mch-gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.mch-gallery-item { position: relative; width: 96px; height: 64px; border-radius: 8px; overflow: hidden;
    border: 1px solid #e5e7eb; background: #fafbfc; }
.mch-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mch-gallery-item.uploading { opacity: .5; }
.mch-gallery-x { position: absolute; top: 2px; right: 4px; width: 16px; height: 16px; line-height: 15px;
    text-align: center; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px;
    cursor: pointer; }
.cat-icon { font-size: 18px; line-height: 1; }
.sort-val { display: inline-block; min-width: 18px; color: var(--text-2); margin-right: 4px; }
img.goods-icon-cell { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; vertical-align: middle; }

/* ===== 体验问题整改（序号16-20）===== */

/* 序号20：后台主色统一蓝色系——原绿色实心按钮一律并入主色（语义绿仍保留在徽章上） */
.btn-success { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-success:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

/* 序号18：表头/徽章文案不折行；链接下划线改浅灰（原黑色下划线看不清） */
th { white-space: nowrap; }
.badge { white-space: nowrap; }
td .link:hover { text-decoration: underline; text-decoration-color: var(--text-3); text-underline-offset: 3px; }

/* 序号17：已取消 tag 字号 -2px、上下内间距 +2px */
.badge.badge-cancel { font-size: 9.5px; padding-top: 5px; padding-bottom: 5px; }

/* 序号19：分页「上一页/下一页」保持同一行，且与列表拉开间距 */
.pagination {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 20px 20px 16px;
    margin-top: 6px;
}
.pagination .pg-info,
.pagination .page-link,
.pagination button { flex: 0 0 auto; white-space: nowrap; }

/* 优惠券「指定发放」弹层（序号15） */
.cg-search { display: flex; gap: 8px; }
.cg-search input { flex: 1; }
.cg-results { margin-top: 8px; max-height: 190px; overflow: auto;
    border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.cg-results:empty { display: none; }
.cg-loading { padding: 14px 12px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.cg-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border-bottom: 1px solid var(--border); cursor: pointer; transition: .12s; }
.cg-item:last-child { border-bottom: none; }
.cg-item:hover { background: #f7faff; }
.cg-item.active { background: var(--primary-light, #eff6ff); }
.cg-avatar { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; background: var(--primary-light, #eff6ff);
    color: var(--primary); display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; }
.cg-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cg-info b { font-size: 13px; color: var(--text); font-weight: 600; }
.cg-pick { flex: 0 0 auto; font-size: 12px; color: var(--primary); }
.cg-item.active .cg-pick { font-weight: 600; }
.cg-picked { margin: 10px 0 14px; padding: 9px 12px; border-radius: 8px; background: var(--bg);
    color: var(--text-2); font-size: 12.5px; border: 1px dashed var(--border); }
.cg-picked.on { background: var(--primary-light, #eff6ff); color: var(--primary);
    border-color: #bfdbfe; border-style: solid; font-weight: 500; }

/* 券「适用商品」已选标签（券 ↔ 商品绑定） */
.cg-picked .xg-chip { display: inline-flex; align-items: center; gap: 6px; margin: 3px 6px 3px 0;
    padding: 3px 8px; border-radius: 14px; background: #fff; border: 1px solid #bfdbfe;
    color: var(--primary); font-size: 12px; font-weight: 500; }
.cg-picked .xg-chip i { font-style: normal; cursor: pointer; color: var(--text-3); line-height: 1; }
.cg-picked .xg-chip i:hover { color: #dc2626; }
/* 商品编辑弹窗内的券多选标签 */
.xj-coupon-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 8px; background: #fafbfd; min-height: 44px; }
.xj-coupon-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
    border-radius: 16px; border: 1px solid var(--border); background: #fff;
    font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: .12s; user-select: none; }
.xj-coupon-chip:hover { border-color: #bfdbfe; }
.xj-coupon-chip.on { background: var(--primary-light, #eff6ff); border-color: #bfdbfe;
    color: var(--primary); font-weight: 600; }
.xj-coupon-chip .cc-val { font-size: 11.5px; opacity: .8; }
.xj-coupon-empty { color: var(--text-3); font-size: 12.5px; }

/* 二级页「用途说明」条（序号4：说明各展示位在用户端的呈现位置） */
.xj-usage-note { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px;
    padding: 10px 12px; border-radius: 8px; background: var(--blue-bg);
    color: var(--text-2); font-size: 12.5px; line-height: 1.7; }
.xj-usage-note b { color: var(--text); font-weight: 600; }

/* 品类广告位海报：本地上传预览 */
.xj-poster-item .xj-upload-box img { max-width: 100%; max-height: 150px; display: block;
    margin: 0 auto; border-radius: 6px; }
.xj-upload-box.uploading { opacity: .6; pointer-events: none; }
