* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.dashboard {
    padding: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 标题样式 */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px;
}

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

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

.logo-container {
    position: relative;
    display: flex;
    align-items: center;
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    width: 50px;
    background: rgba(255, 107, 53, 0.2);
    border: 2px solid #ff6b35;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.logo-fallback:hover {
    transform: scale(1.05);
    background: rgba(255, 107, 53, 0.3);
}

.logo-placeholder {
    font-size: 20px;
    color: #ff6b35;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    color: #ff6b35;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
}

/* 筛选器样式 */
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-group label {
    font-weight: 600;
    color: #ff6b35;
    font-size: 13px;
    white-space: nowrap;
}

.filter-group select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 13px;
    min-width: 90px;
}

.filter-group select option {
    background: #1a1a2e;
    color: #ffffff;
}

/* KPI卡片样式 */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.kpi-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #f7931e);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.kpi-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.kpi-content {
    flex: 1;
}

.kpi-title {
    font-size: 12px;
    color: #cccccc;
    margin-bottom: 6px;
    font-weight: 500;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: #ff6b35;
    margin-bottom: 2px;
}

.kpi-subtitle {
    font-size: 10px;
    color: #aaaaaa;
    margin-top: 2px;
}

/* 主要图表区域样式 */
.main-charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    margin-bottom: 25px;
}

.trend-chart {
    grid-row: span 2;
}

.right-charts {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 18px;
}

.chart-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.2);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chart-header h3 {
    color: #ff6b35;
    font-size: 1rem;
    margin: 0;
}

.time-range-buttons {
    display: flex;
    gap: 5px;
}

.time-btn, .heatmap-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-btn:hover, .heatmap-btn:hover {
    background: rgba(255, 107, 53, 0.3);
}

.time-btn.active, .heatmap-btn.active {
    background: #ff6b35;
    border-color: #ff6b35;
}

/* 热力图样式 */
.heatmap-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

/* 数据表格样式 */
.table-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 16px;
}

.table-container {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

#dataTable {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

#dataTable th,
#dataTable td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    color: #ffffff;
}

#dataTable th {
    background: rgba(255, 107, 53, 0.3);
    color: #ffffff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

#dataTable tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

#dataTable tbody tr:hover {
    background: rgba(255, 107, 53, 0.2);
}

/* 响应式设计 */
/* 响应式设计 */
@media (max-width: 1200px) {
    .main-charts-section {
        grid-template-columns: 1fr;
    }
    
    .trend-chart {
        grid-row: span 1;
    }
    
    .right-charts {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
    }
    
    .kpi-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: 12px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .header-left {
        gap: 12px;
    }
    
    .logo {
        height: 40px;
    }
    
    .logo-fallback {
        height: 40px;
        width: 40px;
    }
    
    .logo-placeholder {
        font-size: 18px;
    }
    
    .kpi-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .kpi-value {
        font-size: 1.4rem;
    }
    
    .right-charts {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .header-left {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        align-items: center;
    }
    
    .dashboard-header h1 {
        font-size: 1.3rem;
    }
    
    .logo {
        height: 35px;
    }
    
    .logo-fallback {
        height: 35px;
        width: 35px;
    }
    
    .logo-placeholder {
        font-size: 16px;
    }
    
    .filter-group {
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }
    
    .kpi-card {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 12px;
    }
    
    .kpi-icon {
        font-size: 1.5rem;
    }
}

/* 图表画布样式 */
canvas {
    max-height: 340px !important;
}

.trend-chart canvas {
    max-height: 480px !important;
}

.ranking-chart canvas {
    max-height: 300px !important;
}

.pie-chart canvas {
    max-height: 300px !important;
}

/* 热力图单元格颜色 */
.heatmap-null {
    background: rgba(128, 128, 128, 0.3) !important;
    color: #888;
}

.heatmap-low {
    background: rgba(255, 107, 53, 0.2) !important;
    color: #ffffff;
}

.heatmap-medium {
    background: rgba(255, 107, 53, 0.5) !important;
    color: #ffffff;
}

.heatmap-high {
    background: rgba(255, 107, 53, 0.7) !important;
    color: #ffffff;
}

.heatmap-very-high {
    background: rgba(255, 107, 53, 1) !important;
    color: #ffffff;
    font-weight: bold;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 53, 0.6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 53, 0.8);
}

#heatmapContainer {
    overflow-x: auto;
    padding: 10px 0;
}

.heatmap-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.heatmap-table th,
.heatmap-table td {
    padding: 8px 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 12px;
    color: #ffffff;
}

.heatmap-table th {
    background: rgba(255, 107, 53, 0.3);
    color: #ffffff;
    font-weight: 600;
}

.heatmap-cell {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.5);
}
/* AI分析板块样式 */
.ai-analysis-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 16px;
    margin-top: 25px;
}

/* AI分析结果区域 */
.ai-results-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.analysis-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s ease;
}

.analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.2);
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.analysis-icon {
    font-size: 1.5rem;
    background: rgba(255, 107, 53, 0.2);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.analysis-header h3 {
    color: #ff6b35;
    font-size: 1.1rem;
    margin: 0;
}

.analysis-content {
    color: #ffffff !important;
    line-height: 1.6;
    font-size: 14px;
    min-height: 120px;
}

.analyze-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border: none;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

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

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 16px;
}

.ai-content {
    margin-top: 20px;
}

.ai-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #cccccc;
}

.ai-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.ai-placeholder p {
    font-size: 14px;
    line-height: 1.5;
}

.ai-analysis-content {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
}

.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #ff6b35;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 107, 53, 0.3);
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.ai-result {
    color: #ffffff !important;
    line-height: 1.6;
    font-size: 14px;
}

.ai-result p {
    margin-bottom: 10px;
    color: #ffffff !important;
}

.ai-result strong {
    color: #ffffff !important;
    font-weight: 600;
}

.ai-error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 6px;
    padding: 15px;
    color: #ff6b6b;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .ai-results-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .ai-analysis-section {
        margin-top: 20px;
        padding: 12px;
    }
    
    .analyze-btn {
        width: 100%;
        justify-content: center;
    }
    
    .ai-placeholder {
        padding: 30px 15px;
    }
    
    .ai-icon {
        font-size: 2.5rem;
    }
    
    .analysis-card {
        padding: 12px;
    }
    
    .analysis-content {
        min-height: 100px;
    }
}
/* 强制AI分析内容为统一的白色文字 */
.analysis-content,
.analysis-content *,
.ai-result,
.ai-result *,
#overallAnalysis,
#overallAnalysis *,
#optimizationSuggestions,
#optimizationSuggestions *,
.ai-analysis-content,
.ai-analysis-content * {
    color: #ffffff !important;
}

/* 只有数字和百分比用橙色强调 */
.analysis-content .highlight-number,
.ai-result .highlight-number,
#overallAnalysis .highlight-number,
#optimizationSuggestions .highlight-number,
.analysis-content .number-highlight,
.ai-result .number-highlight,
#overallAnalysis .number-highlight,
#optimizationSuggestions .number-highlight {
    color: #ff6b35 !important;
    font-weight: 600;
}

/* 确保strong标签也是白色，除非是数字 */
.analysis-content strong,
.ai-result strong,
#overallAnalysis strong,
#optimizationSuggestions strong {
    color: #ffffff !important;
    font-weight: 600;
}

/* 数字相关的strong标签用橙色 */
.analysis-content strong.number-highlight,
.ai-result strong.number-highlight,
#overallAnalysis strong.number-highlight,
#optimizationSuggestions strong.number-highlight {
    color: #ff6b35 !important;
}