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

body {
    font-family: 'PingFang SC', 'Arial', sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 50%, #fecfef 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: #333;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.app-header {
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left .back-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 8px;
}

.header-center .event-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.header-right .share-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #ff6b6b;
    padding: 8px;
}

/* 主内容区域 */
.app-main {
    flex: 1;
    padding: 20px 16px;
    padding-bottom: 90px;
}

/* 活动标题 */
.event-header {
    text-align: center;
    margin-bottom: 30px;
}

.main-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.main-subtitle {
    font-size: 18px;
    color: #ff6b6b;
    font-weight: 500;
    margin-bottom: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    color: #666;
}

.user-name {
    font-weight: 500;
}

.user-coins {
    color: #ff6b6b;
    font-weight: 500;
}

/* 扭蛋机区域 */
.gacha-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.gacha-machine {
    width: 280px;
    height: 420px;
    position: relative;
}

.gacha-glass {
    width: 280px;
    height: 320px;
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(255, 250, 240, 0.9) 100%);
    border-radius: 50% 50% 20% 20%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2),
                inset 0 5px 20px rgba(255, 255, 255, 0.5),
                inset 0 -5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(255, 215, 0, 0.3);
}

.gacha-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8) 0%, transparent 50%);
    pointer-events: none;
    z-index: 5;
}

.gacha-capsules {
    width: 100%;
    height: 100%;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    align-content: center;
}

.gacha-capsule {
    width: 100%;
    height: 80px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: capsuleFloat 3s ease-in-out infinite;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2),
                inset 0 -3px 12px rgba(0, 0, 0, 0.2),
                inset 0 3px 12px rgba(255, 255, 255, 0.6);
}

.gacha-capsule.jumping {
    animation: capsuleJump 0.8s ease-in-out infinite;
}

@keyframes capsuleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(2deg);
    }
    50% {
        transform: translateY(0) rotate(0deg);
    }
    75% {
        transform: translateY(5px) rotate(-2deg);
    }
}

@keyframes capsuleJump {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-10px) rotate(5deg) scale(1.05);
    }
    50% {
        transform: translateY(-3px) rotate(0deg) scale(1.02);
    }
    75% {
        transform: translateY(-8px) rotate(-5deg) scale(1.05);
    }
}

.capsule-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    animation-delay: 0s;
}

.capsule-red {
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    animation-delay: 0.5s;
}

.capsule-content {
    font-size: 28px;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.capsule-text {
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gacha-base {
    width: 280px;
    height: 100px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 50%, #d63031 100%);
    border-radius: 20px 20px 40px 40px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
                inset 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gacha-controls {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    padding: 0 30px;
}

.gacha-vent {
    width: 60px;
    height: 8px;
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    border-radius: 4px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.gacha-btn {
    padding: 12px 32px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3),
                0 0 30px rgba(102, 126, 234, 0.5);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

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

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

.gacha-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
                0 0 40px rgba(102, 126, 234, 0.7);
}

.gacha-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* 抽奖机会按钮 */
.chance-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.chance-btn {
    width: 100%;
    max-width: 320px;
    padding: 16px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 50%, #d63031 100%);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3),
                0 0 30px rgba(255, 107, 107, 0.5);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

.chance-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
                0 0 40px rgba(255, 107, 107, 0.7);
}

.chance-text {
    display: block;
    margin-bottom: 4px;
}

.chance-hint {
    display: block;
    font-size: 14px;
    font-weight: normal;
    opacity: 0.9;
}

.chance-bonus {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.bonus-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.bonus-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* 基金列表 */
.fund-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.fund-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.fund-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.fund-item:hover {
    transform: translateY(-5px) rotateX(5deg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.fund-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
}

.fund-btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.fund-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid #eee;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 100px;
}

.nav-item:hover {
    transform: translateY(-2px);
}

.nav-item.active {
    color: #667eea;
}

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

.nav-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.nav-text {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    transition: color 0.3s ease;
}

.nav-item.active .nav-text {
    color: #667eea;
    font-weight: bold;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 30px;
    width: 90%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    animation: modalPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
                0 0 40px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes modalPop {
    from {
        transform: scale(0.7) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 300% 50%;
    }
}

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

.modal-header h3 {
    color: #333;
    font-size: 24px;
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(90deg);
}

.modal-body {
    margin-bottom: 30px;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 16px;
    animation: resultBounce 1s ease-in-out infinite;
    filter: drop-shadow(0 5px 20px rgba(0, 0, 0, 0.3));
}

@keyframes resultBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

.result-name {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-rarity {
    font-size: 16px;
    padding: 6px 16px;
    border-radius: 16px;
    color: white;
    display: inline-block;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-footer {
    margin-top: 30px;
}

.modal-btn {
    padding: 14px 40px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3),
                0 0 30px rgba(102, 126, 234, 0.5);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4),
                0 0 40px rgba(102, 126, 234, 0.7);
}

.auth-input {
    padding: 14px 20px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
    width: 100%;
    margin-bottom: 20px;
}

.auth-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

.auth-error {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.verify-info {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .app-main {
        padding: 16px 12px;
    }
    
    .main-title {
        font-size: 24px;
    }
    
    .main-subtitle {
        font-size: 16px;
    }
    
    .gacha-machine {
        width: 240px;
        height: 380px;
    }
    
    .gacha-glass {
        width: 240px;
        height: 280px;
    }
    
    .gacha-base {
        width: 240px;
        height: 100px;
    }
    
    .gacha-btn {
        font-size: 16px;
        padding: 10px 28px;
    }
    
    .chance-btn {
        max-width: 280px;
        font-size: 16px;
    }
    
    .fund-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .fund-item {
        padding: 16px;
    }
    
    .modal-content {
        padding: 30px 24px;
    }
    
    .result-icon {
        font-size: 60px;
    }
    
    .result-name {
        font-size: 20px;
    }
}

/* 加载动画 */
@keyframes loadingPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

.loading {
    animation: loadingPulse 1.5s ease-in-out infinite;
}

/* 稀有度样式 */
.rarity-common {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.rarity-rare {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.rarity-epic {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.rarity-legendary {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    animation: legendaryGlow 2s ease-in-out infinite;
}

@keyframes legendaryGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(243, 156, 18, 0.6);
    }
}
