/* ===== 全局重置 & 星空主题 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0e1a;
    color: #e2e8f0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 0;
    overflow-y: auto; /* ★ 允许 body 滚动，但背景统一 */
}

.app-wrapper {
    width: 100%;
    max-width: 420px;
    min-height: 100%; /* ★ 改为 100%，由内容撑开 */
    background: radial-gradient(ellipse at 30% 20%, #0a1a3a 0%, #020812 100%);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 80, 255, 0.08);
}

.stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite alternate;
    opacity: 0.3;
}

    .star.s1 {
        width: 2px;
        height: 2px;
    }

    .star.s2 {
        width: 3px;
        height: 3px;
    }

    .star.s3 {
        width: 4px;
        height: 4px;
        box-shadow: 0 0 6px rgba(255,255,255,0.3);
    }

@keyframes twinkle {
    0% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.shooting-star {
    position: absolute;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.8), transparent);
    animation: shoot 4s linear infinite;
    opacity: 0;
    transform: rotate(-30deg);
}

    .shooting-star:nth-child(1) {
        top: 10%;
        left: 20%;
        animation-delay: 0s;
    }

    .shooting-star:nth-child(2) {
        top: 30%;
        left: 60%;
        animation-delay: 2s;
    }

@keyframes shoot {
    0% {
        transform: translate(0,0) rotate(-30deg);
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    20% {
        transform: translate(-200px,200px) rotate(-30deg);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

.app-wrapper > *:not(.stars) {
    position: relative;
    z-index: 1;
}

/* ===== 视图容器 ===== */
#viewContainer {
    min-height: 100%; /* ★ 确保容器撑满 */
}

/* ===== 页面容器 ===== */
.page {
    display: none;
    padding: 12px 18px 30px;
    animation: fadeSlide 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
    padding-bottom: 90px; /* ★ 为底部导航预留空间 */
    min-height: calc(100vh - 80px);
}

    .page.active {
        display: block;
    }

@keyframes fadeSlide {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== 顶部导航 ===== */
.top-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0 14px;
    position: relative;
}

    .top-bar .title {
        font-size: 20px;
        font-weight: 700;
        background: linear-gradient(135deg, #e0f2fe, #7dd3fc);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        letter-spacing: -0.3px;
        text-shadow: 0 0 20px rgba(56,189,248,0.15);
        text-align: center;
    }

    .top-bar .actions {
        display: none;
    }

/* ===== 毛玻璃卡片 ===== */
.glass-card {
    background: rgba(15,30,60,0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56,189,248,0.15);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,20,80,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
}

.glass-card-light {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
}

/* ===== 首页 ===== */
.hero-section {
    padding: 22px 20px 18px;
    margin-bottom: 18px;
    background: linear-gradient(145deg, rgba(20,60,120,0.35), rgba(8,18,48,0.6));
    border: 1px solid rgba(56,189,248,0.2);
    border-radius: 28px;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 48px rgba(0,40,120,0.3), inset 0 0 60px rgba(56,189,248,0.02);
    position: relative;
    overflow: hidden;
}

    .hero-section::before {
        content: '';
        position: absolute;
        top: -30%;
        right: -10%;
        width: 200px;
        height: 200px;
        background: radial-gradient(circle, rgba(56,189,248,0.12), transparent 70%);
        pointer-events: none;
    }

.hero-main-metric {
    text-align: center;
    padding: 6px 0 4px;
    position: relative;
    z-index: 1;
}

    .hero-main-metric .main-number {
        font-size: 52px;
        font-weight: 700;
        color: #fff;
        line-height: 1.1;
        letter-spacing: -1.5px;
        text-shadow: 0 0 40px rgba(56,189,248,0.15);
    }

    .hero-main-metric .main-unit {
        font-size: 22px;
        font-weight: 400;
        color: #94a3b8;
        margin-left: 4px;
    }

.hero-sub-metrics {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 6px 0 2px;
    position: relative;
    z-index: 1;
}

    .hero-sub-metrics .sub-item {
        font-size: 16px;
        color: #94a3b8;
        font-weight: 400;
        letter-spacing: 0.3px;
    }

.quick-row {
    display: flex;
    gap: 10px;
    margin: 16px 0 4px;
    position: relative;
    z-index: 1;
}

    .quick-row .q-btn {
        flex: 1;
        padding: 10px 0;
        border-radius: 30px;
        background: rgba(56,189,248,0.08);
        border: 1px solid rgba(56,189,248,0.15);
        color: #bae6fd;
        font-size: 14px;
        font-weight: 500;
        text-align: center;
        cursor: pointer;
        transition: 0.2s;
        backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

        .quick-row .q-btn:active {
            transform: scale(0.95);
            background: rgba(56,189,248,0.18);
            border-color: rgba(56,189,248,0.3);
        }

        .quick-row .q-btn .btn-icon {
            width: 18px;
            height: 18px;
            stroke: currentColor;
            stroke-width: 2;
            flex-shrink: 0;
        }

.income-expense {
    display: flex;
    gap: 12px;
    margin: 12px 0 4px;
    position: relative;
    z-index: 1;
}

    .income-expense .ie-item {
        flex: 1;
        padding: 10px 12px;
        background: rgba(0,0,0,0.3);
        border-radius: 16px;
        border: 1px solid rgba(255,255,255,0.06);
    }

        .income-expense .ie-item .lbl {
            font-size: 11px;
            color: #94a3b8;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 4px;
        }

            .income-expense .ie-item .lbl .ie-icon {
                width: 14px;
                height: 14px;
                stroke: currentColor;
                stroke-width: 2;
            }

        .income-expense .ie-item .num {
            font-size: 20px;
            font-weight: 700;
            color: #f8fafc;
            margin-top: 2px;
        }

            .income-expense .ie-item .num.income {
                color: #34d399;
            }

            .income-expense .ie-item .num.expense {
                color: #f87171;
            }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 12px;
}

    .section-header h3 {
        font-size: 17px;
        font-weight: 600;
        color: #f1f5f9;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .section-header h3 .title-icon {
            width: 20px;
            height: 20px;
            stroke: #38bdf8;
            stroke-width: 2;
        }

    .section-header .more {
        font-size: 13px;
        color: #38bdf8;
        font-weight: 500;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 20px;
        transition: 0.15s;
    }

        .section-header .more:active {
            background: rgba(56,189,248,0.12);
        }

/* ===== 基站列表 ===== */
.station-item {
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    transition: 0.15s;
}

    .station-item:active {
        transform: scale(0.98);
        background: rgba(56,189,248,0.06);
        border-color: rgba(56,189,248,0.12);
    }

    .station-item .info .name {
        font-weight: 600;
        color: #f1f5f9;
        font-size: 15px;
    }

    .station-item .status-badge {
        font-size: 16px;
        font-weight: 700;
        padding: 4px 12px;
        border-radius: 30px;
        border: 1px solid transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
    }

        .station-item .status-badge.online {
            background: rgba(52,211,153,0.12);
            color: #34d399;
            border-color: rgba(52,211,153,0.1);
        }

        .station-item .status-badge.offline {
            background: rgba(248,113,113,0.12);
            color: #f87171;
            border-color: rgba(248,113,113,0.08);
        }

/* ===== 分析页 ===== */
.chart-wrapper {
    padding: 18px 16px 14px;
    margin-bottom: 18px;
}

    .chart-wrapper h3 {
        font-size: 16px;
        font-weight: 600;
        color: #f1f5f9;
        margin-bottom: 2px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .chart-wrapper h3 .title-icon {
            width: 20px;
            height: 20px;
            stroke: #38bdf8;
            stroke-width: 2;
        }

.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
}

.legend-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 8px;
}

    .legend-row .lg-item {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        color: #cbd5e1;
        font-weight: 500;
    }

        .legend-row .lg-item .dot {
            width: 10px;
            height: 10px;
            border-radius: 10px;
            box-shadow: 0 0 8px rgba(56,189,248,0.2);
        }

.flow-item {
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(6px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
}

    .flow-item .hash {
        font-family: 'SF Mono', Menlo, monospace;
        font-size: 12px;
        color: #38bdf8;
        background: rgba(56,189,248,0.08);
        padding: 2px 10px;
        border-radius: 30px;
        border: 1px solid rgba(56,189,248,0.06);
    }

    .flow-item .amount {
        font-weight: 600;
        color: #f1f5f9;
    }

/* ===== 伙伴页 ===== */
.partner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 6px;
}

    .partner-grid .p-item {
        padding: 18px 6px 14px;
        text-align: center;
        background: rgba(255,255,255,0.03);
        backdrop-filter: blur(8px);
        border-radius: 20px;
        border: 1px solid rgba(255,255,255,0.05);
        transition: 0.15s;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

        .partner-grid .p-item:active {
            transform: scale(0.95);
            background: rgba(56,189,248,0.06);
            border-color: rgba(56,189,248,0.1);
        }

        .partner-grid .p-item .partner-icon {
            width: 36px;
            height: 36px;
            stroke: #7dd3fc;
            stroke-width: 1.8;
            filter: drop-shadow(0 0 8px rgba(56,189,248,0.12));
            transition: 0.2s;
        }

        .partner-grid .p-item:hover .partner-icon {
            stroke: #38bdf8;
            filter: drop-shadow(0 0 16px rgba(56,189,248,0.25));
        }

        .partner-grid .p-item .name {
            font-size: 12px;
            font-weight: 500;
            color: #cbd5e1;
            margin-top: 2px;
        }

/* ===== 个人中心 ===== */
.profile-card {
    padding: 20px 18px 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(145deg, rgba(20,60,120,0.3), rgba(8,18,48,0.5));
    border: 1px solid rgba(56,189,248,0.12);
}

    .profile-card .avatar {
        width: 60px;
        height: 60px;
        border-radius: 60px;
        background: linear-gradient(135deg, #0f2b5c, #1a4f8e);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 4px 16px rgba(26,80,160,0.3);
        border: 1px solid rgba(56,189,248,0.15);
    }

        .profile-card .avatar .avatar-icon {
            width: 32px;
            height: 32px;
            stroke: #fff;
            stroke-width: 1.8;
        }

    .profile-card .info .name {
        font-size: 18px;
        font-weight: 700;
        color: #f8fafc;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .profile-card .info .name .gold {
            color: #fbbf24;
        }

        .profile-card .info .name .edit-icon {
            font-size: 16px;
            color: #94a3b8;
            cursor: pointer;
            transition: 0.2s;
            padding: 2px;
            line-height: 1;
        }

            .profile-card .info .name .edit-icon:active {
                transform: scale(0.85);
                color: #38bdf8;
            }

    .profile-card .info .uid {
        font-size: 12px;
        color: #94a3b8;
        font-family: 'SF Mono', monospace;
        margin-top: 2px;
    }

.menu-list {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(8px);
    margin-bottom: 18px;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: 0.12s;
    color: #e2e8f0;
}

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

    .menu-item:active {
        background: rgba(56,189,248,0.06);
    }

    .menu-item .left {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 15px;
        font-weight: 500;
    }

        .menu-item .left .menu-icon {
            width: 20px;
            height: 20px;
            stroke: #38bdf8;
            stroke-width: 2;
            flex-shrink: 0;
        }

    .menu-item .arrow {
        color: #475569;
        font-size: 16px;
    }

.primary-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #1a5fb0, #3a8ae0);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 6px 28px rgba(26,80,160,0.4);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .primary-btn .btn-icon {
        width: 22px;
        height: 22px;
        stroke: currentColor;
        stroke-width: 2;
    }

    .primary-btn:active {
        transform: scale(0.97);
        box-shadow: 0 3px 16px rgba(26,80,160,0.25);
    }

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    background: rgba(6,12,30,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(56,189,248,0.12);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 12px;
    z-index: 100;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.6), 0 -2px 30px rgba(56,189,248,0.04);
    pointer-events: auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 12px;
    cursor: pointer;
    transition: 0.15s;
    border: none;
    background: transparent;
    font-family: inherit;
    color: #475569;
    font-size: 10px;
    font-weight: 500;
    min-width: 52px;
    position: relative;
}

    .nav-item .nav-icon {
        width: 24px;
        height: 24px;
        stroke: currentColor;
        stroke-width: 2;
        transition: 0.2s;
    }

    .nav-item.active {
        color: #38bdf8;
    }

        .nav-item.active .nav-icon {
            transform: translateY(-2px);
            filter: drop-shadow(0 0 12px rgba(56,189,248,0.3));
        }

    .nav-item:active {
        transform: scale(0.92);
    }

    .nav-item .badge-dot {
        position: absolute;
        top: 0;
        right: 4px;
        width: 8px;
        height: 8px;
        background: #38bdf8;
        border-radius: 10px;
        border: 2px solid rgba(6,12,30,0.8);
        box-shadow: 0 0 12px rgba(56,189,248,0.4);
    }

/* ===== 辅助 ===== */
.text-muted {
    color: #64748b;
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
}

@media (max-width: 380px) {
    .hero-main-metric .main-number {
        font-size: 38px;
    }

    .hero-main-metric .main-unit {
        font-size: 18px;
    }

    .hero-sub-metrics {
        gap: 24px;
    }

        .hero-sub-metrics .sub-item {
            font-size: 14px;
        }

    .quick-row .q-btn {
        font-size: 12px;
        padding: 8px 0;
    }

    .partner-grid {
        gap: 10px;
    }

        .partner-grid .p-item .partner-icon {
            width: 30px;
            height: 30px;
        }
}
.bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    z-index: 999 !important;
}