* { box-sizing: border-box; }
body { 
    margin: 0; 
    padding: 0; 
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif; 
    overflow: hidden; 
}

#map { 
    height: 100vh; 
    width: 100vw; 
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* 控制面板 */
.controls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 300px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.controls.collapsed {
    width: 140px;
}

.controls.collapsed #panelContent {
    max-height: 0;
    opacity: 0;
    padding: 0 16px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    user-select: none;
}

.panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.controls.collapsed .toggle-icon {
    transform: rotate(180deg);
}

#panelContent {
    padding: 16px;
    max-height: 500px;
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 时间与日期显示 */
.date-section { margin-bottom: 16px; }
.date-section label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    background: #fafafa;
}

.time-display-section {
    text-align: center;
    padding: 16px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 12px;
    margin-bottom: 16px;
}

.time-display {
    font-size: 2.4rem;
    font-weight: 700;
    font-family: "SF Mono", "Consolas", monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

/* --- 滑块部分（已修复） --- */
.slider-section {
    margin-bottom: 16px;
}

.slider-section label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px; /* 确保标题和滑块上下分开 */
    font-weight: 500;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    display: block;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 按钮组 */
.btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.btn {
    padding: 10px 8px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: 0.2s;
}

.btn-success { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); color: white; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-warning { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; }

/* 速度控制 */
.speed-section { margin-top: 12px; border-top: 1px solid #eee; padding-top: 12px; }
.speed-btns { display: flex; gap: 6px; margin-top: 8px; }
.speed-btn { flex: 1; padding: 6px; border: 2px solid #e0e0e0; background: white; border-radius: 8px; cursor: pointer; font-size: 12px; }
.speed-btn.active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-color: transparent; }

/* 地图标注与图例 */
.city-label {
    background: transparent;
    border: none;
    font-size: 11px;
    font-weight: 600;
    color: #2c3e50;
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
    white-space: nowrap;
}
.legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 12px;
}
.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-dot.capital { background: #e67e22; }
.legend-dot.extreme { background: #c0392b; }
.legend-night { width: 20px; height: 10px; background: rgba(0, 0, 0, 0.6); border-radius: 2px; }

.day-night-indicator {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-top: 8px;
}
.day-night-indicator.day { background: #ffecd2; color: #c44536; }
.day-night-indicator.night { background: #2c3e50; color: #ecf0f1; }