/* 全局样式 - 高端简约设计 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

:root {
    --primary: #3a6ea5;
    --primary-light: #e8f0f8;
    --primary-dark: #2c5282;
    --secondary: #48bb78;
    --secondary-light: #f0fff4;
    --accent: #805ad5;
    --bg-color: #f7fafc;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --radius: 10px;
    --transition: all 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 15px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 顶部标题区 */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 40px 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 35px;
    border-radius: var(--radius);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: linear-gradient(120deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    z-index: 1;
}

.header-icon {
    margin-bottom: 15px;
}

.header-icon i {
    font-size: 48px;
    color: white;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.15);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.header h1 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
}

.header p {
    text-align: center;
    font-size: 16px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* 筛选区域样式 */
.filter-section {
    background-color: var(--card-bg);
    padding: 25px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 35px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 25px;
    position: relative;
}

.filter-item {
    flex-grow: 1;
    min-width: 200px;
}

.filter-item h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
}

.select-container {
    position: relative;
}

.select-container select {
    width: 100%;
    padding: 12px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition);
    background-color: var(--card-bg);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233a6ea5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.select-container select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.15);
}

.select-container select[multiple] {
    height: 150px;
    background-image: none;
    padding: 10px;
}

.select-container .simple-select {
    padding-right: 40px;
}

.filter-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 12px 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow);
    min-width: 140px;
    white-space: nowrap;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.filter-btn i {
    font-size: 18px;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.6s ease;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(58, 110, 165, 0.2);
}

.filter-btn:hover::before {
    transform: translateX(100%) rotate(45deg);
}

.filter-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(58, 110, 165, 0.2);
}

.selected-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.selected-info span:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

/* 初始提示区域样式 */
#initial-prompt {
    text-align: center;
    padding: 50px 30px;
    margin-top: 40px;
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.prompt-icon {
    margin-bottom: 20px;
}

.prompt-icon i {
    font-size: 50px;
    color: var(--primary);
    background: var(--primary-light);
    width: 100px;
    height: 100px;
    line-height: 100px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 10px 15px rgba(58, 110, 165, 0.15);
}

#initial-prompt h2 {
    font-size: 24px;
    margin-bottom: 25px;
    color: var(--primary);
    font-weight: 600;
}

#initial-prompt p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
    color: var(--text-secondary);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* 统计卡片样式 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: var(--card-bg);
    padding: 30px 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-icon {
    margin-bottom: 15px;
}

.stat-icon i {
    font-size: 32px;
    color: var(--primary);
    background: var(--primary-light);
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
    display: inline-block;
    transition: var(--transition);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::after {
    transform: scaleX(1);
}

.stat-card:hover .stat-icon i {
    transform: scale(1.1);
}

.stat-card h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 500;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 图表容器 */
.chart-container {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 35px;
    position: relative;
    overflow: hidden;
}

.chart-container h2 {
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    position: relative;
}

.chart-container h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 3px;
}

.chart-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 25px;
}

.chart-col {
    flex: 1 1 calc(50% - 15px);
    min-width: 300px;
}

.chart-wrapper {
    position: relative;
    height: 350px;
    margin-bottom: 20px;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 15px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: linear-gradient(to bottom, var(--primary-light) 0%, rgba(232, 240, 248, 0.6) 100%);
    font-weight: 600;
    color: var(--primary-dark);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tbody tr {
    transition: var(--transition);
    background-color: var(--card-bg);
}

.data-table tbody tr:hover {
    background-color: rgba(232, 240, 248, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 分析文字区域 */
.analysis-text {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 35px;
    position: relative;
    overflow: hidden;
}

.analysis-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
}

.analysis-text h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 22px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.analysis-text p {
    margin-bottom: 18px;
    line-height: 1.8;
    color: var(--text-primary);
    text-align: justify;
}

/* 选项卡样式 */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.tab-btn {
    padding: 12px 20px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 18px;
}

.tab-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(58, 110, 165, 0.25);
}

.tab-content {
    display: none;
}

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

/* AI洞察容器 */
.ai-insight-container {
    background-color: var(--primary-light);
    border-radius: var(--radius);
    padding: 25px;
    margin-top: 30px;
    position: relative;
}

.ai-insight-container h3 {
    font-size: 18px;
    color: var(--primary-dark);
    margin-bottom: 18px;
    position: relative;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.ai-insight-container h3 i {
    font-size: 22px;
    margin-right: 10px;
}

.ai-insight-container h3::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-right: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%233a6ea5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'%3E%3C/polygon%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.ai-loading {
    color: var(--text-secondary);
    font-style: italic;
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.ai-content {
    color: var(--text-primary);
    line-height: 1.8;
}

.ai-content p {
    margin-bottom: 15px;
}

.ai-content strong {
    color: var(--primary-dark);
    font-weight: 600;
}

.ai-content ul {
    padding-left: 20px;
    margin-bottom: 18px;
}

.ai-content li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 22px;
}

.ai-content li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
}

/* 加载提示 */
#loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: var(--text-secondary);
    font-size: 16px;
    text-align: center;
    position: relative;
    flex-direction: column;
    gap: 20px;
}

#loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {transform: rotate(360deg);}
}

/* 图表容器动画效果 */
.chart-container, .stat-card, .analysis-text {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.chart-container:nth-child(2) {
    animation-delay: 0.2s;
}

.chart-container:nth-child(3) {
    animation-delay: 0.3s;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .chart-row {
        flex-direction: column;
    }
    
    .chart-col {
        width: 100%;
    }
    
    .filter-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .tabs {
        padding: 15px;
        gap: 8px;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .filter-item {
        width: 100%;
    }
}