/* 全局暗色系基础样式 */
body {
    font-family: "Microsoft YaHei", sans-serif;
    /* 暗黑渐变底色：深紫+深蓝+暗黑，更具科技感 */
    background: linear-gradient(135deg, #121212, #1a1a2e, #16213e);
    color: #fff;
    margin: 0;
    padding: 20px 0;
    min-height: 100vh;
    text-align: center;
    -webkit-tap-highlight-color: transparent; /* 手机点击不蓝 */
    /* 全局轻微发光效果，提升氛围感 */
    box-shadow: inset 0 0 100px rgba(10, 25, 70, 0.5);
}

.container {
    max-width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

h1 {
    font-size: clamp(1.8rem, 6vw, 2.5rem); /* 自适应字体 */
    margin-bottom: 20px;
    /* 霓虹文字阴影+渐变 */
    background: linear-gradient(90deg, #4cc9f0, #7209b7, #f72585);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 
        0 0 10px rgba(76, 201, 240, 0.5),
        0 0 20px rgba(114, 9, 183, 0.4),
        0 0 30px rgba(247, 37, 133, 0.3);
}

/* 九宫格外层容器 - 暗黑毛玻璃+霓虹边框 */
.lottery-wrapper {
    width: 100%;
    max-width: 420px;                 
    margin: 0 auto 30px;
    padding: 15px;                    
    /* 暗黑毛玻璃：深黑半透明 */
    background: rgba(20, 20, 40, 0.25);   
    backdrop-filter: blur(18px);             
    -webkit-backdrop-filter: blur(18px);     
    /* 霓虹边框+发光 */
    border: 1px solid rgba(76, 201, 240, 0.3);
    border-radius: 24px;                     
    box-shadow: 
        0 0 30px rgba(76, 201, 240, 0.15),
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 0 12px rgba(114, 9, 183, 0.1);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
/* 容器装饰光效 */
.lottery-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(247, 37, 133, 0.05), transparent);
    transform: translateX(-100%);
    animation: shine 3s infinite linear;
    pointer-events: none;
}
@keyframes shine {
    100% { transform: translateX(100%); }
}

/* 抽奖格子网格 - 支持动态列数 */
.lottery-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 3), 1fr);
    gap: clamp(6px, 2vw, 12px);
    width: 100%;
}

/* 抽奖按钮区域 */
.draw-btn-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 0 4px;
}
.draw-btn-area #drawBtn {
    padding: 14px clamp(28px, 8vw, 60px);
    background: linear-gradient(45deg, #7209b7, #f72585);
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    font-size: clamp(16px, 4.5vw, 24px);
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    box-shadow:
        0 0 28px rgba(247, 37, 133, 0.5),
        inset 0 0 12px rgba(255,255,255,0.2);
    text-shadow:
        0 0 10px rgba(255,255,255,0.9),
        0 0 22px rgba(76,201,240,0.7);
    transition: all 0.25s ease;
    letter-spacing: 2px;
}
.draw-btn-area #drawBtn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow:
        0 0 40px rgba(247,37,133,0.7),
        inset 0 0 16px rgba(255,255,255,0.3);
}
.draw-btn-area #drawBtn:active {
    transform: scale(0.97);
}
.draw-btn-area #drawBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    text-shadow: none;
    box-shadow: none;
}

/* 活动已结束遮罩 */
.activity-ended-overlay {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px 28px;
}
.activity-ended-icon {
    font-size: clamp(40px, 12vw, 64px);
    margin-bottom: 14px;
    filter: drop-shadow(0 0 10px rgba(255,215,0,0.5));
}
.activity-ended-message {
    font-size: clamp(15px, 4vw, 20px);
    color: #ffd700;
    font-weight: bold;
    line-height: 1.7;
    text-shadow: 0 0 12px rgba(255,215,0,0.4);
}

.item, .center {
    transform: translateZ(0);
    backface-visibility: hidden;
    background: rgba(30, 30, 50, 0.4);
    border: 2px solid rgba(76, 201, 240, 0.2);
    border-radius: 14px;
    backdrop-filter: blur(10px);              
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 1px 4px rgba(0,0,0,0.3),
        0 0 8px rgba(114, 9, 183, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    transition: all 0.3s ease;
}
/* 格子hover光效 */
.item:hover {
    border-color: rgba(247, 37, 133, 0.4);
    box-shadow: 0 0 15px rgba(247, 37, 133, 0.2);
}

.item img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.3));
}

.item span {
    position: absolute;
    bottom: 5%;
    left: 0; right: 0;
    font-size: clamp(10px, 2.5vw, 13px);
    /* 浅白文字+霓虹阴影 */
    color: rgba(255,255,255,0.9);
    text-shadow: 0 0 5px rgba(76, 201, 240, 0.5);
    font-weight: bold;
    text-align: center;
    padding: 0 4px;
    line-height: 1.2;
}

.center {
    background: linear-gradient(45deg, #7209b7, #f72585);
    border: 4px solid rgba(255,255,255,0.3);
    box-shadow: 
        0 0 25px rgba(247, 37, 133, 0.4),
        inset 0 0 10px rgba(255,255,255,0.2);
    font-size: clamp(20px, 5vw, 28px);
}

/* 选中状态 - 强化霓虹光效 */
.active {
    background: linear-gradient(45deg, #4cc9f0, #7209b7) !important;
    border: 4px solid #fff !important;
    box-shadow: 
        0 0 40px rgba(76, 201, 240, 0.6), 
        inset 0 0 20px #fff !important;
    transform: scale(1.05);
    animation: flash 0.6s infinite alternate;
}

@keyframes flash {
    from { opacity: 1; }
    to   { opacity: 0.8; }
}

/* 抽奖记录区域 - 暗黑风格 */
#records {
    width: 100%;
    max-width: 420px;                    
    margin: 0 auto 40px;                 
    background: rgba(20, 20, 40, 0.25);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(76, 201, 240, 0.3);
    border-radius: 24px;                 
    padding: 25px 20px;
    box-shadow: 
        0 0 30px rgba(76, 201, 240, 0.15),
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 0 12px rgba(114, 9, 183, 0.1);
    overflow: hidden;
    position: relative;
}
#records::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(76, 201, 240, 0.03), transparent);
    transform: translateX(-100%);
    animation: shine 4s infinite linear 1.5s;
    pointer-events: none;
}

#records h2 {
    margin: 0 0 15px 0;
    font-size: 1.4em;
    /* 渐变文字 */
    background: linear-gradient(90deg, #4cc9f0, #f72585);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(76, 201, 240, 0.2);
    padding-bottom: 10px;
}

#recordList {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;          
    overflow-y: auto;           
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 201, 240, 0.4) transparent;
}

#recordList li {
    background: rgba(30, 30, 50, 0.3);
    margin: 10px 0;
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    transition: all 0.3s;
    border: 1px solid rgba(76, 201, 240, 0.15);
}

#recordList li:hover {
    background: rgba(30, 30, 50, 0.5);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 15px rgba(0,0,0,0.3),
        0 0 10px rgba(247, 37, 133, 0.15);
    border-color: rgba(247, 37, 133, 0.3);
}

#recordList li.record-verified {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(56, 142, 60, 0.2));
    border: 1px solid rgba(129, 199, 132, 0.6);
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.25), inset 0 0 8px rgba(255,255,255,0.05);
}
#recordList li.record-verified .verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #4caf50, #388e3c);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 999px;
    margin-left: 8px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
#recordList li.record-verified .verified-date {
    display: block;
    font-size: 12px;
    color: rgba(129, 199, 132, 0.95);
    margin-top: 4px;
    margin-left: 0;
}
#recordList li.record-verified:hover {
    border-color: rgba(129, 199, 132, 0.8);
    box-shadow: 0 0 16px rgba(76, 175, 80, 0.35);
}

#recordList::-webkit-scrollbar {
    width: 6px;
}
#recordList::-webkit-scrollbar-track {
    background: rgba(30, 30, 50, 0.1);
    border-radius: 3px;
}
#recordList::-webkit-scrollbar-thumb {
    background: rgba(76, 201, 240, 0.4);
    border-radius: 3px;
}
#recordList::-webkit-scrollbar-thumb:hover {
    background: rgba(247, 37, 133, 0.5);
    box-shadow: 0 0 8px rgba(247, 37, 133, 0.3);
}

/* 中奖弹窗 - 暗黑霓虹风格 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);              
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal.show {
    opacity: 1;
}

/* 弹窗内容框 */
.modal-content {
    width: 90%;
    max-width: 360px;
    box-sizing: border-box;
    background: rgba(20, 20, 40, 0.4);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 28px;
    padding: 30px 28px;
    box-shadow: 
        0 0 50px rgba(76, 201, 240, 0.2),
        0 15px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 15px rgba(114, 9, 183, 0.1);
    text-align: center;
    color: #fff;
    position: relative;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.prize-modal-header {
    position: relative;
    height: 32px;
    margin-bottom: 4px;
}
.prize-modal-content .prize-modal-header .close {
    top: 0;
    right: 0;
}
.prize-modal-body {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}
.prize-modal-body h2,
.prize-modal-body p {
    text-align: center;
}
.prize-modal-body img,
.prize-modal-body button {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

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

/* 弹窗标题 - 金色霓虹渐变 */
.modal h2 {
    font-size: 2.2em;
    margin: 0 0 20px;
    background: linear-gradient(45deg, #ffd700, #ffec8b, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 2px 20px rgba(255, 215, 0, 0.5);
    animation: titleBounce 2s infinite ease-in-out;
}

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

/* 中奖图片入场动画 */
#prizeImg {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin: 20px auto;
    border-radius: 20px;
    box-shadow: 
        0 0 30px rgba(76, 201, 240, 0.4),
        0 10px 30px rgba(0,0,0,0.5);
    transform: rotate(-10deg) scale(0.8);
    opacity: 0;
    animation: prizePop 1.2s forwards 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes prizePop {
    to {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

#prizeDesc {
    white-space: pre-line;
    line-height: 1.6;
    margin: 8px 0 0 0;
}

/* 关闭按钮 */
.close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    color: rgba(255,255,255,0.8);
    background: rgba(50,50,80,0.9);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 10px rgba(247, 37, 133, 0.2);
    z-index: 10;
    user-select: none;
}

.close:hover {
    color: #fff;
    transform: rotate(90deg);
    text-shadow: 0 0 15px rgba(247, 37, 133, 0.5);
}

/* 确认按钮 - 霓虹渐变+强化光效 */
#confirmBtn {
    background: linear-gradient(45deg, #7209b7, #f72585);
    color: white;
    border: none;
    padding: 14px 50px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 25px;
    box-shadow: 
        0 0 20px rgba(247, 37, 133, 0.5),
        0 8px 25px rgba(0,0,0,0.3);
    transition: all 0.3s;
    animation: jumpBounce 2s infinite ease-in-out;
    text-shadow: 0 2px 5px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
}
/* 按钮流光效果 */
#confirmBtn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: btnShine 2s infinite linear;
}
@keyframes btnShine {
    100% { left: 100%; }
}

#confirmBtn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 0 30px rgba(247, 37, 133, 0.7),
        0 12px 35px rgba(0,0,0,0.4);
}

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

/* 底部浮动 Dock 栏 - 暗黑毛玻璃 */
.dock {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 40, 0.4);          
    backdrop-filter: blur(28px) saturate(180%); 
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(76, 201, 240, 0.2); 
    border-radius: 999px;                       
    padding: 10px 28px;
    display: flex;
    gap: 32px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(114, 9, 183, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.08);
    z-index: 1000;
    transition: all 0.4s ease;
}

/* 单个 Dock 项 */
.dock-item {
    color: rgba(200, 200, 220, 0.7);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 8px 14px;
    border-radius: 16px;
    min-width: 60px;
    backdrop-filter: blur(4px);
}

/* 激活 / hover 状态 - 霓虹光效 */
.dock-item.active,
.dock-item:hover {
    color: #4cc9f0;
    background: rgba(76, 201, 240, 0.12);
    transform: translateY(-6px) scale(1.08);
    box-shadow: 
        0 0 20px rgba(76, 201, 240, 0.4),
        0 12px 30px rgba(0,0,0,0.3);
}

/* 图标微调 */
.dock-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    stroke: currentColor;
    transition: transform 0.35s;
    filter: drop-shadow(0 0 5px rgba(76, 201, 240, 0.2));
}

.dock-item:hover svg,
.dock-item.active svg {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(76, 201, 240, 0.5));
}

/* 响应式适配 */
@media (max-width: 640px) {
    .dock {
        bottom: 8px;
        padding: 8px 20px;
        gap: 24px;
        border-radius: 999px;
        background: rgba(20, 20, 40, 0.45);
        backdrop-filter: blur(24px) saturate(160%);
    }
    .dock-item {
        font-size: 11px;
        min-width: 52px;
        padding: 6px 10px;
    }
    .dock-item svg {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 480px) {
    .lottery-wrapper,
    #records {
        max-width: 92%;                  
        padding: 12px;
        border-radius: 20px;
    }
    
    .lottery-grid {
        gap: 6px;
    }
    .lottery-wrapper {
        padding: 8px;
        border-radius: 16px;
    }
    .item, .center {
        border-width: 2px;
    }
    .item img {
        width: 55%;
        height: 55%;
    }
}

/* 大屏优化 */
@media (min-width: 768px) {
    .lottery-wrapper {
        max-width: 480px;
        padding: 20px;
    }
    .item img {
        width: 70%;
        height: 70%;
    }
}