/* 基礎樣式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 新配色方案 CSS 變數 */
:root {
    /* 主要配色 */
    --primary-color: #00C4C4;        /* 青綠色主品牌色 */
    --secondary-color: #043E8D;       /* 深藍色 */
    --accent-color: #00C4C4;         /* 強調色 */
    --text-dark: #043E8D;            /* 深色文字 */
    --text-light: #D9D9D9;           /* 淺色文字 */
    
    /* 背景與卡片 */
    --bg-gradient: linear-gradient(135deg, #00C4C4 0%, #043E8D 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 8px 32px rgba(0, 196, 196, 0.15);
    
    /* 狀態顏色 - 保持功能性 */
    --success-color: #00C4C4;        /* 成功狀態改為青綠色 */
    --warning-color: #f39c12;        /* 警告色保持 */
    --danger-color: #e74c3c;         /* 危險色保持 */
    --info-color: #043E8D;           /* 資訊色改為深藍 */
    
    /* 數據卡片漸層 - 重新設計 */
    --wind-gradient: linear-gradient(135deg, #00C4C4, #008B8B);
    --direction-gradient: linear-gradient(135deg, #043E8D, #0056B3);
    --temp-gradient: linear-gradient(135deg, #00A0A0, #007A7A);
    --humidity-gradient: linear-gradient(135deg, #006B8B, #004F6B);
    --solar-gradient: linear-gradient(135deg, #00C4C4, #00A8A8);
    --globe-gradient: linear-gradient(135deg, #043E8D, #032E6B);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-gradient);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header 樣式 */
.header {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid rgba(0, 196, 196, 0.2);
}

.header h1 {
    color: var(--text-dark);
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 i {
    color: var(--primary-color);
    font-size: 2.2rem;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--success-color);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-light);
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: var(--success-color);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.last-update {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 主要內容區域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: calc(100vh - 140px);
}

/* 地圖區域 */
.map-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    position: relative;
    border: 1px solid rgba(0, 196, 196, 0.2);
}

.map-container {
    height: 100%;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

#map {
    height: 100%;
    width: 100%;
    border-radius: 10px;
    /* 觸控設備優化 */
    touch-action: pan-x pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Leaflet 觸控優化樣式 */
.leaflet-container {
    touch-action: pan-x pan-y;
}

/* 觸控設備縮放控制優化 */
.leaflet-control-zoom a {
    min-height: 40px;
    min-width: 40px;
    line-height: 40px;
    font-size: 18px;
    text-align: center;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* 自訂彈窗樣式 - 觸控優化 */
.custom-popup .leaflet-popup-content-wrapper {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 196, 196, 0.2);
    min-height: 50px; /* 確保觸控友善的最小高度 */
}

.custom-popup .leaflet-popup-content {
    margin: 15px;
    line-height: 1.6;
    font-size: 14px;
    min-height: 40px; /* 觸控友善的內容高度 */
}

.custom-popup .leaflet-popup-close-button {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 18px;
    text-align: center;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    margin: 5px;
    transition: all 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.custom-popup .leaflet-popup-close-button:hover {
    background: var(--danger-color);
    color: white;
}

.custom-popup .leaflet-popup-tip {
    background: var(--card-bg);
    border: 1px solid rgba(0, 196, 196, 0.2);
    border-top: none;
    border-right: none;
}

/* 觸控設備專用樣式 */
@media (pointer: coarse) {
    /* 增大觸控目標 */
    .leaflet-control-zoom a {
        min-height: 44px;
        min-width: 44px;
        line-height: 44px;
        font-size: 20px;
    }
    
    .custom-popup .leaflet-popup-close-button {
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 20px;
    }
    
    /* 增加彈窗內容的間距 */
    .custom-popup .leaflet-popup-content {
        margin: 20px;
        font-size: 15px;
    }
}

/* 高 DPI 螢幕優化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .leaflet-control-zoom a {
        background-size: 20px 20px;
    }
}

.map-legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    z-index: 1000;
    border: 1px solid rgba(0, 196, 196, 0.2);
}

.map-legend h4 {
    margin-bottom: 10px;
    color: var(--text-dark);
    font-size: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.wind-low { background: var(--success-color); }
.wind-medium { background: var(--warning-color); }
.wind-high { background: var(--danger-color); }

.map-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.control-btn {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 196, 196, 0.3);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* 數據面板 */
.data-panel {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border: 1px solid rgba(0, 196, 196, 0.2);
}

/* 監測站資訊 */
.station-info h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.station-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 監測站搜尋功能 */
.station-search {
    margin-top: 15px;
    position: relative;
}

.search-container {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid rgba(0, 196, 196, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 196, 196, 0.1);
}

.search-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    /* 觸控優化 */
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.search-toggle:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.search-result-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.search-result-item.station {
    border-left: 4px solid #3498db;
}

.search-result-item.location {
    border-left: 4px solid #e74c3c;
}

.search-result-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.search-result-description {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.search-result-type {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 2px;
}

.search-result-type.station {
    background: #e3f2fd;
    color: #2980b9;
}

.search-result-type.location {
    background: #fdf2e9;
    color: #e67e22;
}

.station-list-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow: hidden;
    z-index: 1000;
}

.station-list-panel.hidden {
    display: none;
}

.station-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
}

.station-list-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.station-list-content {
    max-height: 320px;
    overflow-y: auto;
}

.station-list-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 觸控優化 */
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

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

.station-list-item:hover {
    background: #f8f9fa;
}

.station-list-item.active {
    background: #e3f2fd;
    border-left: 4px solid #3498db;
}

.station-item-info {
    flex: 1;
}

.station-item-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.station-item-details {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.station-item-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.station-item-status.online {
    background: #d4edda;
    color: #155724;
}

.station-item-status.offline {
    background: #f8d7da;
    color: #721c24;
}

/* 即時數據卡片 */
.current-data h4 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-data h4 i {
    color: var(--primary-color);
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.data-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
    min-height: 100px;
    position: relative;
}

.data-card:hover {
    transform: translateY(-5px);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.wind-speed .card-icon { background: var(--wind-gradient); }
.wind-direction .card-icon { background: var(--direction-gradient); }
.temperature .card-icon { background: var(--temp-gradient); }
.humidity .card-icon { background: var(--humidity-gradient); }
.solar-radiation .card-icon { background: var(--solar-gradient); }
.black-globe-temp .card-icon { background: var(--globe-gradient); }

.card-content {
    flex: 1;
    position: relative;
}

.data-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
    margin-right: 100px; /* 為右側狀態顯示預留空間 */
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.unit {
    font-size: 1rem;
    color: #7f8c8d;
    font-weight: 500;
}

.data-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-right: 100px; /* 為右側狀態顯示預留空間 */
}

.data-label i {
    font-size: 0.8rem;
}

/* 數據狀態顯示 - 右側佈局 */
.data-status {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
    min-width: 90px;
    text-align: right;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.status-level {
    font-weight: bold;
    font-size: 0.8rem;
    line-height: 1.2;
    margin-bottom: 1px;
}

.status-description {
    color: #7f8c8d;
    font-size: 0.7rem;
    line-height: 1.1;
    opacity: 0.9;
    font-style: italic;
}

/* 數據卡片懸停效果增強 */
.data-card:hover .data-status {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 舒適度描述 */
.comfort-description {
    font-size: 0.85rem;
    margin-top: 5px;
    font-style: italic;
    opacity: 0.8;
}

/* UTCI 圖例樣式 */
.utci-legend {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.utci-legend h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.utci-scale {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.utci-level {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.utci-level:hover {
    transform: scale(1.02);
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.utci-level.active {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 0 5px var(--primary-color);
    z-index: 3;
    font-weight: 700;
    border-left: 4px solid var(--primary-color);
}

.utci-level.active .level-temp::after {
    content: ' ► 當前級距';
    font-size: 10px;
    font-weight: 600;
    opacity: 0.95;
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    white-space: nowrap;
}

.level-temp {
    font-weight: 600;
    min-width: 90px;
    text-align: left;
    white-space: nowrap;
    padding-right: 8px;
    overflow: visible;
}

.level-name {
    font-weight: 500;
    text-align: right;
}

/* 手機版 UTCI 圖例優化 */
@media (max-width: 768px) {
    .utci-legend {
        margin-top: 15px;
        padding: 10px;
    }
    
    .utci-level {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .level-temp {
        min-width: 80px;
        padding-right: 6px;
    }
}

/* 舒適度指標 */
.comfort-section h4 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comfort-section h4 i {
    color: var(--primary-color);
}

.comfort-indicator {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.comfort-meter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.comfort-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #00C4C4, #043E8D);
    color: white;
    box-shadow: 0 8px 24px rgba(0, 196, 196, 0.4);
    border: 4px solid rgba(255, 255, 255, 0.9);
    animation: comfortPulse 2s ease-in-out infinite;
}

@keyframes comfortPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(0, 196, 196, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 12px 32px rgba(0, 196, 196, 0.6); }
}

.comfort-text {
    text-align: center;
}

.comfort-level {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 10px;
}

.comfort-score {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-dark);
    background: linear-gradient(135deg, #00C4C4, #043E8D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.comfort-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comfort-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.comfort-item i {
    width: 20px;
    color: var(--primary-color);
}

.comfort-label {
    font-weight: 600;
    color: #5a6c7d;
    flex: 1;
}

/* 圖表區域 */
.charts-section h4 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.charts-section h4 i {
    color: var(--secondary-color);
}

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

.chart-tabs {
    display: flex;
    gap: 5px;
}

.tab-btn {
    background: #ecf0f1;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.tab-btn i {
    font-size: 0.8rem;
}

.tab-btn.active {
    background: linear-gradient(135deg, #00C4C4, #043E8D);
    color: white;
}

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

.time-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s ease;
}

.time-btn:hover {
    background: #f0f0f0;
}

.time-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-container {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    height: 250px;
}

/* 統計區域 */
.statistics-section h4 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.statistics-section h4 i {
    color: #f39c12;
}

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

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #00C4C4, #043E8D);
    color: white;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    text-align: left;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.stat-value {
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 700;
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .map-section {
        height: 50vh;
        min-height: 400px;
    }
}

/* 平板設計 */
@media (max-width: 768px) and (min-width: 481px) {
    .container {
        padding: 15px;
    }
    
    .data-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .map-section {
        height: 45vh;
        min-height: 350px;
    }
}

/* 手機設計優化 */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header h1 i {
        font-size: 1.7rem;
    }
    
    .header-info {
        justify-content: center;
        gap: 20px;
    }
    
    .status-indicator {
        font-size: 0.8rem;
    }
    
    .last-update {
        font-size: 0.8rem;
    }
    
    .main-content {
        height: calc(100vh - 160px);
    }
    
    /* 手機端：地圖在上方 */
    .map-section {
        order: 1;
        height: 50vh;
        min-height: 350px;
        margin-bottom: 20px;
    }
    
    /* 手機端：詳細資料在下方 */
    .data-panel {
        order: 2;
        padding: 15px;
    }
    
    /* 手機版搜尋功能優化 */
    .station-search {
        margin-top: 10px;
    }
    
    .search-container {
        gap: 6px;
    }
    
    .search-input {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .search-toggle {
        padding: 8px 10px;
        width: 40px;
        font-size: 0.85rem;
    }
    
    .search-results,
    .station-list-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 400px;
        max-height: 70vh;
        z-index: 2000;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .search-result-item,
    .station-list-item {
        padding: 15px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .search-result-item:hover,
    .station-list-item:hover {
        transform: none;
        background: #f8f9fa;
    }
    
    .station-list-header {
        padding: 15px;
        background: #3498db;
        color: white;
        border-radius: 12px 12px 0 0;
    }
    
    .station-list-header h4 {
        color: white;
        font-size: 1rem;
    }
    
    .close-btn {
        color: white;
        padding: 8px;
    }
    
    .close-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        color: white;
    }
    
    .station-item-name {
        font-size: 0.95rem;
    }
    
    .station-item-details {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .data-card {
        padding: 15px;
        min-height: 80px;
    }
    
    .data-card:active {
        transform: scale(0.98);
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .data-value {
        font-size: 1.5rem;
        margin-right: 80px;
    }
    
    .data-label {
        font-size: 0.8rem;
        margin-right: 80px;
    }
    
    .data-status {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        min-width: 70px;
    }
    
    .status-level {
        font-size: 0.75rem;
    }
    
    .status-description {
        font-size: 0.65rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .chart-tabs {
        display: flex;
        justify-content: space-between;
        gap: 8px;
    }
    
    .tab-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 0.8rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    
    .chart-container {
        height: 250px;
        margin-top: 15px;
    }
    
    .map-legend {
        position: static;
        margin-bottom: 15px;
        padding: 12px;
    }
    
    .legend-item {
        font-size: 0.8rem;
    }
    
    .map-controls {
        position: static;
        margin-top: 15px;
        justify-content: center;
    }
    
    .control-btn {
        padding: 10px 15px;
        font-size: 0.8rem;
    }
    
    .comfort-meter {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .comfort-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .comfort-level {
        font-size: 1.1rem;
    }
    
    .comfort-score {
        font-size: 2rem;
    }
    
    .comfort-details {
        gap: 8px;
    }
    
    .comfort-item {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* 滾動條樣式 */
.data-panel::-webkit-scrollbar {
    width: 6px;
}

.data-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.data-panel::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.data-panel::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* 載入動畫 */
.loading {
    animation: spin 1s linear infinite;
}

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