/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0c1426 0%, #1a2332 100%);
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* 主容器 */
.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(135deg, #0c1426 0%, #1a2332 100%);
}

/* 顶部标题栏 */
.dashboard-header {
    background: linear-gradient(90deg, #1e3a5f 0%, #2d4a6b 100%);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #3498db;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-left h1 i {
    color: #3498db;
    margin-right: 12px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.datetime {
    font-size: 16px;
    color: #bdc3c7;
    font-weight: 500;
}

.refresh-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(45deg, #2980b9, #3498db);
}

.refresh-btn i {
    margin-right: 8px;
}

/* 主要内容区域 */
.dashboard-main {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 指标卡片区域样式 */
.metrics-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.metric-card {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12, #e74c3c);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #ffffff;
    flex-shrink: 0;
}

.metric-card:nth-child(1) .metric-icon {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.metric-card:nth-child(2) .metric-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.metric-card:nth-child(3) .metric-icon {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.metric-card:nth-child(4) .metric-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 14px;
    color: #bdc3c7;
    margin-bottom: 5px;
}

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

.metric-value-dual {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 3px;
}

.company-score-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.company-score-group.jiahuan {
    margin-left: -10px;
}

.company-score {
    display: flex;
    align-items: center;
    gap: 4px;
}

.company-name {
    font-size: 14px;
    color: #bdc3c7;
    font-weight: 500;
}

/* 总结算费用卡片样式 */
.total-cost-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}



.company-cost-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-right: 15px;
}

.company-cost-item {
    font-size: 11px;
    color: #95a5a6;
    font-weight: 500;
    padding: 3px 8px;
    margin: 1px 0;
    border-radius: 4px;
    border-left: 2px solid #3498db;
    width: 65px;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.score-value {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
}

.company-change {
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 1px;
}

.company-change.positive {
    color: #e74c3c;
}

.company-change.negative {
    color: #2ecc71;
}

.company-change i {
    font-size: 8px;
}

.metric-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-change.positive {
    color: #e74c3c;
}

.metric-change.negative {
    color: #2ecc71;
}

.metric-change i {
    font-size: 10px;
}

/* 控制区域样式 */
.control-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 选择器容器 */
.selector-container {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

/* 月份选择器 */
.month-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.month-selector label {
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
}

.month-selector select {
    background: #34495e;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    min-width: 120px;
}

.month-selector select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 专业选择器 */
.profession-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profession-selector label {
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
}

.profession-selector select {
    background: #34495e;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    min-width: 100px;
}

.profession-selector select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 时间周期选择器 */
.period-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.period-selector label {
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
}

.period-selector select {
    background: #34495e;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    min-width: 120px;
}

.period-selector select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.period-selector span {
    color: #bdc3c7;
    font-weight: 500;
}

/* 标签导航 */
.tab-navigation {
    display: flex;
    gap: 5px;
}

.tab-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #bdc3c7;
    font-weight: 500;
    border: 1px solid transparent;
}

.tab-item:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #ffffff;
    transform: translateY(-2px);
}

.tab-item.active {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: #ffffff;
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.tab-item i {
    font-size: 16px;
}

/* 标签内容区域 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 图表行 */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.chart-container {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.chart-container.large {
    grid-column: span 2;
}

.chart-container.medium {
    min-height: 350px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.chart-header .period-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header .period-selector label {
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
}

.chart-header .period-selector select {
    background: #34495e;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    min-width: 120px;
}

.chart-header .period-selector select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.chart-header .period-selector span {
    color: #bdc3c7;
    font-weight: 500;
}

.chart-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
}

.chart-header h3 i {
    margin-right: 10px;
    color: #3498db;
}

.chart-controls select {
    background: #34495e;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.chart-controls select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.chart-content {
    height: 300px;
    position: relative;
}

.chart-container.large .chart-content {
    height: 350px;
}

/* Canvas样式 */
.chart-content canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* 数据表格样式 */
.data-table-container {
    height: 100%;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: linear-gradient(90deg, #34495e, #2c3e50);
    color: #ffffff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
}

.data-table tbody tr:hover {
    background: rgba(52, 152, 219, 0.1);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.status-badge.completed {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.status-badge.pending {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border: 1px solid #f39c12;
}

.status-badge.processing {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid #3498db;
}

/* 底部状态栏 */
.dashboard-footer {
    background: linear-gradient(90deg, #1e3a5f 0%, #2d4a6b 100%);
    padding: 15px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 2px solid #3498db;
    font-size: 14px;
}

.footer-center {
    color: #bdc3c7;
    text-align: center;
}

.status-indicator {
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 12px;
}

.status-indicator.online {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .chart-container.large {
        grid-column: span 1;
    }
    
    .charts-row {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-right {
        flex-direction: column;
        gap: 10px;
    }
    
    .dashboard-main {
        padding: 20px;
    }
    
    .metrics-row {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .dashboard-main {
        padding: 15px;
    }
    
    .metric-card {
        padding: 20px;
    }
    
    .chart-container {
        padding: 20px;
    }
    
    .header-left h1 {
        font-size: 24px;
    }
}

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

::-webkit-scrollbar-track {
    background: #2c3e50;
}

::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

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

.metric-card, .chart-container {
    animation: fadeInUp 0.6s ease-out;
}

.metric-card:nth-child(2) {
    animation-delay: 0.1s;
}

.metric-card:nth-child(3) {
    animation-delay: 0.2s;
}

.metric-card:nth-child(4) {
    animation-delay: 0.3s;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}