/* ==================== 基础样式 ==================== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-card-hover: #22222e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #666680;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --header-bg: rgba(10, 10, 15, 0.9);
    --map-stats-bg: rgba(20, 20, 30, 0.9);
    --shadow-color: rgba(0, 0, 0, 0.5);
    --popup-bg: #1a1a24;
    --popup-text: #ffffff;
}

/* ========== 浅色主题 ========== */
[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f7fa;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a7a;
    --text-muted: #9090a8;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.2);
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.12);
    --header-bg: rgba(255, 255, 255, 0.92);
    --map-stats-bg: rgba(255, 255, 255, 0.92);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --popup-bg: #ffffff;
    --popup-text: #1a1a2e;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== 离线模式横幅 ==================== */
#offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    transition: height 0.3s ease;
}
#offline-banner .offline-icon {
    font-size: 14px;
}
body.is-offline #offline-banner {
    height: 32px;
}
body.is-offline .header {
    top: 32px;
}
body.is-offline .main-content .view {
    height: calc(100vh - 60px - 32px - env(safe-area-inset-top, 0px));
}

/* ==================== 头部导航 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 15, 0.4) 0px,
        var(--header-bg) env(safe-area-inset-top, 0px)
    );
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}
[data-theme="light"] .header {
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.5) 0px,
        var(--header-bg) env(safe-area-inset-top, 0px)
    );
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-tabs {
    display: flex;
    gap: 4px;
}

.nav-tab {
    padding: 6px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.nav-tab-icon {
    font-size: 18px;
    line-height: 1;
}

.nav-tab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--accent);
    color: white;
}

.btn-add {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* ==================== 主内容 ==================== */
.main-content {
    padding-top: calc(60px + env(safe-area-inset-top, 0px));
    min-height: 100vh;
}

.view {
    display: none;
    height: calc(100vh - 60px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
}

.view.active {
    display: block;
    opacity: 0;
    transform: translateY(10px);
}

.view.view-enter {
    animation: viewFadeIn 0.3s ease-out forwards;
}

@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
#home-view.view.active {
    opacity: 1;
    transform: none;
}
#home-view.view.view-enter {
    animation: none;
    opacity: 1;
}

/* Sub-view transitions */
.flights-sub-view {
    display: none;
}

.flights-sub-view.active {
    display: block;
    opacity: 0;
    transform: translateY(8px);
}

.flights-sub-view.view-enter {
    animation: viewFadeIn 0.25s ease-out forwards;
}

/* ==================== 地图视图 ==================== */
#map-view {
    overflow: hidden;
}
#map {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

.map-stats-card {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    background: var(--map-stats-bg);
    backdrop-filter: blur(20px);
    padding: 20px 40px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 40px var(--shadow-color);
    z-index: 500;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==================== 行程列表视图 ==================== */
.flights-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

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

.flights-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.btn-sort-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-sort-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 10px;
}

.filter-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    line-height: 1;
}
.filter-tab.active .filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* 时间筛选 (可折叠) */
.flights-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-advanced-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-advanced-filter:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.af-arrow {
    font-size: 10px;
    margin-left: 2px;
}

.active-date-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    font-size: 12px;
    color: var(--accent);
    white-space: nowrap;
}
.active-date-tag button {
    border: none;
    background: none;
    color: var(--accent);
    font-size: 13px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.7;
}
.active-date-tag button:hover {
    opacity: 1;
}

.advanced-filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    animation: slideDown 0.2s ease;
}

.af-section {
    margin-bottom: 14px;
}
.af-section:last-child {
    margin-bottom: 0;
}

.af-search-row {
    margin-bottom: 2px;
}
.af-search-row .flights-search-box {
    position: relative;
}

.af-date-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.af-actions-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

.time-filter-group {
    flex: 1;
}

.time-filter-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.time-filter-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.time-filter-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-filter-reset {
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-filter-reset:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* 地图时间筛选 */
.map-time-filter {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--map-stats-bg);
    backdrop-filter: blur(20px);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 20px var(--shadow-color);
    z-index: 500;
}

.map-filter-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.map-time-filter input {
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    width: 140px;
}

.map-time-filter input:focus {
    outline: none;
    border-color: var(--accent);
}

.map-filter-separator {
    color: var(--text-muted);
    font-size: 13px;
}

.map-filter-reset {
    padding: 8px 16px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.map-filter-reset:hover {
    background: var(--accent-hover);
}

.flights-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 航班卡片 */
.flight-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.flight-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.flight-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.flight-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flight-no {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.flight-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.flight-status.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.flight-status.upcoming {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.flight-status.checkin_open {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.flight-status.boarding {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.flight-route {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
}

.route-point {
    flex: 1 1 0;
    min-width: 0;
}

.route-point.arrival {
    text-align: right;
}

.airport-code {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
}

.airport-city {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    word-break: break-word;
}

.route-time {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

.route-line {
    flex: 0 0 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.route-line-graphic {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--text-muted), var(--accent));
    position: relative;
}

.route-line-graphic::before {
    content: '✈';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

.route-duration {
    font-size: 12px;
    color: var(--text-muted);
}

.route-distance {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==================== 统计视图 ==================== */
.stats-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stats-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
}

.stats-card.large {
    grid-column: span 2;
}

.stats-icon {
    font-size: 36px;
}

.stats-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Stats value animation */
.stats-value {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.stats-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ==================== 模态框 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 0;
    pointer-events: none;
    transition: background 0.35s ease, backdrop-filter 0.35s ease;
}

.modal-overlay.active {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    pointer-events: auto;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 0;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease, max-height 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
}

.modal form,
.modal .detail-content,
.modal .settings-content,
.modal .share-content {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-overlay.active .modal {
    transform: translateY(0);
    opacity: 1;
    max-height: 92vh;
}

@media (min-width: 769px) {
    .modal-overlay {
        align-items: center;
        padding: 20px;
    }
    .modal {
        border-radius: 20px;
        transform: translateY(40px) scale(0.95);
    }
    .modal-overlay.active .modal {
        transform: translateY(0) scale(1);
        max-height: 90vh;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

/* 表单样式 */
#flight-form {
    padding: 24px;
}

/* 智能查询区域 */
.smart-lookup {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.smart-lookup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 12px;
}

.smart-lookup-icon {
    font-size: 16px;
}

.smart-lookup-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.smart-lookup-row .form-group {
    flex: 1;
}

.btn-lookup {
    padding: 12px 20px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: 100px;
}

.btn-lookup:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

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

.lookup-status {
    margin-top: 10px;
    font-size: 13px;
    min-height: 20px;
}

.lookup-status.success {
    color: var(--success);
}

.lookup-status.error {
    color: var(--danger);
}

.lookup-status.info {
    color: var(--text-secondary);
}

.form-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    flex: 1;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--bg-card-hover);
}

.suggestion-code {
    font-weight: 600;
    color: var(--accent);
}

.suggestion-name {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-warning:hover {
    background: #f59e0b;
    color: white;
}

/* 详情模态框 */
.modal-detail {
    max-width: 500px;
}

.detail-content {
    padding: 24px;
}

/* 详情 - 航班号头部(含logo) */
.detail-flight-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.detail-flight-logo {
    flex-shrink: 0;
}
.detail-flight-logo .airline-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    background: var(--bg-secondary);
    padding: 4px;
    border: 1px solid var(--border);
}
.detail-flight-logo .airline-logo-fallback {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 15px;
}
.detail-flight-info {
    flex: 1;
    min-width: 0;
}
.detail-flight-no {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
.detail-flight-airline {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.detail-flight-status {
    flex-shrink: 0;
}

/* 详情 - 日期行 */
.detail-date-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 10px;
}
.detail-date-main {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.detail-date-weekday {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* 详情 - 卡片通用 */
.detail-card {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.detail-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* 详情 - 登机信息卡片 */
.detail-gate-card {
    background: linear-gradient(135deg, var(--bg-card), rgba(59, 130, 246, 0.05));
    border-color: rgba(59, 130, 246, 0.15);
}
.detail-gate-grid {
    display: flex;
    align-items: flex-start;
    gap: 0;
}
.detail-gate-col {
    flex: 1;
    text-align: center;
}
.detail-gate-divider {
    width: 1px;
    background: var(--border);
    align-self: stretch;
    margin: 0 12px;
}
.detail-gate-airport {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}
.detail-gate-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 6px;
}
.detail-gate-label {
    font-size: 11px;
    color: var(--text-muted);
}
.detail-gate-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.detail-gate-value.pending {
    color: var(--warning);
    font-size: 13px;
}
.text-warning {
    color: var(--warning) !important;
}

.detail-route {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.detail-point {
    text-align: center;
    flex: 1 1 0;
    min-width: 0;
}

.detail-point.arrival {
    text-align: center;
}

.detail-code {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
}

.detail-terminal-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 10px;
    border-radius: 8px;
    margin-top: 2px;
    display: inline-block;
}

.detail-city {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.detail-time {
    font-size: 18px;
    font-weight: 600;
    margin-top: 8px;
}

.detail-arrow {
    font-size: 24px;
    color: var(--text-muted);
    flex: 0 0 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 12px;
}

.detail-route-line {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
}

.detail-route-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.detail-route-dash {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), rgba(59,130,246,0.3));
    min-width: 8px;
}

.detail-route-plane {
    font-size: 16px;
    color: var(--accent);
    flex-shrink: 0;
    margin: 0 2px;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* 登机信息 - 单列列表在网格上方 */
.detail-boarding-section {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.detail-boarding-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}
.detail-boarding-row:last-child {
    border-bottom: none;
}
.detail-boarding-label {
    font-size: 13px;
    color: var(--text-muted);
}
.detail-boarding-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-info-grid-bordered {
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.detail-info-grid-bordered .detail-info-item {
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.detail-info-grid-bordered .detail-info-item:nth-child(even) {
    border-right: none;
}

.detail-info-grid-bordered .detail-info-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.detail-info-item {
    background: var(--bg-card);
    padding: 14px;
    border-radius: 10px;
}

.detail-info-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-info-value {
    font-size: 15px;
    font-weight: 500;
}

.detail-reminder-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.detail-reminder-item:last-child {
    border-bottom: none;
}

/* detail-actions defined later in file */

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state-hint {
    font-size: 14px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }
    
    .nav-tabs {
        display: none;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .map-stats-card {
        bottom: 20px;
        padding: 16px 24px;
        gap: 20px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    /* 出发/到达机场和时间在手机上保持一行两列 */
    .form-row:has(#departure),
    .form-row:has(#dep-time) {
        flex-direction: row;
        gap: 10px;
    }
    
    .stats-card.large {
        grid-column: span 1;
    }
    
    .airport-code {
        font-size: 22px;
    }
    
    .route-line {
        flex: 0 0 70px;
    }
    
    .detail-code {
        font-size: 28px;
    }

    .flights-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .flights-header h2 {
        font-size: 20px;
        width: 100%;
    }

    .filter-tabs {
        width: 100%;
        order: 3;
    }

    .filter-tab {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
        font-size: 12px;
    }

    .flights-container {
        padding: 20px 16px;
    }

    .time-filter-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .btn-filter-reset {
        align-self: flex-end;
    }

    .calendar-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .calendar-header h2 {
        font-size: 20px;
    }

    .calendar-nav {
        width: 100%;
        justify-content: space-between;
    }

    .btn-cal-year {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .calendar-month-label {
        min-width: auto;
        font-size: 14px;
    }

    .year-picker-dropdown {
        min-width: 180px;
    }

    .cal-todo-add input {
        font-size: 14px;
    }
}

/* Leaflet 自定义样式 */
.leaflet-container {
    background: var(--bg-primary);
}

.airport-marker {
    background: var(--accent);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.5);
}

.airport-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.airport-popup .leaflet-popup-content-wrapper {
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.airport-popup .leaflet-popup-tip {
    background: var(--bg-card);
}

/* ==================== 设置按钮 ==================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-settings {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-settings:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: rotate(30deg);
}

/* ==================== 设置模态框 ==================== */
.modal-settings {
    max-width: 560px;
}

.settings-content {
    padding: 20px 24px 0;
}

.settings-intro {
    margin-bottom: 20px;
}

.settings-intro p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.settings-intro strong {
    color: var(--accent);
}

.settings-hint {
    margin-top: 6px;
    font-size: 13px !important;
    color: var(--text-muted) !important;
}

/* API 卡片 */
.api-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.api-card:hover {
    border-color: var(--border-light);
}

.api-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.api-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.api-tier {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.api-status {
    font-size: 12px;
    color: var(--text-muted);
}

.api-status.configured {
    color: var(--success);
}

.api-card-body {
    padding: 14px 16px;
}

.api-card-body input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    transition: border-color 0.2s;
}

.api-card-body input:focus {
    outline: none;
    border-color: var(--accent);
}

.api-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.api-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
}

.api-link:hover {
    text-decoration: underline;
}

.btn-test {
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-test:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.api-test-result {
    padding: 0 16px 12px;
    font-size: 12px;
    min-height: 0;
}

.api-test-result.success { color: var(--success); }
.api-test-result.error { color: var(--danger); }
.api-test-result.info { color: var(--text-secondary); }

.settings-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 20px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.cache-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.cache-info strong {
    color: var(--accent);
}

.settings-actions {
    display: flex;
    gap: 10px;
}

/* ==================== API 状态标识 ==================== */
.api-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    margin-left: auto;
}

.api-badge.connected {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* ==================== 智能查询改进 ==================== */
.smart-lookup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.smart-lookup-icon {
    font-size: 16px;
}

.setup-api-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.setup-api-link:hover {
    text-decoration: underline;
}

.lookup-loading-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 加载旋转动画 */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.btn-lookup-loading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 字段填充动画 */
.field-filled {
    animation: fieldHighlight 0.8s ease;
}

@keyframes fieldHighlight {
    0% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
    100% { border-color: var(--border); box-shadow: none; }
}

/* ==================== 航班进度条 ==================== */
.flight-progress-mini {
    width: 100%;
    text-align: center;
}

.progress-track {
    width: 80px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    position: relative;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.progress-plane {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    transition: left 0.5s ease;
}

.progress-text {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 详情模态框中的航站楼标签 */
.detail-terminal {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* 航班卡片中的进度条 */
.flight-card .flight-progress-bar {
    margin-top: 12px;
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.flight-card .flight-progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 2px;
    transition: width 0.5s ease;
}

.flight-countdown {
    margin-top: 10px;
    font-size: 12px;
    color: var(--accent);
    text-align: center;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 8px;
}

/* ==================== 响应式补充 ==================== */
@media (max-width: 768px) {
    .header-actions {
        gap: 8px;
    }

    .btn-settings {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .modal-settings {
        max-width: 100%;
    }

    .settings-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .settings-actions {
        justify-content: flex-end;
    }

    .lang-switcher {
        position: static;
    }

    .lang-dropdown {
        right: 0;
        left: auto;
    }
}

/* ==================== 语言切换器 ==================== */
.lang-switcher {
    position: relative;
}

.btn-lang-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-lang-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 48px;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 6px;
    min-width: 140px;
    box-shadow: 0 10px 30px var(--shadow-color);
    z-index: 1100;
    backdrop-filter: blur(20px);
}

.lang-dropdown.active {
    display: block;
    animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-option {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.lang-option:hover {
    background: var(--accent-glow);
    color: var(--text-primary);
}

.lang-option.active {
    background: var(--accent);
    color: white;
    font-weight: 500;
}

/* ==================== 主题切换按钮 ==================== */
.btn-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-theme-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-light);
    transform: rotate(20deg);
}

/* ========== 浅色主题特殊覆盖 ========== */
[data-theme="light"] .logo-text {
    background: linear-gradient(135deg, #1a1a2e, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .flight-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .modal {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .stats-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .btn-add {
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

[data-theme="light"] .nav-tab.active {
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* 浅色主题下的地图时间筛选器 */
[data-theme="light"] .map-time-filter {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .map-time-filter input[type="date"] {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border);
}

/* 浅色主题下的 Leaflet 弹窗 */
[data-theme="light"] .leaflet-popup-content-wrapper {
    background: var(--popup-bg) !important;
    color: var(--popup-text) !important;
}

[data-theme="light"] .leaflet-popup-tip {
    background: var(--popup-bg) !important;
}

/* ==================== 趣味统计 ==================== */
.stats-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.stats-header-row h2 {
    font-size: 24px;
    font-weight: 600;
}

.btn-share-stats {
    padding: 10px 20px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-share-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.fun-stats-section {
    margin-top: 32px;
    display: none;
}

.fun-stats-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.fun-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.fun-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

.fun-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.fun-card-wide {
    grid-column: span 2;
}

.fun-card-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.fun-card-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
}

.fun-card-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fun-card-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
    background: var(--border);
}

.bar-segment {
    height: 100%;
    transition: width 0.5s ease;
}

.bar-window { background: #3b82f6; }
.bar-aisle { background: #10b981; }
.bar-middle { background: #f59e0b; }

.fun-card-detail {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

.weekday-bars {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    margin-top: 12px;
    height: 50px;
}

.wd-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wd-bar {
    width: 24px;
    background: linear-gradient(to top, var(--accent), rgba(59, 130, 246, 0.4));
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.5s ease;
}

.wd-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ==================== 排行榜 ==================== */
.rankings-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 32px;
}

.ranking-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.ranking-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-rank {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.ranking-name {
    font-size: 14px;
    font-weight: 500;
    min-width: 80px;
}

.ranking-bar-wrap {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.ranking-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #60a5fa);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.ranking-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    min-width: 24px;
    text-align: right;
}

/* ==================== 月度图表 ==================== */
.chart-section {
    margin-top: 32px;
}

.chart-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.month-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.month-nav-btn:hover:not(:disabled) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.month-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.month-nav-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
    text-align: center;
}

.monthly-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-height: 160px;
    padding: 20px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow-x: auto;
}

.month-bar-col {
    flex: 1 0 24px;
    min-width: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.month-bar-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    min-width: 16px;
    text-align: center;
}

.month-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(to top, var(--accent), rgba(59, 130, 246, 0.5));
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    min-height: 2px;
}

.month-bar-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==================== 日历视图 ==================== */
.calendar-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

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

.calendar-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.btn-cal-nav {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cal-nav:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.calendar-month-label {
    font-size: 18px;
    font-weight: 600;
    min-width: 160px;
    text-align: center;
    cursor: pointer;
    position: relative;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.calendar-month-label:hover {
    background: var(--bg-card-hover);
}

.btn-cal-year {
    font-size: 14px;
    font-weight: 700;
    width: 32px;
    height: 32px;
}

.year-picker-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 30px var(--shadow-color);
    z-index: 100;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 200px;
    justify-content: center;
}

.year-picker-dropdown[style*="block"] {
    display: flex;
}

.year-pick-btn {
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.year-pick-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.year-pick-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-cal-today {
    padding: 8px 16px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cal-today:hover {
    background: var(--accent);
    color: white;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.cal-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 0;
    text-transform: uppercase;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 80px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.cal-day.empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.cal-day:not(.empty):hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.cal-day.today {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.cal-day.today .cal-day-num {
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-day.has-flights {
    background: rgba(59, 130, 246, 0.05);
}

.cal-day-num {
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.cal-flight-dots {
    display: flex;
    gap: 3px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.cal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.cal-dot.completed {
    background: var(--success);
}

.cal-dot.upcoming {
    background: var(--accent);
}

.cal-dot-more {
    font-size: 9px;
    color: var(--text-muted);
}

.calendar-flight-detail {
    margin-top: 20px;
}

.cal-detail-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.cal-detail-date {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent);
}

/* 日历待办 */
.cal-day.has-todos {
    border-color: #f59e0b;
}

.cal-todo-dot {
    font-size: 10px;
    margin-top: 2px;
}

.cal-todo-section {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
}

.cal-todo-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.cal-todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.cal-todo-item:last-of-type {
    border-bottom: none;
}

.cal-todo-text {
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    flex: 1;
    transition: all 0.2s;
}

.cal-todo-text.done {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.7;
}

.cal-todo-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.cal-todo-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.cal-todo-add {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.cal-todo-add input {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
}

.cal-todo-add input:focus {
    outline: none;
    border-color: var(--accent);
}

.cal-todo-add button {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-todo-add button:hover {
    background: var(--accent-hover);
}

.cal-flight-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.cal-flight-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.cal-flight-no {
    font-weight: 700;
    color: var(--accent);
    font-size: 15px;
    min-width: 70px;
}

.cal-flight-route {
    display: flex;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.cal-arrow {
    color: var(--text-muted);
}

.cal-flight-time {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: auto;
}

/* ==================== 天气组件 ==================== */
.weather-container {
    margin-top: 16px;
}

.weather-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
}

.weather-icon {
    font-size: 36px;
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.weather-temp {
    font-size: 22px;
    font-weight: 700;
}

.weather-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== 飞行动画图标 ==================== */
.plane-icon-wrapper {
    background: transparent !important;
    border: none !important;
}

.animated-plane {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    animation: planePulse 2s ease-in-out infinite;
}

@keyframes planePulse {
    0%, 100% { transform: scale(1) rotate(var(--plane-angle, 0deg)); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
    50% { transform: scale(1.1) rotate(var(--plane-angle, 0deg)); filter: drop-shadow(0 4px 8px rgba(59, 130, 246, 0.5)); }
}

/* ==================== 分享/导出卡片 ==================== */
.modal-share {
    max-width: 480px;
}

.share-content {
    padding: 24px;
    display: flex;
    justify-content: center;
}

.share-card {
    width: 400px;
    border-radius: 20px;
    overflow: hidden;
}

.share-card-inner {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    padding: 28px;
    border-radius: 20px;
}

.share-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.share-logo {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.share-date {
    font-size: 13px;
    color: #94a3b8;
}

.share-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.share-point {
    text-align: center;
}

.share-code {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 2px;
}

.share-city {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

.share-time {
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}

.share-arrow {
    text-align: center;
    flex: 0 0 120px;
}

.share-flight-no {
    font-size: 14px;
    font-weight: 700;
    color: #3b82f6;
}

.share-line {
    font-size: 12px;
    color: #475569;
    margin: 4px 0;
}

.share-distance {
    font-size: 11px;
    color: #64748b;
}

.share-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #334155;
}

.share-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.share-detail-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-detail-item span:last-child {
    font-size: 14px;
    font-weight: 500;
}

.share-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #334155;
    font-size: 11px;
    color: #475569;
}

.share-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* 分享卡片增强样式 */
.share-airline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.share-airline-name {
    font-size: 14px;
    color: #94a3b8;
}
.share-terminal {
    font-size: 12px;
    color: #60a5fa;
    font-weight: 600;
    margin-top: 2px;
}
.share-duration {
    font-size: 15px;
    color: #94a3b8;
    font-weight: 600;
    margin: 2px 0;
}
.share-fun-fact {
    text-align: center;
    padding: 10px;
    margin-top: 16px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 10px;
    font-size: 13px;
    color: #60a5fa;
    font-weight: 500;
}

/* 年度报告卡片 */
.share-report {
    text-align: center;
}

.report-hero {
    margin: 24px 0;
}

.report-hero-value {
    font-size: 64px;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.report-hero-label {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 4px;
}

.report-stats-row {
    display: flex;
    justify-content: space-around;
    margin: 24px 0;
    padding: 16px 0;
    border-top: 1px solid #334155;
    border-bottom: 1px solid #334155;
}

.report-stat {
    text-align: center;
}

.report-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #60a5fa;
}

.report-stat-label {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.report-insights {
    text-align: left;
    margin-top: 16px;
}

.report-insight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #1e293b;
    font-size: 14px;
}

.report-insight-item span {
    color: #94a3b8;
}

.report-insight-item strong {
    color: #e2e8f0;
}

/* 详情模态框分享按钮 */
.detail-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.detail-actions .btn-secondary,
.detail-actions .btn-primary {
    flex: 1;
    text-align: center;
}

.btn-share {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-share:hover {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

/* Delete button at bottom of detail content */
.detail-delete-section {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.btn-delete-full {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--danger);
    background: transparent;
    color: var(--danger);
    transition: all 0.2s;
}

.btn-delete-full:hover {
    background: var(--danger);
    color: white;
}

/* ==================== 响应式 - 新功能 ==================== */
@media (max-width: 768px) {
    .fun-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fun-card-wide {
        grid-column: span 2;
    }

    .rankings-section {
        grid-template-columns: 1fr;
    }

    .calendar-grid .cal-day {
        min-height: 60px;
        padding: 4px;
    }

    .cal-day-num {
        font-size: 12px;
    }

    .calendar-nav {
        gap: 8px;
    }

    .calendar-month-label {
        font-size: 15px;
        min-width: 120px;
    }

    .share-card {
        width: 100%;
    }

    .stats-header-row {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .cal-flight-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .cal-flight-time {
        margin-left: 0;
    }
}

/* ==================== PWA Standalone Mode ==================== */
@media all and (display-mode: standalone) {
    .header {
        padding-top: env(safe-area-inset-top, 20px);
    }
    .modal-back {
        display: flex !important;
    }
    body {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* ==================== 返回键 ==================== */
.modal-back {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 8px;
}

.modal-back:hover {
    background: var(--bg-hover);
}

/* 在移动端也显示返回键 */
@media (max-width: 768px) {
    .modal-back {
        display: flex;
    }
}

/* ==================== 航站楼标签 ==================== */
.terminal-tag {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    background: var(--bg-secondary);
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* 航班卡片中的航站楼+登机口 (在机场代码下方) */
.route-terminal {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    margin-top: 1px;
    opacity: 0.85;
}
.route-gate {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==================== 登机口信息 ==================== */
.gate-info {
    font-size: 11px;
    color: var(--accent);
    margin-top: 2px;
}

/* 航班卡片中的登机口/航站楼信息框 */
.card-gate-box {
    margin-top: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(59, 130, 246, 0.02));
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}
.card-gate-item {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}
.card-gate-sep {
    margin: 0 8px;
    color: var(--text-muted);
    font-size: 10px;
}

.detail-gate {
    font-size: 12px;
    color: var(--accent);
    margin-top: 4px;
}

.detail-gate.pending {
    color: var(--text-muted);
    font-style: italic;
}

/* ==================== 年份选择器 ==================== */
.stats-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.year-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.year-pill {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.year-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.year-pill:hover:not(.active) {
    background: var(--bg-hover);
}

/* ==================== 地图底部待出行预览 ==================== */
.map-upcoming-preview {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    max-width: 90vw;
    display: none;
}

.upcoming-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.upcoming-scroll::-webkit-scrollbar {
    display: none;
}

.upcoming-card {
    flex-shrink: 0;
    background: var(--map-stats-bg);
    backdrop-filter: blur(20px);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 20px var(--shadow-color);
    cursor: pointer;
    transition: transform 0.2s;
    min-width: 200px;
    max-width: 260px;
}

.upcoming-card:hover {
    transform: translateY(-2px);
}

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

.upcoming-flight-no {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent);
}

.upcoming-countdown {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 10px;
}

.upcoming-route {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upcoming-arrow {
    color: var(--text-muted);
    margin: 0 4px;
}

.upcoming-time {
    font-size: 11px;
    color: var(--text-muted);
}

.upcoming-gate {
    font-size: 11px;
    color: var(--accent);
    margin-top: 2px;
}

/* ==================== 联程航班样式 ==================== */
.connected-group {
    border: 2px dashed var(--accent);
    border-radius: 16px;
    padding: 8px;
    margin-bottom: 12px;
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.connected-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px 8px;
    position: relative;
    z-index: 20;
}

.connected-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.btn-disconnect {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border: none;
    background: rgba(239, 68, 68, 0.08);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto !important;
    position: relative;
    z-index: 50;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.btn-disconnect:hover,
.btn-disconnect:active {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.connected-group .flight-card {
    margin-bottom: 6px;
}

.connected-group .flight-card:last-child {
    margin-bottom: 0;
}

.connected-group-date {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 8px 4px;
    opacity: 0.75;
}

/* 联程多选模式 */
.flight-card.selected-connect,
.nearest-swipe-card.selected-connect {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
}

.flight-card.connect-mode,
.nearest-swipe-card.connect-mode {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connect-checkbox {
    font-size: 22px;
    color: var(--accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    cursor: pointer;
    animation: checkboxSlideIn 0.3s cubic-bezier(.4,0,.2,1) both;
}
@keyframes checkboxSlideIn {
    from { opacity: 0; transform: scale(0.5) translateX(-10px); }
    to { opacity: 1; transform: scale(1) translateX(0); }
}

.flight-card-body {
    flex: 1;
    min-width: 0;
}

.connect-action-bar {
    position: sticky;
    bottom: 0;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px var(--shadow-color);
    z-index: 100;
    flex-wrap: wrap;
}

.connect-bar-text {
    flex: 1 1 100%;
    font-size: 13px;
    color: var(--text-secondary);
}

.connect-bar-actions {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 12px;
}

.btn-connect-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}
.flights-toolbar .btn-connect-inline {
    margin-left: auto;
}
.btn-connect-inline .connect-icon {
    font-size: 14px;
}
.btn-connect-inline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.btn-connect-inline.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ==================== 统计展开/折叠样式 ==================== */
.fun-card-expandable {
    cursor: pointer;
    transition: all 0.3s;
}

.fun-card-expandable:hover {
    box-shadow: 0 4px 16px var(--shadow-color);
}

.expand-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
    transition: transform 0.3s;
}

.fun-card-expand-detail {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}

.expand-day-section {
    margin-bottom: 10px;
}

.expand-day-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.expand-day-flights {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.expand-flight-tag {
    font-size: 11px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 6px;
}

.expand-more {
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 6px;
}

/* 月度详情弹窗 */
.month-bar-clickable {
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
}

.month-bar-clickable:hover {
    transform: scaleY(1.05);
}

.month-detail-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 4px 20px var(--shadow-color);
    white-space: nowrap;
    z-index: 10;
    min-width: 160px;
    max-height: 200px;
    overflow-y: auto;
}

.month-detail-item {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 3px 0;
    border-bottom: 1px solid var(--border);
}

.month-detail-item:last-child {
    border-bottom: none;
}

.month-detail-item small {
    color: var(--text-muted);
    margin-left: 6px;
}

/* ==================== 移动端底部导航 ==================== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(5, 10, 25, 0.98) 0%, rgba(10, 20, 45, 0.95) 40%, rgba(15, 30, 60, 0.85) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top: 1px solid rgba(59, 130, 246, 0.12);
    z-index: 1000;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}
[data-theme="light"] .mobile-nav {
    background: linear-gradient(0deg, rgba(200, 215, 245, 0.98) 0%, rgba(220, 232, 255, 0.94) 40%, rgba(235, 242, 255, 0.82) 100%);
    border-top: 1px solid rgba(37, 99, 235, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.mobile-nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 10px;
    cursor: pointer;
    flex: 1;
    padding: 4px 0;
    transition: color 0.2s;
}

.mobile-nav-tab .mobile-nav-icon {
    font-size: 20px;
}

.mobile-nav-tab.active {
    color: var(--accent);
}

/* ==================== 首页地图 ==================== */
#home-view {
    overflow: hidden;
    position: relative;
}

#home-map {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}
/* Leaflet attribution: hide on home map to prevent overlay overlap */
#home-map .leaflet-control-attribution,
#flights-map .leaflet-control-attribution {
    font-size: 8px;
    opacity: 0.2;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 0;
    pointer-events: none;
}

.home-stats-overlay { display: none; }

/* ==================== Flighty 风格首页覆盖层 ==================== */
.home-flights-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 280px;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -8px 40px var(--shadow-color);
    z-index: 500;
    display: flex;
    flex-direction: column;
    transition: max-height 0.35s cubic-bezier(.4,0,.2,1), opacity 0.3s;
    overflow: hidden;
}
.home-flights-overlay.expanded {
    box-shadow: 0 -12px 60px rgba(0,0,0,0.3);
}
.home-flights-overlay.minimized {
    box-shadow: 0 -4px 16px var(--shadow-color);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 30%, black 60%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 30%, black 60%);
}
.home-flights-overlay:not(.minimized) {
    -webkit-mask-image: none;
    mask-image: none;
}
.home-flights-overlay.minimized .home-overlay-header {
    padding: 6px 20px 4px;
}
.home-flights-overlay.minimized .home-overlay-handle {
    margin: 6px auto 0;
}

.home-overlay-handle {
    width: 36px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.home-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 8px;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
}
.home-overlay-header:hover {
    opacity: 0.85;
}
.home-overlay-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.home-overlay-expand-hint {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.35s cubic-bezier(.4,0,.2,1);
    display: inline-block;
}

.home-overlay-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.home-overlay-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.12);
    padding: 2px 10px;
    border-radius: 12px;
}

.home-nearest-card {
    padding: 0 16px 8px;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}
.home-nearest-card .flight-card {
    margin-bottom: 0;
}

/* 首页待出行列表用 nearest 风格 */
.home-list-card {
    margin-bottom: 8px;
}
/* 列表卡片倒计时框 */
.home-card-countdown {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    text-align: center;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

/* 行程列表卡片样式 (统一使用 nearest-swipe-card) */
.flights-list-card {
    margin-bottom: 8px;
}
.flights-list-card .fcard-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.flights-list-card .nearest-footer .nearest-airline {
    display: none;
}
.flights-list-card .nearest-footer {
    justify-content: space-between;
}
.flights-list-card .nearest-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.flights-list-card .nearest-footer > .nearest-gate {
    margin-left: auto;
}
.flights-list-card .home-card-countdown {
    margin-top: 8px;
    margin-bottom: 0;
}
.nearest-distance {
    font-size: 11px;
    color: var(--text-muted);
}

/* 首页展开列表置顶项 */
.home-list-pinned {
    position: relative;
}

/* 月度图表空状态 */
.month-chart-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 14px;
}

.home-overlay-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 16px 16px;
    gap: 0;
    scrollbar-width: none;
    flex: 1;
    min-height: 0;
    opacity: 0;
    height: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, height 0.3s ease;
}
.home-flights-overlay.expanded .home-overlay-list {
    opacity: 1;
    height: auto;
    pointer-events: auto;
}
.home-overlay-list::-webkit-scrollbar {
    display: none;
}
.home-overlay-list .flight-card {
    margin-bottom: 12px;
}
.home-overlay-list .flights-date-header {
    padding-top: 12px;
}

.home-overlay-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ==================== 行程子标签 ==================== */
.flights-sub-nav {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.flights-sub-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.flights-sub-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.flights-sub-tab.active {
    background: var(--accent);
    color: white;
}

/* flights-sub-view rules defined above in view transitions */

/* ==================== 行程地图 (全功能筛选) ==================== */
.fmap-wrapper {
    position: relative;
    height: calc(100vh - 200px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}

/* 地图子页: 禁止外层滚动，地图撑满 */
#flights-view:has(#flights-map-subview.active) {
    overflow: hidden;
}
#flights-view:has(#flights-map-subview.active) .flights-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}
#flights-map-subview.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
#flights-map-subview.active .fmap-wrapper {
    flex: 1;
    height: auto;
    min-height: 0;
}

.flights-full-map {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

.fmap-filter-bar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 500;
    flex-wrap: wrap;
    transition: opacity 0.3s, transform 0.3s;
}
.fmap-filter-bar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}
.fmap-toggle-filter {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 501;
    padding: 6px 14px;
    background: var(--map-stats-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--shadow-color);
    transition: all 0.2s;
}
.fmap-toggle-filter:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* 全屏按钮 */
.fmap-fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 90px;
    z-index: 501;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--map-stats-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--shadow-color);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.fmap-fullscreen-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* 热力图按钮 */
.fmap-heatmap-btn {
    position: absolute;
    top: 12px;
    right: 140px;
    z-index: 501;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--map-stats-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--shadow-color);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.fmap-heatmap-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}
.fmap-heatmap-btn.active {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
    color: #60a5fa;
}

/* 机场圆点 (替代 circleMarker, 支持 worldCopyJump) */
.airport-dot-icon {
    background: none !important;
    border: none !important;
}
.airport-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #fff;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

/* 全屏模式 */
.fmap-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    z-index: 9999 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* 全屏时隐藏顶部/底部导航和子标签 */
body.fmap-fullscreen-active .header,
body.fmap-fullscreen-active .mobile-nav,
body.fmap-fullscreen-active .flights-sub-nav,
body.fmap-fullscreen-active .fab-container {
    display: none !important;
}
/* 破除父级 stacking context，让 z-index 9999 生效 */
body.fmap-fullscreen-active .main-content,
body.fmap-fullscreen-active .view,
body.fmap-fullscreen-active .flights-container,
body.fmap-fullscreen-active .flights-sub-view {
    transform: none !important;
    overflow: visible !important;
    contain: none !important;
    animation: none !important;
    /* animation:none 移除了 forwards 填充，需要手动还原到动画终态 */
    opacity: 1 !important;
}
.fmap-fullscreen .flights-full-map {
    width: 100% !important;
    height: 100% !important;
}
.fmap-fullscreen .fmap-fullscreen-btn {
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 90px;
    width: 40px;
    height: 40px;
    font-size: 22px;
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.fmap-fullscreen .fmap-heatmap-btn {
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 140px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.fmap-fullscreen .fmap-toggle-filter {
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 16px;
}
.fmap-fullscreen .fmap-filter-bar {
    top: calc(60px + env(safe-area-inset-top, 0px));
}
.fmap-fullscreen .fmap-stats-card {
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.fmap-status-pills {
    display: flex;
    gap: 4px;
    background: var(--map-stats-bg);
    backdrop-filter: blur(20px);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.fmap-pill {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.fmap-pill:hover {
    color: var(--text-primary);
}

.fmap-pill.active {
    background: var(--accent);
    color: white;
}

.fmap-right-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fmap-year-pills {
    display: flex;
    gap: 4px;
    background: var(--map-stats-bg);
    backdrop-filter: blur(20px);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 16px var(--shadow-color);
    overflow-x: auto;
    max-width: min(100%, 400px);
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.fmap-year-pills::-webkit-scrollbar {
    display: none;
}

.fmap-year-pill {
    padding: 5px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.fmap-year-pill:hover {
    color: var(--text-primary);
}

.fmap-year-pill.active {
    background: var(--accent);
    color: white;
}

.fmap-date-range {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--map-stats-bg);
    backdrop-filter: blur(20px);
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.fmap-date-range input {
    padding: 5px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    width: 130px;
}

.fmap-date-range input:focus {
    outline: none;
    border-color: var(--accent);
}

.fmap-date-range span {
    font-size: 12px;
    color: var(--text-muted);
}

.fmap-reset-btn {
    padding: 5px 12px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.fmap-reset-btn:hover {
    background: var(--accent-hover);
}

.fmap-stats-card {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: clamp(16px, 4vw, 32px);
    background: var(--map-stats-bg);
    backdrop-filter: blur(20px);
    padding: 12px clamp(18px, 5vw, 36px);
    border-radius: 14px;
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 30px var(--shadow-color);
    z-index: 500;
}
.fmap-stats-card .stat-item {
    position: relative;
    text-align: center;
}
.fmap-stats-card .stat-item + .stat-item::before {
    content: '';
    position: absolute;
    left: calc(clamp(-8px, -2vw, -16px) - 0.5px);
    top: 15%;
    height: 70%;
    width: 1px;
    background: var(--border-light);
    opacity: 0.6;
}
.fmap-stats-card .stat-value {
    font-size: clamp(18px, 4vw, 28px);
}
.fmap-stats-card .stat-label {
    font-size: clamp(10px, 2vw, 12px);
}

/* ==================== 响应式补充 ==================== */
@media (max-width: 768px) {
    .home-overlay-card {
        padding: 12px 14px;
    }
    
    .home-overlay-code {
        font-size: 16px;
    }
    
    .stats-header-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .year-selector {
        width: 100%;
    }
    
    .connect-action-bar {
        border-radius: 12px 12px 0 0;
    }

    .flights-sub-nav {
        margin-bottom: 16px;
    }
    
    .fmap-wrapper {
        border-radius: 12px;
    }
    #flights-view:has(#flights-map-subview.active) .flights-container {
        height: 100%;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        overflow: hidden;
    }
    #flights-map-subview.active .fmap-wrapper {
        flex: 1;
        height: auto;
        min-height: 0;
    }
    
    .fmap-filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .fmap-right-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }
    
    .fmap-date-range {
        width: 100%;
    }
    
    .fmap-date-range input {
        flex: 1;
        min-width: 0;
    }
    
    .fmap-stats-card {
        padding: 10px clamp(14px, 3.5vw, 22px);
        gap: clamp(14px, 3.5vw, 24px);
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .view {
        height: calc(100vh - 60px - 56px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }
    
    .home-flights-overlay {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        border-radius: 20px 20px 0 0;
    }

    .fab-container {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    /* 行程列表底部留白避免遮挡 */
    .flights-list {
        padding-bottom: 80px;
    }
}

/* ==================== FAB 浮动按钮 + 菜单 ==================== */
.fab-container {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 900;
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.fab-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
}
.fab-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: all 0.2s;
}
.fab-menu-item:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
}
.fab-menu-icon {
    font-size: 16px;
}

.btn-add-float {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 6px 24px var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
}

.btn-add-float:hover {
    box-shadow: 0 8px 32px var(--accent-glow);
}
.btn-add-float.open {
    transform: rotate(45deg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.btn-add-float:active {
    transform: scale(0.95);
}

/* ==================== 设置通用区域 ==================== */
.settings-section {
    margin-bottom: 20px;
}

.settings-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.settings-lang-options {
    display: flex;
    gap: 4px;
}

.settings-lang-btn {
    padding: 5px 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.settings-lang-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.settings-lang-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.settings-theme-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}

.settings-theme-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.settings-theme-icon {
    font-size: 18px;
}

/* --- 设置操作按钮 (刷新等) --- */
.settings-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
}
.settings-action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}
.settings-action-btn.refreshing {
    pointer-events: none;
    opacity: 0.6;
}
.settings-action-btn.refreshing span:first-child {
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* --- 数据同步区 --- */
.settings-row-col {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.sync-input-row {
    display: flex;
    gap: 8px;
    width: 100%;
}
.sync-input-row input {
    flex: 1;
}
.settings-row-col input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
}
.sync-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.btn-sync {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-sync:hover { filter: brightness(1.1); }
.btn-sync:active { transform: scale(0.97); }
.btn-sync.btn-sync-pull {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-sync.btn-sync-pull:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-sync:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ==================== 航空公司 Logo ==================== */
.airline-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: contain;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    flex-shrink: 0;
    padding: 2px;
}
.airline-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}
.flight-card .airline-logo,
.flight-card .airline-logo-fallback {
    width: 22px;
    height: 22px;
    font-size: 8px;
}

/* ==================== 航班列表日期分组 ==================== */
.flights-date-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.flights-date-header:first-child {
    padding-top: 0;
}

/* ==================== 首页覆盖层展开效果 ==================== */
.home-flights-overlay.expanded .home-nearest-card {
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    transition: opacity 0.3s, max-height 0.3s, padding 0.3s, margin 0.3s;
}
.home-nearest-card {
    transition: opacity 0.3s, max-height 0.35s, padding 0.3s, margin 0.3s;
    max-height: 500px;
}
.home-flights-overlay.expanded .home-overlay-list {
    opacity: 1;
    pointer-events: auto;
}

/* ==================== 最近出行详细大卡片 ==================== */
.nearest-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.nearest-detail-card:active {
    transform: scale(0.98);
}

.nearest-countdown {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 8px;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}

.nearest-route {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.nearest-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    flex: 0 0 auto;
}

.nearest-code {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
    letter-spacing: 1px;
}

.nearest-terminal {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    padding: 1px 8px;
    border-radius: 6px;
    margin-top: 2px;
}

.nearest-city {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    text-align: center;
}

.nearest-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
}

.nearest-arrow {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    padding-top: 8px;
    padding-bottom: 16px;
}

.nearest-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.nearest-plane {
    font-size: 14px;
    color: var(--accent);
    flex-shrink: 0;
}

.nearest-duration {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* 经停存在时, 飞行时长下移 */
.stopover-indicator ~ .nearest-duration {
    top: 34px;
}

.nearest-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.nearest-airline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nearest-flight-no {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.nearest-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nearest-gate {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.nearest-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==================== 联程轮播 (全宽滑动) ==================== */
.nearest-connected-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    padding-left: 2px;
}

.home-carousel {
    display: flex;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 0;
}
.home-carousel::-webkit-scrollbar { display: none; }

.nearest-swipe-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
}
.nearest-swipe-card:active {
    transform: scale(0.98);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 4px 0;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

.carousel-dot.active {
    background: var(--accent);
    width: 20px;
    border-radius: 4px;
}

/* ==================== 月度图表下拉选择器 ==================== */
.month-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.month-chart-select {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: auto;
    appearance: auto;
}

.month-chart-select:focus {
    border-color: var(--accent);
}

.month-chart-select:hover {
    border-color: var(--accent);
}

/* ==================== 经停指示器 ==================== */
.stopover-indicator {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 0;
    font-size: 9px;
    color: var(--accent);
    white-space: nowrap;
}

.stopover-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    flex-shrink: 0;
}

.stopover-text {
    opacity: 0.9;
    font-weight: 500;
}

/* 详情页经停 - 使用相对定位 */
.detail-arrow .stopover-indicator {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    font-size: 11px;
    margin-top: 6px;
    gap: 5px;
}

.detail-arrow .stopover-dot {
    width: 6px;
    height: 6px;
}

/* 分享卡经停 */
.share-stopover {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    margin: 2px 0;
}

/* ==================== +1 跨日标识 ==================== */
.next-day-sup {
    font-size: 0.7em;
    color: var(--accent);
    font-weight: 700;
    margin-left: 1px;
    vertical-align: super;
    line-height: 1;
}

/* 表单中的 +1 切换按钮 */
.arr-time-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.arr-time-row input[type="time"] {
    flex: 1;
    min-width: 0;
}

.next-day-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.next-day-toggle input[type="checkbox"] {
    display: none;
}

.next-day-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--border-light);
    color: var(--text-muted);
    background: transparent;
    transition: all 0.2s;
}

.next-day-toggle input[type="checkbox"]:checked + .next-day-badge {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

/* ==================== 日期偏移切换 ==================== */
.day-offset-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.day-offset-select {
    display: none;
}

.day-offset-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--border-light);
    color: var(--text-muted);
    background: transparent;
    transition: all 0.2s;
}

.day-offset-badge.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

/* ==================== 机场名称提示 ==================== */
.airport-hint {
    display: none;
    font-size: 11px;
    color: var(--accent);
    margin-top: 4px;
    line-height: 1.3;
    opacity: 0.8;
}

/* ==================== 高级字段折叠 ==================== */
.advanced-fields-toggle {
    margin: 12px 0 8px;
}

.advanced-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.advanced-toggle-label input[type="checkbox"] {
    display: none;
}

.advanced-toggle-arrow {
    font-size: 10px;
    transition: transform 0.2s;
    margin-left: auto;
}

.advanced-fields {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 航空联盟徽章 ==================== */
.alliance-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.3px;
    line-height: 1.4;
}
.alliance-star { background: linear-gradient(135deg, #C5A94E, #A88B2A); }
.alliance-skyteam { background: linear-gradient(135deg, #0A3A7D, #1A5CC8); }
.alliance-oneworld { background: linear-gradient(135deg, #B51E34, #D43A52); }

/* ==================== 行程搜索框 ==================== */
.flights-search-box {
    position: relative;
    margin: 8px 0 4px;
}
.flights-search-box input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.flights-search-box input:focus {
    border-color: var(--accent);
}
.flights-search-box input::placeholder {
    color: var(--text-muted);
}
.flights-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    background: var(--border);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.flights-search-clear:hover {
    background: var(--accent);
    color: #fff;
}

/* ==================== 首页缩放按钮跟随覆盖层 ==================== */
#home-map .leaflet-bottom.leaflet-right {
    position: fixed !important;
    right: 14px;
    bottom: 290px;
    transition: bottom 0.35s cubic-bezier(.4,0,.2,1), opacity 0.5s ease;
    z-index: 800;
    pointer-events: auto;
}
