/* ===== CSS Variables & Theme ===== */
:root {
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FF8F5E;
    --secondary: #FFD700;
    --success: #00E676;
    --bg-gradient-start: #0F0C29;
    --bg-gradient-mid: #302B63;
    --bg-gradient-end: #24243E;
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-border-hover: rgba(255, 255, 255, 0.2);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end));
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    display: flex;
    justify-content: center;
    padding: 0;
    background-attachment: fixed;
    position: relative;
}

/* ===== Background Decoration ===== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: bgFloat 8s ease-in-out infinite;
}

.bg-circle-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -80px;
    right: -80px;
    animation-delay: 0s;
}

.bg-circle-2 {
    width: 250px;
    height: 250px;
    background: var(--secondary);
    bottom: 20%;
    left: -100px;
    animation-delay: -3s;
}

.bg-circle-3 {
    width: 200px;
    height: 200px;
    background: #7C4DFF;
    bottom: -60px;
    right: 20%;
    animation-delay: -6s;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ===== Container ===== */
.container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 8px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
    justify-content: flex-start;
}

/* ===== Header ===== */
.header {
    text-align: center;
    padding: 6px 0 2px;
    animation: fadeInDown 0.6s ease-out;
}

/* ===== Header Logo with Dynamic Glow ===== */
.header-logo-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 6px;
    width: 80px;
    height: 80px;
    animation: logoFloat 3s ease-in-out infinite;
}

.header-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
    border-radius: 16px;
}

/* 动态发光层 */
.header-logo-glow {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(255, 107, 53, 0.6) 0%,
        rgba(255, 215, 0, 0.4) 30%,
        rgba(255, 107, 53, 0.2) 50%,
        transparent 70%
    );
    animation: logoGlowPulse 2s ease-in-out infinite;
    border-radius: 50%;
}

/* 第二个发光层 - 旋转光晕 */
.header-logo-wrapper::after {
    content: '';
    position: absolute;
    top: -30%;
    left: -30%;
    width: 160%;
    height: 160%;
    z-index: 0;
    pointer-events: none;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(255, 215, 0, 0.15),
        rgba(255, 107, 53, 0.2),
        rgba(255, 215, 0, 0.15),
        transparent
    );
    animation: logoGlowRotate 3s linear infinite;
    border-radius: 50%;
    mask: radial-gradient(circle at center, transparent 30%, black 31%, black 50%, transparent 51%);
    -webkit-mask: radial-gradient(circle at center, transparent 30%, black 31%, black 50%, transparent 51%);
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes logoGlowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes logoGlowRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


.header-title {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.header-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ===== Prize Pool Card ===== */
.prize-pool-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px 16px 14px;
    text-align: center;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease-out 0.1s both;
    transition: border-color var(--transition);
}

.prize-pool-card:hover {
    border-color: var(--card-border-hover);
}

.prize-pool-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.prize-pool-amount {
    font-size: 34px;
    font-weight: 900;
    background: linear-gradient(135deg, #FFD700, #FF6B35, #FFD700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 12px;
    animation: goldShimmer 3s ease-in-out infinite;
}

@keyframes goldShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.prize-pool-amount .currency {
    font-size: 15px;
    font-weight: 700;
    -webkit-text-fill-color: var(--secondary);
    color: var(--secondary);
}

/* ===== Progress Section ===== */
.progress-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-percent {
    font-size: 14px;
    font-weight: 800;
    color: var(--secondary);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* ===== Progress Bar Track ===== */
.progress-bar-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #FF6B35, #FFD700);
    position: relative;
    overflow: hidden;
}

.progress-bar-glow {
    display: none;
}

/* ===== Progress Dots ===== */
.progress-dots {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.progress-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    z-index: 2;
}

/* ===== Progress Stats ===== */
.progress-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
}

.progress-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.stat-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-stat-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

/* ===== Help Info Card ===== */
.help-info-card {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 215, 0, 0.08));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.help-info-icon {
    font-size: 26px;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

.help-info-text {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.help-info-count {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin: 0 3px;
    animation: pulse 1.5s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

/* ===== Invite Button ===== */
.invite-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.4);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out 0.3s both;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.5px;
}

.invite-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s ease;
}

.invite-btn:hover::before {
    left: 100%;
}

.invite-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.invite-btn-icon {
    font-size: 24px;
    animation: bounce 2s ease-in-out infinite;
}

.invite-btn-text {
    position: relative;
    z-index: 1;
}

/* ===== Ripple Effect ===== */
.invite-btn-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.invite-btn:active .invite-btn-ripple {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* ===== Reward Section ===== */
.reward-section {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px 14px 10px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease-out 0.4s both;
    overflow: hidden;
    transition: border-color var(--transition);
}

.reward-section:hover {
    border-color: var(--card-border-hover);
}

.reward-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 2px;
}

.reward-section-icon {
    font-size: 18px;
}

.reward-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.reward-section-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

/* ===== Reward Carousel ===== */
.reward-carousel-wrapper {
    overflow: hidden;
    position: relative;
    height: 310px;
    border-radius: var(--radius-xs);
}

.reward-carousel-wrapper::before,
.reward-carousel-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 24px;
    z-index: 2;
    pointer-events: none;
}

.reward-carousel-wrapper::before {
    top: 0;
    background: linear-gradient(to bottom, var(--card-bg), transparent);
}

.reward-carousel-wrapper::after {
    bottom: 0;
    background: linear-gradient(to top, var(--card-bg), transparent);
}

.reward-carousel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: scrollUp 15s linear infinite;
    padding: 4px 0;
}

.reward-carousel:hover {
    animation-play-state: paused;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-xs);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition);
    flex-shrink: 0;
}

.reward-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.1);
}

.reward-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.reward-info {
    flex: 1;
    min-width: 0;
}

.reward-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reward-desc {
    font-size: 12px;
    color: var(--secondary);
    margin-top: 2px;
    font-weight: 600;
}

.reward-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}

/* ===== App Container ===== */
.app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* ===== Pages ===== */
.page {
    display: none;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 70px; /* 为底部导航栏留空间 */
}

.page.active {
    display: flex;
}

.page .container {
    max-width: 480px;
    width: 100%;
    min-height: auto;
    padding: 8px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(15, 12, 41, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 100;
    max-width: 480px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 16px;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.nav-item .nav-icon {
    font-size: 22px;
    transition: transform var(--transition);
}

.nav-item .nav-label {
    font-size: 11px;
    font-weight: 600;
    transition: color var(--transition);
}

.nav-item.active {
    color: var(--primary);
}

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

.nav-item.active .nav-label {
    color: var(--primary);
}

.nav-item::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 0 0 4px 4px;
    transition: transform var(--transition);
}

.nav-item.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* ===== Data Page ===== */
.data-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.data-card-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 4px;
}

.data-card-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

.data-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.data-card-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.data-card-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.data-card-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 2px 0;
}

/* ===== Activity Selector ===== */
.activity-selector {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.activity-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 2px;
}

.activity-selector-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.activity-selector-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.activity-btn {
    padding: 8px 2px;
    border: none;
    border-radius: var(--radius-xs);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* 强烈立体阴影效果 */
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    transform: translateY(0);
}

/* 顶部高光层 - 增强立体感 */
.activity-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent);
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
    pointer-events: none;
}

/* 底部暗边 - 增强立体感 */
.activity-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2px;
    right: 2px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 var(--radius-xs) var(--radius-xs);
    filter: blur(2px);
    pointer-events: none;
}

.activity-btn:active {
    transform: translateY(3px) scale(0.95);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 1px 2px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

/* 跑马灯亮灯效果 - 霓虹灯彩色效果 */
.activity-btn.marquee {
    color: #fff;
    box-shadow: 
        0 6px 25px rgba(255, 255, 255, 0.3),
        0 3px 10px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
    animation: neonGlow 0.3s ease-in-out infinite alternate;
}

.activity-btn.marquee::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent);
}

.activity-btn.marquee .activity-btn-number {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px currentColor;
}

/* 霓虹灯颜色变体 - 通过JS动态设置不同的颜色 */
.activity-btn.marquee.color-red {
    background: linear-gradient(145deg, #FF1744, #D50000);
    box-shadow: 0 6px 25px rgba(255, 23, 68, 0.6), 0 3px 10px rgba(255, 23, 68, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.activity-btn.marquee.color-orange {
    background: linear-gradient(145deg, #FF9100, #FF6D00);
    box-shadow: 0 6px 25px rgba(255, 145, 0, 0.6), 0 3px 10px rgba(255, 145, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.activity-btn.marquee.color-yellow {
    background: linear-gradient(145deg, #FFEA00, #FFD600);
    box-shadow: 0 6px 25px rgba(255, 234, 0, 0.6), 0 3px 10px rgba(255, 234, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.activity-btn.marquee.color-green {
    background: linear-gradient(145deg, #00E676, #00C853);
    box-shadow: 0 6px 25px rgba(0, 230, 118, 0.6), 0 3px 10px rgba(0, 230, 118, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.activity-btn.marquee.color-cyan {
    background: linear-gradient(145deg, #00E5FF, #00B8D4);
    box-shadow: 0 6px 25px rgba(0, 229, 255, 0.6), 0 3px 10px rgba(0, 229, 255, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.activity-btn.marquee.color-blue {
    background: linear-gradient(145deg, #448AFF, #2962FF);
    box-shadow: 0 6px 25px rgba(68, 138, 255, 0.6), 0 3px 10px rgba(68, 138, 255, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.activity-btn.marquee.color-purple {
    background: linear-gradient(145deg, #D500F9, #AA00FF);
    box-shadow: 0 6px 25px rgba(213, 0, 249, 0.6), 0 3px 10px rgba(213, 0, 249, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.2);
}
.activity-btn.marquee.color-pink {
    background: linear-gradient(145deg, #FF4081, #F50057);
    box-shadow: 0 6px 25px rgba(255, 64, 129, 0.6), 0 3px 10px rgba(255, 64, 129, 0.4), inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -2px 0 rgba(0,0,0,0.2);
}

/* 霓虹灯闪烁动画 */
@keyframes neonGlow {
    0% {
        filter: brightness(1);
    }
    100% {
        filter: brightness(1.3);
    }
}



.activity-btn.active {
    background: linear-gradient(145deg, var(--primary), #D04A1E);
    color: #fff;
    box-shadow: 
        0 8px 25px rgba(255, 107, 53, 0.5),
        0 4px 10px rgba(255, 107, 53, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -3px 0 rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.activity-btn.active::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
}

.activity-btn.active::after {
    background: rgba(0, 0, 0, 0.3);
}

.activity-btn .activity-btn-number {
    display: block;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.activity-btn .activity-btn-label {
    display: block;
    font-size: 8px;
    font-weight: 500;
    opacity: 0.5;
    margin-top: 1px;
    letter-spacing: 0.2px;
}

.activity-btn.active .activity-btn-label {
    opacity: 0.9;
}




/* ===== Records Section ===== */
.records-section {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease-out 0.2s both;
    position: relative;
    overflow: hidden;
}

.records-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 2px;
}

.records-header-icon {
    font-size: 18px;
}

.records-header-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.records-header-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

/* ===== Records Table ===== */
.records-table-wrapper {
    max-height: 260px;
    overflow-y: auto;
    border-radius: var(--radius-xs);
    -webkit-overflow-scrolling: touch;
}



.records-table-wrapper::-webkit-scrollbar {
    width: 3px;
}

.records-table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.records-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.records-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.records-table th {
    background: rgba(255, 107, 53, 0.15);
    color: var(--primary-light);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
    white-space: nowrap;
}

.records-table th.col-name {
    width: 38%;
    text-align: left;
    padding-left: 12px;
}

.records-table th.col-amount {
    width: 28%;
    text-align: left;
}

.records-table th.col-time {
    width: 34%;
    text-align: right;
    padding-right: 12px;
}

.records-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 12px;
    vertical-align: middle;
}

.records-table td.col-name-cell {
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding-left: 12px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.records-table td.col-amount-cell {
    text-align: left;
    color: var(--secondary);
    font-weight: 700;
    font-size: 13px;
}

.records-table td.col-time-cell {
    text-align: right;
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
    padding-right: 12px;
}

.records-table tbody tr {
    transition: background var(--transition);
}

.records-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.records-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== Records Empty State ===== */
.records-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    gap: 8px;
}

.records-empty.show {
    display: flex;
}

.records-empty-icon {
    font-size: 36px;
    opacity: 0.5;
}

.records-empty-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Records Loading State ===== */
.records-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    gap: 10px;
}

.records-loading.show {
    display: flex;
}

.records-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.records-loading-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Rules Page ===== */
.rules-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease-out 0.1s both;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rules-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.rules-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    margin-top: 2px;
}

.rules-content {
    flex: 1;
}

.rules-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rules-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Bottom Safe Area ===== */
.bottom-safe {
    height: 20px;
    flex-shrink: 0;
}

/* ===== Completion Banner ===== */
#completionBanner {
    margin-top: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(0,230,118,0.15), rgba(0,200,83,0.1));
    border: 1px solid rgba(0,230,118,0.3);
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #00E676;
    animation: fadeInUp 0.5s ease;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes scrollUp {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* ===== Telegram Mini App Safe Area ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    .container {
        padding-top: calc(8px + env(safe-area-inset-top));
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* ===== Desktop Styles (min-width: 768px) ===== */
@media (min-width: 768px) {
    body {
        padding: 40px 20px;
        align-items: flex-start;
        background: linear-gradient(160deg, #0F0C29, #302B63, #24243E, #1a1a3e);
    }

    .container {
        max-width: 420px;
        padding: 28px 24px 40px;
        border-radius: 28px;
        background: rgba(15, 12, 41, 0.7);
        backdrop-filter: blur(40px);
        -webkit-backdrop-filter: blur(40px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 80px rgba(255, 107, 53, 0.05);
        min-height: auto;
        gap: 16px;
    }

    .bg-circle-1 {
        width: 400px;
        height: 400px;
        top: -120px;
        right: -120px;
    }

    .bg-circle-2 {
        width: 350px;
        height: 350px;
        bottom: 10%;
        left: -150px;
    }

    .bg-circle-3 {
        width: 280px;
        height: 280px;
        bottom: -80px;
        right: 15%;
    }

    .header {
        padding: 12px 0 6px;
    }

    .header-logo-wrapper {
        width: 100px;
        height: 100px;
    }

    .header-title {
        font-size: 28px;
    }

    .header-subtitle {
        font-size: 16px;
    }

    .prize-pool-card {
        padding: 28px 24px 22px;
    }

    .prize-pool-amount {
        font-size: 46px;
    }

    .prize-pool-amount .currency {
        font-size: 20px;
    }

    .progress-section {
        padding: 18px;
    }

    .progress-bar-track {
        height: 18px;
    }

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

    .invite-btn {
        padding: 20px 24px;
        font-size: 19px;
        cursor: pointer;
    }

    .invite-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 32px rgba(255, 107, 53, 0.5);
    }

    .reward-carousel-wrapper {
        height: 340px;
    }

    .reward-item {
        padding: 12px 16px;
    }

    .reward-item:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateX(6px);
    }

    .bottom-safe {
        display: none;
    }
}

/* ===== Large Desktop (min-width: 1200px) ===== */
@media (min-width: 1200px) {
    body {
        padding: 60px 20px;
    }

    .container {
        max-width: 440px;
        padding: 32px 28px 48px;
    }
}

/* ===== Dark Scrollbar ===== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== Modal / Popup Styles ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: linear-gradient(160deg, #1a1a3e, #2a1a4e, #1e1e42);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(255, 107, 53, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

/* 弹窗顶部装饰光晕 */
.modal-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 20%,
        rgba(255, 107, 53, 0.06) 0%,
        rgba(255, 215, 0, 0.03) 30%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 0;
    position: relative;
    z-index: 1;
}

.modal-header-icon {
    font-size: 28px;
    animation: bounce 2s ease-in-out infinite;
    flex-shrink: 0;
}

.modal-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    flex: 1;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.modal-close-btn:hover,
.modal-close-btn:active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: 16px 20px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.modal-rule-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease both;
}

.modal-rule-item:nth-child(1) { animation-delay: 0.1s; }
.modal-rule-item:nth-child(2) { animation-delay: 0.2s; }
.modal-rule-item:nth-child(3) { animation-delay: 0.3s; }
.modal-rule-item:nth-child(4) { animation-delay: 0.4s; }

.modal-rule-item:hover {
    transform: translateX(4px);
}

/* 危险规则（禁止类）- 红色调 */
.modal-rule-danger {
    border-left: 3px solid #FF5252;
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.08), rgba(255, 82, 82, 0.02));
}

.modal-rule-danger .modal-rule-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.modal-rule-danger .modal-rule-text {
    color: #FF8A80;
}

/* 成功规则（允许类）- 绿色调 */
.modal-rule-success {
    border-left: 3px solid #69F0AE;
    background: linear-gradient(135deg, rgba(105, 240, 174, 0.08), rgba(105, 240, 174, 0.02));
}

.modal-rule-success .modal-rule-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.modal-rule-success .modal-rule-text {
    color: #B9F6CA;
}

/* 警告规则 - 橙色调 */
.modal-rule-warning {
    border-left: 3px solid #FFD740;
    background: linear-gradient(135deg, rgba(255, 215, 64, 0.08), rgba(255, 215, 64, 0.02));
}

.modal-rule-warning .modal-rule-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.modal-rule-warning .modal-rule-text {
    color: #FFE57F;
}

.modal-rule-content {
    flex: 1;
}

.modal-rule-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

.modal-footer {
    padding: 8px 20px 20px;
    position: relative;
    z-index: 1;
}

.modal-confirm-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.4);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.modal-confirm-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s ease;
}

.modal-confirm-btn:hover::before {
    left: 100%;
}

.modal-confirm-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* 弹窗滚动条 */
.modal-container::-webkit-scrollbar {
    width: 3px;
}

.modal-container::-webkit-scrollbar-track {
    background: transparent;
}

.modal-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* 桌面端弹窗适配 */
@media (min-width: 768px) {
    .modal-container {
        max-width: 420px;
    }
    
    .modal-confirm-btn {
        cursor: pointer;
    }
    
    .modal-confirm-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 32px rgba(255, 107, 53, 0.5);
    }
}
