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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #e5ecff;
    background: radial-gradient(circle at 20% 20%, #020617 0, #020617 50%, #000 100%);
}

/* 粒子背景容器（最底层） */
#particles-js {
    position: fixed;
    inset: 0;
    /* z-index: -1; */
    /* 最底下 */
    /* background-color: black; */
    background: radial-gradient(circle at 10% 0, #020617 0, #000 60%, #000 100%);
}

/* 3D 地球背景板：保持原本大小感，中间居中，放在 UI 背后 */
#globe-layer {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    /* 在星空噪点和粒子上方，在 UI 下方 */
    pointer-events: none;
    /* 完全背景，不挡住 UI 操作 */
}

#globe {
    /* 这里就是“比例开关”：调 60→70/80vmin 球就更大 */
    width: 60vmin;
    height: 60vmin;
    max-width: 900px;
    max-height: 900px;
}

/* 噪点星空叠加层：在粒子之上，在地球之下（z=0） */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.35) 0, transparent 60%),
        radial-gradient(1.5px 1.5px at 80% 70%, rgba(255, 255, 255, 0.25) 0, transparent 55%),
        radial-gradient(1px 1px at 10% 80%, rgba(255, 255, 255, 0.18) 0, transparent 45%);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

#app {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 10px 14px;
    z-index: 2;
    /* UI 最上面，浮在地球之上 */
}

/* 顶部导航（玻璃 + 霓虹渐变边框） */
.app-header {
    flex: 0 0 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    background: rgba(3, 4, 10, 0.20);
    border-radius: 18px;
    border: 1px solid rgba(129, 140, 248, 0.55);
    box-shadow:
        0 0 24px rgba(56, 189, 248, 0.40),
        0 14px 40px rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(18px) saturate(1.45);
    -webkit-backdrop-filter: blur(18px) saturate(1.45);
    animation: fadeInDown 0.7s ease-out both;
}

.app-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 8% -20%, rgba(56, 189, 248, 0.35), transparent 60%),
        radial-gradient(circle at 70% 140%, rgba(129, 140, 248, 0.22), transparent 60%);
    mix-blend-mode: screen;
    opacity: 0.85;
    pointer-events: none;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    font-size: 16px;
    position: relative;
    z-index: 1;
}

.app-logo {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: conic-gradient(from 210deg, #38bdf8, #6366f1, #a855f7, #22d3ee);
    box-shadow:
        0 0 18px rgba(56, 189, 248, 0.95),
        0 0 36px rgba(79, 70, 229, 0.85);
    position: relative;
}

.app-logo::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: inherit;
    border: 2px solid rgba(15, 23, 42, 0.85);
    box-shadow: inset 0 0 8px rgba(15, 23, 42, 0.9);
}

.app-subtitle {
    font-size: 11px;
    color: #9fb3ff;
    margin-top: 2px;
    opacity: 0.92;
}

.app-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #9fb3ff;
    position: relative;
    z-index: 1;
}

.select-compact {
    background: rgba(3, 4, 10, 0.30);
    border: 1px solid rgba(129, 140, 248, 0.9);
    border-radius: 999px;
    padding: 4px 12px;
    color: inherit;
    font-size: 12px;
    outline: none;
    appearance: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-decoration: none;
}

.pill {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.88);
    font-size: 12px;
    color: #c5d4ff;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.65), rgba(30, 64, 175, 0.85));
    box-shadow:
        0 0 18px rgba(37, 99, 235, 0.7),
        0 0 36px rgba(56, 189, 248, 0.55);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(3, 4, 10, 0.30);
    border: 1px solid rgba(129, 140, 248, 0.8);
    color: #e3e9ff;
    font-size: 12px;
    box-shadow:
        0 0 20px rgba(88, 101, 242, 0.8),
        0 0 36px rgba(56, 189, 248, 0.5);
}

.user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #a855f7);
    box-shadow:
        0 0 16px rgba(59, 130, 246, 0.95),
        0 0 32px rgba(129, 140, 248, 0.85);
}

/* 主体：左右两个「浮在地球上」的玻璃面板 */
.app-main {
    flex: 1;
    display: flex;
    min-height: 0;
    justify-content: space-between;
    align-items: stretch;
    gap: 12px;
}

.panel-left,
.panel-right {
    position: relative;
    overflow: hidden;
    background: rgba(3, 4, 10, 0.22);
    border-radius: 18px;
    border: 1px solid rgba(129, 140, 248, 0.45);
    box-shadow:
        0 0 30px rgba(79, 70, 229, 0.55),
        0 20px 46px rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    display: flex;
    flex-direction: column;
    padding: 14px;
    min-width: 0;
}

.panel-left {
    flex: 0 0 420px;
    animation: fadeInLeft 0.7s ease-out 0.05s both;
}

.panel-right {
    flex: 0 0 460px;
    animation: fadeInRight 0.7s ease-out 0.05s both;
}

.panel-left::before,
.panel-right::before {
    content: "";
    position: absolute;
    inset: 0;
    mix-blend-mode: screen;
    pointer-events: none;
    opacity: 0.9;
}

.panel-left::before {
    background:
        radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.25), transparent 55%);
}

.panel-right::before {
    background:
        radial-gradient(circle at 120% 0, rgba(129, 140, 248, 0.3), transparent 60%),
        radial-gradient(circle at 10% 130%, rgba(56, 189, 248, 0.18), transparent 60%);
}

/* KPI 区 */
.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.kpi-header-title {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.kpi-header-unit {
    font-size: 11px;
    color: #9fb3ff;
    opacity: 0.9;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    position: relative;
    z-index: 1;
}

.kpi-card {
    position: relative;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(3, 5, 12, 0.65);
    border: 1px solid rgba(129, 140, 248, 0.85);
    box-shadow:
        0 10px 26px rgba(15, 23, 42, 0.96),
        0 0 22px rgba(79, 70, 229, 0.75);
    cursor: default;
    overflow: hidden;
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at 0 0, rgba(96, 165, 250, 0.50), transparent 60%),
        radial-gradient(circle at 120% 120%, rgba(129, 140, 248, 0.35), transparent 60%);
    opacity: 0.55;
    pointer-events: none;
    mix-blend-mode: screen;
}

.kpi-label {
    font-size: 11px;
    color: #a9bbff;
    margin-bottom: 4px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.kpi-value {
    font-size: 16px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.kpi-unit {
    font-size: 11px;
    color: #8ea2ff;
    margin-left: 3px;
}

.kpi-trend {
    font-size: 11px;
    margin-top: 2px;
    position: relative;
    z-index: 1;
}

.trend-up {
    color: #4caf50;
}

.trend-down {
    color: #ef5350;
}

/* 区域标签 */
.regions-strip {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    position: relative;
    z-index: 1;
}

.region-pill {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 253, 0.7);
    background: rgba(5, 8, 23, 0.85);
    color: #c5d7ff;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 0 14px rgba(15, 23, 42, 0.9);
}

.region-pill:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 18px rgba(56, 189, 248, 0.8),
        0 0 28px rgba(79, 70, 229, 0.8);
}

.region-pill.active {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #fff;
    border-color: transparent;
    box-shadow:
        0 0 22px rgba(56, 189, 248, 1),
        0 0 40px rgba(79, 70, 229, 1);
}

/* 图表容器（略深，保证可读性） */
.charts-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.chart-card {
    flex: 1;
    border-radius: 16px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: rgba(3, 6, 20, 0.92);
    border: 1px solid rgba(129, 140, 248, 0.8);
    box-shadow:
        0 14px 32px rgba(15, 23, 42, 0.96),
        0 0 22px rgba(37, 99, 235, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #a9bbff;
    padding: 0 4px 4px;
    border-bottom: 1px solid rgba(76, 103, 187, 0.6);
    margin-bottom: 4px;
}

.chart-header span:first-child {
    letter-spacing: 0.04em;
}

.chart-body {
    flex: 1;
    min-height: 0;
}

#chart-main,
#chart-secondary {
    width: 100%;
    height: 100%;
}

/* 右侧信息区：多卡片布局，叠在地球右侧上方 */
.right-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
    gap: 12px;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.info-card-main {
    grid-column: 1 / 3;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(3, 5, 14, 0.70);
    border-radius: 18px;
    border: 1px solid rgba(129, 140, 248, 0.75);
    box-shadow:
        0 0 24px rgba(56, 189, 248, 0.55),
        0 18px 40px rgba(15, 23, 42, 0.95);
    position: relative;
    overflow: hidden;
}

.info-card-main::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 100% 0, rgba(79, 70, 229, 0.40), transparent 60%),
        radial-gradient(circle at -10% 120%, rgba(56, 189, 248, 0.32), transparent 60%);
    mix-blend-mode: screen;
    pointer-events: none;
    opacity: 0.9;
}

.info-title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e3f2fd;
    position: relative;
    z-index: 1;
}

.info-subtitle {
    font-size: 12px;
    color: #a5b8ff;
    position: relative;
    z-index: 1;
}

.info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.info-tag {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.7);
    font-size: 11px;
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

.info-list {
    margin-top: 6px;
    font-size: 12px;
    color: #cdd7ff;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.info-item+.info-item {
    margin-top: 4px;
}

.info-label {
    color: #93c5fd;
    margin-right: 4px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.9);
}

.status-dot.warn {
    background: #ffb300;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.9);
}

.status-dot.danger {
    background: #ef5350;
    box-shadow: 0 0 10px rgba(239, 83, 80, 0.9);
}

.info-footer {
    margin-top: 4px;
    font-size: 11px;
    color: #8aa4ff;
    opacity: 0.92;
    position: relative;
    z-index: 1;
}

.card-compact {
    padding: 10px;
    border-radius: 14px;
    background: rgba(3, 5, 14, 0.72);
    border: 1px solid rgba(129, 140, 248, 0.7);
    box-shadow:
        0 10px 26px rgba(15, 23, 42, 0.96),
        0 0 20px rgba(37, 99, 235, 0.65);
    font-size: 12px;
    position: relative;
    overflow: hidden;
}

.card-compact::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.27), transparent 60%);
    mix-blend-mode: screen;
    pointer-events: none;
    opacity: 0.9;
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #bfdbfe;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.badge-soft {
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.7);
    font-size: 11px;
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.85);
}

.mini-kpi-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.mini-kpi-item {
    flex: 1;
}

.mini-kpi-label {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 2px;
}

.mini-kpi-value {
    font-size: 13px;
    color: #e5e7eb;
}

.mini-bar {
    height: 4px;
    border-radius: 999px;
    margin-top: 4px;
    background: rgba(15, 23, 42, 0.9);
    overflow: hidden;
}

.mini-bar-inner {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22d3ee, #6366f1, #a855f7);
    width: 72%;
}

.risk-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1;
}

.risk-item {
    display: flex;
    align-items: flex-start;
    font-size: 11px;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.risk-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    margin-right: 6px;
    margin-top: 4px;
    background: #facc15;
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.9);
}

.risk-dot.danger {
    background: #f97373;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.9);
}

.contact-line {
    font-size: 11px;
    color: #c7d2fe;
    margin-bottom: 2px;
}

.timeline {
    position: relative;
    padding-left: 10px;
    font-size: 11px;
    color: #cbd5f5;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    bottom: 3px;
    width: 1px;
    background: linear-gradient(to bottom, #22d3ee, #6366f1);
    opacity: 0.8;
}

.timeline-item {
    position: relative;
    padding-left: 10px;
    margin-bottom: 4px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 4px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22d3ee;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.9);
}

.timeline-time {
    color: #93c5fd;
    margin-right: 4px;
}

@media (max-width: 1200px) {
    .panel-left {
        flex-basis: 360px;
    }

    .panel-right {
        flex-basis: 380px;
    }

    #globe {
        width: 54vmin;
        height: 54vmin;
    }
}

@media (max-width: 1024px) {
    #app {
        padding: 8px;
    }

    .app-main {
        flex-direction: column;
        align-items: center;
    }

    .panel-left,
    .panel-right {
        flex: 0 0 auto;
        width: 100%;
        max-width: 960px;
    }

    .right-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .info-card-main {
        grid-column: 1 / 2;
    }

    #globe {
        width: 50vmin;
        height: 50vmin;
    }
}

/* 入场动画 */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }

    to {
        opacity: 0.7;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(24px);
    }

    to {
        opacity: 0.7;
        transform: translateX(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}