/* ================================================================
   财务管理系统 - 全局样式表 style.css
   v4.5.0 · 财务系统 · 专业版
   ================================================================ */

/* ================================================================
   1. CSS 变量 / 设计令牌
   ================================================================ */
:root {
    /* 主色调 */
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --accent: #14b8a6;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #0284c7;

    /* 文字颜色 */
    --text: #1e293b;
    --text-main: #1e293b;
    --text-secondary: #475569;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --text-muted: #94a3b8;

    /* 背景 */
    --bg: #f8fafc;
    --bg-secondary: #f1f5f9;
    --card-bg: #ffffff;

    /* 边框 */
    --border: #e8ecf2;
    --border-light: #f1f5f9;

    /* 过渡 */
    --transition: all 0.25s ease;

    /* 业务板块色 */
    --biz-liquor: #dc2626;
    --biz-computer: #2c5282;
    --biz-ebike: #0d9488;
    --biz-rooster: #ea580c;
    --biz-expense: #d97706;

    /* 业务板块浅色（用于 badge 背景） */
    --biz-liquor-light: #fee2e2;
    --biz-computer-light: #dbeafe;
    --biz-ebike-light: #ccfbf1;
    --biz-rooster-light: #fff7ed;
    --biz-expense-light: #fef3c7;

    /* 侧边栏 */
    --sidebar-width: 240px;
    --sidebar-bg: #0f2c4c;
    --sidebar-bg-hover: rgba(255,255,255,0.06);
    --sidebar-text: rgba(255,255,255,0.65);
    --sidebar-text-active: #ffffff;
    --sidebar-border: rgba(255,255,255,0.06);
}

/* 暗色模式 */
.dark-mode {
    --text: #f1f5f9;
    --text-main: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;
    --text-lighter: #64748b;
    --text-muted: #64748b;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --card-bg: #1e293b;
    --border: #334155;
    --border-light: #334155;
}

/* ================================================================
   2. 基础重置
   ================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-lighter); }

/* ================================================================
   3. 应用布局
   ================================================================ */
.app {
    display: flex;
    min-height: 100vh;
}

/* ================================================================
   4. 侧边栏 v5 — 全新视觉升级
   ================================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}

/* ---- 头部：品牌区域 ---- */
.sidebar-header {
    padding: 22px 18px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: relative;
    overflow: hidden;
}
.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(20,184,166,0.4), transparent);
}

.sidebar-logo {
    width: 42px; height: 42px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    position: relative;
}
.sidebar-logo-wrap {
    position: relative;
    flex-shrink: 0;
}
.sidebar-logo-glow {
    position: absolute;
    inset: -2px;
    border-radius: 14px;
    background: conic-gradient(from 180deg, rgba(20,184,166,0.6), rgba(2,132,199,0.4), rgba(245,158,11,0.3), rgba(20,184,166,0.6));
    opacity: 0.6;
    animation: logoGlowRotate 8s linear infinite;
    z-index: -1;
    filter: blur(6px);
}
@keyframes logoGlowRotate {
    to { transform: rotate(360deg); }
}

.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--sidebar-text-active);
    white-space: nowrap;
    line-height: 1.25;
}
.sidebar-title span {
    display: block;
    font-size: 9.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.38);
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-top: 3px;
}

/* ---- 侧边栏折叠按钮（右上角） ---- */
.sidebar-collapse-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 10;
}
.sidebar-collapse-btn:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}
.sidebar-collapse-btn:active {
    transform: translateY(-50%) scale(0.94);
}
.sidebar-collapse-btn svg {
    width: 17px;
    height: 17px;
    display: block;
}

/* ---- 折叠状态：仅保留图标 ---- */
body.sidebar-collapsed .sidebar {
    width: 72px;
}
body.sidebar-collapsed .main {
    margin-left: 72px;
}
body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 22px 10px 16px;
}
body.sidebar-collapsed .sidebar-logo-wrap {
    display: none;
}
body.sidebar-collapsed .sidebar-title {
    display: none;
}
body.sidebar-collapsed .nav-section-label {
    display: none;
}
body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    font-size: 0;
}
body.sidebar-collapsed .nav-item .nav-icon {
    margin-right: 0;
}
body.sidebar-collapsed .nav-item .nav-badge {
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
}
body.sidebar-collapsed .sidebar-footer {
    display: none;
}
body.sidebar-collapsed .sidebar-collapse-btn {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
}
body.sidebar-collapsed .sidebar-collapse-btn:active {
    transform: translateX(-50%) translateY(-50%) scale(0.94);
}

/* ---- 导航区域 ---- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 12px;
    mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent 100%);
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* ---- 分区标签 ---- */
.nav-section-label {
    font-size: 10.5px;
    font-weight: 700;
    color: rgba(255,255,255,0.28);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 18px 14px 7px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-section-label::before {
    content: '';
    width: 14px;
    height: 2px;
    border-radius: 1px;
    background: linear-gradient(90deg, rgba(20,184,166,0.45), transparent);
    flex-shrink: 0;
}

/* ---- 导航项 v5 —— 药丸激活态 + 图标背景 ---- */
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
    margin-bottom: 2px;
    position: relative;
    text-decoration: none;
}
.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: #e8ecf2;
    transform: translateX(2px);
}
.nav-item:hover .nav-icon {
    color: var(--accent);
    background: linear-gradient(135deg, rgba(20,184,166,0.20), rgba(2,132,199,0.12));
    transform: scale(1.04);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(13,148,136,0.22) 0%, rgba(20,184,166,0.12) 50%, rgba(2,132,199,0.10) 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 1px 3px rgba(0,0,0,0.1),
        0 0 0 1px rgba(20,184,166,0.12);
}
.nav-item.active .nav-icon {
    color: var(--accent);
    background: linear-gradient(135deg, rgba(20,184,166,0.28), rgba(2,132,199,0.16));
    filter: drop-shadow(0 0 6px rgba(20,184,166,0.35));
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
}
.nav-icon svg { width: 19px; height: 19px; }

/* 激活项左侧指示条 */
.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 20px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, var(--accent), #0ea5e9);
    box-shadow: 0 0 10px rgba(20,184,166,0.5);
    transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.nav-item.active::before {
    transform: translateY(-50%) scaleY(1);
}

/* 导航项角标（通知数等） */
.nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    flex-shrink: 0;
    animation: badgePulse 2s infinite;
}
.nav-badge.badge-warn { background: #f59e0b; }
.nav-badge.badge-info { background: #0284c7; }
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ---- 分组可折叠（点击分组标题收起/展开） ---- */
.nav-section-label.nav-section-collapsible {
    cursor: pointer;
    user-select: none;
}
.nav-section-label.nav-section-collapsible:hover {
    color: rgba(255,255,255,0.5);
}
.section-collapse-arrow {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    opacity: 0.4;
    transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease;
}
.section-collapse-arrow svg { width: 13px; height: 13px; }
.nav-section-label.nav-section-collapsed .section-collapse-arrow {
    transform: rotate(-90deg);
    opacity: 0.25;
}
/* 整体侧栏折叠时隐藏分组折叠箭头 */
body.sidebar-collapsed .nav-section-label .section-collapse-arrow { display: none; }

/* ---- 底部状态栏 v5 ---- */
.sidebar-footer {
    padding: 14px 18px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    position: relative;
}
.sidebar-footer::before {
    content: '';
    position: absolute;
    top: -1px; left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(20,184,166,0.25), transparent);
}
.sidebar-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 10.5px;
    color: rgba(255,255,255,0.28);
    margin-bottom: 6px;
}
.sidebar-status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 6px rgba(22,163,74,0.5);
    animation: statusBlink 3s infinite;
    flex-shrink: 0;
}
.sidebar-status-dot.offline { background: #94a3b8; box-shadow: none; animation: none; }
@keyframes statusBlink {
    0%, 90% { opacity: 1; }
    95% { opacity: 0.4; }
    100% { opacity: 1; }
}
.sidebar-version { 
    display: inline-block; 
    color: rgba(255,255,255,0.32); 
    font-weight: 500;
    letter-spacing: 0.3px;
}
.sidebar-year { 
    display: inline-block; 
    color: rgba(255,255,255,0.24);
}

/* ================================================================
   5. 主内容区 & 顶栏
   ================================================================ */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: 64px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 1;
    min-width: 0;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.breadcrumb {
    font-size: 12px;
    color: var(--text-lighter);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.date-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg);
}
.date-display svg { color: var(--text-lighter); }

/* ===== 网络状态 + IP ===== */
.net-info {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--bg);
    white-space: nowrap;
    flex-shrink: 0;
}
.net-dot {
    width: 9px; height: 9px; border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}
.net-dot.net-online {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}
.net-dot.net-online::after {
    content: ''; position: absolute; inset: -3px; border-radius: 50%;
    border: 2px solid #22c55e; opacity: 0.5;
    animation: netPulse 1.6s ease-out infinite;
}
.net-dot.net-offline {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.18);
}
.net-ip { font-variant-numeric: tabular-nums; letter-spacing: 0.2px; color: var(--text-light); overflow: visible; flex-shrink: 0; white-space: nowrap; }
.net-text { font-size: 12px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.net-sep { color: var(--text-lighter); margin: 0 6px; opacity: 0.5; flex-shrink: 0; }
.net-date { font-size: 12px; color: var(--text-light); letter-spacing: 0.3px; white-space: nowrap; }
.net-time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: 1px; white-space: nowrap; min-width: 72px; }
@keyframes netPulse {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

.topbar-btn {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: none;
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.topbar-btn:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.badge-dot {
    position: absolute;
    top: 2px; right: 0px;
    min-width: 17px; height: 17px;
    border-radius: 9px;
    background: var(--danger);
    border: 1.5px solid var(--card-bg);
    display: none;
    align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: #fff;
    line-height: 1; padding: 0 4px;
    box-sizing: border-box;
}
.badge-dot.has-unread { display: inline-flex; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 24px;
    background: var(--bg);
    cursor: pointer;
    transition: var(--transition);
}
.user-chip:hover { background: var(--bg-secondary); }

.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.user-role {
    font-size: 11px;
    color: var(--text-lighter);
}

/* ================================================================
   6. 内容容器
   ================================================================ */
.content {
    flex: 1;
    padding: 24px;
    position: relative;
}

/* ================================================================
   7. KPI 卡片 (v3)
   ================================================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card-v3 {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.kpi-card-v3:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.kpi-glow {
    position: absolute;
    top: -40px; right: -40px;
    width: 120px; height: 120px;
    border-radius: 50%;
    opacity: 0.05;
    pointer-events: none;
}
.k-revenue .kpi-glow { background: var(--success); }
.k-expense .kpi-glow { background: var(--danger); }
.k-profit .kpi-glow { background: var(--primary); }
.k-orders .kpi-glow { background: var(--warning); }

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.kpi-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.kpi-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.green { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #16a34a; }
.kpi-icon.red { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #dc2626; }
.kpi-icon.teal { background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #0d9488; }
.kpi-icon.amber { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}
.kpi-value .currency {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-light);
    margin-right: 2px;
}

.kpi-trend {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
}
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend .trend-label { color: var(--text-lighter); }

/* ================================================================
   8. 图表区
   ================================================================ */
.chart-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}
.chart-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.08); }

.chart-card-v3 {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(15,44,76,0.06);
    border: 1px solid var(--border);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-header-v3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.chart-title-v3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.chart-subtitle {
    font-size: 12px;
    color: var(--text-lighter);
    margin-top: 3px;
}

.chart-body {
    position: relative;
    height: 280px;
}
.chart-body.tall { height: 320px; }

/* ================================================================
   9. 表格
   ================================================================ */
.table-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.table-card-v3 {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(15,44,76,0.06);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.table-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}
.table-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.table-header h3::before {
    content: '';
    display: inline-block;
    width: 4px; height: 18px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 2px;
    margin-right: 10px;
    vertical-align: middle;
}

.table-header-v3 {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
}
.table-header-v3 h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    padding: 13px 24px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.3px;
    background: linear-gradient(180deg, rgba(13,148,136,0.08), rgba(13,148,136,0.02));
    border-bottom: 2px solid var(--accent);
}
.data-table td {
    padding: 13px 24px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.2s; }
.data-table tbody tr:hover { background: var(--bg); }

.data-table-v3 {
    width: 100%;
    border-collapse: collapse;
}
.data-table-v3 th {
    text-align: left;
    padding: 13px 24px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.3px;
    background: linear-gradient(180deg, rgba(13,148,136,0.08), rgba(13,148,136,0.02));
    border-bottom: 2px solid var(--accent);
}
.data-table-v3 td {
    padding: 13px 24px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.data-table-v3 tr:last-child td { border-bottom: none; }
.data-table-v3 tbody tr { transition: background 0.2s; }
.data-table-v3 tbody tr:hover { background: var(--bg); }

/* 空状态 */
.empty-state-v3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
}
.empty-state-v3 .empty-icon {
    color: var(--text-lighter);
    margin-bottom: 12px;
}
.empty-state-v3 .empty-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.empty-state-v3 .empty-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* ================================================================
   10. 业务详情头部
   ================================================================ */
.detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.detail-header-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.d-liquor { background: var(--biz-liquor-light); }
.d-computer { background: var(--biz-computer-light); }
.d-ebike { background: var(--biz-ebike-light); }
.d-rooster { background: var(--biz-rooster-light); }
.d-expense { background: var(--biz-expense-light); }

.detail-header-info { flex: 1; }
.detail-header-info h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.detail-header-info p {
    font-size: 13px;
    color: var(--text-light);
}

.detail-header-stats {
    display: flex;
    gap: 32px;
}

/* ================================================================
   11. 筛选栏
   ================================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
}

.filter-bar-v3 {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
    border-radius: 16px;
    margin-bottom: 24px;
}

.filter-select-v3 {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}
.filter-select-v3:hover { border-color: var(--text-lighter); }
.filter-select-v3:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,0.1); }

.search-box-v3 {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    min-width: 180px;
}
.search-box-v3::placeholder { color: var(--text-lighter); }
.search-box-v3:hover { border-color: var(--text-lighter); }
.search-box-v3:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,148,136,0.1); }

/* ================================================================
   12. 按钮
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 12px rgba(13,148,136,0.2);
}
.btn-primary:hover {
    box-shadow: 0 6px 18px rgba(13,148,136,0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-outline-v3 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.btn-outline-v3:hover { border-color: var(--primary); color: var(--primary); }

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(13,148,136,0.25);
    transition: var(--transition);
    padding: 9px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-gradient:hover {
    box-shadow: 0 6px 20px rgba(13,148,136,0.4);
    transform: translateY(-1px);
}
.btn-gradient:active { transform: translateY(0); }

/* ================================================================
   13. 标签 & 状态
   ================================================================ */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}
.tag-income { background: #dcfce7; color: #16a34a; }
.tag-expense { background: #fee2e2; color: #dc2626; }
.tag-liquor { background: var(--biz-liquor-light); color: var(--biz-liquor); }
.tag-computer { background: var(--biz-computer-light); color: var(--biz-computer); }
.tag-ebike { background: var(--biz-ebike-light); color: var(--biz-ebike); }
.tag-rooster { background: var(--biz-rooster-light); color: var(--biz-rooster); }

.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: middle;
}
.status-dot.completed { background: #16a34a; box-shadow: 0 0 6px rgba(22,163,74,0.35); }
.status-dot.processing { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.35); }
.status-dot.pending { background: #94a3b8; }

.amount-positive { color: var(--success); font-weight: 600; }
.amount-negative { color: var(--danger); font-weight: 600; }

/* ================================================================
   14. 表单
   ================================================================ */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light, #64748b);
    margin-bottom: 5px;
}

.form-field {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text);
    outline: none;
}
.form-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
}
.form-field[type="number"] { -moz-appearance: textfield; }
.form-field[type="number"]::-webkit-inner-spin-button,
.form-field[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none; margin: 0;
}
.form-field:hover { border-color: #cbd5e1; }

/* 新增弹窗：四竖排字段布局 */
.form-grid-4col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    column-gap: 14px;
    row-gap: 0;
}
.form-group.full-width { grid-column: 1 / -1; }
@media (max-width: 720px) {
    .form-grid-4col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .form-grid-4col { grid-template-columns: 1fr; }
}
.modal-title-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 3px;
    margin-right: 10px;
    vertical-align: middle;
}

/* 图片上传区 */
.img-upload-area {
    width: 100%;
    height: 120px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border 0.2s;
    position: relative;
    overflow: hidden;
}
.img-upload-area:hover { border-color: var(--primary); }
.img-upload-area.has-image { border-style: solid; }
.img-upload-area img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.img-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-lighter);
    font-size: 13px;
}
.img-upload-placeholder svg { width: 28px; height: 28px; }

/* ================================================================
   15. 弹窗系统 (Modal)
   ================================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 28px 32px;
    width: 720px;
    max-width: 96vw;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(15,23,42,0.30), 0 0 0 1px rgba(255,255,255,0.05) inset;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.3s cubic-bezier(.16,1,.3,1), opacity 0.3s;
    opacity: 0;
}
.modal-backdrop.show .modal-container { transform: translateY(0) scale(1); opacity: 1; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-light, #f0f0f0);
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    letter-spacing: -0.01em;
}

.modal-close {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.modal-close:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }

.modal-body { margin-bottom: 22px; }

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 18px;
    margin-top: 4px;
    border-top: 1px solid var(--border-light, #f0f0f0);
}
.modal-footer .btn {
    padding: 9px 22px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
}

/* ================================================================
   16. 确认弹窗 (Confirm Dialog)
   ================================================================ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 28px;
    width: 400px;
    max-width: 92vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: translateY(10px);
    transition: transform 0.25s;
}
.confirm-overlay.show .confirm-dialog { transform: translateY(0); }

.confirm-dialog-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.confirm-dialog-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
}
.confirm-dialog-icon svg { width: 30px; height: 30px; }

.confirm-dialog-body {
    text-align: center;
    margin-bottom: 24px;
}

.confirm-dialog-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.confirm-dialog-msg {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

.confirm-dialog-detail {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--bg);
    font-size: 12px;
    color: var(--text-light);
}

.confirm-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn-cancel {
    flex: 1;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.confirm-btn-cancel:hover { background: var(--bg); }

.confirm-btn-delete {
    flex: 1;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(220,38,38,0.3);
    transition: var(--transition);
}
.confirm-btn-delete:hover {
    box-shadow: 0 6px 20px rgba(220,38,38,0.4);
    transform: translateY(-1px);
}
.confirm-btn-delete svg { width: 16px; height: 16px; }

/* ================================================================
   17. Toast 提示
   ================================================================ */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    background: var(--text);
    color: #fff;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 13.5px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    font-weight: 500;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: #d97706; }
.toast.info { background: var(--info); }

/* ================================================================
   18. 启动加载画面 (Boot Screen)
   ================================================================ */
.boot-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 80% at 10% 20%, rgba(255,236,179,0.70) 0%, transparent 55%),
        radial-gradient(ellipse 80% 60% at 90% 80%, rgba(252,228,214,0.65) 0%, transparent 50%),
        radial-gradient(ellipse 60% 50% at 75% 15%, rgba(243,226,245,0.50) 0%, transparent 50%),
        linear-gradient(135deg, #FFFDF5 0%, #FFF8E7 20%, #FFEFD5 42%, #FCE4EC 65%, #F3E5F5 85%, #EDE7F6 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.boot-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* 背景光斑装饰 */
.boot-overlay::before {
    content: '';
    position: absolute;
    width: 360px; height: 360px;
    top: -60px; right: -40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,185,66,0.15), rgba(255,180,200,0.08), transparent);
    filter: blur(48px);
    animation: bootGlowFloat 8s ease-in-out infinite;
    pointer-events: none;
}
.boot-overlay::after {
    content: '';
    position: absolute;
    width: 280px; height: 280px;
    bottom: -40px; left: -30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196,160,240,0.12), rgba(167,200,240,0.06), transparent);
    filter: blur(44px);
    animation: bootGlowFloat2 10s ease-in-out infinite;
    pointer-events: none;
}
@keyframes bootGlowFloat {
    0%,100% { transform: translate(0,0) scale(1); }
    50%     { transform: translate(-20px,18px) scale(1.08); }
}
@keyframes bootGlowFloat2 {
    0%,100% { transform: translate(0,0) scale(1); }
    50%     { transform: translate(16px,-14px) scale(1.1); }
}

.boot-bg-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.boot-particle {
    position: absolute;
    border-radius: 50%;
    animation: bootParticleFloat 4s ease-in-out infinite;
}
@keyframes bootParticleFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.55; }
    50% { transform: translateY(-24px) scale(1.15); opacity: 0.9; }
}

.boot-card {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 420px;
    max-width: 92vw;
    padding: 42px 36px 34px;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-radius: 24px;
    box-shadow:
        0 4px 32px rgba(74,52,41,0.08),
        0 1px 4px rgba(74,52,41,0.04),
        inset 0 1px 0 rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.65);
}

.boot-logo-area {
    margin-bottom: 22px;
}

.boot-logo-img {
    width: 72px; height: 72px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow:
        0 8px 28px rgba(245,185,66,0.35),
        0 2px 8px rgba(0,0,0,0.08);
    border: 3px solid rgba(255,255,255,0.9);
    animation: bootLogoPulse 3s ease-in-out infinite;
}
@keyframes bootLogoPulse {
    0%, 100% { box-shadow: 0 8px 28px rgba(245,185,66,0.35), 0 2px 8px rgba(0,0,0,0.08), 0 0 0 0 rgba(245,185,66,0.15); }
    50%     { box-shadow: 0 8px 40px rgba(245,185,66,0.45), 0 2px 8px rgba(0,0,0,0.08), 0 0 0 10px rgba(245,185,66,0); }
}

.boot-title {
    font-size: 23px;
    font-weight: 800;
    color: #4A3429;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.boot-subtitle {
    font-size: 13px;
    color: rgba(74,52,41,0.45);
    margin-bottom: 28px;
}

.boot-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
    text-align: left;
}

.boot-step {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 13px;
    border-radius: 11px;
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(200,190,178,0.25);
    opacity: 0.38;
    transition: all 0.35s ease;
}
.boot-step.active {
    opacity: 1;
    background: rgba(255,250,235,0.85);
    border-color: rgba(245,185,66,0.35);
    box-shadow: 0 2px 10px rgba(245,185,66,0.08);
}
.boot-step.done {
    opacity: 0.72;
    background: rgba(245,255,230,0.6);
    border-color: rgba(168,214,96,0.3);
}

.boot-step-icon {
    width: 26px; height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boot-step-spinner {
    width: 17px; height: 17px;
    border: 2px solid rgba(74,52,41,0.1);
    border-top-color: #D4A843;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.boot-step-label {
    flex: 1;
    font-size: 13px;
    color: rgba(74,52,41,0.62);
    font-weight: 500;
}
.boot-step.done .boot-step-label { color: rgba(74,52,41,0.78); }

.boot-step-check {
    display: none;
    align-items: center;
    justify-content: center;
}
.boot-step.done .boot-step-check { display: flex; }
.boot-step.done .boot-step-icon { display: none; }

.boot-progress-wrap {
    width: 100%;
    height: 5px;
    background: rgba(200,190,178,0.2);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.boot-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #F5C842, #F5B942);
    border-radius: 5px;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(245,200,66,0.3);
}

.boot-status {
    font-size: 12px;
    color: rgba(74,52,41,0.35);
    text-align: center;
    min-height: 18px;
}
.boot-status.ready {
    color: #B8942A;
    font-weight: 600;
}

/* ================================================================
   19. 安全进入 Toast (Security Toast)
   ================================================================ */
.security-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.security-toast.show {
    opacity: 1;
    transform: translateX(0);
}
.security-toast.hide {
    opacity: 0;
    transform: translateX(20px);
}

.security-toast-icon {
    width: 36px; height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.security-toast-body { flex: 1; }

.security-toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.security-toast-ip {
    font-size: 12px;
    color: var(--text-light);
    font-family: monospace;
}

/* ================================================================
   20. 待办事项 (Todo)
   ================================================================ */
.todo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.todo-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.todo-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.todo-title svg { width: 20px; height: 20px; color: var(--primary); }

.todo-progress {
    font-size: 12px;
    color: var(--text-lighter);
    padding: 3px 10px;
    background: var(--bg);
    border-radius: 12px;
    font-weight: 500;
}

.todo-header-right { display: flex; gap: 8px; }

.todo-empty {
    text-align: center;
    padding: 40px 20px;
}

.todo-empty-icon {
    font-size: 42px;
    opacity: 0.3;
    margin-bottom: 12px;
}

.todo-empty-text {
    font-size: 14px;
    color: var(--text-lighter);
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg);
    transition: var(--transition);
}
.todo-item:hover { background: var(--bg-secondary); }
.todo-item.done { opacity: 0.5; }
.todo-item.done .todo-text { text-decoration: line-through; }

.todo-check {
    width: 22px; height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    margin-top: 1px;
}
.todo-check:hover { border-color: var(--primary); }
.todo-check.checked {
    background: var(--primary);
    border-color: var(--primary);
}
.todo-check svg {
    width: 14px; height: 14px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.15s;
}
.todo-check.checked svg { opacity: 1; }

.todo-content { flex: 1; min-width: 0; }

.todo-text {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    word-break: break-word;
}

.todo-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
}

.todo-prio-high { color: var(--danger); font-weight: 600; }
.todo-prio-normal { color: var(--warning); font-weight: 600; }
.todo-prio-low { color: var(--success); font-weight: 600; }

.todo-note {
    color: var(--text-lighter);
    padding-left: 8px;
    border-left: 2px solid var(--border);
}

.todo-delete-btn {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-lighter);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}
.todo-delete-btn:hover { background: #fee2e2; color: var(--danger); }
.todo-delete-btn svg { width: 16px; height: 16px; }

.todo-progress-bar-wrap {
    margin-top: 16px;
}

.todo-progress-bar {
    width: 100%;
    height: 5px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.todo-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ================================================================
   21. 商品管理 (Product Manager)
   ================================================================ */
.product-card {
    background: var(--bg);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.product-card-img {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }

.no-img {
    font-size: 36px;
    color: var(--text-lighter);
}

.product-card-body { margin-bottom: 8px; }

.product-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.product-card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}
.product-card-price .unit {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-lighter);
    margin-left: 2px;
}

.product-card-delete {
    position: absolute;
    top: 8px; right: 8px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    color: var(--text-lighter);
}
.product-card:hover .product-card-delete { opacity: 1; }
.product-card-delete:hover { background: #fee2e2; color: var(--danger); }
.product-card-delete svg { width: 16px; height: 16px; }

.add-product-card {
    border: 2px dashed var(--border);
    border-radius: 12px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-lighter);
}
.add-product-card:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(13,148,136,0.03);
}

.plus-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 300;
    transition: var(--transition);
}
.add-product-card:hover .plus-icon {
    background: var(--primary);
    color: #fff;
}

/* 商品快速选择 (Sale Modal) */
.product-search-wrap {
    display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
    background: var(--bg-secondary, #f1f5f9);
    border-radius: 10px; padding: 6px 12px;
    border: 1px solid var(--border);
}
.product-search-icon {
    width: 18px; height: 18px; flex-shrink: 0; opacity: .45;
    transition: opacity .2s;
}
.product-search-wrap:focus-within .product-search-icon { opacity: .75; }
.product-search-input {
    flex: 1; min-width: 0;
    padding: 7px 0;
    border: none;
    border-radius: 0;
    font-size: 13px;
    font-family: inherit;
    background: transparent;
    color: var(--text);
    outline: none;
}
.product-search-input::placeholder { color: var(--text-muted); }
.product-search-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.08);
}
.product-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding: 6px 2px;
}

.product-pick-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 140px;
}
.product-pick-chip:hover { border-color: var(--primary); background: rgba(13,148,136,0.04); transform: translateY(-1px); }
.product-pick-chip.disabled {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(100%);
    background: var(--bg-secondary, #f1f5f9);
    border-style: dashed;
    transform: none;
}
.product-pick-chip.disabled:hover { border-color: var(--border); background: var(--bg-secondary, #f1f5f9); transform: none; }
.product-pick-chip.selected {
    border-color: var(--primary);
    background: rgba(13,148,136,0.08);
    box-shadow: 0 2px 8px rgba(13,148,136,0.15);
}

.product-pick-thumb {
    width: 38px; height: 38px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.product-pick-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-pick-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-pick-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.product-pick-price {
    font-size: 13px;
    color: var(--primary);
    font-weight: 700;
}

.product-pick-stock {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #16a34a;
    background: rgba(22,163,74,0.1);
    padding: 1px 7px;
    border-radius: 6px;
    margin-left: 5px;
    vertical-align: middle;
}
.product-pick-stock.stock-empty {
    color: #dc2626;
    background: rgba(220,38,38,0.08);
}

/* ====== 客户选择器（搜索 + 自定义输入） ====== */
.customer-select-wrap {
    grid-column: 1 / -1;
    position: relative;
}
.customer-select-wrap .product-search-input {
    width: 100%;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--card-bg, #fff);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13.5px;
    transition: border-color .2s, box-shadow .2s;
}
.customer-select-wrap .product-search-input:focus {
    border-color: var(--primary, #0d9488);
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
    outline: none;
}
.cust-suggest-box {
    display: none;
    position: absolute;
    left: 0; right: 0; top: calc(100% + 4px);
    z-index: 50;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
}
.cust-suggest-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 10px; cursor: pointer;
    transition: background .15s;
}
.cust-suggest-item:hover { background: rgba(13,148,136,.07); }
.cust-suggest-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg,var(--primary,#0d9488),#0f766e);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(13,148,136,.25);
}
.cust-suggest-info { display: flex; flex-direction: column; gap: 2px; }
.cust-suggest-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; }
.cust-suggest-phone { font-size: 11.5px; color: var(--text-muted); }

.product-pick-empty-card {
    width: 100%;
    text-align: center;
    padding: 24px 16px;
    border-radius: 10px;
    border: 1px dashed var(--border);
    background: var(--bg);
}

.product-pick-empty-icon {
    font-size: 32px;
    opacity: 0.4;
    margin-bottom: 8px;
}

.product-pick-empty-text {
    font-size: 13px;
    color: var(--text-lighter);
    margin-bottom: 8px;
}

/* ================================================================
   22. 快捷键面板 (Shortcuts Modal)
   ================================================================ */
.shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.shortcuts-overlay { opacity: 1; visibility: visible; }

.shortcuts-dialog {
    background: var(--card-bg);
    border-radius: 16px;
    width: 920px;
    max-width: 92vw;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

.shortcuts-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.shortcuts-dialog-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.shortcuts-close {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.shortcuts-close:hover { background: var(--bg-secondary); color: var(--danger); }

.shortcuts-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px 24px;
}

.shortcuts-section {
    margin-bottom: 16px;
    min-width: 0;
}

.shortcuts-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.shortcut-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
}

.s-icon {
    display: none;
}

.shortcut-keys {
    display: flex;
    align-items: center;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 26px;
    padding: 0 6px;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: inherit;
}
kbd.highlight {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-dark);
}

.shortcuts-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.shortcuts-footer-hint {
    font-size: 12px;
    color: var(--text-lighter);
    display: flex;
    align-items: center;
    gap: 6px;
}

.shortcuts-hint-badge {
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    padding: 0 4px;
}

/* 快捷键面板窄屏回退 */
@media (max-width: 1024px) {
    .shortcuts-body { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .shortcuts-body { grid-template-columns: 1fr; }
    .shortcuts-dialog { width: 94vw; }
}

/* 快捷键操作 Toast */
.shortcut-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    animation: shortcutToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.shortcut-toast kbd {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}
@keyframes shortcutToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ================================================================
   23. 更新日志弹窗 (Changelog Modal)
   ================================================================ */
.changelog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.changelog-overlay { opacity: 1; visibility: visible; }

.changelog-dialog {
    background: var(--card-bg);
    border-radius: 16px;
    width: 520px;
    max-width: 92vw;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

/* 操作手册弹窗加宽（三竖排） */
#manualModal .changelog-dialog {
    width: 920px;
}
@media (max-width: 1024px) {
    #manualModal .changelog-dialog { width: 92vw; }
    .manual-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .manual-grid { grid-template-columns: 1fr; gap: 18px; }
}

.changelog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.changelog-header-left {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.changelog-close {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.changelog-close:hover { background: var(--bg-secondary); color: var(--danger); }

/* ---- 语音播报设置弹窗 ---- */
.voice-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.voice-row.column { flex-direction: column; align-items: stretch; }
.voice-row:last-child { border-bottom: none; }
.voice-row-main { padding-right: 12px; }
.voice-row-title { font-size: 15px; font-weight: 600; color: var(--text); }
.voice-row-desc { font-size: 12.5px; color: var(--text-light); margin-top: 3px; }
.voice-group-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--text-light);
    margin: 18px 0 2px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}
.cat-row { padding: 12px 0; }
.cat-row .voice-row-title { font-size: 14px; }
.cat-row .voice-row-desc { font-size: 12px; }
.voice-rate-val { color: var(--accent); font-weight: 700; font-size: 13px; }

/* 开关 */
.voice-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.voice-switch input { opacity: 0; width: 0; height: 0; }
.voice-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--border); border-radius: 26px; transition: .25s;
}
.voice-slider:before {
    content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: .25s; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.voice-switch input:checked + .voice-slider { background: var(--accent); }
.voice-switch input:checked + .voice-slider:before { transform: translateX(20px); }

/* 音色选择 + 试听 */
.voice-select-wrap { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.voice-select {
    flex: 1; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font-size: 14px;
}
.voice-test {
    padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); cursor: pointer; font-size: 14px; white-space: nowrap; transition: .2s;
}
.voice-test:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 语速滑块 */
.voice-range { width: 100%; margin-top: 10px; accent-color: var(--accent); }

/* 提示卡 */
.voice-tip {
    margin-top: 18px; padding: 14px 16px; border-radius: 12px;
    background: rgba(13,148,136,0.08); border: 1px solid rgba(13,148,136,0.2);
}
.voice-tip-title { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.voice-tip-body { font-size: 12.5px; color: var(--text-light); line-height: 1.6; }
.voice-tip-body b { color: var(--text); }

.changelog-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.changelog-version {
    margin-bottom: 24px;
}

.changelog-ver-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.changelog-ver-tag {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(13,148,136,0.1);
}

.changelog-ver-date {
    font-size: 12px;
    color: var(--text-lighter);
}

.changelog-ver-list {
    list-style: none;
    padding-left: 0;
}

.changelog-ver-list li {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}
.changelog-ver-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 11px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--text-lighter);
}

.changelog-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    text-align: center;
    font-size: 12px;
    color: var(--text-lighter);
}

/* 操作手册：三竖排网格 */
.manual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 22px 24px;
    align-items: start;
}
.manual-grid .changelog-version { margin-bottom: 0; }

/* 操作手册章节标题 */
.manual-sec-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}
.manual-sec-icon { display: none; }

/* ================================================================
   24. 动画
   ================================================================ */
.anim-fade-up {
    animation: animFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes animFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.anim-stagger > * {
    animation: animFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* 刷新时禁用入场动画，避免内容重新上移（同会话非首次访问时由页面 <head> 脚本加 .no-enter） */
.no-enter .fade-in-up,
.no-enter .anim-fade-up,
.no-enter .anim-stagger > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* ================================================================
   25. Tooltip (data-tooltip) — 已全局禁用
   ================================================================ */
[data-tooltip]::after {
    display: none !important;
}

/* ================================================================
   26. 响应式
   ================================================================ */
@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-grid { grid-template-columns: 1fr; }
    .detail-header-stats { gap: 20px; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main {
        margin-left: 0;
    }
    /* 移动端抽屉式导航，不使用折叠按钮 */
    .sidebar-collapse-btn { display: none; }
    body.sidebar-collapsed .sidebar { width: var(--sidebar-width); }
    body.sidebar-collapsed .main { margin-left: 0; }
    .kpi-grid { grid-template-columns: 1fr; }
    .detail-header {
        flex-direction: column;
        text-align: center;
    }
    .detail-header-stats {
        justify-content: center;
    }
    .topbar-right .date-display { display: none; }
    .user-chip > div:last-child { display: none; }
}

/* ================================================================
   28. 移动端适配（手机访问）
   ================================================================ */

/* 表格横向滚动容器（所有屏通用，桌面下不触发滚动） */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 汉堡按钮：默认隐藏，窄屏才显示 */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    border: none; background: rgba(15,23,42,0.06);
    color: #0f172a;
    border-radius: 10px;
    cursor: pointer;
    margin-right: 2px;
    flex-shrink: 0;
    transition: background .2s;
}
.hamburger-btn:active { background: rgba(15,23,42,0.14); }

/* 抽屉遮罩 */
.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.45);
    z-index: 95;
    opacity: 0;
    transition: opacity .25s ease;
    -webkit-tap-highlight-color: transparent;
}
body.nav-open .nav-backdrop { display: block !important; opacity: 1 !important; }
body.nav-open .sidebar {
    transform: translateX(0) !important;
    box-shadow: 8px 0 40px rgba(0,0,0,0.28);
}

@media (max-width: 768px) {
    /* 显示汉堡按钮 */
    .hamburger-btn { display: inline-flex; width: 48px; height: 48px; background: rgba(15,23,42,0.08); border-radius: 12px; }

    /* 侧边栏抽屉 */
    .sidebar {
        width: 270px;
        max-width: 86vw;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(8,20,40,0.18);
    }
    .sidebar .logo, .sidebar .nav-item { min-height: 46px; }

    /* 新增元素移动端适配 */
    .sidebar-logo-glow { display: none; } /* 手机端省掉光晕动画 */
    .sidebar-right-glow { display: none; }
    .nav-badge {
        min-width: 18px; height: 18px;
        font-size: 9.5px;
        padding: 0 5px;
        line-height: 18px;
    }
    .sidebar-status-row { flex-wrap: wrap; gap: 4px; }
    .sidebar-footer { padding: 10px 14px 12px; }

    /* 顶栏收紧 */
    .topbar { height: 56px; padding: 0 12px; justify-content: flex-start; }
    .topbar-right { gap: 6px; margin-left: auto; flex-shrink: 0; }
    .topbar-left { gap: 6px; margin-left: 2px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
    .page-title { font-size: 16px; max-width: 100%; }
    .net-info { display: none; }
    .page-title { font-size: 16px; max-width: 54vw; }
    .breadcrumb { display: none; }

    /* 内容区边距收紧 */
    .content { padding: 10px 12px !important; overflow-x: hidden; }
    .card, .table-card, .chart-card, .stat-card-item,
    .kpi-card, .panel, .alert-card, .table-card-v2, .biz-card-v2 { margin-bottom: 10px !important; }
    .card { padding: 14px; }

    /* 确保主区域可滚动 */
    html, body { overflow-x: hidden; }
    .main { min-height: auto; }

    /* 表格：横向滚动 + 首列吸顶 + 触控友好 */
    table.data-table {
        width: auto;
        min-width: 100%;
        white-space: nowrap;
    }
    table.data-table th,
    table.data-table td {
        padding: 12px 14px;
        font-size: 13px;
    }
    table.data-table th:first-child,
    table.data-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: var(--card-bg);
        box-shadow: 1px 0 0 var(--border);
    }
    /* 表格内操作/状态按钮加大 */
    .btn-sm { min-height: 38px; font-size: 13px; padding: 8px 14px; border-radius: 10px; }

    /* 筛选栏换行铺满 */
    .filter-bar-v3 { padding: 12px; gap: 10px; }
    .filter-select-v3, .search-box-v3 {
        flex: 1 1 auto;
        min-width: 140px;
        font-size: 14px;
        min-height: 44px;
    }
    .search-box-v3 input { font-size: 14px; }

    /* 按钮触控区加大（通用） */
    .btn, .btn-outline-v3, .gradient-btn, .topbar-btn {
        min-height: 44px;
        font-size: 15px;
    }
    .gradient-btn { padding: 10px 18px; }

    /* 弹窗：底部抽屉式（bottom sheet） */
    .modal-backdrop { align-items: flex-end; padding: 0; }
    .modal-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0;
        border-radius: 18px 18px 0 0;
        max-height: 94vh;
        padding-top: 0;
    }
    /* 顶部抓手条（提示可下滑关闭） */
    .modal-container::before {
        content: '';
        display: block;
        width: 42px; height: 4px; border-radius: 4px;
        background: var(--border);
        margin: 9px auto 4px;
        flex-shrink: 0;
    }
    .modal-header { padding: 12px 18px; align-items: center; }
    .modal-header h3 { font-size: 17px; }
    .modal-close { width: 38px; height: 38px; font-size: 24px; }
    .modal-body {
        max-height: calc(94vh - 140px);
        overflow-y: auto;
        padding: 18px 16px;
        -webkit-overflow-scrolling: touch;
    }
    .modal-footer {
        flex-direction: column;
        gap: 12px;
        padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
    }
    .modal-footer .btn, .modal-footer button {
        width: 100%;
        min-height: 50px;
        font-size: 16px;
        border-radius: 12px;
    }

    /* 弹窗表单字段：触控友好（字号 16px 防 iOS 自动缩放） */
    .form-group { margin-bottom: 16px; }
    .form-group label { display: block; font-size: 14px; margin-bottom: 8px; }
    .form-field {
        width: 100%;
        height: 48px;
        min-height: 48px;
        padding: 0 14px;
        font-size: 16px;
        border-radius: 12px;
        box-sizing: border-box;
    }
    textarea.form-field { height: auto; padding: 12px 14px; font-size: 16px; }
    select.form-field { padding-right: 38px; }

    /* 客户/商品搜索输入框 */
    .product-search-wrap {
        position: relative;
        min-height: 48px;
        border-radius: 12px;
        padding: 6px 14px;
    }
    .product-search-input { font-size: 16px; padding: 8px 0; }

    /* 客户选择器下拉 */
    .customer-select-wrap { position: relative; }
    .cust-suggest-box {
        z-index: 60;
        max-height: 240px;
        border: 1px solid var(--border);
    }
    .cust-suggest-item {
        min-height: 54px;
        padding: 12px 14px;
        font-size: 15px;
    }
    .cust-suggest-avatar { width: 36px; height: 36px; font-size: 15px; }
    .cust-suggest-name { font-size: 15px; }
    .cust-suggest-phone { font-size: 12.5px; }

    /* 商品选择 chip */
    .product-picker { max-height: 260px; }
    .product-pick-chip {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 12px;
        min-width: 0;
        flex: 1 1 calc(50% - 10px);
    }
    .product-pick-chip.disabled { opacity: .65; }
    .product-pick-thumb { width: 42px; height: 42px; }

    /* 标签页横向滚动 */
    .biz-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .biz-tab { flex: 0 0 auto; min-width: 100px; min-height: 44px; }

    /* 统计卡 / KPI 网格 */
    .stat-cards-row { grid-template-columns: 1fr !important; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-header-v3 { padding: 18px 16px; }
    .chart-grid { grid-template-columns: 1fr; gap: 14px; }
    .chart-body { height: 240px; }

    /* 商品网格 4 列 -> 2 列 */
    .form-grid-4col { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }

    /* 通知面板：手机端居中弹窗（全屏遮罩+居中卡片） */
    .notify-panel {
        position: fixed !important;
        top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
        width: 100vw !important; max-width: none !important;
        height: 100vh;
        margin: 0 !important;
        border-radius: 0 !important;
        background: rgba(15,23,42,0.5) !important;
        z-index: 99999 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }
    .notify-mobile-card {
        background: var(--card-bg);
        border-radius: 20px;
        width: 92vw;
        max-width: 400px;
        max-height: 75vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    }
    .notify-panel-header { padding: 14px 18px 10px; }
    .notify-panel-title { font-size: 15px; }
    .notify-list { max-height: calc(75vh - 110px); }
    .notify-item { padding: 12px 14px; min-height: 60px; }
    .notify-item-text { font-size: 13px; }
    .notify-item-time { font-size: 11px; }
    .notify-view-btn { padding: 5px 12px; font-size: 11.5px; }
    .notify-footer { padding: 10px 16px; }

    /* 表格空状态缩小 */
    .table-empty-state { padding: 32px 16px; }
    .table-empty-state .empty-icon-float { font-size: 34px; margin-bottom: 8px; }
}

@media (max-width: 480px) {
    .page-title { font-size: 15px; }
    .content { padding: 12px 10px !important; }
    .card { padding: 14px; }
    .kpi-grid { grid-template-columns: 1fr; }
    .product-grid-v2 { grid-template-columns: 1fr !important; }
    .pkpi-grid { grid-template-columns: 1fr !important; }
    .table-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .table-actions { width: 100%; display: flex; gap: 8px; }
    .table-actions .btn-outline-v3,
    .table-actions .gradient-btn { flex: 1; justify-content: center; min-height: 44px; }
    table.data-table th,
    table.data-table td { padding: 10px 11px; font-size: 12px; }
    .modal-footer { flex-direction: column; gap: 10px; }
    .modal-footer .btn, .modal-footer button { width: 100%; min-height: 48px; }
    /* 小屏再收紧表单与选择器 */
    .form-field { height: 46px; min-height: 46px; }
    .product-search-wrap { min-height: 46px; }
    .product-pick-chip { flex: 1 1 100%; }
    .form-grid-4col { grid-template-columns: 1fr !important; }
    .biz-tab { min-width: 84px; }
}

/* ================================================================
   27. 通知中心下拉面板
   ================================================================ */
.notify-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: -8px;
    width: 360px;
    max-width: 92vw;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.02);
    z-index: 9998;
    opacity: 0; transform: translateY(-8px) scale(0.96);
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.notify-panel.open {
    opacity: 1; transform: translateY(0) scale(1);
    visibility: visible;
}
.notify-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.notify-panel-title {
    font-size: 15px; font-weight: 700; color: var(--text-main);
    display: flex; align-items: center; gap: 6px;
}
.notify-panel-badge {
    background: var(--danger);
    color: #fff; font-size: 11px; font-weight: 700;
    padding: 2px 7px; border-radius: 10px; min-width: 20px; text-align: center;
}
.notify-panel-close {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 4px; border-radius: 6px; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.notify-panel-close:hover { color: var(--danger); background: var(--bg); }
.notify-list {
    max-height: 340px; overflow-y: auto; padding: 4px 0;
}
.notify-list::-webkit-scrollbar { width: 4px; }
.notify-list::-webkit-scrollbar-track { background: transparent; }
.notify-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.notify-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 16px; margin: 0 6px; border-radius: 12px;
    cursor: pointer; transition: all 0.25s ease; position: relative;
    border-left: 3px solid transparent;
}
.notify-item:hover { background: var(--bg); border-color: var(--border); }

/* ===== 未读通知（醒目样式） ===== */
.notify-item.unread {
    background: rgba(16,185,129,0.06);
    border-left-color: #10b981;
}
.notify-item.unread:hover { background: rgba(16,185,129,0.1); }
/* 未读圆点：加大 + 发光 */
.notify-item.unread .notify-dot {
    width: 9px; height: 9px; margin-top: 5px;
    box-shadow: 0 0 6px currentColor;
}
/* 未读文字：加粗 + 鲜明 */
.notify-item.unread .notify-msg {
    font-weight: 600; color: #1e293b;
}

/* ===== 已读通知（淡化样式） ===== */
.notify-item:not(.unread) .notify-dot {
    width: 6px; height: 6px; margin-top: 7px;
    opacity: 0.35;
    background: #94a3b8 !important;
    box-shadow: none;
}
.notify-item:not(.unread) .notify-msg {
    font-weight: 400; color: #94a3b8 !important;
}
.notify-item:not(.unread) .notify-time {
    color: #cbd5e1;
}

/* 已读项右侧显示"已读"小标签 */
.notify-item:not(.unread)::after {
    content: '✓';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #10b981;
    font-weight: 600;
    opacity: 0.6;
}
.notify-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px;
}
.notify-dot.info { background: var(--primary); }
.notify-dot.success { background: var(--success); }
.notify-dot.warning { background: var(--warning); }
.notify-dot.danger { background: var(--danger); }
.notify-body { flex: 1; min-width: 0; }
.notify-msg {
    font-size: 13px; color: var(--text-main); line-height: 1.5;
    word-break: break-word; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    text-align: left;
}
.notify-time {
    font-size: 11px; color: var(--text-muted); margin-top: 4px;
    text-align: left;
}
.notify-empty {
    text-align: center; padding: 40px 20px;
}
.notify-empty svg {
    width: 48px; height: 48px; color: var(--border); margin-bottom: 10px;
}
.notify-empty p { font-size: 13px; color: var(--text-muted); }
.notify-actions {
    display: flex; gap: 0; border-top: 1px solid var(--border);
    padding: 8px 10px; background: var(--bg);
}
.notify-actions button {
    flex: 1; padding: 8px 12px; border: none; background: transparent;
    font-size: 12px; font-weight: 500; color: var(--text-muted); cursor: pointer;
    border-radius: 8px; transition: var(--transition); text-align: center;
}
.notify-actions button:hover { background: var(--card-bg); color: var(--text-main); }
.notify-actions button.primary { color: var(--primary); }
.notify-actions button.danger { color: var(--danger); }
.notify-view-btn {
    flex-shrink: 0; align-self: center; margin-left: 8px;
    padding: 5px 12px; font-size: 11px; font-weight: 500;
    color: var(--primary); background: rgba(13,148,136,0.08);
    border-radius: 20px; text-decoration: none; white-space: nowrap;
    transition: all .2s;
}
.notify-view-btn:hover { color: #fff; background: var(--primary); }

/* 铃铛未读计数 */
.badge-count {
    position: absolute;
    top: 4px; right: 4px;
    min-width: 16px; height: 16px;
    background: var(--danger);
    color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 8px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--card-bg);
    box-shadow: 0 2px 6px rgba(220,38,38,0.3);
}

/* ================================================================
   28. 主题设置下拉面板
   ================================================================ */
.theme-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: -8px;
    width: 280px;
    max-width: 92vw;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.02);
    z-index: 9998;
    opacity: 0; transform: translateY(-8px) scale(0.96);
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
    overflow: hidden;
}
.theme-panel.open {
    opacity: 1; transform: translateY(0) scale(1);
    visibility: visible;
}
.theme-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.theme-panel-title {
    font-size: 15px; font-weight: 700; color: var(--text-main);
    display: flex; align-items: center; gap: 6px;
}
.theme-panel-close {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 4px; border-radius: 6px; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.theme-panel-close:hover { color: var(--danger); background: var(--bg); }
.theme-section {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-light);
}
.theme-section:last-child { border-bottom: none; }
.theme-section-label {
    font-size: 12px; font-weight: 700; color: var(--text-lighter);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 6px;
}
.theme-options {
    display: flex; gap: 8px;
}
.theme-option {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 8px; padding: 14px 10px; border-radius: 12px;
    border: 2px solid var(--border);
    cursor: pointer; transition: all 0.2s ease;
    background: var(--bg);
}
.theme-option:hover { border-color: var(--text-lighter); }
.theme-option.active {
    border-color: var(--primary);
    background: rgba(13,148,136,0.05);
    box-shadow: 0 0 0 4px rgba(13,148,136,0.06);
}
.theme-option-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}
.theme-option-icon.light { background: #fef9c3; }
.theme-option-icon.dark { background: #1e293b; color: #f1c40f; }
.theme-option-label {
    font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.theme-option.active .theme-option-label { color: var(--primary); }
/* 语言选项 */
.lang-options {
    display: flex; gap: 8px;
}
.lang-option {
    flex: 1; padding: 10px 16px; border-radius: 10px;
    border: 2px solid var(--border);
    cursor: pointer; transition: all 0.2s ease;
    text-align: center; font-size: 13px; font-weight: 600;
    background: var(--bg); color: var(--text-secondary);
}
.lang-option:hover { border-color: var(--text-lighter); }
.lang-option.active {
    border-color: var(--primary);
    background: rgba(13,148,136,0.05);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13,148,136,0.06);
}

/* ================================================================
   29. v4.3 视觉升级 — 全局氛围 / 侧边栏 / 顶栏 / 卡片质感
   ================================================================ */

/* 设计令牌补充 */
:root {
    --shadow-xs: 0 1px 2px rgba(15,44,76,0.04);
    --shadow-sm: 0 1px 3px rgba(15,44,76,0.06), 0 1px 2px rgba(15,44,76,0.04);
    --shadow-md: 0 4px 16px rgba(15,44,76,0.07), 0 2px 6px rgba(15,44,76,0.04);
    --shadow-lg: 0 12px 34px rgba(15,44,76,0.10), 0 4px 12px rgba(15,44,76,0.05);
    --shadow-xl: 0 24px 60px rgba(15,44,76,0.16);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --glass-bg: rgba(255,255,255,0.72);
    --glass-border: rgba(255,255,255,0.55);
    --sidebar-grad: linear-gradient(165deg, #0e3252 0%, #0b2a47 45%, #0a2238 100%);
}

/* ---------- 全局氛围背景（轻盈、不压暗） ---------- */
body {
    background:
        radial-gradient(1100px 620px at 100% -5%, rgba(20,184,166,0.07), transparent 58%),
        radial-gradient(900px 520px at -5% 105%, rgba(2,132,199,0.06), transparent 55%),
        radial-gradient(700px 480px at 60% 40%, rgba(245,158,11,0.03), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

/* ---------- 侧边栏 v5：渐变玻璃 + 多层光晕氛围 ---------- */
.sidebar {
    background: var(--sidebar-grad);
    box-shadow:
        4px 0 28px rgba(8,20,40,0.20),
        0 0 60px rgba(13,148,136,0.04) inset;
    overflow: hidden;
}

/* 顶部主光晕 */
.sidebar::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20,184,166,0.22) 0%, rgba(2,132,199,0.08) 45%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
/* 中部辅助光晕 */
.sidebar::after {
    content: '';
    position: absolute;
    bottom: 120px; left: -40px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,0.06), transparent 65%);
    pointer-events: none;
    z-index: 0;
}
.sidebar > * { position: relative; z-index: 1; }

/* 右侧装饰线 */
.sidebar {
    border-right: none;
}
.sidebar-right-glow {
    position: absolute;
    top: 10%; bottom: 10%;
    right: 0;
    width: 1px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(20,184,166,0.25) 15%,
        rgba(20,184,166,0.35) 35%,
        rgba(2,132,199,0.18) 55%,
        rgba(245,158,11,0.12) 75%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 2;
}

/* ---- 头部增强 ---- */
.sidebar-header {
    border-bottom-color: transparent;
}
.sidebar-logo {
    box-shadow:
        0 4px 16px rgba(20,184,166,0.3),
        0 0 0 1px rgba(255,255,255,0.12);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s ease;
}
.sidebar-logo:hover {
    transform: scale(1.08) rotate(-4deg);
    box-shadow:
        0 6px 24px rgba(20,184,166,0.5),
        0 0 0 1px rgba(255,255,255,0.2),
        0 0 30px rgba(20,184,166,0.15);
}

/* 分区标签增强 */
.nav-section-label {
    color: rgba(255,255,255,0.26);
    letter-spacing: 2px;
}

/* 导航项增强 */
.nav-item {
    position: relative;
    overflow: hidden;
}
.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    width: 3px;
    height: 20px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, var(--accent), #38bdf8);
    transform: translateY(-50%) scaleY(0);
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 0 12px rgba(20,184,166,0.55);
}
.nav-item:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.09) 0%, rgba(255,255,255,0.04) 100%);
    color: #fff;
    transform: translateX(3px);
}
.nav-item.active {
    background: linear-gradient(135deg,
        rgba(13,148,136,0.20) 0%,
        rgba(20,184,166,0.12) 50%,
        rgba(14,165,233,0.08) 100%);
    color: #fff;
    font-weight: 600;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.07),
        0 0 12px rgba(20,184,166,0.06);
}
.nav-item.active::before { transform: translateY(-50%) scaleY(1); }
.nav-item.active .nav-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 7px rgba(20,184,166,0.4));
}

/* 底部状态栏增强 */
.sidebar-footer {
    border-top-color: transparent;
    color: rgba(255,255,255,0.32);
}

/* ---------- 顶栏：玻璃拟态 ---------- */
.topbar {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15,44,76,0.04), 0 8px 26px rgba(15,44,76,0.05);
}
.page-title {
    background: linear-gradient(120deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.date-display {
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.topbar-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}
.topbar-btn:hover {
    background: var(--bg-secondary);
    color: var(--primary);
    border-color: rgba(13,148,136,0.25);
    transform: translateY(-1px);
}

.user-chip {
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}
.user-chip:hover {
    border-color: rgba(13,148,136,0.25);
    background: var(--bg-secondary);
}
.user-avatar {
    box-shadow: 0 2px 8px rgba(13,148,136,0.35);
}

/* ---------- 卡片 / 表格 / 详情：分层阴影 + 悬浮抬升 ---------- */
.kpi-card-v3,
.chart-card,
.chart-card-v3,
.table-card,
.table-card-v3,
.detail-header-v3,
.tab-bar-v2,
.todo-card-v2,
.table-card-v2,
.product-card,
.add-product-card {
    box-shadow: var(--shadow-md);
}
.kpi-card-v3:hover,
.chart-card:hover,
.chart-card-v3:hover,
.table-card:hover,
.table-card-v3:hover,
.detail-header-v3:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.table-card-v2:hover,
.todo-card-v2:hover { box-shadow: var(--shadow-lg); }

/* KPI 顶部高光描边 */
.kpi-card-v3::after {
    content: '';
    position: absolute;
    top: 0; left: 18px; right: 18px;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, rgba(13,148,136,0.35), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.kpi-card-v3:hover::after { opacity: 1; }

/* ---------- 按钮焦点环（可访问性 + 精致感） ---------- */
.btn:focus-visible,
.qa-btn:focus-visible,
.btn-primary:focus-visible,
.btn-gradient:focus-visible,
.btn-outline:focus-visible,
.topbar-btn:focus-visible,
.user-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13,148,136,0.28);
}

/* 滚动条更精致 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* 内容区进入有层次 */
.content { animation: contentFade 0.5s ease both; }
@keyframes contentFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 暗色模式：保持可读、不过黑 ---------- */
body.dark-mode {
    background:
        radial-gradient(1100px 620px at 100% -5%, rgba(20,184,166,0.10), transparent 58%),
        radial-gradient(900px 520px at -5% 105%, rgba(2,132,199,0.08), transparent 55%),
        #0b1220;
    background-attachment: fixed;
}
body.dark-mode .topbar {
    background: rgba(15,23,42,0.66);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom-color: rgba(255,255,255,0.07);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 26px rgba(0,0,0,0.35);
}
body.dark-mode .page-title {
    background: linear-gradient(120deg, #f1f5f9 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.dark-mode .sidebar {
    background: linear-gradient(165deg, #0d1b30 0%, #0a1424 50%, #080f1c 100%);
    box-shadow:
        4px 0 28px rgba(0,0,0,0.55),
        0 0 50px rgba(13,148,136,0.03) inset;
}
body.dark-mode .sidebar::before {
    background: radial-gradient(circle, rgba(20,184,166,0.18) 0%, rgba(2,132,199,0.06) 45%, transparent 70%);
}
body.dark-mode .sidebar::after {
    background: radial-gradient(circle, rgba(245,158,11,0.04), transparent 60%);
}
body.dark-mode .date-display,
body.dark-mode .net-info,
body.dark-mode .topbar-btn,
body.dark-mode .user-chip {
    background: rgba(30,41,59,0.8);
    border-color: rgba(255,255,255,0.08);
}
body.dark-mode .topbar-btn:hover {
    background: rgba(51,65,85,0.9);
    color: var(--accent);
    border-color: rgba(20,184,166,0.3);
}
body.dark-mode .user-chip:hover {
    background: rgba(51,65,85,0.9);
    border-color: rgba(20,184,166,0.3);
}
body.dark-mode .kpi-card-v3,
body.dark-mode .chart-card,
body.dark-mode .chart-card-v3,
body.dark-mode .table-card,
body.dark-mode .table-card-v3,
body.dark-mode .detail-header-v3,
body.dark-mode .tab-bar-v2,
body.dark-mode .todo-card-v2,
body.dark-mode .table-card-v2,
body.dark-mode .product-card,
body.dark-mode .add-product-card {
    box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
body.dark-mode .kpi-card-v3:hover,
body.dark-mode .chart-card:hover,
body.dark-mode .chart-card-v3:hover,
body.dark-mode .table-card:hover,
body.dark-mode .table-card-v3:hover,
body.dark-mode .detail-header-v3:hover {
    box-shadow: 0 16px 44px rgba(0,0,0,0.55);
}

/* ---------- 暗色模式：v2 组件全覆盖（仪表盘+业务页） ---------- */

/* KPI 卡片 v2 */
body.dark-mode .kpi-card-v2 {
    background: rgba(30,41,59,0.75);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}
body.dark-mode .kpi-card-v2:hover {
    box-shadow: 0 12px 36px rgba(0,0,0,0.45);
}
body.dark-mode .kpi-value-v2 {
    color: #f1f5f9;
}
body.dark-mode .kpi-value-v2 .currency {
    color: #94a3b8;
}
body.dark-mode .kpi-icon-v2.green { background: linear-gradient(135deg, rgba(22,163,74,0.25), rgba(22,163,74,0.12)); color: #4ade80; }
body.dark-mode .kpi-icon-v2.red   { background: linear-gradient(135deg, rgba(220,38,38,0.25), rgba(220,38,38,0.12)); color: #f87171; }
body.dark-mode .kpi-icon-v2.teal  { background: linear-gradient(135deg, rgba(13,148,136,0.25), rgba(13,148,136,0.12)); color: #2dd4bf; }
body.dark-mode .kpi-icon-v2.amber { background: linear-gradient(135deg, rgba(217,119,6,0.25), rgba(217,119,6,0.12)); color: #fbbf24; }

/* 快捷操作按钮 */
body.dark-mode .qa-btn {
    background: rgba(30,41,59,0.7);
    border-color: rgba(255,255,255,0.1);
    color: #cbd5e1;
}
body.dark-mode .qa-btn:hover {
    border-color: rgba(20,184,166,0.4);
    color: #2dd4bf;
    box-shadow: 0 4px 14px rgba(13,148,136,0.15);
    background: rgba(30,41,59,0.95);
}
body.dark-mode .qa-btn.primary {
    box-shadow: 0 4px 14px rgba(13,148,136,0.35);
}

/* 图表卡片 v2 */
body.dark-mode .chart-card-v2 {
    background: rgba(30,41,59,0.75);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}
body.dark-mode .chart-title-v2 { color: #f1f5f9; }
body.dark-mode .chart-subtitle-v2 { color: #94a3b8; }

/* 区块标题 */
body.dark-mode .section-title-v2,
body.dark-mode .todo-title-v2 {
    color: #f1f5f9;
}
body.dark-mode .section-link {
    color: #2dd4bf;
}

/* 业务卡片 v2 */
body.dark-mode .biz-card-v2 {
    background: rgba(30,41,59,0.75);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}
body.dark-mode .biz-card-v2:hover {
    box-shadow: 0 16px 44px rgba(0,0,0,0.5);
}
body.dark-mode .biz-card-v2-info h4 {
    color: #f1f5f9;
}
body.dark-mode .biz-card-v2-info span {
    color: #94a3b8;
}
body.dark-mode .biz-card-v2-stat-label {
    color: #94a3b8;
}
body.dark-mode .biz-card-v2-stat-value {
    color: #f1f5f9;
}
body.dark-mode .biz-card-v2-progress-bar {
    background: rgba(255,255,255,0.06);
}
/* 业务卡片图标背景 - 深色模式降低饱和度 */
body.dark-mode .biz-card-v2-icon.i-liquor  { background: rgba(220,38,38,0.15); }
body.dark-mode .biz-card-v2-icon.i-computer { background: rgba(30,58,95,0.3); }
body.dark-mode .biz-card-v2-icon.i-ebike   { background: rgba(13,148,136,0.15); }
body.dark-mode .biz-card-v2-icon.i-rooster  { background: rgba(194,65,12,0.15); }
body.dark-mode .biz-card-v2-icon.i-expense  { background: rgba(217,119,6,0.15); }

/* 表格卡片 v2 */
body.dark-mode .table-card-v2 {
    background: rgba(30,41,59,0.75);
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}
body.dark-mode .table-card-v2:hover {
    box-shadow: 0 10px 32px rgba(0,0,0,0.45);
}
body.dark-mode .table-header-v2 {
    color: #f1f5f9;
}
body.dark-mode .table-header-v2::before {
    background: linear-gradient(180deg, #2dd4bf, #14b8a6);
}

/* 数据表格 v2 */
body.dark-mode .data-table-v2 th {
    color: #e2e8f0;
    font-weight: 700;
    border-bottom-color: rgba(255,255,255,0.08);
    background: rgba(15,23,42,0.4);
}
body.dark-mode .data-table-v2 td {
    color: #cbd5e1;
    border-bottom-color: rgba(255,255,255,0.05);
}
body.dark-mode .data-table-v2 tbody tr:hover {
    background: rgba(51,65,85,0.4);
}

/* 数据表格 th 暗色模式 */
body.dark-mode .data-table th,
body.dark-mode .data-table-v3 th {
    color: #f1f5f9;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(13,148,136,0.18), rgba(13,148,136,0.06));
    border-bottom-color: rgba(20,184,166,0.55);
}

/* 按钮 v2 */
body.dark-mode .btn-v2-outline {
    background: rgba(30,41,59,0.7);
    border-color: rgba(255,255,255,0.12);
    color: #cbd5e1;
}
body.dark-mode .btn-v2-outline:hover {
    border-color: rgba(20,184,166,0.5);
    color: #2dd4bf;
    background: rgba(30,41,59,0.95);
}

/* 待办相关 */
body.dark-mode .todo-stat-mini {
    background: rgba(30,41,59,0.5);
}
body.dark-mode .todo-stat-mini .num {
    color: #f1f5f9;
}
body.dark-mode .todo-add-btn {
    background: rgba(30,41,59,0.7);
    border-color: rgba(255,255,255,0.1);
    color: #2dd4bf;
}
body.dark-mode .todo-add-btn:hover {
    border-color: rgba(20,184,166,0.4);
    background: rgba(13,148,136,0.1);
}

/* 图表 badge */
body.dark-mode .chart-badge {
    background: rgba(22,163,74,0.15);
    color: #4ade80;
}

/* ================================================================
   通用打印规则（所有页面 + iframe 报表独立打印共享）
   ================================================================ */
@media print {
    body { background: #fff !important; }
    /* 隐藏导航 / 顶栏 / 装饰 / 按钮 / 启动画面 */
    .sidebar, header, .topbar, .topbar-right, .user-chip,
    .content-bg-decoration, .content-bg-decoration-2,
    .quick-actions, .todo-card-v2, button,
    .boot-overlay, [class*="boot"] { display: none !important; }
    /* 主内容区全宽 */
    .app { display: block !important; }
    .main-content, .content {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 16px !important;
        max-width: 100% !important;
    }
    /* 强制显示所有内容（抵消入场动画的 opacity:0 / transform 偏移） */
    * {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        box-shadow: none !important;
    }
    /* 卡片打印描边，避免白底白边 */
    .kpi-card-v2, .chart-card-v2, .biz-card-v2, .table-card-v2,
    .kpi-card-v3, .chart-card, .biz-card, .table-card {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
        break-inside: avoid;
    }
}

/* ========== 首次登录待办引导 ========== */
.onboard-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn .25s ease;
}
.onboard-dialog {
    width: 760px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
    background: #fff; border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0,0,0,.18), 0 0 1px rgba(0,0,0,.08);
    padding: 32px 28px 24px;
    animation: slideUp .35s cubic-bezier(.16,1,.3,1);
}
.onboard-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }

.onboard-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: stretch;
}
.onboard-steps .onboard-step { margin-bottom: 0; height: 100%; box-sizing: border-box; }
.onboard-header-icon { font-size: 36px; line-height: 1; }
.onboard-header-icon img { width: 44px; height: 44px; object-fit: contain; display: block; }
.onboard-header h2 { font-size: 22px; font-weight: 700; color: #1e293b; margin: 0 0 4px; }
.onboard-header p { font-size: 13px; color: #64748b; margin: 0; }

/* 步骤卡片 */
.onboard-step {
    border: 2px solid #e2e8f0; border-radius: 14px;
    padding: 16px 18px; margin-bottom: 16px;
    transition: all .3s ease;
}
.onboard-step.done { border-color: #10b981; background: #ecfdf5; }
.ob-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ob-step-num {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
    background: linear-gradient(135deg,#0d9488,#14b8a6); color: #fff;
}
.ob-step-num.done { background: #10b981; }
.ob-step-head h3 { font-size: 15px; font-weight: 600; color: #1e293b; margin: 0; flex: 1; }
.ob-step-status {
    font-size: 11px; padding: 2px 10px; border-radius: 10px;
    font-weight: 500; color: #dc2626; background: #fef2f2;
}
.onboard-step.done .ob-step-status { color: #059669; background: #d1fae5; }

.ob-step-body .form-group { margin-bottom: 10px; }
.ob-step-body .form-field { font-size: 14px; }
.ob-hint { font-size: 12px; color: #94a3b8; margin-bottom: 12px; }
.ob-step-body .btn { width: 100%; justify-content: center; }

.ob-preview { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.ob-preview img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid #e2e8f0; }
.ob-preview span { font-size: 14px; color: #475569; }

/* 底部 */
.onboard-footer { text-align: center; margin-top: 8px; padding-top: 16px; border-top: 1px solid #f1f5f9; }
.ob-all-done { font-size: 15px; font-weight: 600; color: #059669; margin: 0 0 14px; }
.ob-remain-hint { font-size: 12px; color: #d97706; margin: 0 0 10px; }
/* 强制：未完成时「开始使用」按钮禁用置灰 */
.onboard-footer .btn-primary:disabled {
    background: #cbd5e1 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: .8;
}

/* user-avatar 图片样式 */
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* 首次登录引导：窄屏自动堆叠为单排 */
@media (max-width: 720px) {
    .onboard-steps { grid-template-columns: 1fr; gap: 14px; }
    .onboard-steps .onboard-step { height: auto; }
}

/* 暗黑模式适配 */
body.dark-mode .onboard-dialog { background: #1e293b; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
body.dark-mode .onboard-header h2 { color: #f1f5f9; }
body.dark-mode .onboard-header p { color: #94a3b8; }
body.dark-mode .ob-step-head h3 { color: #e2e8f0; }
body.dark-mode .onboard-step { border-color: #334155; background: rgba(30,41,59,.5); }
body.dark-mode .onboard-step.done { border-color: #059669; background: rgba(6,78,59,.3); }
body.dark-mode .onboard-footer { border-top-color: #334155; }
