/**
 * 首页视觉微调（index.html）— 叠加在 global-optimize / index-mobile 之后
 */
/* 首页区块柔和渐变底 */
#homePage,
#algoPage,
#myPage {
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f2f8 48%, #f8f9fa 100%);
}

.dash-wrap {
    border-radius: 0 0 16px 16px;
}

/* 公式卡片：圆角 + 柔和阴影 */
.formulaCard {
    border-radius: 14px !important;
    border-color: rgba(102, 126, 234, 0.12) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06) !important;
    overflow: hidden;
}

.formulaCard:hover {
    box-shadow: 0 8px 22px rgba(102, 126, 234, 0.14) !important;
}

.formulaCard .card-body {
    border-radius: 14px;
}

/* 公告条 */
.notice-bar {
    margin: 0 12px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 193, 7, 0.35);
    border-bottom: none;
    box-shadow: 0 2px 12px rgba(255, 183, 0, 0.12);
    padding: 10px 14px !important;
}

.notice-more {
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.65);
    transition: background 0.2s ease;
}

.notice-more:hover {
    background: rgba(255, 255, 255, 0.95);
}

/* 顶栏导航 — 统一胶囊风格，减轻 VIP 黑块视觉重量 */
.site-header {
    padding: 10px 12px 8px !important;
    box-shadow: 0 4px 18px rgba(76, 29, 149, 0.22) !important;
}

.header-row1 {
    margin-bottom: 8px !important;
    gap: 8px !important;
    align-items: center !important;
}

.header-left {
    min-width: 0;
    flex: 1;
}

.site-title {
    font-size: 15px !important;
    line-height: 1.25 !important;
    letter-spacing: 0.01em;
}

.header-right {
    flex-shrink: 0;
    gap: 8px !important;
}

#userArea .login-btn {
    background: rgba(255, 255, 255, 0.96) !important;
    color: #5b68e8 !important;
    padding: 6px 14px !important;
    font-size: 12px !important;
    border-radius: 999px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.top-nav-tabs {
    display: flex !important;
    gap: 6px !important;
    padding: 4px !important;
    background: rgba(0, 0, 0, 0.14) !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 10px,
        #000 calc(100% - 10px),
        transparent 100%
    );
    mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 10px,
        #000 calc(100% - 10px),
        transparent 100%
    );
}

.top-nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    flex: 0 0 auto !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.94) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    letter-spacing: 0.02em;
    scroll-snap-align: start;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, color 0.2s ease !important;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
}

.nav-tab.active {
    background: #fff !important;
    color: #5b68e8 !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14) !important;
    border-color: transparent !important;
}

.nav-tab.nav-vip {
    background: rgba(255, 215, 0, 0.14) !important;
    border: 1px solid rgba(255, 215, 0, 0.38) !important;
    overflow: visible !important;
}

.nav-tab.nav-vip::before,
.nav-tab.nav-vip::after {
    display: none !important;
}

.nav-tab.nav-vip .vip-crown {
    font-size: 9px !important;
    margin-right: 2px !important;
    animation: none !important;
    opacity: 0.95;
    -webkit-text-fill-color: initial !important;
    color: inherit !important;
}

.nav-tab.nav-vip > span:not(.vip-crown) {
    position: relative;
    z-index: 1;
    background: none !important;
    -webkit-text-fill-color: #ffeaa7 !important;
    color: #ffeaa7 !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

.nav-tab.nav-vip:hover {
    background: rgba(255, 215, 0, 0.22) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.22) !important;
}

.nav-tab.nav-vip.active {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%) !important;
    border-color: transparent !important;
}

.nav-tab.nav-vip.active > span:not(.vip-crown) {
    background: none !important;
    -webkit-text-fill-color: #3d2914 !important;
    color: #3d2914 !important;
}

@media (min-width: 769px) {
    .top-nav-tabs {
        justify-content: space-between !important;
        overflow-x: visible !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
    }

    .nav-tab {
        flex: 1 1 0 !important;
        text-align: center !important;
        min-width: 0 !important;
    }
}

/* 首页活动 / 推荐区块 */
.welcome-section,
.activity-section-new,
.quick-entry-section,
.recommend-section,
.home-notice-section {
    padding-left: 4px;
    padding-right: 4px;
}

.welcome-card,
.home-notice-list,
.recommend-item,
.activity-card {
    border-radius: 16px;
}

/* 我的页用户卡与菜单 */
.my-user-card {
    border-radius: 18px !important;
    box-shadow: 0 10px 28px rgba(102, 126, 234, 0.28) !important;
}

.my-menu-grid {
    gap: 10px !important;
}

.my-menu-grid-item {
    border-radius: 14px !important;
    border-color: rgba(102, 126, 234, 0.1) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.my-menu-grid-item:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.12);
    transform: translateY(-2px);
}

/* 移动端间距 */
@media (max-width: 768px) {
    #homePage,
    #algoPage,
    #myPage {
        padding-top: 8px !important;
    }

    .notice-bar {
        margin: 0 8px 8px;
        padding: 8px 12px !important;
    }

    .top-nav-tabs {
        gap: 5px !important;
        padding: 3px !important;
    }

    .nav-tab {
        padding: 7px 10px !important;
        font-size: 11px !important;
    }

    .formulaCard {
        margin-bottom: 8px !important;
    }

    .my-page-content {
        padding: 14px 10px !important;
    }

    .my-user-card {
        padding: 16px !important;
        margin-bottom: 14px !important;
    }

    .my-menu-grid {
        gap: 8px !important;
    }

    .my-menu-grid-item {
        padding: 12px 4px !important;
    }

    .dash-preview {
        gap: 8px !important;
    }
}

@media (max-width: 480px) {
    .notice-bar {
        margin: 0 6px 6px;
    }
}
