/* ==================== 重置与基础 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "Segoe UI", sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.5;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ==================== 深色模式 ==================== */
body.dark-mode {
    background: #0a0a0f;
    color: #e0e0e0;
}

/* ==================== 容器 ==================== */
.app-container {
    display: flex;
    flex-direction: column;
}
.app-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 10px 20px;
    border-bottom: 1px solid #2a2a3a;
    flex-shrink: 0;
    z-index: 100;
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 16px;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sound-btn,
.api-indicator,
.settings-trigger {
    display: inline-flex;
    align-items: center;
    height: 32px;
    line-height: 1;
    padding: 0 12px;
    box-sizing: border-box;
}

.settings-trigger {
    background: rgba(79, 195, 247, 0.1);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 6px;
    color: #4fc3f7;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    width: 36px;
    justify-content: center;
}
.settings-trigger:hover {
    background: rgba(79, 195, 247, 0.2);
    transform: translateY(-1px);
}

/* ==================== 设置浮层 (全新设计) ==================== */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 8, 16, 0.85);
    backdrop-filter: blur(12px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.settings-panel {
    background: linear-gradient(145deg, #12121f 0%, #0c0c16 100%);
    border-radius: 32px;
    width: 90%;
    max-width: 540px;
    border: 1px solid rgba(79, 195, 247, 0.25);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(79, 195, 247, 0.1) inset;
    overflow: hidden;
    animation: panelGlideIn 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

@keyframes panelGlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: rgba(10, 10, 20, 0.6);
    border-bottom: 1px solid rgba(79, 195, 247, 0.2);
}
.settings-header h3 {
    font-size: 1.35rem;
    font-weight: 600;
    background: linear-gradient(135deg, #e0f2fe, #4fc3f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-header h3::before {
    content: "⚙️";
    font-size: 1.4rem;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #4fc3f7;
}
.close-settings {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.close-settings:hover {
    background: rgba(231, 76, 60, 0.25);
    color: #ff7b5c;
    transform: rotate(90deg);
}

.settings-content {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
}
.settings-content::-webkit-scrollbar {
    width: 4px;
}
.settings-content::-webkit-scrollbar-track {
    background: #1e1e2a;
    border-radius: 8px;
}
.settings-content::-webkit-scrollbar-thumb {
    background: #4fc3f7;
    border-radius: 8px;
}

.setting-card {
    background: rgba(18, 18, 30, 0.7);
    border-radius: 24px;
    padding: 18px 20px;
    border: 1px solid rgba(79, 195, 247, 0.15);
    transition: all 0.2s;
}
.setting-card:hover {
    border-color: rgba(79, 195, 247, 0.35);
    background: rgba(26, 26, 42, 0.6);
}
.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4fc3f7;
    margin-bottom: 16px;
}
.card-title span {
    font-size: 1.2rem;
}

.location-preview {
    background: #0a0a12;
    border-radius: 20px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-family: monospace;
    font-size: 0.8rem;
    border: 1px solid #2a2a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.coord-text {
    color: #b9e6ff;
    word-break: break-all;
}
.reset-location-btn {
    background: linear-gradient(135deg, #2c3e66, #1f2a48);
    border: none;
    padding: 8px 18px;
    border-radius: 40px;
    color: #e0f2fe;
    font-weight: 500;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.reset-location-btn:hover {
    background: linear-gradient(135deg, #3e5a8c, #2a3a60);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* ==================== 新增控件样式 ==================== */
/* 阈值滑块 */
.threshold-control {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}
.threshold-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #2a2a3a;
    border-radius: 4px;
    outline: none;
}
.threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #4fc3f7;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px #4fc3f7;
}
.threshold-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4fc3f7;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}
.threshold-value {
    font-weight: 600;
    color: #4fc3f7;
    font-size: 1.1rem;
    margin-left: 8px;
}

/* 主题选择下拉框 */
.theme-select {
    background: #0a0a12;
    border: 1px solid #2a2a3a;
    border-radius: 40px;
    padding: 8px 16px;
    color: #e0e0e0;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}
.theme-select:hover {
    border-color: #4fc3f7;
}
.theme-select:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}

/* 手动经纬度输入区域 */
.manual-location-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0;
}
.input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.input-group label {
    min-width: 60px;
    font-size: 0.8rem;
    color: #aaa;
}
.input-group input {
    flex: 1;
    background: #0a0a12;
    border: 1px solid #2a2a3a;
    border-radius: 40px;
    padding: 8px 14px;
    color: #e0e0e0;
    font-size: 0.85rem;
    font-family: monospace;
    transition: 0.2s;
}
.input-group input:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
}
.save-location-btn {
    background: linear-gradient(135deg, #2c3e66, #1f2a48);
    border: none;
    border-radius: 40px;
    padding: 8px 16px;
    color: #e0f2fe;
    font-weight: 500;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.save-location-btn:hover {
    background: linear-gradient(135deg, #3e5a8c, #2a3a60);
    transform: translateY(-2px);
}

/* 清除位置按钮 */
.clear-location-btn {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid #e74c3c;
    border-radius: 40px;
    padding: 8px 16px;
    color: #ff8a6c;
    font-weight: 500;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.clear-location-btn:hover {
    background: rgba(231, 76, 60, 0.3);
    transform: translateY(-2px);
}

/* 模拟/清除地震按钮样式（沿用原有 test-btn 风格，补充独立类） */
.simulate-btn, .clear-eq-btn {
    background: rgba(243, 156, 18, 0.15);
    border: 1px solid #f39c12;
    color: #f7b05e;
    padding: 10px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
    width: 100%;
}
.simulate-btn:hover, .clear-eq-btn:hover {
    background: rgba(243, 156, 18, 0.3);
    transform: translateY(-2px);
}
.clear-eq-btn {
    border-color: #e74c3c;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}
.clear-eq-btn:hover {
    background: rgba(231, 76, 60, 0.2);
}

/* 按钮组 */
.button-group-flex {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.datasource-switch {
    display: flex;
    gap: 12px;
    background: #0a0a12;
    padding: 6px;
    border-radius: 60px;
    border: 1px solid #2a2a3a;
}
.ds-btn {
    flex: 1;
    text-align: center;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 10px 0;
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.ds-btn.active {
    background: linear-gradient(135deg, #4fc3f7, #00bcd4);
    color: #0a0a0f;
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}
.ds-btn:not(.active):hover {
    background: rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
}

.toggle-switch {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
.toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toggle-btn {
    width: 52px;
    height: 28px;
    background: #2a2a3a;
    border-radius: 40px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
    border: none;
}
.toggle-btn.active {
    background: linear-gradient(135deg, #4fc3f7, #00bcd4);
}
.toggle-btn::after {
    content: "";
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 3px;
    transition: transform 0.2s;
}
.toggle-btn.active::after {
    transform: translateX(24px);
}

.earthquake-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    border-radius: 40px;
    padding: 8px 18px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ff8a6c;
    animation: pulseBadge 1.5s infinite;
    width: fit-content;
}
@keyframes pulseBadge {
    0%, 100% { opacity: 0.9; box-shadow: 0 0 0 0 rgba(231,76,60,0.4);}
    50% { opacity: 1; box-shadow: 0 0 0 6px rgba(231,76,60,0);}
}

.test-btn {
    background: rgba(243, 156, 18, 0.15);
    border: 1px solid #f39c12;
    color: #f7b05e;
    padding: 10px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
    width: 100%;
}
.test-btn:hover {
    background: rgba(243, 156, 18, 0.3);
    transform: translateY(-2px);
}

.settings-footer {
    padding: 14px 24px;
    background: #08080e;
    border-top: 1px solid #1f1f2a;
    text-align: center;
    font-size: 0.7rem;
    color: #5f6c84;
}
.info-note {
    font-size: 0.7rem;
    color: #6b7b9c;
    margin-top: 10px;
    text-align: center;
}

/* 原有样式延续 (保持系统完整性) */
.sound-btn, .api-indicator, .earthquake-badge {
    display: inline-flex;
    align-items: center;
    height: 32px;
    line-height: 1;
    padding: 0 12px;
    box-sizing: border-box;
}

.datasource-switch {
    height: 36px;
    padding: 2px;
}

.ds-btn {
    height: 32px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
}

.app-title-icon {
    font-size: 24px;
    animation: shake 2s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.app-title h1 {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #4fc3f7, #00bcd4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-title .subtitle {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}

.sound-btn {
    padding: 6px 12px;
    background: rgba(79, 195, 247, 0.1);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 6px;
    color: #4fc3f7;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.sound-btn:hover {
    background: rgba(79, 195, 247, 0.2);
    transform: translateY(-1px);
}

.sound-btn.muted {
    color: #666;
    border-color: #3a3a4a;
    background: rgba(100, 100, 100, 0.1);
}

.api-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(79, 195, 247, 0.1);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 6px;
    font-size: 11px;
    color: #aaa;
}

.api-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4fc3f7;
    animation: blink 1s ease-in-out infinite;
}

.api-dot.error {
    background: #e74c3c;
    animation: blink-fast 0.5s ease-in-out infinite;
}

.api-dot.success {
    background: #2ecc71;
    animation: none;
}

.api-dot.ws-connected {
    background: #9b59b6;
    animation: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes blink-fast {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.main-content {
    flex: 1;
    display: flex;
    padding: 10px;
    gap: 10px;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    overflow: auto;
    min-height: 0;
}

.left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.map-container {
    position: relative;
    background: #12121a;
    border-radius: 10px;
    border: 1px solid #2a2a3a;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    z-index: 1;
}

.map-overlay {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}
.map-overlay > * {
    pointer-events: auto;
}

.status-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(18, 18, 26, 0.95);
    border-radius: 8px;
    padding: 10px 14px;
    border: 1px solid #2a2a3a;
    z-index: 1000;
    min-width: 120px;
}
.status-label {
    font-size: 9px;
    color: #666;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.status-value {
    font-size: 13px;
    font-weight: 600;
    color: #4fc3f7;
}
.status-value.stopped { color: #2ecc71; }
.status-value.running { color: #e74c3c; }

.location-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(18, 18, 26, 0.95);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #2a2a3a;
    z-index: 1000;
    min-width: 200px;
}
.location-title {
    font-size: 11px;
    font-weight: 600;
    color: #4fc3f7;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.location-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11px;
}
.location-label { color: #666; }
.location-value { color: #ccc; font-weight: 500; }

.manual-location-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.manual-location-dialog {
    background: #12121a;
    border-radius: 12px;
    padding: 20px 24px;
    width: 90%;
    max-width: 380px;
    color: #e0e0e0;
    border: 1px solid #2a2a3a;
    box-shadow: 0 20px 35px rgba(0,0,0,0.5);
}
.manual-location-dialog h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #4fc3f7;
}
.manual-location-dialog p {
    margin: 0 0 20px 0;
    color: #888;
    font-size: 12px;
}
.manual-location-dialog label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #aaa;
}
.manual-location-dialog input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #2a2a3a;
    background: #1a1a24;
    color: #fff;
    font-size: 14px;
}
.manual-location-dialog .button-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.manual-location-dialog .confirm-btn,
.manual-location-dialog .cancel-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.manual-location-dialog .confirm-btn {
    background: linear-gradient(135deg, #4fc3f7, #00bcd4);
    color: #0a0a0f;
}
.manual-location-dialog .confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}
.manual-location-dialog .cancel-btn {
    background: #2a2a3a;
    color: #ccc;
}
.manual-location-dialog .cancel-btn:hover {
    background: #3a3a4a;
}
.manual-location-dialog .helper-link {
    text-align: center;
    border-top: 1px solid #2a2a3a;
    padding-top: 16px;
}
.manual-location-dialog .helper-link a {
    color: #4fc3f7;
    text-decoration: none;
    font-size: 13px;
}
.manual-location-dialog .helper-link p {
    margin-top: 8px;
    font-size: 11px;
    color: #666;
}

.map-legend {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 8px;
    background: rgba(18, 18, 26, 0.9);
    border-radius: 8px;
    border: 1px solid #2a2a3a;
    margin-top: 8px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #888;
}
.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.right-section {
    width: 300px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    scrollbar-gutter: stable;
}
.right-section .countdown-panel {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #12121a;
    backdrop-filter: blur(8px);
    margin-bottom: 0;
    flex-shrink: 0;
}

.panel {
    background: #12121a;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #2a2a3a;
    transition: box-shadow 0.2s;
}
.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2a2a3a;
    padding: 5px;
}
.panel-icon {
    font-size: 16px;
}
.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #4fc3f7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.countdown-panel {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08) 0%, rgba(243, 156, 18, 0.08) 100%);
    border: 2px solid rgba(231, 76, 60, 0.3);
    position: relative;
}
.countdown-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.countdown-item {
    background: #1a1a24;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #2a2a3a;
    width: auto;
    transition: all 0.2s ease;
}
.countdown-item.arrived {
    border-color: rgba(231, 76, 60, 0.5);
    background: rgba(231, 76, 60, 0.1);
}
.countdown-wave-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.countdown-wave-name {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.countdown-wave-speed {
    font-size: 10px;
    color: #666;
}
.countdown-time {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}
.countdown-time.p-wave {
    color: #ff6b6b;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
}
.countdown-time.s-wave {
    color: #ffd93d;
    text-shadow: 0 0 20px rgba(255, 217, 61, 0.4);
}
.countdown-time.surface-wave {
    color: #3dfff5;
    text-shadow: 0 0 20px rgba(61, 255, 245, 0.4);
}
.countdown-distance {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
}
.countdown-status {
    display: inline-block;
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.countdown-status.waiting {
    background: rgba(79, 195, 247, 0.15);
    color: #4fc3f7;
    border: 1px solid rgba(79, 195, 247, 0.3);
}
.countdown-status.arrived {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.4);
    animation: pulse-status 1.5s ease-in-out infinite;
}
@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.earthquake-panel {
    display: none;
}
.earthquake-panel.active {
    display: block;
}
.earthquake-header {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
}
.earthquake-title {
    font-size: 14px;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 4px;
}
.earthquake-location {
    font-size: 12px;
    color: #ff8c6b;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.detail-item {
    background: #1a1a24;
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #2a2a3a;
}
.detail-label {
    font-size: 9px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.detail-value.large {
    font-size: 20px;
    color: #e74c3c;
}
.elapsed-box {
    margin-top: 12px;
    padding: 12px;
    background: rgba(79, 195, 247, 0.1);
    border: 1px solid rgba(79, 195, 247, 0.2);
    border-radius: 8px;
    text-align: center;
}
.elapsed-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.elapsed-value {
    font-size: 22px;
    font-weight: 700;
    color: #4fc3f7;
    font-variant-numeric: tabular-nums;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.data-item {
    background: #1a1a24;
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #2a2a3a;
    width: auto;
}
.data-label {
    font-size: 9px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.data-value {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.data-value.warning { color: #f39c12; }
.data-value.danger { color: #e74c3c; }
.data-value.success { color: #2ecc71; }

.notification-container {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
}
.notification {
    background: #1a1a24;
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid #2a2a3a;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}
.notification.show {
    transform: translateX(0);
    opacity: 1;
}
.notification.success { border-left: 4px solid #2ecc71; }
.notification.error { border-left: 4px solid #e74c3c; }
.notification.warning { border-left: 4px solid #f39c12; }
.notification.info { border-left: 4px solid #4fc3f7; }
.notification-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}
.notification-message {
    font-size: 11px;
    color: #aaa;
    line-height: 1.4;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0f;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: opacity 0.5s ease;
}
.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #2a2a3a;
    border-top-color: #4fc3f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    font-size: 13px;
    color: #666;
    text-align: center;
}
.loading-progress {
    width: 200px;
    height: 4px;
    background: #2a2a3a;
    border-radius: 2px;
    margin-top: 12px;
}
.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #00bcd4);
    width: 0%;
    transition: width 0.3s ease;
}

.epicenter-marker {
    width: 30px;
    height: 30px;
    position: relative;
}
.epicenter-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border-radius: 50%;
    box-shadow: 0 0 15px #e74c3c, 0 0 30px rgba(231, 76, 60, 0.5);
}
.epicenter-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 2px solid #e74c3c;
    border-radius: 50%;
    animation: epicenter-pulse 1.5s ease-out infinite;
}
@keyframes epicenter-pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

.user-marker {
    width: 20px;
    height: 20px;
    position: relative;
}
.user-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #4fc3f7;
    border-radius: 50%;
    box-shadow: 0 0 10px #4fc3f7;
}
.user-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(79, 195, 247, 0.5);
    border-radius: 50%;
}

.leaflet-control-attribution { display: none !important; }
.leaflet-control-zoom a {
    background: #1a1a24 !important;
    color: #fff !important;
    border: 1px solid #3a3a4a !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
}
.leaflet-control-zoom a:hover { background: #2a2a3a !important; }

#waveCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
    border-radius: 10px;
}

.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}
.empty-state-icon {
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.5;
}
.empty-state-text {
    font-size: 13px;
    line-height: 1.6;
}

.tooltip {
    position: relative;
}
.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: #1a1a24;
    border: 1px solid #3a3a4a;
    border-radius: 6px;
    font-size: 11px;
    color: #ccc;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 8px);
}

.datasource-switch {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 40px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(79, 195, 247, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.ds-btn {
    border-radius: 32px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
    color: #b0b0c0;
    font-family: inherit;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}
.ds-btn.active {
    background: linear-gradient(135deg, #4fc3f7, #00bcd4);
    color: #0a0a0f;
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.4);
    transform: scale(1.02);
}
.ds-btn:not(.active):hover {
    background: rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
    transform: translateY(-1px);
}
.ds-btn:active {
    transform: scale(0.98);
}

.cert-tip {
    background: rgba(243,156,18,0.15);
    border-left: 4px solid #f39c12;
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    margin-top: 8px;
    backdrop-filter: blur(4px);
}
.cert-tip a {
    color: #f39c12;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}
.cert-tip .reconnect-link {
    margin-left: 12px;
    color: #4fc3f7;
}

@media (max-width: 900px) {
    .header-content {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    .app-title,
    .header-right {
        justify-content: center;
        flex-wrap: wrap;
    }
}
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 8px;
    }
    .app-title h1 {
        font-size: 16px;
    }
    .right-section {
        width: 100%;
        flex-direction: column;
        gap: 12px;
        max-height: 40vh;
        overflow-y: auto;
        padding-right: 0;
    }
    .right-section .countdown-panel {
        position: relative;
        top: auto;
        width: 100%;
    }
    .countdown-time {
        font-size: 18px;
    }
    .detail-grid,
    .data-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .countdown-item {
        padding: 10px;
    }
}
@media (max-height: 600px) {
    .right-section {
        gap: 8px;
    }
    .countdown-item {
        padding: 8px 10px;
    }
    .countdown-time {
        font-size: 16px;
        margin-bottom: 2px;
    }
    .countdown-wave-header {
        margin-bottom: 2px;
    }
    .countdown-wave-name {
        font-size: 9px;
    }
    .countdown-wave-speed {
        font-size: 8px;
    }
    .countdown-distance {
        font-size: 9px;
        margin-bottom: 4px;
    }
    .countdown-status {
        font-size: 8px;
        padding: 2px 6px;
    }
    .panel {
        padding: 10px 12px;
    }
    .panel-header {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }
    .data-item, .detail-item {
        padding: 8px 10px;
    }
    .elapsed-value {
        font-size: 18px;
    }
}
@media (min-width: 1920px) {
    .right-section {
        width: 340px;
    }
    .countdown-time {
        font-size: 22px;
    }
}
@media (max-width: 480px) {
    .right-section .countdown-panel {
        position: relative;
        top: auto;
    }
    .countdown-time {
        font-size: 18px;
    }
    .countdown-item {
        padding: 8px 10px;
    }
}
@media (max-aspect-ratio: 3/4) and (min-height: 800px) {
    .right-section {
        max-height: 50vh;
    }
    .countdown-time {
        font-size: 20px;
    }
    .right-section .countdown-panel {
        min-height: auto;
    }
}
.right-section::-webkit-scrollbar {
    width: 4px;
}
.right-section::-webkit-scrollbar-track {
    background: #1a1a24;
    border-radius: 4px;
}
.right-section::-webkit-scrollbar-thumb {
    background: #4a4a5a;
    border-radius: 4px;
}
.right-section::-webkit-scrollbar-thumb:hover {
    background: #5a5a6a;
}
.notification {
    animation: slideInRight 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
.notification.warning {
    border-left: 4px solid #f39c12;
    box-shadow: 0 0 12px rgba(243, 156, 18, 0.2);
}
.notification.error {
    border-left: 4px solid #e74c3c;
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.2);
}
.notification.success {
    border-left: 4px solid #2ecc71;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.2);
}
.notification.info {
    border-left: 4px solid #4fc3f7;
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.2);
}
