/* ===== 99联储 · 页面布局样式 ===== */

/* 底部导航 */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 430px;
    margin: 0 auto;
    /* 高度由「行高 + 底部安全留白」决定，不写死 height：
       写死的话刘海机上 env() 变大不会撑高，只会把 tab 挤扁。
       行高在 .tab 上给，底部留白见 :root 的 --tabbar-bottom。 */
    background: linear-gradient(180deg, rgba(7, 4, 16, .7), rgba(7, 4, 16, .98));
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(245, 197, 66, .12);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: var(--tabbar-bottom);
    z-index: 50;
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: var(--tab-row-h);
    gap: 4px;
    font-size: 10px;
    color: #666;
    cursor: pointer;
    transition: .3s;
    flex: 1;
    text-decoration: none;
}

.tab.active {
    color: var(--gold);
}

.tab.active i {
    filter: drop-shadow(0 0 8px var(--gold));
}

.tab i {
    font-size: 18px;
}

/* 页面切换 */
.page {
    display: none;
    animation: fadeUp .3s ease;
    position: relative;
    z-index: 1;
}

.page.active {
    display: block;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* 子页面（独立页面，不走 tab 切换） */
.sub-page {
    position: relative;
    z-index: 1;
}

/* 页面通用头部。
   顶部间距与左右内边距一致（原来写死 48px，是左右的 2.4 倍，视觉上"头顶空一块"）；
   刘海/状态栏更高时按设备让位。理由与 .page-top 相同，见 common.css。 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    padding-top: max(20px, env(safe-area-inset-top));
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header .back-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.page-header h2 {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 20px;
    margin: 0;
}

/* 行情滚动 */
.marquee-wrap {
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, .05);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    padding: 10px 0;
}

.marquee-track {
    display: flex;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, .4);
}

/* 间距做成每项自带的尾间距（不用 gap）：两份内容拼起来后，一份的宽度
   正好等于「每一项 + 每一条间距」，-50% 平移才落在重复边界上。
   用 gap 的话最后一项后面没有间距，会差半个间距，每轮都要跳一下。 */
.marquee-track > span {
    margin-right: 24px;
}

/* 内容撑不满容器就不跑：平移只会把内容推出空白区，居中静态显示更清楚 */
.marquee-static {
    justify-content: center;
}

.marquee-static > span:last-child {
    margin-right: 0;
}

/* 内容溢出才跑。width:max-content 让 -50% 相对内容宽度算，而不是容器宽度 */
.marquee-run {
    width: max-content;
    animation: marquee 20s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
