/* 变量定义 */
:root {
    --primary-color: #2563eb;
    --accent-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --nav-bg: #1e293b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 暗色模式变量覆盖 */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --nav-bg: #020617;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: all 0.3s ease;
}

/* 导航栏 */
nav {
    background-color: var(--nav-bg);
    color: white;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.5rem; font-weight: 800; color: var(--accent-color); }
.logo span { color: white; font-weight: 300; }

/* 布局 */
.main-layout {
    max-width: 1400px;
    margin: 2rem auto;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    padding: 0 1rem;
}

/* 卡片通用 */
.card, .search-card, .filter-card, .chart-container {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

/* 表单 */
.input-group { margin-bottom: 1.2rem; }
label { display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-muted); text-transform: uppercase; }
input, select {
    width: 100%;
    padding: 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    box-sizing: border-box;
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

/* 航班卡片设计 */
.flight-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    display: grid;
    grid-template-columns: 100px 1fr 140px 140px;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.airline-info { font-weight: 800; color: var(--primary-color); }
.time-info b { font-size: 1.2rem; display: block; }
.price-info { text-align: right; }
.price-val { font-size: 1.6rem; font-weight: 900; color: var(--accent-color); }

/* Loading 遮罩 */
#loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); display: flex; flex-direction: column;
    justify-content: center; align-items: center; z-index: 1000; color: white;
}
.hidden { display: none !important; }
.spinner { width: 40px; height: 40px; border: 4px solid #f3f3f3; border-top: 4px solid var(--primary-color); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.canvas-wrapper { height: 250px; }

@media (max-width: 900px) {
    .main-layout { grid-template-columns: 1fr; }
    .flight-item { grid-template-columns: 1fr 1fr; }
}
