/* 成本控制看板样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* 顶部标题栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
    position: relative;
    z-index: 100;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.company-name {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.header-center h1 {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    text-align: center;
    font-style: italic;
}

.header-right {
    text-align: right;
}

.datetime {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 5px;
}

.cost-status {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
}

.status-controlled {
    color: #10b981;
    font-weight: bold;
    text-shadow: 0 0 10px #10b981;
}

/* 主要内容区域 */
.main-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: calc(100vh - 120px);
}

/* 行布局 */
.row-1, .row-2, .row-3, .row-4 {
    display: flex;
    gap: 20px;
    height: auto;
    min-height: 300px;
}

.row-1 { min-height: 350px; }
.row-2 { min-height: 400px; }
.row-3 { min-height: 300px; }
.row-4 { min-height: 280px; }

/* 面板通用样式 */
.panel {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.05) 100%);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #f59e0b, transparent);
    animation: scan 4s infinite;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.panel:hover {
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

.panel-header h3 {
    font-size: 20px;
    font-weight: bold;
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* 第一行：成本总览和预算监控 */
.cost-overview {
    flex: 1.2;
}

.budget-monitor {
    flex: 0.8;
}

.panel-tabs {
    display: flex;
    gap: 10px;
}

.tab {
    padding: 8px 16px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab.active, .tab:hover {
    background: rgba(245, 158, 11, 0.4);
    border-color: #f59e0b;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.cost-stats {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 20px;
}

.stat-circle {
    position: relative;
}

.circle-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#f59e0b 0deg 306deg, rgba(245, 158, 11, 0.2) 306deg 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.circle-inner {
    width: 80px;
    height: 80px;
    background: rgba(26, 26, 46, 0.9);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.circle-value {
    font-size: 24px;
    font-weight: bold;
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.circle-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.cost-numbers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    flex: 1;
}

.number-item {
    text-align: center;
    padding: 15px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.number-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.number-value {
    font-size: 24px;
    font-weight: bold;
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.cost-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    transition: all 0.3s ease;
}

.category-item:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.4);
}

.category-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 2px;
}

.category-amount {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.category-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.category-status.normal {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.category-status.warning {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 预算监控 */
.monitor-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 8px 16px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.control-btn.active, .control-btn:hover {
    background: rgba(245, 158, 11, 0.4);
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.budget-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 8px;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.budget-alert.critical {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.budget-alert.warning {
    border-left-color: #f59e0b;
}

.budget-alert.info {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.alert-priority {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.budget-alert.critical .alert-priority {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.budget-alert.warning .alert-priority {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.budget-alert.info .alert-priority {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 2px;
}

.alert-details {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.alert-amount {
    font-size: 14px;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

.budget-alert.critical .alert-amount,
.budget-alert.warning .alert-amount {
    color: #ef4444;
}

.budget-alert.info .alert-amount {
    color: #10b981;
}

.btn-handle {
    padding: 6px 12px;
    background: linear-gradient(45deg, #f59e0b, #d97706);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-handle:hover {
    background: linear-gradient(45deg, #d97706, #b45309);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

/* 第二行：成本分析和趋势预测 */
.cost-analysis {
    flex: 1;
}

.trend-forecast {
    flex: 1;
}

.analysis-overview {
    display: flex;
    gap: 20px;
}

.cost-breakdown {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.breakdown-category {
    font-size: 14px;
    color: #ffffff;
    font-weight: bold;
    min-width: 80px;
}

.breakdown-percentage {
    font-size: 16px;
    font-weight: bold;
    color: #f59e0b;
    min-width: 40px;
}

.breakdown-amount {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    flex: 1;
}

.breakdown-trend {
    font-size: 12px;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.breakdown-trend.up {
    color: #ef4444;
}

.breakdown-trend.down {
    color: #10b981;
}

.breakdown-trend.stable {
    color: #9ca3af;
}

.cost-chart {
    flex: 1;
    height: 250px;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* 趋势预测 */
.forecast-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.forecast-kpis {
    display: flex;
    gap: 20px;
}

.kpi-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    flex: 1;
}

.kpi-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.kpi-info {
    flex: 1;
}

.kpi-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.kpi-value {
    font-size: 20px;
    font-weight: bold;
    color: #f59e0b;
    margin-bottom: 2px;
}

.kpi-trend {
    font-size: 12px;
    font-weight: bold;
}

.kpi-trend.up {
    color: #ef4444;
}

.kpi-trend.normal {
    color: #10b981;
}

.kpi-trend.potential {
    color: #3b82f6;
}

.forecast-chart {
    height: 200px;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* 第三行：部门成本和效益分析 */
.department-cost {
    flex: 1;
}

.benefit-analysis {
    flex: 1;
}

.department-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.department-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dept-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.dept-name {
    font-size: 14px;
    color: #ffffff;
    font-weight: bold;
    min-width: 80px;
}

.dept-budget {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 60px;
}

.dept-used {
    font-size: 14px;
    color: #f59e0b;
    font-weight: bold;
    min-width: 60px;
}

.dept-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.progress-bar {
    height: 8px;
    background: #f59e0b;
    border-radius: 4px;
    position: relative;
    flex: 1;
    max-width: 150px;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(245, 158, 11, 0.2);
    border-radius: 4px;
    width: 100%;
}

.progress-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    min-width: 35px;
}

.dept-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.dept-status.normal {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.dept-status.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 效益分析 */
.benefit-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.benefit-metrics {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.metric-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.metric-info {
    flex: 1;
}

.metric-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.metric-value {
    font-size: 20px;
    font-weight: bold;
    color: #f59e0b;
    margin-bottom: 2px;
}

.metric-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.benefit-chart {
    height: 150px;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* 第四行：成本优化和预算调整 */
.cost-optimization {
    flex: 1;
}

.budget-adjustment {
    flex: 1;
}

.optimization-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.optimization-summary {
    display: flex;
    gap: 20px;
}

.opt-type {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid;
    flex: 1;
}

.opt-type.implemented {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.opt-type.planning {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.opt-type.evaluating {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.opt-count {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.opt-type.implemented .opt-count {
    color: #10b981;
}

.opt-type.planning .opt-count {
    color: #3b82f6;
}

.opt-type.evaluating .opt-count {
    color: #f59e0b;
}

.opt-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.optimization-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 180px;
    overflow-y: auto;
}

.opt-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 6px;
    border-left: 4px solid;
}

.opt-item.implemented {
    border-left-color: #10b981;
}

.opt-item.planning {
    border-left-color: #3b82f6;
}

.opt-item.evaluating {
    border-left-color: #f59e0b;
}

.opt-title {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    min-width: 80px;
}

.opt-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    flex: 1;
}

.opt-saving {
    font-size: 12px;
    font-weight: bold;
    color: #10b981;
    min-width: 100px;
}

.opt-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.opt-item.implemented .opt-status {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.opt-item.planning .opt-status {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.opt-item.evaluating .opt-status {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 预算调整 */
.adjustment-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.adjustment-requests h4 {
    color: #f59e0b;
    margin-bottom: 15px;
    font-size: 16px;
}

.request-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.request-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.request-dept {
    font-size: 12px;
    color: #f59e0b;
    font-weight: bold;
    min-width: 60px;
}

.request-content {
    flex: 1;
}

.request-title {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 2px;
}

.request-reason {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.request-amount {
    font-size: 14px;
    font-weight: bold;
    color: #f59e0b;
    min-width: 80px;
    text-align: center;
}

.request-action {
    display: flex;
    gap: 5px;
}

.btn-approve {
    padding: 4px 8px;
    background: linear-gradient(45deg, #10b981, #059669);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-approve:hover {
    background: linear-gradient(45deg, #059669, #047857);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.btn-reject {
    padding: 4px 8px;
    background: linear-gradient(45deg, #ef4444, #dc2626);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-reject:hover {
    background: linear-gradient(45deg, #dc2626, #b91c1c);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.request-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* 响应式设计 */
@media (max-width: 1600px) {
    .row-1, .row-2, .row-3, .row-4 {
        flex-direction: column;
        height: auto;
    }
    
    .panel {
        margin-bottom: 20px;
    }
    
    .cost-stats {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .analysis-overview {
        flex-direction: column;
    }
    
    .forecast-kpis {
        flex-direction: column;
    }
    
    .optimization-summary {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-left, .header-right {
        justify-content: center;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .panel {
        padding: 15px;
    }
    
    .cost-numbers {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(245, 158, 11, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.7);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    animation: fadeInUp 0.6s ease-out;
}

.panel:nth-child(1) { animation-delay: 0.1s; }
.panel:nth-child(2) { animation-delay: 0.2s; }
.panel:nth-child(3) { animation-delay: 0.3s; }
.panel:nth-child(4) { animation-delay: 0.4s; }

/* 数据更新动画 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.number-value, .kpi-value, .metric-value {
    animation: pulse 2s infinite;
}