/* la 生意通 - 优化版样式文件 */
/* 版本: 2.1.0 | 最后更新: 2024-01-01 | 修复表格对齐问题 */

/* ====== CSS 重置和基础设置 ====== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ====== 全局文本选择限制 ====== */
/* 禁止全局文本选择，只允许输入框选择 */
* {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 允许输入框和文本域的文本选择 */
input, textarea, [contenteditable="true"] {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* 允许代码块和预格式化文本的选择 */
code, pre {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

:root {
    /* ====== 颜色系统 ====== */
    /* 主色调 - 深蓝 */
    --primary-50: #e8eaf6;
    --primary-100: #c5cae9;
    --primary-200: #9fa8da;
    --primary-300: #7986cb;
    --primary-400: #5c6bc0;
    --primary-500: #3f51b5;
    --primary-600: #3949ab;
    --primary-700: #303f9f;
    --primary-800: #283593;
    --primary-900: #1a237e;
    
    --primary-color: var(--primary-900);
    --primary-light: var(--primary-400);
    --primary-dark: var(--primary-900);
    --secondary-color: var(--primary-600);
    --accent-color: #2196f3;
    
    /* 功能色 */
    --success-50: #e8f5e9;
    --success-100: #c8e6c9;
    --success-200: #a5d6a7;
    --success-300: #81c784;
    --success-400: #66bb6a;
    --success-500: #4caf50;
    --success-600: #43a047;
    --success-700: #388e3c;
    --success-800: #2e7d32;
    --success-900: #1b5e20;
    
    --warning-50: #fff3e0;
    --warning-100: #ffe0b2;
    --warning-200: #ffcc80;
    --warning-300: #ffb74d;
    --warning-400: #ffa726;
    --warning-500: #ff9800;
    --warning-600: #fb8c00;
    --warning-700: #f57c00;
    --warning-800: #ef6c00;
    --warning-900: #e65100;
    
    --error-50: #ffebee;
    --error-100: #ffcdd2;
    --error-200: #ef9a9a;
    --error-300: #e57373;
    --error-400: #ef5350;
    --error-500: #f44336;
    --error-600: #e53935;
    --error-700: #d32f2f;
    --error-800: #c62828;
    --error-900: #b71c1c;
    
    --info-50: #e3f2fd;
    --info-100: #bbdefb;
    --info-200: #90caf9;
    --info-300: #64b5f6;
    --info-400: #42a5f5;
    --info-500: #2196f3;
    --info-600: #1e88e5;
    --info-700: #1976d2;
    --info-800: #1565c0;
    --info-900: #0d47a1;
    
    --success-color: var(--success-500);
    --warning-color: var(--warning-500);
    --error-color: var(--error-500);
    --info-color: var(--info-500);
    
    /* 中性色 */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-disabled: var(--gray-400);
    --divider-color: var(--gray-300);
    --background-color: var(--gray-100);
    --surface-color: #ffffff;
    --surface-variant: var(--gray-50);
    
    /* 阴影系统 */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    
    /* 边框圆角 */
    --radius-none: 0;
    --radius-sm: 0.25rem;    /* 4px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* 间距系统 */
    --space-0: 0;
    --space-1: 0.25rem;      /* 4px */
    --space-2: 0.5rem;       /* 8px */
    --space-3: 0.75rem;      /* 12px */
    --space-4: 1rem;         /* 16px */
    --space-5: 1.25rem;      /* 20px */
    --space-6: 1.5rem;       /* 24px */
    --space-8: 2rem;         /* 32px */
    --space-10: 2.5rem;      /* 40px */
    --space-12: 3rem;        /* 48px */
    --space-16: 4rem;        /* 64px */
    --space-20: 5rem;        /* 80px */
    
    /* 字体系统 */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    
    --font-size-xs: 0.75rem;     /* 12px */
    --font-size-sm: 0.875rem;    /* 14px */
    --font-size-base: 1rem;      /* 16px */
    --font-size-lg: 1.125rem;    /* 18px */
    --font-size-xl: 1.25rem;     /* 20px */
    --font-size-2xl: 1.5rem;     /* 24px */
    --font-size-3xl: 1.875rem;   /* 30px */
    --font-size-4xl: 2.25rem;    /* 36px */
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-none: 1;
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
    
    /* 动画和过渡 */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* 层级 */
    --z-negative: -1;
    --z-0: 0;
    --z-10: 10;
    --z-20: 20;
    --z-30: 30;
    --z-40: 40;
    --z-50: 50;
    --z-auto: auto;
    
    /* 容器宽度 */
    --container-xs: 20rem;     /* 320px */
    --container-sm: 24rem;     /* 384px */
    --container-md: 28rem;     /* 448px */
    --container-lg: 32rem;     /* 512px */
    --container-xl: 36rem;     /* 576px */
    --container-2xl: 42rem;    /* 672px */
    --container-3xl: 48rem;    /* 768px */
    --container-4xl: 56rem;    /* 896px */
    --container-5xl: 64rem;    /* 1024px */
    --container-6xl: 72rem;    /* 1152px */
    --container-7xl: 80rem;    /* 1280px */
}

/* ====== 基础样式 ====== */
html {
    font-size: 16px;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: var(--line-height-normal);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ====== 排版工具类 ====== */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }

.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.leading-none { line-height: var(--line-height-none); }
.leading-tight { line-height: var(--line-height-tight); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }
.text-info { color: var(--info-color); }

.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }

.bg-primary { background-color: var(--primary-color); }
.bg-success { background-color: var(--success-color); }
.bg-warning { background-color: var(--warning-color); }
.bg-error { background-color: var(--error-color); }
.bg-info { background-color: var(--info-color); }

.bg-surface { background-color: var(--surface-color); }
.bg-background { background-color: var(--background-color); }

/* ====== 间距工具类 ====== */
.m-0 { margin: var(--space-0); }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }
.m-6 { margin: var(--space-6); }

.mt-0 { margin-top: var(--space-0); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-0 { margin-bottom: var(--space-0); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.p-0 { padding: var(--space-0); }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.pt-0 { padding-top: var(--space-0); }
.pt-1 { padding-top: var(--space-1); }
.pt-2 { padding-top: var(--space-2); }
.pt-3 { padding-top: var(--space-3); }
.pt-4 { padding-top: var(--space-4); }
.pt-5 { padding-top: var(--space-5); }
.pt-6 { padding-top: var(--space-6); }

.pb-0 { padding-bottom: var(--space-0); }
.pb-1 { padding-bottom: var(--space-1); }
.pb-2 { padding-bottom: var(--space-2); }
.pb-3 { padding-bottom: var(--space-3); }
.pb-4 { padding-bottom: var(--space-4); }
.pb-5 { padding-bottom: var(--space-5); }
.pb-6 { padding-bottom: var(--space-6); }

/* ====== 布局工具类 ====== */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hidden { display: none; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

.gap-0 { gap: var(--space-0); }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-initial { flex: 0 1 auto; }
.flex-none { flex: none; }

/* ====== 边框和圆角工具类 ====== */
.rounded-none { border-radius: var(--radius-none); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

.border { border: 1px solid var(--divider-color); }
.border-0 { border-width: 0; }
.border-2 { border-width: 2px; }

.border-primary { border-color: var(--primary-color); }
.border-success { border-color: var(--success-color); }
.border-warning { border-color: var(--warning-color); }
.border-error { border-color: var(--error-color); }
.border-info { border-color: var(--info-color); }

/* ====== 阴影工具类 ====== */
.shadow-none { box-shadow: none; }
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }
.shadow-inner { box-shadow: var(--shadow-inner); }

/* ====== 动画关键帧 ====== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-25%);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(60, 60);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(100, 100);
    }
}

/* ====== 动画工具类 ====== */
.animate-fade-in {
    animation: fadeIn var(--transition-normal);
}

.animate-fade-out {
    animation: fadeOut var(--transition-normal);
}

.animate-slide-in-up {
    animation: slideInUp var(--transition-normal);
}

.animate-slide-in-down {
    animation: slideInDown var(--transition-normal);
}

.animate-slide-in-left {
    animation: slideInLeft var(--transition-normal);
}

.animate-slide-in-right {
    animation: slideInRight var(--transition-normal);
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

.animate-shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(90deg, 
        var(--background-color) 25%, 
        var(--surface-color) 50%, 
        var(--background-color) 75%);
    background-size: 200% 100%;
}

/* ====== 布局容器 ====== */
#main-container {
    display: flex;
    min-height: 100vh;
    /* 修复: 加 max-height 锁视口高度, 否则长内容(如配置管理49行)把容器撑高后
       被 overflow:hidden 裁剪且 window 无法滚动; 锁定后滚动发生在内部 content-wrapper */
    max-height: 100vh;
    background-color: var(--background-color);
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 180px;
    background: linear-gradient(180deg, var(--primary-900) 0%, var(--primary-800) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-20);
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--primary-300) 0%, 
        var(--accent-color) 50%, 
        var(--primary-300) 100%);
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar-header {
    padding: var(--space-6) var(--space-4) var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: white;
    transition: all var(--transition-fast);
    padding: var(--space-2);
    border-radius: var(--radius-md);
}

.logo:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff 0%, var(--primary-100) 100%);
    color: var(--primary-color);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    box-shadow: var(--shadow-md);
}

.logo-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .logo-text {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 6px 0;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* 卡片式导航(紧凑+分组: 2026-08-16 按业务分组, 压缩高度/间距, 适配 1080 屏) */
.nav-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 var(--space-2) var(--space-2);
}

/* 导航分组 */
.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.nav-group-title {
    font-size: 10px;
    line-height: 1;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    padding: 8px var(--space-3) 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

.sidebar.collapsed .nav-group-title {
    display: none;
}

.nav-card {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 3px var(--space-2);
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 30px;
    background-color: transparent;
    border: 1px solid transparent;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.nav-card:hover::before {
    left: 100%;
}

.nav-card:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-card.active {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.08) 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md);
    position: relative;
}

.nav-card.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, 
        var(--primary-300) 0%, 
        var(--accent-color) 100%);
    border-radius: var(--radius-full);
}

.nav-card-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.nav-card.active .nav-card-icon {
    background: linear-gradient(135deg, var(--primary-300) 0%, var(--accent-color) 100%);
    box-shadow: var(--shadow-md);
}

.nav-card-text {
    flex: 1;
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .nav-card-text {
    display: none;
}

.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

/* 主要内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background-color: var(--background-color);
}

/* 顶部导航栏 */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    height: 64px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--divider-color);
    box-shadow: var(--shadow-sm);
    z-index: var(--z-10);
    position: relative;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex: 1;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* 顶部栏 */
.top-bar {
    height: 72px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--divider-color);
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    box-shadow: var(--shadow-sm);
    z-index: var(--z-10);
    position: sticky;
    top: 0;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex: 1;
}

#toggle-sidebar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--divider-color);
    background-color: var(--surface-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

#toggle-sidebar:hover {
    background-color: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: rotate(90deg);
}

#page-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

#user-display {
    padding: var(--space-2) var(--space-3);
    background-color: var(--background-color);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    border: 1px solid var(--divider-color);
    transition: all var(--transition-fast);
}

#user-display:hover {
    background-color: var(--surface-variant);
    color: var(--text-primary);
}

#logout-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--divider-color);
    background-color: var(--surface-color);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

#logout-btn:hover {
    background-color: var(--error-50);
    border-color: var(--error-200);
    color: var(--error-600);
    transform: translateY(-1px);
}

/* ============ 消息通知铃铛 ============ */
.msg-bell-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

#msg-bell {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--divider-color);
    background-color: var(--surface-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

#msg-bell:hover {
    background-color: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.msg-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background-color: var(--error-600);
    color: #fff;
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--surface-color);
    line-height: 1;
}

.msg-panel {
    position: absolute;
    top: 52px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    background-color: var(--surface-color);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-50);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.msg-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--divider-color);
    background-color: var(--surface-variant);
}

.msg-panel-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.msg-list {
    max-height: 420px;
    overflow-y: auto;
}

.msg-empty {
    padding: var(--space-6);
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.msg-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--divider-color);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    text-align: left;
}

.msg-item:hover {
    background-color: var(--surface-variant);
}

.msg-item.read {
    opacity: 0.7;
}

.msg-item-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-50, #e3f2fd);
    color: var(--primary-color);
    font-size: 12px;
}

.msg-item-body {
    flex: 1;
    min-width: 0;
}

.msg-item-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 2px;
}

.msg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--error-600);
    flex-shrink: 0;
}

.msg-item-content {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
}

.msg-item-time {
    font-size: 12px;
    color: var(--text-tertiary, #9e9e9e);
}

/* ============ P2-2 经营驾驶舱 ============ */
.business-dashboard {
    margin-bottom: var(--space-6);
}

.business-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.business-header h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.business-sub {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.business-body {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.business-card {
    background-color: var(--surface-color);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.business-card h4 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 var(--space-3);
}

/* 趋势条形图 */
.trend-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-2);
    height: 180px;
    padding-top: var(--space-2);
}

.trend-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    min-width: 0;
}

.trend-bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 0;
}

.trend-bar {
    width: 60%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-600, #1976d2));
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.4s ease;
    min-height: 4px;
}

.trend-label {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.trend-val {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

/* 转化漏斗 */
.funnel-row {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: space-between;
}

.funnel-step {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    background: var(--surface-color);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-md);
    min-width: 0;
}

.funnel-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.funnel-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    white-space: nowrap;
}

.funnel-arrow {
    color: var(--text-disabled, #bbb);
    font-size: 12px;
    flex-shrink: 0;
}

@media (max-width: 1200px) {
    .funnel-row {
        flex-wrap: wrap;
    }
    .funnel-step {
        min-width: 70px;
    }
}

/* TOP 列表 */
.top-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--divider-color);
    font-size: var(--font-size-sm);
}

.top-list li:last-child {
    border-bottom: none;
}

.top-list li.empty {
    justify-content: center;
    color: var(--text-secondary);
    padding: var(--space-4) 0;
}

.top-list .rank {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background-color: var(--primary-50, #e3f2fd);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-list .top-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.top-list em {
    font-style: normal;
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

/* 响应式: 驾驶舱堆叠 */
@media (max-width: 1100px) {
    .business-body {
        grid-template-columns: 1fr;
    }
    .trend-chart {
        height: 140px;
    }
}

/* ============ P2-3 报表中心 Tab ============ */
.report-tabs {
    display: flex;
    gap: var(--space-2);
    background-color: var(--surface-variant);
    border-radius: var(--radius-lg);
    padding: 4px;
}

.report-tab {
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.report-tab:hover {
    color: var(--text-primary);
}

.report-tab.active {
    background-color: var(--surface-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    font-weight: var(--font-weight-semibold);
}

/* 内容区域 */
.content-wrapper {
    flex: 1;
    /* 修复: flex item 默认 min-height:auto 不允许收缩, 长内容(如配置管理49行)会把
       content-wrapper 撑高后超出 main-content 被 overflow:hidden 裁剪且无滚动条;
       加 min-height:0 使其收缩到视口内并产生页面级滚动 */
    min-height: 0;
    overflow: auto;
    position: relative;
}

.content-section {
    position: relative;
    opacity: 0;
    visibility: hidden;
    transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1), visibility 500ms cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 100%;
    padding: var(--space-6);
    display: none;
}

.content-section.active {
    opacity: 1;
    visibility: visible;
    /* 修复: flex column + 限高, 使 module-header 固定、仅 module-content(表格区)滚动 */
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ====== 模块容器样式 ====== */
.module-container {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    margin: 0;
    background-color: var(--surface-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--divider-color);
    /* 修复: flex column + 限高, 支撑 header 固定/表格区滚动 */
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* 仪表板容器样式 */
.dashboard-container {
    padding: var(--space-6);
    animation: fadeIn var(--transition-normal);
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    margin: 0;
    /* 修复: content-section.active 限高+overflow:hidden 会裁剪仪表盘内容(仪表盘无
       module-content), 加 flex:1+min-height:0 使其填满可视区并在容器内滚动 */
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* 确保所有容器靠左 */
.dashboard-content,
.dashboard-grid,
.dashboard-card,
.table-container {
    margin: 0;
    width: 100%;
}

.module-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--divider-color);
    background-color: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    /* 修复: 长表格滚动时功能区固定, 滚动仅发生在表格区(module-content) */
    flex-shrink: 0;
}

/* 模块头部操作区(搜索/筛选/按钮): flex 布局 + 自动换行,
   修复头部控件被挤压/覆盖(2026-08-31 工人管理/售后维保/报价管理) */
.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

/* 模块内容区(表格等): 高度受限; 滚动下沉到 table-container, 使 sticky thead 表头固定生效 */
.module-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 表格容器: 高度自适应内容(行数少时表格下方不留白), 超高时以容器高度为上限滚动, thead sticky 固定 */
.table-container {
    max-height: 100%;
    overflow: auto;
}

.module-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) 44px;
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-lg);
    background-color: var(--background-color);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-500-rgb, 63, 81, 181), 0.1);
    background-color: var(--surface-color);
}

.search-icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-disabled);
    pointer-events: none;
    width: 20px;
    height: 20px;
}

/* ====== 优化表格样式（修复对齐问题） ====== */
.table-optimized-container,
.table-container {
    width: 100%;
    min-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-lg);
    background-color: var(--surface-color);
    position: relative;
    margin-bottom: var(--space-4);
}

.table-optimized {
    width: 100%;
    table-layout: fixed;
    /* 修复: border-collapse:collapse 会使 position:sticky 的 thead 失效(表头无法固定),
       改为 separate + border-spacing:0; 行分隔线由 td 的 border-bottom 承担 */
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--surface-color);
    font-size: 12px;
}

.table-optimized thead {
    background: linear-gradient(180deg, var(--surface-color) 0%, var(--surface-variant) 100%);
    position: sticky;
    top: 0;
    z-index: var(--z-10);
}

.table-optimized th {
    padding: var(--space-4);
    text-align: center;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    background-color: inherit;
    transition: background-color var(--transition-fast);
    vertical-align: middle !important;
    font-size: 12px;
}

/* 表头筛选器样式 */
.header-with-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.header-text {
    font-weight: 600;
    white-space: nowrap;
}

/* 筛选按钮样式 */
.filter-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 2px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.filter-btn:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

/* 列筛选样式 */
.column-filter {
    width: 100%;
    margin-top: 5px;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 11px;
    background: white;
    cursor: pointer;
}

.column-filter:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 表头分隔线 */
.table-optimized th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background-color: var(--divider-color);
    opacity: 0.6;
}

.table-optimized tbody tr {
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--divider-color);
    background-color: var(--surface-color);
}

.table-optimized tbody tr:hover {
    background-color: rgba(var(--primary-500-rgb, 63, 81, 181), 0.03);
    transform: translateX(1px);
}

.table-optimized tbody tr:last-child {
    border-bottom: none;
}

.table-optimized td {
    padding: var(--space-4);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid var(--divider-color);
    transition: all var(--transition-fast);
    font-size: 12px;
}

/* 确保表头和数据列宽度一致 */
.table-optimized th,
.table-optimized td {
    box-sizing: border-box;
}

/* 特殊列样式 */
.table-optimized td.text-long {
    white-space: normal;
    word-break: break-word;
    max-height: 60px;
    overflow-y: auto;
    line-height: var(--line-height-relaxed);
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
}

.table-optimized td.text-numeric {
    text-align: right;
    font-family: var(--font-mono);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.table-optimized td.text-center {
    text-align: center;
}

/* 表格中图片样式 */
/* 通用表格图片样式，但排除商品表格 */
.table-optimized img:not(#products-table img) {
    max-width: 40px;
    max-height: 40px;
    object-fit: cover;
    border-radius: 4px;
    vertical-align: middle;
}

/* 商品表格图片样式 */
#products-table img {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 4px;
    vertical-align: middle;
}

/* 特定图片单元格样式 */
/* 针对订单表格的特定图片样式 */
#orders-table td.text-center img,
#orders-table td img {
    max-width: 32px;
    max-height: 32px;
    object-fit: cover;
    border-radius: 4px;
}

/* 针对商品表格的特定图片样式 */
#products-table td.text-center img,
#products-table td img {
    max-width: 100px;
    max-height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

/* 操作列宽度统一 */
.table-optimized th[data-is-action-column="true"],
.table-optimized td:last-child:has(.action-buttons) {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    text-align: center;
}

/* ====== 统一操作按钮样式 - 简洁现代风格 ====== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

/* 统一按钮基础样式 */
.action-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 56px;
    height: 26px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1;
}

/* 查看/主要按钮 - 蓝色填充 */
.action-buttons .btn-primary {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.action-buttons .btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* 编辑/成功按钮 - 绿色填充 */
.action-buttons .btn-success {
    background-color: #22c55e;
    color: white;
    border-color: #22c55e;
}

.action-buttons .btn-success:hover {
    background-color: #16a34a;
    border-color: #16a34a;
}

/* 删除/错误按钮 - 红色填充 */
.action-buttons .btn-error {
    background-color: #ef4444;
    color: white;
    border-color: #ef4444;
}

.action-buttons .btn-error:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

/* 轮廓按钮 - 白色背景蓝色边框 */
.action-buttons .btn-outline {
    background-color: white;
    color: #3b82f6;
    border-color: #3b82f6;
}

.action-buttons .btn-outline:hover {
    background-color: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

/* 图片/上传按钮 - 灰色填充 */
.action-buttons .btn-image,
.action-buttons .btn-info {
    background-color: #6b7280;
    color: white;
    border-color: #6b7280;
}

.action-buttons .btn-image:hover,
.action-buttons .btn-info:hover {
    background-color: #4b5563;
    border-color: #4b5563;
}

/* 按钮图标 */
.action-buttons .btn i {
    font-size: 11px;
}

/* 按钮禁用状态 */
.action-buttons .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 表格斑马纹效果 */
.table-optimized tbody tr:nth-child(even) {
    background-color: var(--surface-variant);
}

.table-optimized tbody tr:nth-child(even):hover {
    background-color: rgba(var(--primary-500-rgb, 63, 81, 181), 0.05);
}

/* 表格排序指示器 */
.table-optimized th.sortable {
    cursor: pointer;
    user-select: none;
}

.table-optimized th.sortable:hover {
    background-color: rgba(var(--primary-500-rgb, 63, 81, 181), 0.05);
}

.table-optimized th.sortable::after {
    content: '↕';
    margin-left: var(--space-1);
    font-size: var(--font-size-xs);
    opacity: 0.5;
}

.table-optimized th.sortable.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--primary-color);
}

.table-optimized th.sortable.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--primary-color);
}

/* 空状态样式增强 */
.table-empty-state {
    padding: var(--space-12) var(--space-6);
    text-align: center;
    color: var(--text-disabled);
    background-color: var(--surface-variant);
    border-radius: var(--radius-lg);
    margin: var(--space-4);
    grid-column: 1 / -1;
}

.table-empty-state i {
    font-size: 36px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.table-empty-state h4 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

/* 表格单元格焦点状态 */
.table-optimized td:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -1px;
    z-index: var(--z-10);
    position: relative;
}

/* 表格拖拽调整列宽 */
.table-optimized th.resizable {
    position: relative;
}

.table-optimized th.resizable::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    background-color: transparent;
    transition: background-color var(--transition-fast);
}

.table-optimized th.resizable:hover::after {
    background-color: var(--primary-color);
}

/* 表格加载状态 */
.table-loading {
    position: relative;
    min-height: 200px;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(var(--primary-500-rgb, 63, 81, 181), 0.05) 50%, 
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    pointer-events: none;
}

/* ====== 分页样式 ====== */
.pagination-container {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--divider-color);
    background-color: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.pagination-info {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-2);
    border: 1px solid var(--divider-color);
    background-color: var(--surface-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-input {
    width: 60px;
    height: 40px;
    padding: 0 var(--space-2);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: var(--font-size-sm);
    background-color: var(--surface-color);
    color: var(--text-primary);
}

.page-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-500-rgb, 63, 81, 181), 0.1);
}

/* ====== 按钮样式 ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    user-select: none;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-900) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-400) 0%, var(--success-600) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-700) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-400) 0%, var(--warning-600) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--warning-500) 0%, var(--warning-700) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-error {
    background: linear-gradient(135deg, var(--error-400) 0%, var(--error-600) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-error:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--error-500) 0%, var(--error-700) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background-color: rgba(var(--primary-500-rgb, 63, 81, 181), 0.05);
    transform: translateY(-2px);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
    border-radius: var(--radius-xl);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 36px;
    height: 36px;
}

.btn-icon.btn-lg {
    width: 52px;
    height: 52px;
}

/* 按钮加载状态 */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-outline.loading::after {
    border: 2px solid rgba(var(--primary-500-rgb, 63, 81, 181), 0.3);
    border-top-color: var(--primary-color);
}

/* ====== 表单样式 ====== */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

/* 表单复选框 */
.form-check-inline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
}

.form-check-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
    opacity: 1;
    visibility: visible;
    display: inline-block;
}

.form-label.required::after {
    content: ' *';
    color: var(--error-color);
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-lg);
    background-color: var(--surface-color);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-500-rgb, 63, 81, 181), 0.1);
}

/* 筛选下拉框样式: 与 .form-control 统一外观
   (2026-08-31 修复: 工人管理/售后维保/报价管理头部下拉框无样式,
   渲染成 17px 高的浏览器默认小框, 被右侧按钮挤压遮挡) */
.form-select {
    min-height: 36px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-lg);
    background-color: var(--surface-color);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-500-rgb, 63, 81, 181), 0.1);
}

.form-control.error {
    border-color: var(--error-color);
    background-color: rgba(var(--error-500-rgb, 244, 67, 54), 0.02);
}

.form-control.disabled,
.form-control:disabled {
    background-color: var(--background-color);
    color: var(--text-disabled);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-hint {
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.form-error {
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--error-color);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* 搜索筛选容器 */
.search-filter-container {
    position: relative;
    display: inline-flex;
    width: 100%;
}

.search-filter-input {
    flex: 1;
    padding-right: 120px;
}

.filter-buttons {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding-right: 12px;
}

.filter-btn {
    background: none;
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-md);
    padding: 4px 12px;
    margin-left: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background-color: var(--background-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ====== 仪表板样式 ====== */
.dashboard-container {
    padding: var(--space-6);
    animation: fadeIn var(--transition-normal);
    width: 100%;
    max-width: 100%;
    margin: 0;
    text-align: left;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.dashboard-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background-color: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-spring);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--primary-300) 0%, 
        var(--accent-color) 50%, 
        var(--primary-300) 100%);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--divider-color);
}

.stat-card.primary::before {
    background: linear-gradient(90deg, var(--primary-300) 0%, var(--primary-500) 50%, var(--primary-300) 100%);
}

.stat-card.success::before {
    background: linear-gradient(90deg, var(--success-300) 0%, var(--success-500) 50%, var(--success-300) 100%);
}

.stat-card.warning::before {
    background: linear-gradient(90deg, var(--warning-300) 0%, var(--warning-500) 50%, var(--warning-300) 100%);
}

.stat-card.info::before {
    background: linear-gradient(90deg, var(--info-300) 0%, var(--info-500) 50%, var(--info-300) 100%);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
    font-size: var(--font-size-xl);
    color: white;
    box-shadow: var(--shadow-md);
}

.stat-card.primary .stat-icon {
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-600) 100%);
}

.stat-card.success .stat-icon {
    background: linear-gradient(135deg, var(--success-400) 0%, var(--success-600) 100%);
}

.stat-card.warning .stat-icon {
    background: linear-gradient(135deg, var(--warning-400) 0%, var(--warning-600) 100%);
}

.stat-card.info .stat-icon {
    background: linear-gradient(135deg, var(--info-400) 0%, var(--info-600) 100%);
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    line-height: 1.2;
}

.stat-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-3);
    font-weight: var(--font-weight-medium);
}

.stat-change {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

/* 财务统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

/* 财务统计行样式 - 紧凑布局 */
.stats-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,250,252,0.8) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-sm);
}

.stat-item-income {
    color: var(--success-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-income .stat-icon-inline {
    color: var(--success-500);
    font-size: var(--font-size-base);
}

.stat-item-expense {
    color: var(--error-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-expense .stat-icon-inline {
    color: var(--error-500);
    font-size: var(--font-size-base);
}

.stat-item-profit {
    color: var(--primary-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-profit .stat-icon-inline {
    color: var(--primary-500);
    font-size: var(--font-size-base);
}

/* 本月数据统计卡片样式 */
.stat-item-month-income {
    color: var(--success-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-month-income .stat-icon-inline {
    color: var(--success-500);
    font-size: var(--font-size-base);
}

.stat-item-month-expense {
    color: var(--error-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-month-expense .stat-icon-inline {
    color: var(--error-500);
    font-size: var(--font-size-base);
}

.stat-item-month-profit {
    color: var(--primary-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-month-profit .stat-icon-inline {
    color: var(--primary-500);
    font-size: var(--font-size-base);
}

/* 商品库存统计卡片样式 */
.stat-item-total {
    color: var(--info-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-total .stat-icon-inline {
    color: var(--info-500);
    font-size: var(--font-size-lg);
}

.stat-item-stock {
    color: var(--primary-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-stock .stat-icon-inline {
    color: var(--primary-500);
    font-size: var(--font-size-lg);
}

.stat-item-low {
    color: var(--warning-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-low .stat-icon-inline {
    color: var(--warning-500);
    font-size: var(--font-size-lg);
}

.stat-item-value {
    color: var(--success-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-value .stat-icon-inline {
    color: var(--success-500);
    font-size: var(--font-size-lg);
}

/* 最畅销和滞销风险产品样式 */
.stat-item-best-selling {
    color: var(--success-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-best-selling .stat-icon-inline {
    color: var(--success-500);
    font-size: var(--font-size-lg);
}

.stat-item-slow-moving {
    color: var(--warning-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-slow-moving .stat-icon-inline {
    color: var(--warning-500);
    font-size: var(--font-size-lg);
}

/* 入库统计卡片样式 */
.stat-item-purchase-total {
    color: var(--info-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-purchase-total .stat-icon-inline {
    color: var(--info-500);
    font-size: var(--font-size-lg);
}

.stat-item-purchase-amount {
    color: var(--success-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-purchase-amount .stat-icon-inline {
    color: var(--success-500);
    font-size: var(--font-size-lg);
}

.stat-item-purchase-quantity {
    color: var(--primary-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-purchase-quantity .stat-icon-inline {
    color: var(--primary-500);
    font-size: var(--font-size-lg);
}

/* 出库统计卡片样式 */
.stat-item-sale-total {
    color: var(--info-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-sale-total .stat-icon-inline {
    color: var(--info-500);
    font-size: var(--font-size-lg);
}

.stat-item-sale-amount {
    color: var(--error-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-sale-amount .stat-icon-inline {
    color: var(--error-500);
    font-size: var(--font-size-lg);
}

.stat-item-sale-quantity {
    color: var(--warning-600);
    font-weight: var(--font-weight-medium);
}

.stat-item-sale-quantity .stat-icon-inline {
    color: var(--warning-500);
    font-size: var(--font-size-lg);
}

.stat-label-inline {
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
}

.stat-value-inline {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    min-width: 70px;
    display: inline-block;
}

.stat-divider {
    color: var(--border-color);
    font-size: var(--font-size-base);
    opacity: 0.5;
    margin: 0 var(--space-1);
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--error-color);
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

/* 活动区域 */
.activity-section {
    margin-top: var(--space-8);
}

.activity-container {
    background-color: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--divider-color);
}

/* 仪表板活动和待办任务水平布局 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.dashboard-card {
    background-color: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--divider-color);
}

.dashboard-card:first-child {
    border-right: 2px solid var(--divider-color);
}

.dashboard-card:last-child {
    border-left: 2px solid var(--divider-color);
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .dashboard-card:first-child {
        border-right: none;
    }
    
    .dashboard-card:last-child {
        border-left: none;
    }
}

.activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--divider-color);
}

.activity-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: var(--space-2);
}

.task-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: var(--space-2);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--divider-color);
    transition: all var(--transition-fast);
}

.activity-item:hover {
    background-color: var(--surface-variant);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin: 0 calc(-1 * var(--space-4));
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    background-color: var(--background-color);
    border-radius: var(--radius-lg);
    margin-right: var(--space-4);
    flex-shrink: 0;
    color: var(--primary-color);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-description {
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-1);
    color: var(--text-primary);
    line-height: var(--line-height-relaxed);
}

.activity-time {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

/* 商品分析卡片样式 */
.product-analysis-row {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.analysis-card {
    flex: 1;
    min-width: 300px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 12px;
}

.best-selling-card {
    border-left: 3px solid #4CAF50;
}

.slow-moving-card {
    border-left: 3px solid #ff9800;
}

.analysis-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.product-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}

.product-list li:last-child {
    border-bottom: none;
}

.product-name {
    font-weight: 500;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-sales, .product-stock, .product-value {
    font-size: 12px;
    color: #666;
    margin-left: 8px;
    min-width: 60px;
    text-align: right;
}

.product-sales {
    color: #4CAF50;
    font-weight: 500;
}

.product-value {
    color: #ff9800;
    font-weight: 500;
}

/* ====== 状态标签样式 ====== */
.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-active {
    background-color: rgba(var(--success-500-rgb, 76, 175, 80), 0.1);
    color: var(--success-600);
    border: 1px solid rgba(var(--success-500-rgb, 76, 175, 80), 0.2);
}

.status-active::before {
    background-color: var(--success-500);
}

.status-inactive {
    background-color: rgba(var(--gray-500-rgb, 158, 158, 158), 0.1);
    color: var(--gray-600);
    border: 1px solid rgba(var(--gray-500-rgb, 158, 158, 158), 0.2);
}

.status-inactive::before {
    background-color: var(--gray-500);
}

.status-pending {
    background-color: rgba(var(--warning-500-rgb, 255, 152, 0), 0.1);
    color: var(--warning-600);
    border: 1px solid rgba(var(--warning-500-rgb, 255, 152, 0), 0.2);
}

.status-pending::before {
    background-color: var(--warning-500);
}

.status-completed {
    background-color: rgba(var(--success-500-rgb, 76, 175, 80), 0.1);
    color: var(--success-600);
    border: 1px solid rgba(var(--success-500-rgb, 76, 175, 80), 0.2);
}

.status-completed::before {
    background-color: var(--success-500);
}

.status-processing {
    background-color: rgba(var(--info-500-rgb, 33, 150, 243), 0.1);
    color: var(--info-600);
    border: 1px solid rgba(var(--info-500-rgb, 33, 150, 243), 0.2);
}

.status-processing::before {
    background-color: var(--info-500);
}

.status-cancelled {
    background-color: rgba(var(--error-500-rgb, 244, 67, 54), 0.1);
    color: var(--error-600);
    border: 1px solid rgba(var(--error-500-rgb, 244, 67, 54), 0.2);
}

.status-cancelled::before {
    background-color: var(--error-500);
}

/* 库存不足/低库存警示 (2026-08-21: 补全缺失样式, 与 status-active 风格统一) */
.status-warning {
    background-color: rgba(var(--warning-500-rgb, 255, 152, 0), 0.12);
    color: var(--warning-700, #f57c00);
    border: 1px solid rgba(var(--warning-500-rgb, 255, 152, 0), 0.35);
}

.status-warning::before {
    background-color: var(--warning-500);
}

/* ====== 模态框样式 ====== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    /* 修复: 垂直居中, 避免长内容弹窗(如供应商表单)底部超出视口导致保存按钮不可见 */
    align-items: center;
    justify-content: center;
    z-index: var(--z-50);
    padding: var(--space-4);
    animation: fadeIn var(--transition-normal);
    overflow: hidden;
}

/* 模态框显示时冻结底层页面 */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none; /* 阻止触摸事件 */
    -webkit-overflow-scrolling: none; /* 阻止iOS上的弹性滚动 */
}

/* 模态框内容区域允许滚动 */
.modal-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* 允许模态框内部滚动 */
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideInDown var(--transition-spring);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--divider-color);
    /* 修复: 长内容(如供应商表单)超高时整体滚动, 配合 header/footer sticky 保证保存按钮始终可见 */
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-header {
    /* 修复: 头部不压缩且固定在弹窗顶部, 保证标题/关闭按钮始终可见 */
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 5;
    padding: var(--space-6);
    border-bottom: 1px solid var(--divider-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface-variant);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background-color: var(--background-color);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    /* 修复: 允许收缩, 内容超高时 body 内部滚动, 避免底部 footer(保存按钮)被裁掉 */
    min-height: 0;
    padding: var(--space-6);
    overflow-y: auto;
}

.modal-footer {
    /* 修复: 底部按钮栏固定在弹窗底部, 保存/确认按钮始终可见 */
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: var(--space-6);
    border-top: 1px solid var(--divider-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-4);
    background-color: var(--surface-variant);
}

/* ====== 搜索选择框样式 ====== */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-lg);
    background-color: var(--surface-color);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.searchable-select input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-500-rgb, 63, 81, 181), 0.1);
}

.searchable-select .selected-display {
    display: none;
}

.searchable-select .suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--gray-800);
    color: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-50);
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: rotateIn var(--transition-spring);
}

.searchable-select .suggestion-item {
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.searchable-select .suggestion-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: var(--space-6);
}

.searchable-select .suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* 旋转动画 */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: translateY(-10px) rotateX(-90deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* ====== 加载指示器 ====== */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-50);
    transition: opacity var(--transition-normal);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid var(--divider-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--space-4);
}

.loading-text {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

/* 表格容器样式 */
/* 修复: 移除 max-height:600px/overflow-y, 否则不分页的长表格(如配置管理49行)被截断在600px内,
   改为由页面级滚动(content-wrapper overflow:auto)展示全部行 */
.table-container {
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* 表格容器滚动条样式 */
.table-container::-webkit-scrollbar {
    width: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--background-color);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--divider-color);
    border-radius: var(--radius-full);
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* 通知样式 */
.notification {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    z-index: 100;
    max-width: 400px;
    animation: slideInRight var(--transition-spring);
    display: none;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255, 255, 0.1);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 50;
    padding: var(--space-4);
    animation: fadeIn var(--transition-normal);
    overflow: hidden;
}

.notification.success {
    background: linear-gradient(135deg, 
        rgba(var(--success-500-rgb, 76, 175, 80), 0.95) 0%, 
        rgba(var(--success-600-rgb, 67, 160, 71), 0.95) 100%);
    color: white;
    border-color: rgba(var(--success-500-rgb, 76, 175, 80), 0.3);
}

.notification.error {
    background: linear-gradient(135deg, 
        rgba(var(--error-500-rgb, 244, 67, 54), 0.95) 0%, 
        rgba(var(--error-600-rgb, 229, 57, 53), 0.95) 100%);
    color: white;
    border-color: rgba(var(--error-500-rgb, 244, 67, 54), 0.3);
}

.notification.warning {
    background: linear-gradient(135deg, 
        rgba(var(--warning-500-rgb, 255, 152, 0), 0.95) 0%, 
        rgba(var(--warning-600-rgb, 251, 140, 0), 0.95) 100%);
    color: white;
    border-color: rgba(var(--warning-500-rgb, 255, 152, 0), 0.3);
}

.notification.info {
    background: linear-gradient(135deg, 
        rgba(var(--info-500-rgb, 33, 150, 243), 0.95) 0%, 
        rgba(var(--info-600-rgb, 30, 136, 229), 0.95) 100%);
    color: white;
    border-color: rgba(var(--info-500-rgb, 33, 150, 243), 0.3);
}

/* ====== 工具提示 ====== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: var(--z-30);
    background-color: var(--gray-800);
    color: white;
    text-align: center;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-fast);
    box-shadow: var(--shadow-lg);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tooltip-top {
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-bottom {
    top: 125%;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-left {
    top: 50%;
    right: 125%;
    transform: translateY(-50%);
}

.tooltip-right {
    top: 50%;
    left: 125%;
    transform: translateY(-50%);
}

/* ====== 骨架屏加载动画 ====== */
.skeleton {
    background: linear-gradient(90deg, 
        var(--background-color) 25%, 
        var(--surface-color) 50%, 
        var(--background-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-2);
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-rect {
    height: 120px;
    border-radius: var(--radius-lg);
}

/* ====== 暗色模式支持 ====== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #b0bec5;
        --text-disabled: #546e7a;
        --divider-color: #37474f;
        --background-color: #121212;
        --surface-color: #1e1e1e;
        --surface-variant: #2d2d2d;
        
        --gray-50: #121212;
        --gray-100: #1e1e1e;
        --gray-200: #2d2d2d;
        --gray-300: #37474f;
        --gray-400: #546e7a;
        --gray-500: #78909c;
        --gray-600: #90a4ae;
        --gray-700: #b0bec5;
        --gray-800: #cfd8dc;
        --gray-900: #eceff1;
    }
    
    .notification {
        backdrop-filter: blur(20px);
        background-color: rgba(30, 30, 30, 0.9);
    }
    
    /* 暗色模式下的表格样式 */
    .table-optimized th {
        background-color: var(--surface-variant);
    }
    
    .table-optimized tbody tr:nth-child(even) {
        background-color: rgba(255, 255, 255, 0.02);
    }
    
    .table-optimized tbody tr:hover {
        background-color: rgba(var(--primary-500-rgb, 63, 81, 181), 0.05);
    }
}

/* ====== 响应式设计 ====== */

/* 超大屏幕 (≥ 1536px) */
@media (min-width: 1536px) {
    .content-wrapper {
        padding: var(--space-8);
    }
    
    .module-container {
        max-width: 100%;
        margin: 0;
    }
    
    .dashboard-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 大屏幕 (≥ 1280px) */
@media (min-width: 1280px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 中等屏幕 (≥ 1024px) */
@media (min-width: 1024px) {
    .sidebar:not(.collapsed) {
        width: 210px;
    }
    
    .top-bar {
        padding: 0 var(--space-8);
    }
    
    .table-optimized {
        font-size: var(--font-size-base);
    }
}

/* 平板横屏 (≥ 768px) 和 (≤ 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar {
        width: 72px;
    }
    
    .sidebar .nav-card-text,
    .sidebar .logo-text {
        display: none;
    }
    
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .module-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
    }
    
    .search-box {
        min-width: 100%;
        max-width: 100%;
    }
    
    .table-optimized {
        table-layout: auto; /* 在中等屏幕上使用自动布局 */
    }
    
    .table-optimized th[data-is-action-column="true"],
    .table-optimized td:last-child:has(.action-buttons) {
        width: 180px !important;
        min-width: 180px !important;
        max-width: 180px !important;
    }
}

/* 平板竖屏 (≥ 640px) 和 (≤ 767px) */
@media (min-width: 640px) and (max-width: 767px) {
    .top-bar {
        padding: 0 var(--space-4);
        height: 64px;
    }
    
    #page-title {
        font-size: var(--font-size-lg);
    }
    
    .content-wrapper {
        padding: var(--space-4);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }
    
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-height: 80vh;
    }
    
    .table-optimized {
        font-size: var(--font-size-sm);
        table-layout: auto;
    }
    
    .table-optimized th,
    .table-optimized td {
        padding: var(--space-3);
    }
    
    .table-optimized th[data-is-action-column="true"],
    .table-optimized td:last-child:has(.action-buttons) {
        width: 160px !important;
        min-width: 160px !important;
        max-width: 160px !important;
    }
}

/* 手机横屏 (≥ 480px) 和 (≤ 639px) */
@media (min-width: 480px) and (max-width: 639px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left var(--transition-normal);
        z-index: var(--z-40);
        width: 210px;
        height: 100vh;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
    
    .top-bar-left {
        flex: 0 0 auto;
    }
    
    #user-display {
        display: none;
    }
    
    .module-header {
        padding: var(--space-4);
    }
    
    .table-optimized {
        font-size: var(--font-size-sm);
        table-layout: auto;
    }
    
    .table-optimized th,
    .table-optimized td {
        padding: var(--space-3);
    }
    
    .table-optimized th[data-is-action-column="true"],
    .table-optimized td:last-child:has(.action-buttons) {
        width: 140px !important;
        min-width: 140px !important;
        max-width: 140px !important;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: var(--space-1);
    }
    
    .btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-sm);
    }
}

/* 手机竖屏 (≤ 479px) */
@media (max-width: 479px) {
    body {
        font-size: var(--font-size-sm);
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left var(--transition-normal);
        z-index: var(--z-40);
        width: 100%;
        height: 100vh;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
    
    .top-bar {
        padding: 0 var(--space-3);
        height: 56px;
    }
    
    .top-bar-left,
    .top-bar-right {
        flex: 1;
    }
    
    #page-title {
        font-size: var(--font-size-base);
        text-align: center;
    }
    
    #user-display,
    .btn-text {
        display: none;
    }
    
    .content-wrapper {
        padding: var(--space-3);
    }
    
    .module-container {
        border-radius: var(--radius-lg);
    }
    
    .module-header {
        padding: var(--space-3);
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }
    
    .search-box {
        min-width: 100%;
        max-width: 100%;
    }
    
    .table-optimized-container {
        border-radius: var(--radius-lg);
    }
    
    .table-optimized {
        font-size: var(--font-size-xs);
        table-layout: auto; /* 在小屏幕上使用自动布局 */
    }
    
    .table-optimized th,
    .table-optimized td {
        padding: var(--space-2);
        min-width: 80px;
    }
    
    .table-optimized th[data-is-action-column="true"],
    .table-optimized td:last-child:has(.action-buttons) {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: var(--space-1);
    }
    
    .btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--font-size-sm);
    }
    
    .btn-icon {
        width: 36px;
        height: 36px;
    }
    
    .pagination-container {
        padding: var(--space-3);
        flex-direction: column;
        gap: var(--space-2);
    }
    
    .pagination {
        width: 100%;
        justify-content: center;
    }
    
    .modal-backdrop {
        padding: var(--space-2);
    }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: var(--radius-lg);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-4);
    }
}

/* ====== 打印样式优化 ====== */
@media print {
    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }
    
    /* 隐藏不需要打印的元素 */
    .sidebar,
    .top-bar,
    .btn:not(.print-visible),
    .search-box,
    .pagination-container,
    .modal-backdrop,
    .notification,
    .loading-indicator {
        display: none !important;
    }
    
    /* 调整布局 */
    #main-container {
        display: block !important;
        background-color: white !important;
    }
    
    .main-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .content-wrapper {
        padding: 0 !important;
        overflow: visible !important;
    }
    
    .module-container {
        box-shadow: none !important;
        border: 1px solid var(--divider-color) !important;
        border-radius: 0 !important;
        page-break-inside: avoid !important;
    }
    
    .module-header {
        border-bottom: 2px solid var(--primary-color) !important;
    }
    
    /* 表格打印优化 */
    .table-optimized-container {
        border: 1px solid var(--divider-color) !important;
        border-radius: 0 !important;
        overflow: visible !important;
        page-break-inside: avoid !important;
    }
    
    .table-optimized {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto !important;
        table-layout: fixed !important;
    }
    
    .table-optimized thead {
        display: table-header-group !important;
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    .table-optimized th {
        border-bottom: 2px solid var(--primary-color) !important;
        color: black !important;
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    .table-optimized tbody tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
        border-bottom: 1px solid var(--divider-color) !important;
    }
    
    .table-optimized td {
        color: black !important;
    }
    
    /* 确保所有文字可读 */
    * {
        color: black !important;
        background-color: white !important;
    }
    
    /* 避免在行内分页 */
    .table-optimized tr {
        page-break-inside: avoid !important;
    }
    
    /* 统计卡片打印优化 */
    .stat-card {
        border: 1px solid var(--divider-color) !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
    }
    
    /* 隐藏不必要的装饰 */
    .stat-card::before,
    .nav-card::before,
    .btn::before,
    .sidebar::before {
        display: none !important;
    }
    
    /* 确保链接可读 */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: var(--font-size-sm);
        color: var(--text-secondary);
    }
    
    /* 打印页眉页脚控制 */
    @page :first {
        margin-top: 2cm;
    }
    
    @page :left {
        margin-left: 2cm;
        margin-right: 1.5cm;
    }
    
    @page :right {
        margin-left: 1.5cm;
        margin-right: 2cm;
    }
    
    /* 隐藏操作列 */
    .table-optimized th:last-child,
    .table-optimized td:last-child {
        display: none !important;
    }
}

/* ====== 无障碍优化 ====== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 焦点样式优化 */
:focus-visible {
    outline: 3px solid var(--primary-300);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --success-color: #006400;
        --warning-color: #8b4513;
        --error-color: #8b0000;
        --divider-color: #000000;
    }
    
    .status {
        border-width: 2px;
    }
    
    .table-optimized th {
        border-bottom: 3px solid var(--primary-color);
    }
}

/* ====== 滚动条美化 ====== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background-color: var(--background-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background-color: var(--divider-color);
    border-radius: var(--radius-full);
    border: 2px solid var(--background-color);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--gray-400);
}

/* 火狐浏览器滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--divider-color) var(--background-color);
}

/* 表格容器自定义滚动条 */
.table-optimized-container::-webkit-scrollbar {
    height: 8px;
}

.table-optimized-container::-webkit-scrollbar-track {
    background-color: var(--surface-variant);
    border-radius: var(--radius-full);
}

.table-optimized-container::-webkit-scrollbar-thumb {
    background-color: var(--primary-400);
    border-radius: var(--radius-full);
}

/* ====== 细节优化 ====== */
/* 1. 平滑滚动锚点 */
html {
    scroll-padding-top: 80px;
}

/* 2. 图片优化 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 3. 列表优化 */
ul, ol {
    padding-left: var(--space-6);
}

/* 4. 选择文本样式 */
::selection {
    background-color: rgba(var(--primary-500-rgb, 63, 81, 181), 0.2);
    color: var(--text-primary);
}

/* 防止模态框和表单元素的意外文本选择 */
.modal-content,
.form-control,
.searchable-select input,
.table-optimized {
    user-select: auto;
}

/* 特别防止按钮和链接的文本选择 */
.btn,
.nav-link,
.sidebar-link {
    user-select: none;
}

/* 防止模态框打开时的意外文本选择 */
.modal-open {
    user-select: none;
}

.modal-open .modal-content {
    user-select: text;
}

/* 防止表单控件在获得焦点时自动选择文本 */
.form-control:focus {
    user-select: auto;
}

/* 5. 占位符样式 */
::placeholder {
    color: var(--text-disabled);
    opacity: 1;
}

/* 6. 禁用状态样式 */
[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

/* 7. 代码样式 */
code {
    font-family: var(--font-mono);
    background-color: var(--background-color);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}

/* 8. 引用样式 */
blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: var(--space-4);
    margin-left: 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* 9. 水平线样式 */
hr {
    border: none;
    height: 1px;
    background-color: var(--divider-color);
    margin: var(--space-6) 0;
}

/* 10. 细节图标样式 */
.detail-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background-color: var(--background-color);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.detail-icon:hover {
    background-color: var(--primary-50);
    color: var(--primary-color);
}

/* ====== 性能优化 ====== */
/* 减少重绘重排 */
.content-section {
    will-change: transform, opacity;
}

/* 硬件加速 */
.stat-card,
.table-optimized tbody tr {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 图片懒加载占位 */
.lazy-image {
    background-color: var(--background-color);
    background-image: linear-gradient(90deg, 
        var(--background-color) 25%, 
        var(--surface-color) 50%, 
        var(--background-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ====== 特殊组件样式 ====== */
/* 数据卡片 */
.data-card {
    background-color: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--divider-color);
    transition: all var(--transition-normal);
}

.data-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
}

.data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--divider-color);
}

.data-card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.data-card-content {
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

/* 标签组 */
.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    background-color: var(--background-color);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
}

.tag:hover {
    background-color: var(--primary-50);
    color: var(--primary-color);
}

.tag.active {
    background-color: var(--primary-color);
    color: white;
}

/* 进度条 */
/* 进度条包装器 - 垂直布局 */
.progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: var(--background-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--primary-300) 0%, 
        var(--primary-500) 50%, 
        var(--primary-300) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    background-color: var(--error-50);
    color: var(--error-600);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: 1;
}

.badge-primary {
    background-color: var(--primary-50);
    color: var(--primary-600);
}

.badge-success {
    background-color: var(--success-50);
    color: var(--success-600);
}

.badge-warning {
    background-color: var(--warning-50);
    color: var(--warning-600);
}

/* ====== 最终优化补充 ====== */
/* 确保所有交互元素都有合适的触摸目标 */
@media (max-width: 768px) {
    .btn,
    .nav-card,
    .page-btn,
    .modal-close {
        min-height: 44px;
        min-width: 44px;
    }
}

/* 优化长按选择 */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 优化输入框在iOS上的显示 */
input,
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: var(--radius-lg);
}

/* 复选框/单选框恢复原生外观(2026-08-31):
   全局 input{appearance:none} 会把不在 .form-check-inline 内的 checkbox 压成 0x0,
   导致表格勾选/权限配置等所有复选框不可见不可点 */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
    vertical-align: middle;
}

/* 优化数字输入框 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* 优化细节图标 */
.detail-icon svg {
    width: 16px;
    height: 16px;
}

/* 优化表格操作按钮在小屏幕上的显示 */
@media (max-width: 479px) {
    .action-buttons .btn {
        padding: var(--space-1) var(--space-2);
        font-size: var(--font-size-xs);
    }
    
    .action-buttons .btn-icon {
        width: 32px;
        height: 32px;
    }
}

/* 优化模态框在小屏幕上的显示 */
@media (max-width: 639px) {
    .modal-content {
        border-radius: var(--radius-lg);
    }
    
    .modal-body {
        max-height: 60vh;
    }
}

/* 优化打印时的表格显示 */
@media print {
    .table-optimized {
        font-size: 10pt !important;
    }
    
    .table-optimized th,
    .table-optimized td {
        padding: 4pt 6pt !important;
    }
}

/* 优化骨架屏动画 */
.skeleton {
    animation: shimmer 2s ease-in-out infinite;
}

/* 添加自定义滚动条给特定元素 */
.scrollable-content {
    scrollbar-width: thin;
    scrollbar-color: var(--divider-color) var(--background-color);
}

.scrollable-content::-webkit-scrollbar {
    width: 6px;
}

.scrollable-content::-webkit-scrollbar-track {
    background-color: var(--background-color);
}

.scrollable-content::-webkit-scrollbar-thumb {
    background-color: var(--divider-color);
    border-radius: var(--radius-full);
}

/* 优化表单组件的过渡效果 */
.form-control,
.btn,
.nav-card,
.stat-card,
.modal-content {
    transition: all var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

/* 添加悬停提升效果 */
.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* 添加点击涟漪效果 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.ripple:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

/* 表格调试样式（开发模式） */
.debug-table-alignment .table-optimized td {
    border-left: 1px dashed rgba(255, 0, 0, 0.2);
}

.debug-table-alignment .table-optimized th {
    border-left: 1px dashed rgba(0, 0, 255, 0.2);
}

.debug-table-alignment .table-optimized th::before {
    opacity: 1 !important;
}

/* 表格列宽指示器（开发模式） */
.table-optimized th::before {
    content: attr(data-expected-width);
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    color: var(--text-disabled);
    background: rgba(0, 0, 0, 0.1);
    padding: 1px 3px;
    border-radius: 2px;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.table-optimized th:hover::before {
    opacity: 1;
}

/* 表格内容过长时的提示 */
.table-optimized td[title] {
    cursor: help;
    position: relative;
}

.table-optimized td[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--gray-800);
    color: white;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    z-index: var(--z-30);
    box-shadow: var(--shadow-lg);
    margin-bottom: 4px;
}

/* 表格单元格编辑状态 */
.table-optimized td.editing {
    background-color: rgba(var(--primary-500-rgb, 63, 81, 181), 0.05);
    border: 1px solid var(--primary-color) !important;
    position: relative;
}

.table-optimized td.editing::before {
    content: '✎';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    color: var(--primary-color);
}

/* 表格行选中状态 */
.table-optimized tbody tr.selected {
    background-color: rgba(var(--primary-500-rgb, 63, 81, 181), 0.08);
    border-left: 3px solid var(--primary-color);
}

.table-optimized tbody tr.selected td:first-child {
    padding-left: calc(var(--space-4) - 3px);
}

/* 表格过滤输入框 */
.table-filter {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background-color: var(--surface-color);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.table-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-500-rgb, 63, 81, 181), 0.1);
}

/* 表格列隐藏/显示控制 */
.table-column-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background-color: var(--surface-variant);
    border-radius: var(--radius-lg);
}

.column-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.column-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 表格导出按钮组 */
.table-export-buttons {
    display: flex;
    gap: var(--space-2);
    margin-left: auto;
}

.table-export-buttons .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
}

/* 表格统计信息 */
.table-stats {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--space-2);
}

/* 表格批量操作栏 */
.table-batch-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-50);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--primary-200);
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: var(--z-20);
}

.table-batch-actions.active {
    display: flex;
    animation: slideInUp var(--transition-fast);
}

.batch-selection-count {
    font-weight: var(--font-weight-medium);
    color: var(--primary-700);
}

/* 表格空状态改进 */
.table-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    color: var(--text-disabled);
}

.table-empty-state i {
    font-size: 36px;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

.table-empty-state h4 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

.table-empty-state p {
    max-width: 400px;
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-4);
}

/* 表格加载骨架屏 */
.table-skeleton {
    display: table;
    width: 100%;
    border-collapse: collapse;
}

.table-skeleton-row {
    display: table-row;
}

.table-skeleton-cell {
    display: table-cell;
    padding: var(--space-4);
    border-bottom: 1px solid var(--divider-color);
}

.skeleton-cell {
    height: 20px;
    background: linear-gradient(90deg, 
        var(--background-color) 25%, 
        var(--surface-color) 50%, 
        var(--background-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* 表格自适应高度 */
.table-auto-height {
    max-height: 600px;
    overflow-y: auto;
}

/* 表格固定列（首列固定） */
.table-fixed-first-column .table-optimized th:first-child,
.table-fixed-first-column .table-optimized td:first-child {
    position: sticky;
    left: 0;
    background-color: var(--surface-color);
    z-index: var(--z-10);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

/* 表格单元格紧凑模式 */
.table-compact .table-optimized th,
.table-compact .table-optimized td {
    padding: var(--space-2) var(--space-3);
}

.table-compact .table-optimized {
    font-size: var(--font-size-sm);
}

/* 表格单元格紧凑模式 */
.table-compact .action-buttons .btn {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
}

/* 表格单元格链接样式 */
.table-optimized td a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.table-optimized td a:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

/* 表格单元格多行文本省略 */
.table-optimized td.multi-line {
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: var(--line-height-relaxed);
}

/* 表格单元格图标对齐 */
.table-optimized td.with-icon {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.table-optimized td.with-icon i {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* 表格单元格状态指示器 */
.table-optimized td.status-cell {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.table-optimized td.status-cell::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.7;
}

/* 表格单元格头像 */
.table-optimized td.avatar-cell {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.table-optimized td .avatar {
    max-width: 60px;
    max-height: 60px;
    border-radius: 50%;
    background-color: var(--primary-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    color: var(--primary-700);
    font-weight: var(--font-weight-medium);
    flex-shrink: 0;
}

/* 表格单元格标签组 */
.table-optimized td .tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.table-optimized td .tag {
    font-size: var(--font-size-xs);
    padding: 1px 6px;
}

/* 表格单元格进度条 */
.table-optimized td .progress-cell {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* 进度条包装器 - 垂直布局 */
.table-optimized td .progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.table-optimized td .progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--background-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.table-optimized td .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--primary-300) 0%, 
        var(--primary-500) 50%, 
        var(--primary-300) 100%);
    border-radius: var(--radius-full);
}

.table-optimized td .progress-label {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-optimized td .progress-value {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* 表格单元格星级评分 */
.table-optimized td .star-rating {
    display: flex;
    gap: 2px;
}

.table-optimized td .star {
    color: var(--warning-300);
    font-size: var(--font-size-sm);
}

.table-optimized td .star.filled {
    color: var(--warning-500);
}

/* 表格单元格颜色指示器 */
.table-optimized td .color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--divider-color);
    display: inline-block;
    vertical-align: middle;
    margin-right: var(--space-2);
}

/* 表格单元格文件图标 */
.table-optimized td .file-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-50);
    color: var(--primary-600);
    border-radius: var(--radius-sm);
    margin-right: var(--space-2);
    font-size: var(--font-size-sm);
}

/* 表格单元格复选框 */
.table-optimized td .row-checkbox {
    margin: 0;
    cursor: pointer;
}

/* 表格单元格下拉菜单 */
.table-optimized td .dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--surface-color);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 160px;
    z-index: var(--z-30);
    display: none;
}

.table-optimized td .dropdown-menu.show {
    display: block;
    animation: fadeIn var(--transition-fast);
}

.table-optimized td .dropdown-item {
    display: block;
    padding: var(--space-3) var(--space-4);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.table-optimized td .dropdown-item:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

/* 表格单元格工具菜单 */
.table-optimized td .tool-menu {
    position: relative;
}

.table-optimized td .tool-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--divider-color);
    background-color: var(--surface-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.table-optimized td .tool-menu-btn:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 表格单元格内联编辑 */
.table-optimized td .inline-edit {
    display: none;
}

.table-optimized td.editing .inline-view {
    display: none;
}

.table-optimized td.editing .inline-edit {
    display: block;
}

.table-optimized td .inline-edit input,
.table-optimized td .inline-edit select {
    width: 100%;
    padding: var(--space-2);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}

/* 表格单元格验证状态 */
.table-optimized td.valid .form-control {
    border-color: var(--success-color);
}

.table-optimized td.invalid .form-control {
    border-color: var(--error-color);
}

.table-optimized td .validation-message {
    font-size: var(--font-size-xs);
    margin-top: var(--space-1);
    display: none;
}

.table-optimized td.invalid .validation-message {
    display: block;
    color: var(--error-color);
}

/* 表格单元格提示信息 */
.table-optimized td .cell-hint {
    font-size: var(--font-size-xs);
    color: var(--text-disabled);
    margin-top: var(--space-1);
}

/* 表格单元格时间线 */
.table-optimized td .timeline {
    position: relative;
    padding-left: 20px;
}

.table-optimized td .timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--divider-color);
}

.table-optimized td .timeline-item {
    position: relative;
    margin-bottom: var(--space-2);
}

.table-optimized td .timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid var(--surface-color);
}

/* 表格单元格折叠内容 */
.table-optimized td .collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.table-optimized td .collapsible-content.expanded {
    max-height: 200px;
}

.table-optimized td .toggle-collapse {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--primary-color);
    cursor: pointer;
    font-size: var(--font-size-xs);
    margin-top: var(--space-2);
}

/* 表格单元格评分 */
.table-optimized td .rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.table-optimized td .rating-star {
    color: var(--warning-300);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: color var(--transition-fast);
}

.table-optimized td .rating-star:hover,
.table-optimized td .rating-star.active {
    color: var(--warning-500);
}

/* 表格单元格徽章组 */
.table-optimized td .badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

/* 表格单元格开关 */
.table-optimized td .toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.table-optimized td .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.table-optimized td .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--divider-color);
    transition: .4s;
    border-radius: 34px;
}

.table-optimized td .toggle-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.table-optimized td input:checked + .toggle-slider {
    background-color: var(--success-color);
}

.table-optimized td input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* 表格单元格颜色选择器 */
.table-optimized td .color-picker {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--divider-color);
    cursor: pointer;
    display: inline-block;
}

/* 表格单元格图片预览 */
.table-optimized td .image-preview {
    max-width: 120px;
    max-height: 120px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.table-optimized td .image-preview:hover {
    transform: scale(1.1);
}

/* 表格单元格音频播放器 */
.table-optimized td .audio-player {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.table-optimized td .audio-player button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 表格单元格视频缩略图 */
.table-optimized td .video-thumbnail {
    position: relative;
    width: 60px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
}

.table-optimized td .video-thumbnail::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: var(--font-size-sm);
    background-color: rgba(0, 0, 0, 0.5);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 表格单元格地图预览 */
.table-optimized td .map-preview {
    width: 60px;
    height: 40px;
    border-radius: var(--radius-sm);
    background-color: var(--primary-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-600);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

/* 表格单元格二维码 */
.table-optimized td .qrcode {
    width: 40px;
    height: 40px;
    background-color: var(--background-color);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 表格单元格文件上传 */
.table-optimized td .file-upload {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.table-optimized td .file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.table-optimized td .file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    background-color: var(--primary-50);
    color: var(--primary-600);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
}

/* 表格单元格日期选择器 */
.table-optimized td .date-picker {
    width: 100px;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}

/* 表格单元格时间选择器 */
.table-optimized td .time-picker {
    width: 80px;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}

/* 表格单元格货币输入 */
.table-optimized td .currency-input {
    position: relative;
}

.table-optimized td .currency-input::before {
    content: '¥';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.table-optimized td .currency-input input {
    padding-left: 24px;
}

/* 表格单元格百分比输入 */
.table-optimized td .percent-input {
    position: relative;
}

.table-optimized td .percent-input::after {
    content: '%';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.table-optimized td .percent-input input {
    padding-right: 24px;
}

/* 表格单元格单位选择器 */
.table-optimized td .unit-selector {
    display: flex;
}

.table-optimized td .unit-selector input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
}

.table-optimized td .unit-selector select {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
    background-color: var(--background-color);
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-sm);
}

/* 表格单元格滑块 */
.table-optimized td .slider {
    width: 100%;
    height: 6px;
    background-color: var(--background-color);
    border-radius: var(--radius-full);
    outline: none;
    -webkit-appearance: none;
}

.table-optimized td .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary-color);
    cursor: pointer;
}

.table-optimized td .slider-value {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-align: center;
    margin-top: var(--space-1);
}

/* 表格单元格颜色选择器 */
.table-optimized td .color-selector {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.table-optimized td .color-option {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform var(--transition-fast);
}

.table-optimized td .color-option:hover {
    transform: scale(1.2);
}

.table-optimized td .color-option.selected {
    border-color: var(--primary-color);
}

/* 表格单元格图标选择器 */
.table-optimized td .icon-selector {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.table-optimized td .icon-option {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.table-optimized td .icon-option:hover {
    background-color: var(--primary-50);
    color: var(--primary-color);
}

.table-optimized td .icon-option.selected {
    background-color: var(--primary-color);
    color: white;
}

/* 表格单元格表情选择器 */
.table-optimized td .emoji-selector {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.table-optimized td .emoji-option {
    width: 24px;
    height: 24px;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.table-optimized td .emoji-option:hover {
    background-color: var(--background-color);
}

/* 表格单元格标签输入 */
.table-optimized td .tag-input {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    padding: var(--space-1);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-sm);
    min-height: 32px;
}

.table-optimized td .tag-input input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 60px;
    font-size: var(--font-size-sm);
    background-color: transparent;
}

/* 表格单元格自动完成 */
.table-optimized td .autocomplete {
    position: relative;
}

.table-optimized td .autocomplete-items {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: var(--z-30);
    display: none;
}

.table-optimized td .autocomplete-items.show {
    display: block;
}

.table-optimized td .autocomplete-item {
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.table-optimized td .autocomplete-item:hover {
    background-color: var(--background-color);
}

/* 表格单元格富文本编辑器 */
.table-optimized td .rich-text-editor {
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.table-optimized td .rich-text-toolbar {
    display: flex;
    gap: var(--space-1);
    padding: var(--space-1);
    background-color: var(--surface-variant);
    border-bottom: 1px solid var(--divider-color);
}

.table-optimized td .rich-text-content {
    min-height: 60px;
    padding: var(--space-2);
    font-size: var(--font-size-sm);
    outline: none;
}

/* 表格单元格代码编辑器 */
.table-optimized td .code-editor {
    border: 1px solid var(--divider-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.table-optimized td .code-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    background-color: var(--surface-variant);
    border-bottom: 1px solid var(--divider-color);
}

.table-optimized td .code-editor-content {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    min-height: 60px;
    padding: var(--space-2);
    outline: none;
    white-space: pre-wrap;
}

/* 表格单元格预览模式 */
.table-optimized td .preview-mode {
    opacity: 0.7;
}

.table-optimized td .preview-mode:hover {
    opacity: 1;
}

/* 表格单元格全屏模式 */
.table-optimized td.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-color);
    z-index: var(--z-50);
    padding: var(--space-6);
    overflow: auto;
}

/* 表格单元格打印样式 */
@media print {
    .table-optimized td .action-buttons,
    .table-optimized td .dropdown-menu,
    .table-optimized td .tool-menu,
    .table-optimized td .inline-edit,
    .table-optimized td .toggle-switch,
    .table-optimized td .file-upload,
    .table-optimized td .slider,
    .table-optimized td .color-selector,
    .table-optimized td .icon-selector,
    .table-optimized td .emoji-selector,
    .table-optimized td .tag-input,
    .table-optimized td .autocomplete,
    .table-optimized td .rich-text-editor,
    .table-optimized td .code-editor {
        display: none !important;
    }
}

/* ===== 修复: 操作列 td 与行对齐 (2026-08-21) =====
   原因: td.action-buttons 被 .action-buttons{display:flex} 化后脱离表格单元格布局,
   高度不随行拉伸(同行图片列60px/多行备注时行高变大, 操作列 td 仍保持内容高度),
   导致图标顶部对齐、下方大片空白(用户反馈"操作列和行不对齐")。
   修复: 操作列 td 恢复 table-cell + vertical-align:middle, 图标内联居中于整行 */
.table-optimized td.action-buttons,
td.action-buttons {
    display: table-cell;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
}
.table-optimized td.action-buttons .icon-btn + .icon-btn,
td.action-buttons .icon-btn + .icon-btn {
    margin-left: 4px;
}

/* ===== 操作列统一图标按钮 (2026-08-21: 去外壳纯图标, 全局缩小) ===== */
.action-icons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    flex-shrink: 0;
    line-height: 1;
    border-radius: 4px;
    transition: color .15s ease, background-color .15s ease, transform .15s ease;
}

.icon-btn:hover {
    color: #334155;
    background-color: rgba(100, 116, 139, 0.1);
    transform: translateY(-1px);
}

.icon-btn:active {
    transform: scale(0.9);
}

.icon-btn.edit { color: #3b82f6; }
.icon-btn.edit:hover { color: #2563eb; background-color: rgba(59, 130, 246, 0.12); }

.icon-btn.view { color: #10b981; }
.icon-btn.view:hover { color: #059669; background-color: rgba(16, 185, 129, 0.12); }

.icon-btn.delete { color: #ef4444; }
.icon-btn.delete:hover { color: #dc2626; background-color: rgba(239, 68, 68, 0.12); }

.icon-btn.export { color: #8b5cf6; }
.icon-btn.export:hover { color: #7c3aed; background-color: rgba(139, 92, 246, 0.12); }

.icon-btn.primary { color: #6366f1; }
.icon-btn.primary:hover { color: #4f46e5; background-color: rgba(99, 102, 241, 0.12); }

.icon-btn.info { color: #0ea5e9; }
.icon-btn.info:hover { color: #0284c7; background-color: rgba(14, 165, 233, 0.12); }

.icon-btn.warning { color: #f59e0b; }
.icon-btn.warning:hover { color: #d97706; background-color: rgba(245, 158, 11, 0.12); }

.icon-btn.success { color: #10b981; }
.icon-btn.success:hover { color: #059669; background-color: rgba(16, 185, 129, 0.12); }

.icon-btn.default { color: #64748b; }
.icon-btn.default:hover { color: #475569; background-color: rgba(100, 116, 139, 0.12); }

.icon-btn.sm { font-size: 11px; padding: 1px; }
.icon-btn.lg { font-size: 14px; padding: 3px; }

/* ====== 合同模板所见即所得编辑器 ====== */
.ct-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: #f5f6f8;
    border: 1px solid #d9dde3;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}
.ct-toolbar .ct-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    line-height: 1;
}
.ct-toolbar .ct-btn:hover { background: #e9ecf1; }
.ct-toolbar select {
    height: 30px;
    padding: 0 4px;
    font-size: 12px;
    border: 1px solid #d9dde3;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}
.ct-toolbar .ct-sep {
    width: 1px;
    height: 20px;
    background: #d9dde3;
    margin: 0 4px;
}
.ct-editor {
    min-height: 320px;
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #d9dde3;
    border-radius: 0 0 6px 6px;
    padding: 12px 14px;
    background: #f5f6fa; /* 浅色底色, 与页面白底区分, 避免光标/鼠标指针难辨 */
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
}
.ct-editor:focus {
    border-color: var(--primary-color, #4a6cf7);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.12);
}
.ct-editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}
.ct-editor table td {
    border: 1px solid #999;
    padding: 6px;
}
.ct-ph {
    background: #eef2ff;
    color: var(--primary-color, #4a6cf7);
    border: 1px dashed #9db2f7;
    border-radius: 3px;
    padding: 0 3px;
    font-family: monospace;
    font-size: 0.92em;
}

