* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* 头部 */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 数据源状态指示器 */
.data-source-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 0.9em;
    color: white;
}

.data-source-indicator.online {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.data-source-indicator.partial {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.data-source-indicator.offline {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.status-details {
    margin-left: auto;
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    opacity: 0.9;
}

.status-details span {
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.status-details .r2 {
    background: rgba(76, 175, 80, 0.3);
}

.status-details .local {
    background: rgba(255, 152, 0, 0.3);
}

.status-details .error {
    background: rgba(244, 67, 54, 0.3);
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.95em;
    color: #666;
    font-weight: 500;
}

/* 内容区 */
.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* 左侧面板 */
.left-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.left-panel h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* 控制条 */
.controls {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.search-box,
.sort-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.search-box:focus,
.sort-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 表格 */
.airlines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.airlines-table thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.airlines-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
}

.airlines-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
}

.airlines-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.airlines-table tbody tr:hover {
    background: #f8f9ff;
    box-shadow: inset 3px 0 0 #667eea;
}

.airlines-table tbody tr:nth-child(even) {
    background: #f9fafb;
}

.airlines-table .rank {
    font-weight: bold;
    color: #667eea;
}

.airlines-table .rank-1 {
    font-size: 1.1em;
    color: #ffc107;
}

.airlines-table .rank-2 {
    color: #c0c0c0;
}

.airlines-table .rank-3 {
    color: #cd7f32;
}

/* 置信度显示 */
.confidence-0,
.confidence-1 {
    color: #ff4444;
    font-weight: bold;
}

.confidence-2 {
    color: #ff9800;
    font-weight: bold;
}

.confidence-3 {
    color: #4CAF50;
    font-weight: bold;
}

.confidence-4 {
    color: #2196F3;
    font-weight: bold;
}

/* 右侧面板 */
.right-panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.right-panel h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.map-container {
    flex: 1;
    min-height: 500px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 20px;
}

/* 图例 */
.legend {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.legend-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.legend-items {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* 详情面板 */
.detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.detail-panel.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.detail-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

.detail-content h3 {
    color: #333;
    margin-bottom: 20px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 0.95em;
    font-weight: 600;
}

.detail-section p {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.detail-section span:first-child {
    font-weight: 500;
    color: #666;
}

.detail-section span:last-child {
    color: #333;
    font-weight: 600;
}

/* 页脚 */
.footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 0.9em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .map-container {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-value {
        font-size: 1.8em;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .airlines-table {
        font-size: 0.8em;
    }

    .airlines-table th,
    .airlines-table td {
        padding: 8px 5px;
    }

    .map-container {
        min-height: 300px;
    }

    .legend-items {
        gap: 10px;
    }

    .legend-color {
        width: 15px;
        height: 15px;
    }
}

@media (max-width: 500px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.4em;
    }

    .left-panel,
    .right-panel {
        padding: 15px;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .detail-content {
        max-width: 90%;
        padding: 20px;
    }
}

/* 加载动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* Tab 导航 */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 新闻动态 */
#news-tab {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.news-header h2 {
    font-size: 1.4em;
    color: #333;
    margin: 0;
}

.news-filters {
    display: flex;
    gap: 12px;
}

.news-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    background: white;
    cursor: pointer;
}

.news-filters select:focus {
    outline: none;
    border-color: #667eea;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
    gap: 20px;
}

.news-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
    cursor: pointer;
}

.news-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.news-image {
    flex-shrink: 0;
    width: 200px;
    height: 140px;
    overflow: hidden;
    border-radius: 6px;
    background: #f5f5f5;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.news-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-title:hover {
    color: #667eea;
}

.news-meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
}

.news-meta .source {
    font-weight: 500;
    color: #667eea;
}

.news-summary {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 12px 0;
}

.news-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.tag.delivery {
    background: #e3f2fd;
    color: #1976d2;
}

.tag.order {
    background: #e8f5e9;
    color: #388e3c;
}

.tag.maintenance {
    background: #fff3e0;
    color: #f57c00;
}

.tag.retirement {
    background: #ffebee;
    color: #c62828;
}

.tag.airline {
    background: #f3e5f5;
    color: #7b1fa2;
}

.tag.aircraft {
    background: #e0f7fa;
    color: #0097a7;
}

/* 新闻响应式 */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-card {
        flex-direction: column;
    }

    .news-image {
        width: 100%;
        height: 200px;
    }

    .news-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}