/* 中国神话风格 - 全局样式 */
/* 本地自托管字体，无需依赖 Google Fonts CDN（在中国大陆被屏蔽） */
@font-face {
    font-family: 'Noto Sans SC';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/NotoSansSC-VF.woff2') format('woff2-variations');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 神话配色 */
    --primary-color: #8B0000;
    --primary-dark: #5C0000;
    --primary-light: #B22222;
    --gold-color: #D4AF37;
    --gold-light: #F0E68C;
    --bronze-color: #CD7F32;
    --jade-color: #00A86B;
    --ink-color: #1a1a1a;
    --paper-color: #F5F0E6;
    --paper-dark: #E8DFD0;
    --silk-red: #DC143C;
    --phoenix-orange: #FF6B35;
    --dragon-green: #2E8B57;
    --cloud-white: #F8F8FF;
    
    /* 文本颜色 */
    --text-primary: #2C1810;
    --text-secondary: #5D4E37;
    --text-gold: #D4AF37;
    
    /* 边框和阴影 */
    --border-color: #C4A35A;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #F5F0E6 0%, #E8DFD0 50%, #DEC9A6 100%);
    background-image: 
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C4A35A' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: var(--text-primary);
    line-height: 1.8;
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0a0a 0%, #2C1810 50%, #1a0a0a 100%);
    background-image: 
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0L100 50L50 100L0 50Z' fill='%23D4AF37' fill-opacity='0.03'/%3E%3C/svg%3E"),
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(139, 0, 0, 0.1) 0%, transparent 50%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: float 20s linear infinite;
}

@keyframes float {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-container {
    background: linear-gradient(135deg, rgba(245, 240, 230, 0.95) 0%, rgba(232, 223, 208, 0.95) 100%);
    border: 3px solid var(--gold-color);
    border-radius: 8px;
    box-shadow: 
        0 0 0 1px rgba(212, 175, 55, 0.3),
        0 0 40px rgba(212, 175, 55, 0.2),
        var(--shadow-lg);
    padding: 48px;
    width: 100%;
    max-width: 480px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--gold-color) 20%, 
        var(--silk-red) 50%, 
        var(--gold-color) 80%, 
        transparent 100%);
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--gold-color) 20%, 
        var(--silk-red) 50%, 
        var(--gold-color) 80%, 
        transparent 100%);
}

.login-box {
    background: linear-gradient(135deg, rgba(245, 240, 230, 0.95) 0%, rgba(232, 223, 208, 0.95) 100%);
    border: 3px solid var(--gold-color);
    border-radius: 8px;
    box-shadow: 
        0 0 0 1px rgba(212, 175, 55, 0.3),
        0 0 40px rgba(212, 175, 55, 0.2),
        var(--shadow-lg);
    padding: 48px;
    width: 100%;
    max-width: 480px;
    position: relative;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background-image: url('logo.png?v=20260814a');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid var(--gold-color);
    border-radius: 50%;
    margin-bottom: 24px;
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* 侧边栏 LOGO（经典主题） */
.sidebar-logo {
    width: 48px;
    height: 48px;
    background-image: url('logo.png?v=20260814a');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid var(--gold-color);
    border-radius: 50%;
    margin: 0 auto 12px;
    box-shadow:
        0 0 14px rgba(212, 175, 55, 0.4),
        inset 0 0 12px rgba(0, 0, 0, 0.25);
}

.logo::before {
    content: '';
    display: none;
}

.logo svg {
    display: none;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-shadow: 2px 2px 0 var(--gold-light);
    letter-spacing: 4px;
}

.subtitle {
    color: var(--text-gold);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold-color);
    box-shadow: 
        0 0 0 3px rgba(212, 175, 55, 0.2),
        inset 0 0 10px rgba(212, 175, 55, 0.05);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--gold-light);
    border: 2px solid var(--gold-color);
    padding: 14px 28px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(139, 0, 0, 0.4),
        0 0 20px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-login {
    background: linear-gradient(135deg, var(--silk-red) 0%, var(--primary-dark) 100%);
    color: var(--gold-light);
    border: 2px solid var(--gold-color);
    padding: 14px 28px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 10px;
    letter-spacing: 4px;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.4), transparent);
    transition: left 0.5s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(139, 0, 0, 0.4),
        0 0 30px rgba(212, 175, 55, 0.4);
}

.btn-login:hover::before {
    left: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color);
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 13px;
    letter-spacing: 1px;
}

.btn-secondary {
    background: linear-gradient(135deg, #F5F0E6 0%, #E8DFD0 100%);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--paper-dark) 100%);
    border-color: var(--gold-color);
    transform: translateY(-1px);
}

.demo-accounts {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(232, 223, 208, 0.5) 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.demo-accounts p {
    margin: 4px 0;
}

/* 主应用布局 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a0a0a 0%, #2C1810 50%, #1a0a0a 100%);
    border-right: 3px solid var(--gold-color);
    color: var(--gold-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, 
        transparent 0%, 
        var(--gold-color) 20%, 
        var(--silk-red) 50%, 
        var(--gold-color) 80%, 
        transparent 100%);
    opacity: 0.5;
}

.sidebar-header {
    padding: 32px 24px;
    border-bottom: 2px solid var(--gold-color);
    position: relative;
    text-align: center;
}

.sidebar-header::before {
    content: '☰';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: var(--gold-color);
    opacity: 0.3;
    display: none; /* 已由侧边栏 LOGO 取代 */
}

.sidebar-header h2 {
    font-size: 17px;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--gold-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    line-height: 1.5;
}

.sidebar-header p {
    font-size: 12px;
    color: var(--bronze-color);
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--bronze-color);
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 6px;
    transition: all 0.3s;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--gold-color);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.nav-item:hover {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, transparent 100%);
    color: var(--gold-light);
    border-color: rgba(212, 175, 55, 0.3);
}

.nav-item:hover::before {
    transform: scaleY(1);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.6) 0%, rgba(92, 0, 0, 0.6) 100%);
    color: var(--gold-light);
    border-color: var(--gold-color);
    box-shadow: 
        0 0 15px rgba(139, 0, 0, 0.3),
        inset 0 0 20px rgba(212, 175, 55, 0.1);
}

.nav-item.active::before {
    transform: scaleY(1);
    background: var(--gold-light);
}

.nav-item svg {
    flex-shrink: 0;
}

.nav-item span {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 2px solid var(--gold-color);
}

.btn-logout {
    width: 100%;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.3) 0%, rgba(92, 0, 0, 0.3) 100%);
    color: var(--gold-light);
    border: 2px solid var(--gold-color);
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
}

.btn-logout:hover {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.5) 0%, rgba(92, 0, 0, 0.5) 100%);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.btn-change-password {
    width: 100%;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(205, 127, 50, 0.2) 100%);
    color: var(--gold-light);
    border: 2px solid var(--gold-color);
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.btn-change-password:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3) 0%, rgba(205, 127, 50, 0.3) 100%);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    min-height: 100vh;
    background: linear-gradient(135deg, #F5F0E6 0%, #E8DFD0 100%);
    position: relative;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--gold-color) 0%, 
        var(--silk-red) 25%, 
        var(--gold-color) 50%, 
        var(--silk-red) 75%, 
        var(--gold-color) 100%);
}

/* 页面 */
.page {
    display: none;
    animation: fadeIn 0.4s ease;
}

.page.active {
    display: block;
}

/* 页面内元素动画 */
.page.active .metrics-grid {
    animation: slideUp 0.5s ease 0.1s both;
}

.page.active .charts-grid {
    animation: slideUp 0.5s ease 0.2s both;
}

.page.active .table-container {
    animation: slideUp 0.5s ease 0.15s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, var(--silk-red), var(--gold-color));
}

.page-header h1 {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 2px;
}

.page-header h1::before {
    content: '◆';
    font-size: 20px;
    color: var(--gold-color);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.filter-select,
.filter-input {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    transition: all 0.3s;
    cursor: pointer;
    min-width: 140px;
}

.filter-select:hover,
.filter-input:hover {
    border-color: var(--gold-color);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--silk-red);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

/* 指标卡片 */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.metric-card {
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 28px;
    display: flex;
    gap: 20px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold-color), var(--silk-red));
}

.metric-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--gold-color) 0%, transparent 70%);
    opacity: 0.05;
    transform: translate(30%, 30%);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.15),
        0 0 30px rgba(212, 175, 55, 0.2);
    border-color: var(--gold-color);
}

.metric-icon {
    width: 64px;
    height: 64px;
    border: 2px solid var(--gold-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.metric-card:hover .metric-icon {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.metric-icon.blue {
    background: linear-gradient(135deg, #1a5490 0%, #0d3a6a 100%);
    color: var(--gold-light);
    box-shadow: 0 4px 12px rgba(26, 84, 144, 0.3);
}

.metric-icon.red {
    background: linear-gradient(135deg, var(--silk-red) 0%, var(--primary-dark) 100%);
    color: var(--gold-light);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.metric-icon.green {
    background: linear-gradient(135deg, var(--jade-color) 0%, #006400 100%);
    color: var(--gold-light);
    box-shadow: 0 4px 12px rgba(0, 168, 107, 0.3);
}

.metric-icon.purple {
    background: linear-gradient(135deg, #6B238E 0%, #4A0E5C 100%);
    color: var(--gold-light);
    box-shadow: 0 4px 12px rgba(107, 35, 142, 0.3);
}

.metric-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 26px;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.2;
    font-family: 'Courier New', monospace;
}

.metric-change {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-change.positive {
    color: var(--jade-color);
    font-weight: 600;
}

.metric-change.positive::before {
    content: '↑';
    font-size: 14px;
}

.metric-change.negative {
    color: var(--silk-red);
    font-weight: 600;
}

.metric-change.negative::before {
    content: '↓';
    font-size: 14px;
}

/* 图表 */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
    position: relative;
    z-index: 1;
}

.chart-card {
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-color), var(--silk-red), var(--gold-color));
}

.chart-card:hover {
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.12),
        0 0 30px rgba(212, 175, 55, 0.15);
    border-color: var(--gold-color);
}

.chart-card.full-width {
    grid-column: 1 / -1;
    margin-top: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--paper-dark);
    position: relative;
}

.chart-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--silk-red), var(--gold-color));
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 1px;
}

.chart-header h3::before {
    content: '☰';
    font-size: 16px;
    color: var(--gold-color);
}

.btn-export {
    background: linear-gradient(135deg, #F5F0E6 0%, #E8DFD0 100%);
    border: 2px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
    font-weight: 600;
}

.btn-export:hover {
    background: linear-gradient(135deg, var(--silk-red) 0%, var(--primary-dark) 100%);
    border-color: var(--gold-color);
    color: var(--gold-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}

.chart-container {
    height: 300px;
}

/* 表格 */
.table-container {
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    max-height: 640px;
    overflow-y: auto;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 1px;
    /* 冻结表头：表格滚动时表头固定 */
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
}

/* 可排序列 */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table th.sortable:hover {
    color: var(--silk-red);
    background: linear-gradient(135deg, #DEC9A6 0%, #D2B98F 100%);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--paper-dark);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.05) 0%, transparent 100%);
}

.data-table tbody tr:nth-child(even) {
    background: rgba(232, 223, 208, 0.3);
}

.status-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.status-badge.draft {
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    color: var(--text-secondary);
    border: 1px solid var(--bronze-color);
}

.status-badge.submitted {
    background: linear-gradient(135deg, rgba(26, 84, 144, 0.15) 0%, rgba(13, 58, 106, 0.15) 100%);
    color: #1a5490;
    border: 1px solid #1a5490;
}

.status-badge.approved {
    background: linear-gradient(135deg, rgba(0, 168, 107, 0.15) 0%, rgba(0, 100, 0, 0.15) 100%);
    color: var(--jade-color);
    border: 1px solid var(--jade-color);
}

.status-badge.rejected {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.15) 0%, rgba(139, 0, 0, 0.15) 100%);
    color: var(--silk-red);
    border: 1px solid var(--silk-red);
}

/* 待审批 / 启用 / 禁用徽章（经典主题） */
.status-badge.pending {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, rgba(184, 115, 51, 0.15) 100%);
    color: var(--bronze-color);
    border: 1px solid var(--bronze-color);
}

.status-badge.active {
    background: linear-gradient(135deg, rgba(0, 168, 107, 0.15) 0%, rgba(0, 100, 0, 0.15) 100%);
    color: var(--jade-color);
    border: 1px solid var(--jade-color);
}

.status-badge.inactive {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.15) 0%, rgba(71, 85, 105, 0.15) 100%);
    color: #64748B;
    border: 1px solid #64748B;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    margin-right: 8px;
    transition: all 0.2s;
}

.action-btn:hover {
    text-decoration: underline;
    color: var(--silk-red);
}

.action-btn.delete {
    color: var(--silk-red);
}

.action-btn.success {
    color: var(--jade-color);
    font-weight: 700;
}

.action-btn.danger {
    color: var(--silk-red);
    font-weight: 700;
}

/* Tab切换 */
.approval-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--silk-red);
    border-bottom-color: var(--silk-red);
    font-weight: 700;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    border: 3px solid var(--gold-color);
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 0 0 1px rgba(212, 175, 55, 0.3),
        0 0 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold-color), var(--silk-red), var(--gold-color));
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.modal-close {
    background: transparent;
    border: 2px solid var(--border-color);
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    transition: all 0.2s;
    font-family: inherit;
}

.modal-close:hover {
    color: var(--silk-red);
    border-color: var(--silk-red);
    background: rgba(220, 20, 60, 0.1);
}

.modal-form {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color);
}

/* 预算事项清单 */
.budget-items-section {
    margin-top: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.budget-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.budget-item {
    display: grid;
    grid-template-columns: 1fr 150px 40px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.budget-item input {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background: #FFFEF9;
}

.btn-remove-item {
    background: transparent;
    border: 2px solid var(--silk-red);
    color: var(--silk-red);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-remove-item:hover {
    background: var(--silk-red);
    color: white;
}

/* 统计分析 */
.analysis-filters {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 32px;
    padding: 24px;
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.analysis-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.summary-card {
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.summary-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 1px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--paper-dark);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item span {
    color: var(--text-secondary);
    font-size: 14px;
}

.summary-item strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #2C1810 0%, #1a0a0a 100%);
    color: var(--gold-light);
    padding: 16px 28px;
    border: 2px solid var(--gold-color);
    border-radius: 4px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(212, 175, 55, 0.3);
    z-index: 2000;
    display: none;
    animation: slideIn 0.3s ease;
    font-weight: 600;
    letter-spacing: 1px;
}

.toast.show {
    display: block;
}

.toast.success {
    background: linear-gradient(135deg, var(--jade-color) 0%, #006400 100%);
    border-color: var(--gold-light);
}

.toast.error {
    background: linear-gradient(135deg, var(--silk-red) 0%, var(--primary-dark) 100%);
    border-color: var(--gold-light);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header h2,
    .sidebar-header p,
    .nav-item span {
        display: none;
    }

    /* 折叠态退出按钮仅显示图标文字，避免溢出裁剪 */
    .btn-logout {
        font-size: 0;
        padding: 12px 4px;
    }
    .btn-logout::before {
        content: '⏻';
        font-size: 16px;
        letter-spacing: 0;
    }
    
    .main-content {
        margin-left: 60px;
        padding: 16px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .budget-item {
        grid-template-columns: 1fr;
    }
}

/* 智能洞察卡片 */
.insight-card {
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
    position: relative;
    overflow: hidden;
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-color), var(--silk-red), var(--gold-color));
}

.insight-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 1px;
}

.insight-card h4::before {
    content: '☯';
    font-size: 20px;
    color: var(--gold-color);
}

.insight-item {
    padding: 12px 16px;
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    border-radius: 4px;
    margin-bottom: 12px;
    border-left: 4px solid var(--gold-color);
    transition: all 0.3s;
}

.insight-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.insight-item:last-child {
    margin-bottom: 0;
}

.insight-item.warning {
    border-left-color: var(--bronze-color);
}

.insight-item.success {
    border-left-color: var(--jade-color);
}

.insight-item.danger {
    border-left-color: var(--silk-red);
}

.insight-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
}

/* 图表内洞察区域 */
.chart-insight {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(232, 223, 208, 0.5) 100%);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.chart-insight-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.chart-insight-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.8;
}

/* 数据加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--silk-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #E8DFD0 25%, #DEC9A6 50%, #E8DFD0 75%);
    background-size: 2000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 120px;
    margin-bottom: 16px;
}

/* 加载状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 240, 230, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
}

.loading-content {
    text-align: center;
}

.loading-content p {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 20px;
}

/* 月份选择器样式优化 */
.month-selector {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    border-radius: 4px;
}

.month-btn {
    padding: 6px 14px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
}

.month-btn:hover {
    background: #FFFEF9;
    border-color: var(--border-color);
    color: var(--primary-color);
}

.month-btn.active {
    background: linear-gradient(135deg, var(--silk-red) 0%, var(--primary-dark) 100%);
    color: var(--gold-light);
    border-color: var(--gold-color);
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.3);
}

/* 数据对比高亮 */
.highlight-value {
    position: relative;
    display: inline-block;
}

.highlight-value::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--silk-red), var(--gold-color));
}

/* 趋势箭头 */
.trend-arrow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.trend-arrow.up {
    background: rgba(0, 168, 107, 0.15);
    color: var(--jade-color);
    border: 1px solid var(--jade-color);
}

.trend-arrow.down {
    background: rgba(220, 20, 60, 0.15);
    color: var(--silk-red);
    border: 1px solid var(--silk-red);
}

.trend-arrow.stable {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

/* 角色和部门管理页面样式 */
.departments-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    margin-top: 24px;
}

.department-tree-container,
.department-list-container {
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.department-tree-container h3,
.department-list-container h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 1px;
}

.department-tree {
    max-height: 600px;
    overflow-y: auto;
}

.tree-node {
    margin-bottom: 4px;
}

.tree-node-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tree-node-content:hover {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
}

.tree-expand-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-color);
    font-size: 10px;
}

.tree-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.tree-type {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 2px 8px;
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.tree-users {
    font-size: 12px;
    color: var(--text-secondary);
}

.tree-children {
    margin-left: 20px;
}

/* 权限树样式 */
.permission-tree {
    max-height: 500px;
    overflow-y: auto;
}

.permission-module {
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.module-header {
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid var(--border-color);
}

.module-header label {
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

.module-permissions {
    padding: 12px 16px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--paper-dark);
}

.permission-item:last-child {
    border-bottom: none;
}

.permission-item label {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

.permission-code {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Badge样式 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.badge-primary {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.15) 0%, rgba(92, 0, 0, 0.15) 100%);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.badge-success {
    background: linear-gradient(135deg, rgba(0, 168, 107, 0.15) 0%, rgba(0, 100, 0, 0.15) 100%);
    color: var(--jade-color);
    border: 1px solid var(--jade-color);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, rgba(184, 115, 51, 0.15) 100%);
    color: var(--bronze-color);
    border: 1px solid var(--bronze-color);
}

.badge-danger {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.15) 0%, rgba(139, 0, 0, 0.15) 100%);
    color: var(--silk-red);
    border: 1px solid var(--silk-red);
}

.badge-secondary {
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* 分页样式 */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination .page-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.pagination .page-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.pagination .page-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: 600;
}

.pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-btn:disabled:hover {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

.pagination .page-info {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 4px;
}

/* 模态框body样式 */
.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-info {
    background: linear-gradient(135deg, #1a5490 0%, #0d3a6a 100%);
    color: var(--gold-light);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 600;
    padding: 8px 16px;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0d3a6a 0%, #08234a 100%);
    box-shadow: 0 4px 12px rgba(26, 84, 144, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--bronze-color) 0%, #B87333 100%);
    color: white;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 600;
    padding: 8px 16px;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #B87333 0%, #9A6329 100%);
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--silk-red) 0%, var(--primary-dark) 100%);
    color: var(--gold-light);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 600;
    padding: 8px 16px;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #3A0000 100%);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.4);
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .departments-layout {
        grid-template-columns: 1fr;
    }
}

/* 额外装饰样式 */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.top-bar-left h1 {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info span {
    font-weight: 600;
    color: var(--text-primary);
}

.btn-icon {
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.btn-icon:hover {
    border-color: var(--gold-color);
    color: var(--primary-color);
    background: rgba(212, 175, 55, 0.1);
}

.page-container {
    position: relative;
    z-index: 1;
}

.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.recent-section {
    margin-top: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.link-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.link-more:hover {
    color: var(--silk-red);
    text-decoration: underline;
}

.empty-row {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

.report-container {
    background: linear-gradient(135deg, #FFFEF9 0%, #F5F0E6 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    min-height: 400px;
}

/* 报表表格 */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: #FFFEF9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.report-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 1px;
}

.report-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--paper-dark);
    font-size: 14px;
    color: var(--text-primary);
}

.report-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.05) 0%, transparent 100%);
}

/* 复选框样式 */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--silk-red);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #E8DFD0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--bronze-color) 0%, var(--gold-color) 100%);
    border-radius: 5px;
    border: 2px solid #E8DFD0;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--gold-color) 0%, var(--bronze-color) 100%);
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--paper-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.success {
    background: linear-gradient(90deg, var(--jade-color), #00C853);
}

.progress-fill.warning {
    background: linear-gradient(90deg, var(--bronze-color), var(--phoenix-orange));
}

.progress-fill.danger {
    background: linear-gradient(90deg, var(--silk-red), #FF1744);
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* 环比趋势箭头 */
.trend-up {
    color: var(--jade-color);
    font-weight: 700;
}

.trend-down {
    color: var(--silk-red);
    font-weight: 700;
}

/* 导入撤销提示条（顶部，10 分钟自动消失） */
.import-undo-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1500;
    background: linear-gradient(135deg, #8B0000 0%, #5C0000 100%);
    color: var(--gold-light);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--gold-color);
    font-size: 14px;
}

.import-undo-bar > div {
    display: flex;
    gap: 8px;
}

.import-undo-bar .btn-secondary {
    background: transparent;
    color: var(--gold-light);
    border-color: var(--gold-color);
    padding: 6px 12px;
    font-size: 13px;
}

.import-undo-bar .btn-primary {
    background: var(--gold-color);
    color: #1B2537;
    border-color: var(--gold-light);
    padding: 6px 16px;
    font-size: 13px;
}

/* 预算列表审批意见小字 */
.approval-comment {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 预算详情弹窗 */
.budget-detail-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    padding: 16px;
    background: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 16px;
}

.budget-detail-info div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.budget-detail-info span {
    color: var(--text-secondary);
    font-size: 13px;
}

.budget-detail-info b {
    color: var(--text-primary);
    font-size: 14px;
}

.budget-detail-comment {
    grid-column: 1 / -1;
}

.budget-detail-title {
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* 表格行内展开（支出/收入明细） */
.row-toggle {
    cursor: pointer;
    color: var(--gold-color);
    font-weight: 700;
    user-select: none;
    margin-right: 6px;
}

.row-detail td {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0%, transparent 100%);
    font-size: 13px;
    color: var(--text-secondary);
}

/* 文本危险色 */
.text-danger {
    color: var(--silk-red) !important;
    font-weight: 700;
}

/* ============ 双主题支持（经典主题保持原样，金融主题见 styles-finance.css） ============ */

/* 只读金额输入背景：经典主题 = 原米色渐变，金融主题在 styles-finance.css 中覆盖 */
:root {
    --input-bg: linear-gradient(135deg, #E8DFD0 0%, #DEC9A6 100%);
    /* 分页按钮配色（经典主题；金融主题在 styles-finance.css 覆盖） */
    --card-bg: #FFFEF9;
    --text-color: #2C1810;
    --text-muted: #5D4E37;
}

/* 无权限提示行（app.js 渲染），经典主题颜色与原先硬编码 #999 一致 */
.muted-row {
    text-align: center;
    color: #999;
}

/* 导入预览样式 */
.import-preview-stat {
    font-size: 15px;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(232, 223, 208, 0.4) 100%);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.import-preview-stat b {
    color: var(--primary-color);
}

.import-preview-content .data-table {
    margin-bottom: 14px;
}

.import-preview-tip {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* 待审批角标（经典主题） */
.nav-badge {
    position: absolute;
    top: 8px;
    right: 10px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--silk-red) 0%, var(--primary-dark) 100%);
    color: var(--gold-light);
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(139, 0, 0, 0.4);
}

/* 登录页主题切换按钮（经典主题） */
.login-theme-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 240, 230, 0.7);
    border: 2px solid var(--gold-color);
    border-radius: 50%;
    cursor: pointer;
    color: var(--gold-color);
    z-index: 10;
    transition: all 0.3s;
}

.login-theme-toggle:hover {
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.4);
    transform: rotate(20deg);
}
