/* LGURT ERP v2 - Multi-Theme System with CSS Variables */

/* ========================================
   CSS Variables - Theme System
   支持 4 色 × 2 模式 = 8 种主题组合
   ======================================== */

/* Purple Dark Theme (默认) */
:root[data-theme-color="purple"][data-theme-mode="dark"] {
    /* Primary Colors */
    --primary-400: #c084fc;
    --primary-500: #a855f7;
    --primary-600: #9333ea;
    --primary-700: #7e22ce;

    /* Primary with Alpha */
    --primary-500-alpha-05: rgba(168, 85, 247, 0.05);
    --primary-500-alpha-10: rgba(168, 85, 247, 0.1);
    --primary-500-alpha-15: rgba(168, 85, 247, 0.15);
    --primary-500-alpha-20: rgba(168, 85, 247, 0.2);
    --primary-500-alpha-30: rgba(168, 85, 247, 0.3);
    --primary-500-alpha-40: rgba(168, 85, 247, 0.4);
    --primary-600-alpha-05: rgba(147, 51, 234, 0.05);

    /* Background Colors */
    --bg-base: #0f172a;
    --bg-elevated: #1e293b;
    --bg-input: #334155;
    --bg-hover: rgba(255, 255, 255, 0.05);

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    /* Border Colors */
    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.1);
    --border-input: #475569;
}

/* Green Dark Theme */
:root[data-theme-color="green"][data-theme-mode="dark"] {
    --primary-400: #6ee7b7;
    --primary-500: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;

    --primary-500-alpha-05: rgba(16, 185, 129, 0.05);
    --primary-500-alpha-10: rgba(16, 185, 129, 0.1);
    --primary-500-alpha-15: rgba(16, 185, 129, 0.15);
    --primary-500-alpha-20: rgba(16, 185, 129, 0.2);
    --primary-500-alpha-30: rgba(16, 185, 129, 0.3);
    --primary-500-alpha-40: rgba(16, 185, 129, 0.4);
    --primary-600-alpha-05: rgba(5, 150, 105, 0.05);

    --bg-base: #0f172a;
    --bg-elevated: #1e293b;
    --bg-input: #334155;
    --bg-hover: rgba(255, 255, 255, 0.05);

    --text-primary: #f1f5f9;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.1);
    --border-input: #475569;
}

/* Blue Dark Theme */
:root[data-theme-color="blue"][data-theme-mode="dark"] {
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;

    --primary-500-alpha-05: rgba(59, 130, 246, 0.05);
    --primary-500-alpha-10: rgba(59, 130, 246, 0.1);
    --primary-500-alpha-15: rgba(59, 130, 246, 0.15);
    --primary-500-alpha-20: rgba(59, 130, 246, 0.2);
    --primary-500-alpha-30: rgba(59, 130, 246, 0.3);
    --primary-500-alpha-40: rgba(59, 130, 246, 0.4);
    --primary-600-alpha-05: rgba(37, 99, 235, 0.05);

    --bg-base: #0f172a;
    --bg-elevated: #1e293b;
    --bg-input: #334155;
    --bg-hover: rgba(255, 255, 255, 0.05);

    --text-primary: #f1f5f9;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.1);
    --border-input: #475569;
}

/* Pink Dark Theme */
:root[data-theme-color="pink"][data-theme-mode="dark"] {
    --primary-400: #f9a8d4;
    --primary-500: #ec4899;
    --primary-600: #db2777;
    --primary-700: #be185d;

    --primary-500-alpha-05: rgba(236, 72, 153, 0.05);
    --primary-500-alpha-10: rgba(236, 72, 153, 0.1);
    --primary-500-alpha-15: rgba(236, 72, 153, 0.15);
    --primary-500-alpha-20: rgba(236, 72, 153, 0.2);
    --primary-500-alpha-30: rgba(236, 72, 153, 0.3);
    --primary-500-alpha-40: rgba(236, 72, 153, 0.4);
    --primary-600-alpha-05: rgba(219, 39, 119, 0.05);

    --bg-base: #0f172a;
    --bg-elevated: #1e293b;
    --bg-input: #334155;
    --bg-hover: rgba(255, 255, 255, 0.05);

    --text-primary: #f1f5f9;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.1);
    --border-input: #475569;
}

/* ========== Orange Theme - Dark Mode ========== */
:root[data-theme-color="orange"][data-theme-mode="dark"] {
    --primary-400: #fdba74;
    --primary-500: #f97316;
    --primary-600: #ea580c;
    --primary-700: #c2410c;

    --primary-500-alpha-05: rgba(249, 115, 22, 0.05);
    --primary-500-alpha-10: rgba(249, 115, 22, 0.1);
    --primary-500-alpha-15: rgba(249, 115, 22, 0.15);
    --primary-500-alpha-20: rgba(249, 115, 22, 0.2);
    --primary-500-alpha-30: rgba(249, 115, 22, 0.3);
    --primary-500-alpha-40: rgba(249, 115, 22, 0.4);
    --primary-600-alpha-05: rgba(234, 88, 12, 0.05);

    --bg-base: #0f172a;
    --bg-elevated: #1e293b;
    --bg-input: #334155;
    --bg-hover: rgba(255, 255, 255, 0.05);

    --text-primary: #f1f5f9;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.1);
    --border-input: #475569;
}

/* ========== Cyan Theme - Dark Mode ========== */
:root[data-theme-color="cyan"][data-theme-mode="dark"] {
    --primary-400: #67e8f9;
    --primary-500: #06b6d4;
    --primary-600: #0891b2;
    --primary-700: #0e7490;

    --primary-500-alpha-05: rgba(6, 182, 212, 0.05);
    --primary-500-alpha-10: rgba(6, 182, 212, 0.1);
    --primary-500-alpha-15: rgba(6, 182, 212, 0.15);
    --primary-500-alpha-20: rgba(6, 182, 212, 0.2);
    --primary-500-alpha-30: rgba(6, 182, 212, 0.3);
    --primary-500-alpha-40: rgba(6, 182, 212, 0.4);
    --primary-600-alpha-05: rgba(8, 145, 178, 0.05);

    --bg-base: #0f172a;
    --bg-elevated: #1e293b;
    --bg-input: #334155;
    --bg-hover: rgba(255, 255, 255, 0.05);

    --text-primary: #f1f5f9;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.1);
    --border-input: #475569;
}

/* Purple Light Theme */
:root[data-theme-color="purple"][data-theme-mode="light"] {
    --primary-400: #a855f7;
    --primary-500: #9333ea;
    --primary-600: #7e22ce;
    --primary-700: #6b21a8;

    --primary-500-alpha-05: rgba(147, 51, 234, 0.05);
    --primary-500-alpha-10: rgba(147, 51, 234, 0.1);
    --primary-500-alpha-15: rgba(147, 51, 234, 0.15);
    --primary-500-alpha-20: rgba(147, 51, 234, 0.2);
    --primary-500-alpha-30: rgba(147, 51, 234, 0.3);
    --primary-500-alpha-40: rgba(147, 51, 234, 0.4);
    --primary-600-alpha-05: rgba(126, 34, 206, 0.05);

    --bg-base: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-input: #f1f5f9;
    --bg-hover: rgba(0, 0, 0, 0.03);

    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --border-primary: rgba(0, 0, 0, 0.1);
    --border-secondary: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-input: #cbd5e1;
}

/* Green Light Theme */
:root[data-theme-color="green"][data-theme-mode="light"] {
    --primary-400: #10b981;
    --primary-500: #059669;
    --primary-600: #047857;
    --primary-700: #065f46;

    --primary-500-alpha-05: rgba(5, 150, 105, 0.05);
    --primary-500-alpha-10: rgba(5, 150, 105, 0.1);
    --primary-500-alpha-15: rgba(5, 150, 105, 0.15);
    --primary-500-alpha-20: rgba(5, 150, 105, 0.2);
    --primary-500-alpha-30: rgba(5, 150, 105, 0.3);
    --primary-500-alpha-40: rgba(5, 150, 105, 0.4);
    --primary-600-alpha-05: rgba(4, 120, 87, 0.05);

    --bg-base: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-input: #f1f5f9;
    --bg-hover: rgba(0, 0, 0, 0.03);

    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --border-primary: rgba(0, 0, 0, 0.1);
    --border-secondary: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-input: #cbd5e1;
}

/* Blue Light Theme */
:root[data-theme-color="blue"][data-theme-mode="light"] {
    --primary-400: #3b82f6;
    --primary-500: #2563eb;
    --primary-600: #1d4ed8;
    --primary-700: #1e40af;

    --primary-500-alpha-05: rgba(37, 99, 235, 0.05);
    --primary-500-alpha-10: rgba(37, 99, 235, 0.1);
    --primary-500-alpha-15: rgba(37, 99, 235, 0.15);
    --primary-500-alpha-20: rgba(37, 99, 235, 0.2);
    --primary-500-alpha-30: rgba(37, 99, 235, 0.3);
    --primary-500-alpha-40: rgba(37, 99, 235, 0.4);
    --primary-600-alpha-05: rgba(29, 78, 216, 0.05);

    --bg-base: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-input: #f1f5f9;
    --bg-hover: rgba(0, 0, 0, 0.03);

    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --border-primary: rgba(0, 0, 0, 0.1);
    --border-secondary: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-input: #cbd5e1;
}

/* Pink Light Theme */
:root[data-theme-color="pink"][data-theme-mode="light"] {
    --primary-400: #ec4899;
    --primary-500: #db2777;
    --primary-600: #be185d;
    --primary-700: #9f1239;

    --primary-500-alpha-05: rgba(219, 39, 119, 0.05);
    --primary-500-alpha-10: rgba(219, 39, 119, 0.1);
    --primary-500-alpha-15: rgba(219, 39, 119, 0.15);
    --primary-500-alpha-20: rgba(219, 39, 119, 0.2);
    --primary-500-alpha-30: rgba(219, 39, 119, 0.3);
    --primary-500-alpha-40: rgba(219, 39, 119, 0.4);
    --primary-600-alpha-05: rgba(190, 24, 93, 0.05);

    --bg-base: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-input: #f1f5f9;
    --bg-hover: rgba(0, 0, 0, 0.03);

    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --border-primary: rgba(0, 0, 0, 0.1);
    --border-secondary: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-input: #cbd5e1;
}

/* ========== Orange Theme - Light Mode ========== */
:root[data-theme-color="orange"][data-theme-mode="light"] {
    --primary-400: #f97316;
    --primary-500: #ea580c;
    --primary-600: #c2410c;
    --primary-700: #9a3412;

    --primary-500-alpha-05: rgba(234, 88, 12, 0.05);
    --primary-500-alpha-10: rgba(234, 88, 12, 0.1);
    --primary-500-alpha-15: rgba(234, 88, 12, 0.15);
    --primary-500-alpha-20: rgba(234, 88, 12, 0.2);
    --primary-500-alpha-30: rgba(234, 88, 12, 0.3);
    --primary-500-alpha-40: rgba(234, 88, 12, 0.4);
    --primary-600-alpha-05: rgba(194, 65, 12, 0.05);

    --bg-base: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-input: #f1f5f9;
    --bg-hover: rgba(0, 0, 0, 0.03);

    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --border-primary: rgba(0, 0, 0, 0.1);
    --border-secondary: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-input: #cbd5e1;
}

/* ========== Cyan Theme - Light Mode ========== */
:root[data-theme-color="cyan"][data-theme-mode="light"] {
    --primary-400: #06b6d4;
    --primary-500: #0891b2;
    --primary-600: #0e7490;
    --primary-700: #155e75;

    --primary-500-alpha-05: rgba(8, 145, 178, 0.05);
    --primary-500-alpha-10: rgba(8, 145, 178, 0.1);
    --primary-500-alpha-15: rgba(8, 145, 178, 0.15);
    --primary-500-alpha-20: rgba(8, 145, 178, 0.2);
    --primary-500-alpha-30: rgba(8, 145, 178, 0.3);
    --primary-500-alpha-40: rgba(8, 145, 178, 0.4);
    --primary-600-alpha-05: rgba(14, 116, 144, 0.05);

    --bg-base: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-input: #f1f5f9;
    --bg-hover: rgba(0, 0, 0, 0.03);

    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --border-primary: rgba(0, 0, 0, 0.1);
    --border-secondary: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-input: #cbd5e1;
}

/* ========================================
   Navigation
   ======================================== */
.nav-section {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1rem;
}

/* 导航分组 - 优化动画 */
.nav-group {
    margin-bottom: 0.5rem;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.75rem;
    margin: 0.125rem 0.5rem;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.nav-group-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-500-alpha-10) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-group-header:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-group-header:hover::before {
    opacity: 1;
}

.nav-group.expanded .nav-group-header {
    color: var(--primary-400);
    font-weight: 500;
    background: var(--primary-500-alpha-10);
}

.nav-group.expanded .nav-group-header::before {
    opacity: 0.5;
}

.nav-group-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-group-header:hover .nav-group-icon {
    transform: scale(1.1);
}

.nav-group.expanded .nav-group-icon {
    transform: scale(1.05);
}

.nav-group-title {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-group-arrow {
    font-size: 1.25rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-subtle);
}

.nav-group.expanded .nav-group-arrow {
    transform: rotate(90deg);
    color: var(--primary-400);
}

.nav-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 0.5rem;
}

.nav-group.expanded .nav-group-items {
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    padding-left: 2.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.75rem;
    margin: 0.125rem 0.5rem;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-500) 0%, var(--primary-600) 100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 4px 4px 0;
    transform: translateX(-4px);
}

.nav-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-500-alpha-05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
    transform: translateX(4px);
    padding-left: 2.75rem;
}

.nav-item:hover::before {
    opacity: 0.6;
    transform: translateX(0);
}

.nav-item:hover::after {
    opacity: 1;
}

.nav-item.active {
    background: var(--primary-500-alpha-15);
    color: var(--primary-400);
    font-weight: 500;
    box-shadow: inset 0 0 0 1px var(--primary-500-alpha-20);
    transform: translateX(4px);
    padding-left: 2.75rem;
}

.nav-item.active::before {
    opacity: 1;
    transform: translateX(0);
}

.nav-item.active::after {
    opacity: 0.5;
}

/* 移除涟漪效果以提升性能 */

/* ========================================
   Page Transition Animations (极简版 - 零卡顿)
   ======================================== */

/* 完全移除页面过渡动画，实现即时加载 */
main > .p-6 {
    /* 不使用任何动画，让内容立即显示 */
}

/* 只优化导航项的性能 */
.nav-item {
    will-change: background-color;
}

/* 减少布局抖动的全局优化 */
html {
    scroll-behavior: auto; /* 改为auto，避免滚动动画影响性能 */
}

body {
    overflow-x: hidden;
    overflow-y: scroll; /* 始终显示滚动条，避免内容跳动 */
}

/* 防止内容闪烁 */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 优化图像和媒体加载 */
img, video {
    display: block;
    max-width: 100%;
    height: auto;
}

/* 为导航栏内容提供GPU加速 */
aside {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 减少动画引起的重排 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 页面加载进度条 (极简版) */
.page-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary-500);
    z-index: 9999;
    transition: none; /* 完全移除过渡，立即显示/隐藏 */
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   Panels
   ======================================== */
.panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-secondary);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-weight: 600;
}

.panel-body {
    padding: 1.25rem;
}

/* ========================================
   KPI Cards
   ======================================== */
.kpi-card {
    background: linear-gradient(135deg, var(--primary-500-alpha-10), var(--primary-600-alpha-05));
    border: 1px solid var(--primary-500-alpha-20);
    border-radius: 0.75rem;
    padding: 0.875rem 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
    min-height: 95px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-500-alpha-10) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    pointer-events: none;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-500-alpha-40);
    box-shadow: 0 8px 16px -4px var(--primary-500-alpha-30);
}

.kpi-card:hover::before {
    opacity: 1;
    transform: translate(25%, 25%);
}

.kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-sub {
    font-size: 0.65rem;
    color: var(--text-primary);
    opacity: 0.7;
    margin-top: 0.25rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* KPI卡片 - 大尺寸（决策页面等） */
.kpi-card-large {
    background: linear-gradient(135deg, var(--primary-500-alpha-10), var(--primary-600-alpha-05));
    border: 1px solid var(--primary-500-alpha-20);
    border-radius: 1rem;
    padding: 1.75rem 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}

.kpi-card-large::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-500-alpha-10) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    pointer-events: none;
}

.kpi-card-large:hover {
    transform: translateY(-4px);
    border-color: var(--primary-500-alpha-40);
    box-shadow: 0 12px 24px -6px var(--primary-500-alpha-30);
}

.kpi-card-large:hover::before {
    opacity: 1;
    transform: translate(25%, 25%);
}

.kpi-label-large {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    letter-spacing: 0.025em;
    text-align: left;
}

.kpi-value-large {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
    text-align: left;
}

.kpi-sub-large {
    font-size: 0.8125rem;
    color: var(--text-subtle);
    line-height: 1.4;
    text-align: left;
}

/* 响应式：手机端稍微缩小 */
@media (max-width: 640px) {
    .kpi-card-large {
        padding: 1.25rem 1.5rem;
        min-height: 120px;
    }

    .kpi-label-large {
        font-size: 0.8125rem;
        margin-bottom: 0.5rem;
    }

    .kpi-value-large {
        font-size: 1.875rem;
        margin-bottom: 0.375rem;
    }

    .kpi-sub-large {
        font-size: 0.75rem;
    }
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
}

.badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.badge-danger {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.badge-info {
    background: var(--primary-500-alpha-15);
    color: var(--primary-400);
}

.badge-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: transform 0.6s ease-out;
    pointer-events: none;
}

.btn:active::after {
    transform: translate(-50%, -50%) scale(2);
    transition: transform 0s;
}

.btn-primary {
    background: var(--primary-600);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: var(--primary-700);
    box-shadow: 0 4px 8px var(--primary-500-alpha-40);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: var(--border-hover);
    border-color: var(--primary-500-alpha-20);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ========================================
   Tabs
   ======================================== */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--primary-500-alpha-15);
    color: var(--primary-400);
    border-color: var(--primary-500-alpha-30);
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

/* ========================================
   Chips
   ======================================== */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-hover);
    border: 1px solid var(--border-primary);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s;
}

.chip:hover {
    background: var(--border-hover);
    color: var(--text-secondary);
}

.chip.active {
    background: var(--primary-500-alpha-15);
    color: var(--primary-400);
    border-color: var(--primary-500-alpha-30);
}

/* ========================================
   Tables
   ======================================== */
.table-container {
    overflow-x: auto;
    max-height: 600px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-primary);
    white-space: nowrap;
}

.data-table td {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-secondary);
}

.data-table tbody tr:hover {
    background: var(--border-secondary);
}

.data-table .cursor-pointer {
    cursor: pointer;
}

/* ========================================
   Alerts
   ======================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-critical {
    background: rgba(248, 113, 113, 0.1);
    border-color: #f87171;
    color: #fca5a5;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
    color: #fcd34d;
}

.alert-success {
    background: rgba(52, 211, 153, 0.1);
    border-color: #34d399;
    color: #6ee7b7;
}

.alert-info {
    background: var(--primary-500-alpha-10);
    border-color: var(--primary-500);
    color: var(--primary-400);
}

/* ========================================
   Modal
   ======================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
}

/* ========================================
   Form inputs
   ======================================== */
.form-input,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    color: var(--text-primary);
    border-radius: 0.5rem;
    transition: border-color 0.15s;
}

.form-input:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px var(--primary-500-alpha-20);
}

/* Checkbox */
input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-500);
    cursor: pointer;
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--border-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-500-alpha-30);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-500-alpha-40);
}

/* ========================================
   Utilities
   ======================================== */
.text-primary {
    color: var(--primary-500);
}

.bg-primary {
    background-color: var(--primary-500);
}

/* ========================================
   Body and Layout Overrides
   ======================================== */

/* 平滑的主题切换过渡 */
html {
    transition: background-color 0.25s ease, color 0.25s ease;
}

body,
.panel,
.marketing-panel,
.btn,
aside,
header,
nav,
.kpi-card,
.marketing-kpi-card,
.marketing-feature-card,
input,
textarea,
select,
.badge,
.chip {
    transition: background-color 0.25s ease,
                color 0.25s ease,
                border-color 0.25s ease;
}

body {
    background-color: var(--bg-base) !important;
    color: var(--text-secondary) !important;
}

aside {
    background-color: var(--bg-elevated) !important;
    border-color: var(--border-primary) !important;
}

header {
    background-color: var(--bg-elevated) !important;
    border-color: var(--border-primary) !important;
}

.logo-text {
    color: var(--primary-400) !important;
}

/* ========================================
   UX 增强优化 (2024)
   ======================================== */

/* 按钮增强 - 添加活跃状态和禁用状态 */
.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary:active {
    background: var(--primary-700);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-secondary:active {
    background: var(--bg-input);
}

.btn-success:active {
    background: #047857;
}

.btn-danger:active {
    background: #b91c1c;
}

/* 面板增强 - 悬停效果和更好的层次感 */
.panel {
    transition: all 0.2s ease;
}

.panel:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--border-hover);
}

/* 表格增强 - 更好的行交互 */
.data-table tbody tr {
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Chip 增强 - 更明显的活跃状态 */
.chip.active {
    background: var(--primary-500-alpha-20);
    color: var(--primary-400);
    border-color: var(--primary-500-alpha-40);
    font-weight: 600;
    box-shadow: 0 0 0 3px var(--primary-500-alpha-10);
}

/* 输入框增强 - 聚焦状态 */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-500) !important;
    box-shadow: 0 0 0 3px var(--primary-500-alpha-15);
}

/* 徽章增强 - 更明显的视觉 */
.badge {
    font-weight: 600;
    letter-spacing: 0.025em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-neutral {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Tab 增强 - 更平滑的切换动画 */
.tab-btn {
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-500);
    border-radius: 2px 2px 0 0;
}

/* 链接增强 - 更好的悬停效果 */
a {
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-400);
}

/* 卡片阴影层次 */
.shadow-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.shadow {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.shadow-lg {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* 加载动画优化 */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 列表项淡入（错开动画） */
.data-table tbody tr {
    animation: fadeIn 0.2s ease-out;
}

/* 模态框增强 */
.modal {
    transition: opacity 0.2s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal:not(.hidden) {
    opacity: 1;
}

.modal-backdrop {
    transition: background-color 0.2s ease;
}

.modal-content {
    animation: fadeIn 0.25s ease-out;
}

/* 通知提示优化 */
.toast {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式按钮组 */
.flex-wrap .btn {
    min-width: fit-content;
}

/* 滚动条美化 */
.table-container::-webkit-scrollbar,
.overflow-y-auto::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track,
.overflow-y-auto::-webkit-scrollbar-track {
    background: var(--bg-elevated);
}

.table-container::-webkit-scrollbar-thumb,
.overflow-y-auto::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover,
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* 改善对比度 */
.text-slate-400 {
    color: var(--text-muted) !important;
}

.text-slate-500 {
    color: var(--text-subtle) !important;
}

/* 确保所有文本在任何背景下可读 */
.bg-emerald-50 {
    background: rgba(16, 185, 129, 0.1) !important;
}

.text-emerald-700 {
    color: #34d399 !important;
}

/* 改善选中状态的可见性 */
input[type="checkbox"]:checked {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
}

input[type="checkbox"] {
    accent-color: var(--primary-600);
    cursor: pointer;
}

/* 工具提示样式 */
[title] {
    cursor: help;
}

/* 可点击元素的指针样式 */
[onclick],
.cursor-pointer {
    cursor: pointer;
}

/* 禁用元素样式 */
[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 空状态优化 */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state .text-4xl {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 加载状态优化 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* 错误状态优化 */
.error-state {
    padding: 2rem;
    text-align: center;
    color: #f87171;
}

/* 成功状态优化 */
.success-state {
    padding: 2rem;
    text-align: center;
    color: #34d399;
}

/* ========================================
   Tailwind 颜色类覆盖 - 适配主题系统
   ======================================== */

/* 文本颜色覆盖 */
.text-gray-100 { color: var(--text-secondary) !important; }
.text-gray-200 { color: var(--text-secondary) !important; }
.text-gray-300 { color: var(--text-secondary) !important; }
.text-gray-400 { color: var(--text-muted) !important; }
.text-gray-500 { color: var(--text-muted) !important; }
.text-gray-600 { color: var(--text-subtle) !important; }
.text-gray-700 { color: var(--text-subtle) !important; }
.text-gray-800 { color: var(--text-primary) !important; }
.text-gray-900 { color: var(--text-primary) !important; }

.text-white { color: var(--text-primary) !important; }
.text-slate-100 { color: var(--text-secondary) !important; }
.text-slate-200 { color: var(--text-secondary) !important; }
.text-slate-300 { color: var(--text-muted) !important; }
.text-slate-400 { color: var(--text-muted) !important; }
.text-slate-500 { color: var(--text-subtle) !important; }
.text-slate-600 { color: var(--text-subtle) !important; }
.text-slate-700 { color: var(--text-primary) !important; }
.text-slate-800 { color: var(--text-primary) !important; }
.text-slate-900 { color: var(--text-primary) !important; }

/* 背景颜色覆盖 */
.bg-white { background: var(--bg-elevated) !important; }
.bg-gray-50 { background: var(--bg-elevated) !important; }
.bg-gray-100 { background: var(--bg-input) !important; }
.bg-gray-200 { background: var(--bg-input) !important; }
.bg-gray-300 { background: var(--border-primary) !important; }
.bg-slate-50 { background: var(--bg-elevated) !important; }
.bg-slate-100 { background: var(--bg-input) !important; }
.bg-slate-200 { background: var(--bg-input) !important; }

/* 边框颜色覆盖 */
.border-gray-100 { border-color: var(--border-secondary) !important; }
.border-gray-200 { border-color: var(--border-primary) !important; }
.border-gray-300 { border-color: var(--border-primary) !important; }
.border-slate-100 { border-color: var(--border-secondary) !important; }
.border-slate-200 { border-color: var(--border-primary) !important; }
.border-slate-300 { border-color: var(--border-primary) !important; }

/* 特殊颜色保持不变（主题色、状态色等） */
.text-purple-600,
.text-purple-700,
.text-blue-600,
.text-emerald-600,
.text-green-400,
.text-red-400 {
    /* 保留原有颜色 */
}

/* Hover 状态的边框颜色 */
.hover\:border-purple-300:hover {
    border-color: var(--primary-500-alpha-30) !important;
}

/* 紫色背景（主题色相关） */
.bg-purple-50 {
    background: var(--primary-500-alpha-10) !important;
}

.bg-purple-100 {
    background: var(--primary-500-alpha-15) !important;
}

/* Emerald 颜色（用于 info box） */
.bg-emerald-50 {
    background: rgba(16, 185, 129, 0.1) !important;
}

.border-emerald-200 {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.text-emerald-700 {
    color: #34d399 !important;
}

/* 自定义文本颜色类 */
.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-subtle {
    color: var(--text-subtle) !important;
}

/* ========================================
   导航和全局动画优化
   ======================================== */

/* 左侧导航动画优化 */
.nav-item {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: background-color, transform;
}

.nav-item:hover {
    background-color: var(--primary-500-alpha-15);
    transform: translateX(4px);
}

.nav-item.active {
    background-color: var(--primary-500-alpha-20);
    border-left: 3px solid var(--primary-500);
}

/* 全局交互元素动画 */
button, .btn, a, .card, .panel {
    transition: all 0.2s ease-in-out;
}

button:hover, .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active, .btn:active {
    transform: translateY(0);
}

/* 焦点状态动画 */
button:focus, a:focus, .btn:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    transform: scale(1.02);
}

/* 加载状态动画 */
.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 卡片悬停效果 */
.card:hover, .panel:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Tab按钮动画 */
.tab-btn {
    transition: all 0.2s ease-in-out;
}

.tab-btn.active {
    background-color: var(--primary-500);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-500-alpha-30);
}

/* 输入框焦点动画 */
input:focus, textarea:focus, select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-500-alpha-10);
    transform: scale(1.01);
    transition: all 0.2s ease-in-out;
}
