/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #ff4757, #ff3838, #ff4757);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* 背景装饰 */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-star, .floating-diamond {
    position: absolute;
    color: rgba(255, 255, 255, 0.3);
    animation: float 3s ease-in-out infinite;
}

.floating-star {
    font-size: 20px;
}

.floating-star:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-star:nth-child(2) {
    top: 20%;
    right: 15%;
    animation-delay: 1s;
}

.floating-star:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-delay: 2s;
}

.floating-diamond {
    font-size: 16px;
}

.floating-diamond:nth-child(4) {
    top: 30%;
    right: 10%;
    animation-delay: 0.5s;
}

.floating-diamond:nth-child(5) {
    bottom: 30%;
    right: 30%;
    animation-delay: 1.5s;
}

.floating-star::before {
    content: "✨";
}

.floating-diamond::before {
    content: "💎";
}

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

/* 主标题 */
.header {
    text-align: center;
    margin: 30px 0;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ffdc00, #fff700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 栏目选择区域 */
.category-selection {
    margin: 40px auto;
    max-width: 800px;
    text-align: center;
    padding: 0 20px;
}

.selection-title {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.category-card {
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 为每个栏目添加独特的渐变背景 */
.category-card[data-category-id="1"] {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e, #ffb3ba);
}

.category-card[data-category-id="2"] {
    background: linear-gradient(135deg, #4ecdc4, #45b7aa, #96ceb4);
}

.category-card[data-category-id="3"] {
    background: linear-gradient(135deg, #45b7d1, #6c7ce0, #a8e6cf);
}

.category-card[data-category-id="4"] {
    background: linear-gradient(135deg, #ffa726, #ffcc02, #ffb74d);
}

.category-card[data-category-id="5"] {
    background: linear-gradient(135deg, #e74c3c, #c0392b, #f39c12);
}

.category-card[data-category-id="6"] {
    background: linear-gradient(135deg, #9b59b6, #8e44ad, #3498db);
}

.category-card[data-category-id="7"] {
    background: linear-gradient(135deg, #1abc9c, #16a085, #2ecc71);
}

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

.category-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1) saturate(1.1);
}

.category-card:hover::before {
    left: 100%;
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.category-name {
    font-size: 1.3rem;
    color: #fff;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.category-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
}

.category-amount {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 15px;
    display: inline-block;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    animation: breathe 2s ease-in-out infinite;
    transform-origin: center;
}

.category-amount .amount-number {
    color: #ff4444 !important;
    font-weight: 900 !important;
    font-size: 1.4em !important;
    text-shadow: 0 0 15px rgba(255, 68, 68, 0.8) !important;
    display: inline-block !important;
}

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

/* 抽奖码输入区域 */
.code-input-container {
    max-width: 400px;
    margin: 0 auto 30px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.category-info {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.category-info h3 {
    color: #fff;
    font-size: 1.4rem;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.category-info p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 0.9rem;
}

.back-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#codeInput {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    outline: none;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#codeInput:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.verify-btn {
    padding: 15px 25px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.verify-btn:active {
    transform: translateY(0);
}

.code-status {
    text-align: center;
    font-size: 16px;
    min-height: 24px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.code-status.success {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.code-status.error {
    color: #000;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    border: 2px solid #000;
    text-shadow: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

/* 抽奖信息 */
.lottery-info {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.info-item {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
    margin: 0 10px;
    backdrop-filter: blur(10px);
}

.label {
    font-weight: normal;
}

.value {
    font-weight: bold;
    color: #ffdc00;
    text-shadow: 0 0 10px rgba(255, 220, 0, 0.5);
}

/* 抽奖容器 */
.lottery-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 20px 50px;
    position: relative;
    z-index: 1;
}

.lottery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    justify-items: center;
    min-height: 650px;
    align-content: center;
}

/* 红包样式 */
.red-packet {
    width: 150px;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.red-packet:hover {
    transform: scale(1.05);
}

.red-packet.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.packet-front, .packet-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.6s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.packet-front {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    border: 3px solid #ffdc00;
    color: #ffdc00;
    transform: rotateY(0deg);
}

.packet-back {
    background: linear-gradient(135deg, #ffdc00, #fff700);
    color: #ff4757;
    transform: rotateY(180deg);
}

.red-packet.flipped .packet-front {
    transform: rotateY(-180deg);
}

.red-packet.flipped .packet-back {
    transform: rotateY(0deg);
}

.packet-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.packet-text {
    font-size: 1.4rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.amount {
    font-size: 2.2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 中奖动画 */
.red-packet.winning {
    animation: winningPulse 1s ease-in-out;
}

@keyframes winningPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); box-shadow: 0 0 30px rgba(255, 220, 0, 0.8); }
    100% { transform: scale(1); }
}

/* 中奖红包突出显示 */
.red-packet.winner-highlight {
    position: relative;
    animation: winnerGlow 2s ease-in-out infinite;
}

.red-packet.winner-highlight::before {
    content: '🎉';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    animation: celebrate 1.5s ease-in-out infinite;
    z-index: 10;
}

.red-packet.winner-highlight::after {
    content: '中奖';
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #ff4757, #ff3838);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.5);
    z-index: 10;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes winnerGlow {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 220, 0, 0.6), 0 0 30px rgba(255, 71, 87, 0.3);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 0 25px rgba(255, 220, 0, 0.8), 0 0 45px rgba(255, 71, 87, 0.4);
    }
}

@keyframes celebrate {
    0%, 100% { transform: translateX(-50%) rotate(-10deg); }
    50% { transform: translateX(-50%) rotate(10deg); }
}

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



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

.modal {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal-overlay.show .modal {
    transform: scale(1);
    opacity: 1;
}

.prize-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: celebration 1s ease-in-out infinite alternate;
}

@keyframes celebration {
    0% { transform: rotate(-10deg) scale(1); }
    100% { transform: rotate(10deg) scale(1.1); }
}

.prize-title {
    font-size: 2rem;
    font-weight: bold;
    color: #ff4757;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.prize-amount {
    font-size: 3rem;
    font-weight: bold;
    color: #ffdc00;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    background: linear-gradient(45deg, #ffdc00, #fff700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.prize-message {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.remaining-info {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 25px;
}

.continue-btn, .close-btn {
    padding: 12px 30px;
    margin: 0 10px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.close-btn {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* 加载提示 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 71, 87, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    z-index: 1001;
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 重置按钮 */
.reset-container {
    text-align: center;
    margin: 30px 0;
    position: relative;
    z-index: 1;
}

.reset-btn {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* 参与记录按钮 */
.admin-link {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
}

.admin-link a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 15px 25px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53, #ff6b6b);
    background-size: 200% 200%;
    border-radius: 30px;
    box-shadow: 
        0 8px 25px rgba(255, 107, 107, 0.4),
        0 0 20px rgba(255, 142, 83, 0.3);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: recordsFloat 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.admin-link a::before {
    content: '📋';
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.admin-link a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.admin-link a:hover {
    transform: translateY(-3px) scale(1.05);
    background-position: 100% 0;
    box-shadow: 
        0 15px 35px rgba(255, 107, 107, 0.5),
        0 0 30px rgba(255, 142, 83, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.admin-link a:hover::after {
    left: 100%;
}

.admin-link a:active {
    transform: translateY(-1px) scale(1.02);
}

/* 浮动动画 */
@keyframes recordsFloat {
    0%, 100% { 
        transform: translateY(0px);
        box-shadow: 
            0 8px 25px rgba(255, 107, 107, 0.4),
            0 0 20px rgba(255, 142, 83, 0.3);
    }
    50% { 
        transform: translateY(-5px);
        box-shadow: 
            0 12px 30px rgba(255, 107, 107, 0.5),
            0 0 25px rgba(255, 142, 83, 0.4);
    }
}

/* 脉冲提示效果 */
.admin-link a::before {
    animation: iconPulse 2s ease-in-out infinite;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .selection-title {
        font-size: 1.5rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .category-card {
        padding: 20px 15px;
    }
    
    .category-name {
        font-size: 1.1rem;
    }
    
    .lottery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        min-height: 500px;
    }
    
    .red-packet {
        width: 120px;
        height: 160px;
    }
    
    .packet-icon {
        font-size: 2.5rem;
    }
    
    .packet-text {
        font-size: 1.1rem;
    }
    
    .amount {
        font-size: 1.7rem;
    }
    
    .modal {
        padding: 30px 20px;
        width: 95%;
    }
    
    .prize-title {
        font-size: 1.5rem;
    }
    
    .prize-amount {
        font-size: 2.5rem;
    }
    
    /* 参与记录按钮平板优化 */
    .admin-link a {
        padding: 14px 22px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .selection-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 10px;
    }
    
    .category-card {
        padding: 15px 10px;
        border-radius: 15px;
    }
    
    .category-icon {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    
    .category-name {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .category-desc {
        font-size: 0.7rem;
        margin-bottom: 8px;
        line-height: 1.2;
    }
    
    .category-amount {
        font-size: 0.9rem;
        padding: 6px 10px;
        border-radius: 10px;
    }
    
    .lottery-grid {
        gap: 10px;
        min-height: 420px;
    }
    
    .red-packet {
        width: 100px;
        height: 130px;
    }
    
    .packet-icon {
        font-size: 2.2rem;
        margin-bottom: 8px;
    }
    
    .packet-text {
        font-size: 1rem;
    }
    
    .amount {
        font-size: 1.5rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .verify-btn {
        width: 100%;
    }
    
    /* 参与记录按钮移动端优化 */
    .admin-link {
        bottom: 15px;
        right: 15px;
    }
    
    .admin-link a {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 25px;
    }
    
    .admin-link a::before {
        font-size: 16px;
    }
} 