/* ============================================================
 * 前台样式 - 单页 banner + 3 tab 结构
 * 毛玻璃卡片效果
 * ============================================================ */

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

body {
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, rgba(15, 32, 75, 0.15) 0%, rgba(32, 58, 108, 0.15) 100%),
                url('../images/bg.jpg') center center / cover no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
}

.page-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ 广告位 ============ */
.banner {
    width: 100%;
    background: #0f204b;
}

.banner-slider {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 1200 / 360;
    overflow: hidden;
}

.banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.banner-slide.is-active {
    opacity: 1;
    z-index: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
}

.banner-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.banner-dot.is-active {
    background: #ffffff;
    transform: scale(1.2);
}

.banner-empty {
    max-width: 1200px;
    margin: 0 auto;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    background: linear-gradient(135deg, #0f204b 0%, #1a5fb4 100%);
}

/* ============ Tab 导航 ============ */
.tab-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.tab-link {
    display: inline-block;
    padding: 18px 28px;
    text-decoration: none;
    color: #000;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-link:hover {
    color: #1a5fb4;
    border-bottom-color: rgba(26, 95, 180, 0.4);
}

.tab-link.is-active {
    color: #1a5fb4;
    border-bottom-color: #1a5fb4;
}

.tab-link--disabled {
    color: #999;
    cursor: not-allowed;
}

.tab-link--disabled:hover {
    color: #999;
    border-bottom-color: transparent;
}

/* ============ 主内容 ============ */
.main-content {
    flex: 1;
    padding: 30px 0 40px;
}

body.is-predict-tab .main-content {
    padding: 0 0 40px;
}

body.is-predict-tab .main-content,
.main-content.main-content--predict {
    padding-top: 0 !important;
}

.main-content:has(> .container > .tab-panel--predict:not([hidden])) {
    padding-top: 0 !important;
}

body.is-predict-tab .tab-nav {
    box-shadow: none;
}

body.is-predict-tab .tab-nav,
.tab-nav.tab-nav--predict {
    box-shadow: none !important;
}

body.is-predict-tab .main-content > .container {
    max-width: none;
    width: 100%;
    margin-top: 0;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
}

.main-content > .container.container--predict {
    max-width: none;
    width: 100%;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-left: 0;
    padding-right: 0;
}

.main-content:has(> .container > .tab-panel--predict:not([hidden])) > .container {
    max-width: none;
    width: 100%;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-left: 0;
    padding-right: 0;
}

body.is-predict-tab .tab-panel[data-panel="predict"] {
    margin-top: 0;
    padding-top: 0;
}

.tab-panel--predict {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.tab-panel {
    display: block;
}

.tab-panel[hidden] {
    display: none !important;
}

/* ============ 卡片 - 透明玻璃效果 ============ */
.card {
    background: rgba(255, 255, 255, 0.34);
    backdrop-filter: blur(24px) brightness(1.12) saturate(1.05);
    -webkit-backdrop-filter: blur(24px) brightness(1.12) saturate(1.05);
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 48px rgba(0, 0, 0, 0.5);
}

.card-header {
    background: transparent;
    padding: 18px 25px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.card-header h2 {
    color: #000;
    font-weight: 700;
    font-size: 22px;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
    padding-bottom: 10px;
    position: relative;
    text-shadow: none;
}

.card-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 20%;
    min-width: 60px;
    height: 2px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 1px;
}

.card-header .btn {
    flex-shrink: 0;
}

.card-body {
    padding: 25px;
    line-height: 1.8;
    color: #000;
}

/* ============ 按钮 ============ */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 22px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #1a5fb4 0%, #0f204b 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2476d1 0%, #1a5fb4 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* ============ 卡片内元素 ============ */
.download-code {
    background: rgba(0, 0, 0, 0.06);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.download-code .code {
    font-size: 28px;
    font-weight: bold;
    color: #1a5fb4;
    margin-left: 10px;
}

.notice {
    background: rgba(255, 193, 7, 0.15);
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.notice-text {
    color: #000;
    font-weight: 500;
}

.rewards-section,
.rules-section {
    margin-bottom: 20px;
}

.rewards-section h3,
.rules-section h3 {
    color: #1a5fb4;
    margin-bottom: 15px;
    font-size: 18px;
}

.reward-item {
    padding: 6px 0;
    color: #000;
    font-weight: 500;
}

.rules-section p {
    padding: 4px 0;
    color: #000;
}

/* ============ 联系信息（旧格式兼容） ============ */
.contact-info p {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    word-break: break-all;
    color: #000;
}

.contact-info p:last-child {
    border-bottom: none;
}

.contact-info strong {
    color: #1a5fb4;
    display: inline-block;
    min-width: 120px;
}

.notice-highlight {
    color: #000;
    font-weight: 500;
    background: rgba(255, 193, 7, 0.2);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    border-left: 4px solid #e74c3c;
}

/* ============ 公告 / 富文本内容 ============ */
.announcement-content {
    line-height: 1.7;
    color: #000;
}

.announcement-content img {
    max-width: 100%;
    height: auto;
}

.announcement-content ul,
.announcement-content ol {
    padding-left: 1.5em;
    margin: 0.5em 0;
}

.announcement-meta {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

/* 富文本通用样式 */
.rich-content {
    line-height: 1.7;
    color: #000;
}

.rich-content img {
    max-width: 100%;
    height: auto;
}

.rich-content ul,
.rich-content ol {
    padding-left: 1.5em;
    margin: 0.5em 0;
}

.rich-content p {
    margin: 0.5em 0;
    color: #000;
}

.rich-content strong {
    color: #000;
}

/* ============ APP下载 tab ============ */
.download-page {
    max-width: 900px;
    margin: 0 auto;
}

.download-page > div {
    background: rgba(255, 255, 255, 0.34);
    backdrop-filter: blur(24px) brightness(1.12) saturate(1.05);
    -webkit-backdrop-filter: blur(24px) brightness(1.12) saturate(1.05);
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 14px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.download-page h2 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 24px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.download-page p {
    color: #000;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
    padding: 20px 12px;
    border-radius: 8px;
    background: transparent;
    min-width: 0;
}

.stat-icon {
    margin-bottom: 10px;
    line-height: 1;
}

.stat-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: inline-block;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    margin-bottom: 5px;
    word-break: break-all;
}

.stat-label {
    font-size: 14px;
    color: #000;
}

.download-section {
    text-align: center;
}

.download-btn-wrapper {
    display: inline-block;
    padding: 5px;
    margin: 30px 0;
    border: 2px solid rgba(231, 76, 60, 0.3);
    border-radius: 20px;
    background: rgba(231, 76, 60, 0.05);
}

.btn-download-red {
    font-size: 22px;
    font-weight: 600;
    padding: 18px 56px;
    display: inline-block;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5);
    animation: pulse-red 2s ease-in-out infinite;
    border: 3px solid #fff;
    text-decoration: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-radius: 14px;
}

.btn-download-red:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 35px rgba(231, 76, 60, 0.7);
    animation: none;
}

.btn-download-disabled {
    font-size: 22px;
    font-weight: 600;
    padding: 18px 56px;
    margin: 30px 0;
    display: inline-block;
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
    border: 3px solid #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: not-allowed;
    border-radius: 14px;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 8px 25px rgba(231, 76, 60, 0.5); }
    50%      { box-shadow: 0 8px 35px rgba(231, 76, 60, 0.85); }
}

.download-icon {
    font-size: 24px;
    vertical-align: middle;
}

.download-note {
    color: #000;
    font-size: 14px;
}

/* ============ 活动回馈 - 外层卡片包裹，内4张纯图片四宫格 ============ */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-row-gap: 10px;
    grid-column-gap: 10px;
    margin: 16px auto 0;
    max-width: 480px;
}

.activity-grid img {
    width: 100%;
    height: auto;
    display: block;
}

.disclaimer-text {
    text-align: center;
    color: #000;
    font-size: 14px;
    margin-top: 16px;
}

/* ============ 页脚 ============ */
.footer {
    background: rgba(0, 0, 0, 0.35);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .tab-nav {
        gap: 0;
        flex-wrap: nowrap;
    }

    .tab-link {
        flex: 1;
        min-width: 0;
        text-align: center;
        padding: 14px 6px;
        font-size: 14px;
    }

    .card-header {
        padding: 14px 16px;
        gap: 8px;
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .card-header h2 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .card-header .btn {
        flex-shrink: 0;
        align-self: center;
        padding: 7px 14px;
        font-size: 13px;
        border-radius: 18px;
    }

    .card-body {
        padding: 20px;
    }

    .banner-slider {
        aspect-ratio: 16 / 9;
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .activity-grid {
        grid-row-gap: 8px;
        grid-column-gap: 8px;
        max-width: 400px;
    }

    .stat-item {
        padding: 18px 6px;
    }

    .stat-icon {
        margin-bottom: 8px;
    }

    .stat-icon img {
        width: 44px;
        height: 44px;
    }

    .stat-number {
        font-size: 20px;
    }

    .stat-label {
        font-size: 13px;
        line-height: 1.4;
    }

    .download-page > div {
        padding: 20px;
    }

    .btn-download-red,
    .btn-download-disabled {
        font-size: 18px;
        padding: 14px 28px;
    }
}

@media (max-width: 480px) {
    .download-code .code {
        font-size: 22px;
    }

    .card-header {
        padding: 12px 14px;
    }

    .card-header h2 {
        font-size: 15px;
    }

    .card-header .btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .download-page > div {
        padding: 16px;
    }

    .activity-grid {
        grid-row-gap: 8px;
        grid-column-gap: 8px;
    }

    .stat-item {
        padding: 14px 8px;
    }

    .stat-number {
        font-size: 17px;
    }

    .stat-label {
        font-size: 12px;
    }

    .activity-grid {
        max-width: 320px;
    }
}
