/* 抽奖页面样式表 */

/* 字体导入 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    background: linear-gradient(to bottom right, #2D1B69, #0F2027, #1a1a2e);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    position: relative;
}

/* 自定义工具类 */
.content-auto {
    content-visibility: auto;
}

.text-shadow {
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.8);
}

.text-shadow-glow {
    text-shadow: 0 0 10px currentColor;
}

.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.neo {
    box-shadow: 
        5px 5px 15px rgba(0, 0, 0, 0.3),
        -5px -5px 15px rgba(255, 255, 255, 0.05);
}

.neo-inset {
    box-shadow: 
        inset 3px 3px 7px rgba(0, 0, 0, 0.3),
        inset -3px -3px 7px rgba(255, 255, 255, 0.05);
}

.prize-glow-diamond {
    box-shadow: 0 0 15px rgba(185, 242, 255, 0.8), 0 0 30px rgba(185, 242, 255, 0.4);
}

.prize-glow-gold {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.4);
}

.prize-glow-silver {
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.8), 0 0 30px rgba(192, 192, 192, 0.4);
}

.prize-glow-bronze {
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.8), 0 0 30px rgba(205, 127, 50, 0.4);
}

.gradient-text {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

/* 背景元素 */
.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: none;
}

.shine {
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    background-size: 200px 100%;
    animation: shine 2s ease-in-out infinite;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #00D9FF;
}

input:checked + .slider:before {
    transform: translateX(30px);
}

/* 3D效果 */
.badge-3d {
    transform-style: preserve-3d;
    perspective: 500px;
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.card-3d:hover {
    transform: translateY(-10px) rotateX(5deg);
}

.modal-backdrop {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* 动画关键帧 */
@keyframes twinkle {
    from { opacity: 0.3; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes confetti-fall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes particle-rise {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100vh) scale(0.3); opacity: 0; }
}

@keyframes float-in {
    0% { transform: translateY(50px) scale(0.8); opacity: 0; }
    70% { transform: translateY(-10px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes shine {
    0% { background-position: -200px; }
    100% { background-position: 200px; }
}

/* 页面布局 */
.container {
    max-width: 6xl;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
}

/* 页面标题 */
header {
    text-align: center;
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: bold;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #00D9FF, #FF10F0, #B9F2FF);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

header p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #d1d5db;
    max-width: 2xl;
    margin: 0 auto;
}

/* 抽奖模式切换 */
.glass.rounded-2xl.p-1.mb-8 {
    position: relative;
    overflow: hidden;
}

.glass.rounded-2xl.p-1.mb-8 .flex {
    border-radius: 0.75rem;
    overflow: hidden;
}

.glass.rounded-2xl.p-1.mb-8 button {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    z-index: 10;
}

.glass.rounded-2xl.p-1.mb-8 button.active-mode {
    color: #00D9FF;
    font-weight: 600;
}

#mode-indicator {
    position: absolute;
    top: 0.25rem;
    left: 0.25rem;
    height: calc(100% - 0.5rem);
    width: calc(50% - 0.25rem);
    background: linear-gradient(to right, rgba(0, 217, 255, 0.2), rgba(108, 92, 231, 0.2));
    border-radius: 0.75rem;
    transition: all 0.3s;
}

/* 抽奖设置区域 */
.grid.grid-cols-1.lg\:grid-cols-3 {
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 左侧：抽奖参数设置 */
.glass.rounded-2xl.p-6.neo {
    height: 100%;
}

.glass.rounded-2xl.p-6.neo h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.glass.rounded-2xl.p-6.neo h2 i {
    margin-right: 0.5rem;
}

/* 表单元素 */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d1d5db;
}

textarea, input[type="text"], input[type="number"], select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    font-family: inherit;
    transition: all 0.3s;
}

textarea:focus, input[type="text"]:focus, input[type="number"]:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #00D9FF;
}

textarea {
    resize: none;
}

#name-count {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* 中间和右侧：抽奖区和结果区 */
.lg\:col-span-2 {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 抽奖区域 */
.glass.rounded-2xl.p-6.neo.relative {
    position: relative;
    overflow: hidden;
}

.glass.rounded-2xl.p-6.neo.relative .absolute {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.25rem;
    background: linear-gradient(to right, #00D9FF, #FF10F0);
}

#drawing-area {
    padding: 3rem 1rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

#drawing-animation {
    font-size: clamp(1.5rem, 5vw, 3rem);
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px currentColor;
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 按钮样式 */
.mt-8.flex.justify-center.gap-4 button {
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 500;
    color: white;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.mt-8.flex.justify-center.gap-4 button i {
    margin-right: 0.5rem;
}

.mt-8.flex.justify-center.gap-4 button:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

#start-draw {
    background: linear-gradient(to right, #00D9FF, #6C5CE7);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2);
}

#stop-draw {
    background: linear-gradient(to right, #FF10F0, #FF1744);
    box-shadow: 0 0 15px rgba(255, 16, 240, 0.2);
}

#start-draw:disabled, #stop-draw:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 结果展示区域 */
#prize-history {
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 10rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#prize-history .text-gray-400.text-center {
    padding: 2rem;
}

#prize-history .glass.rounded-lg.p-3 {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

#prize-history .flex.justify-between.items-center {
    margin-bottom: 0.5rem;
}

#prize-history .font-medium.text-sm {
    font-weight: 500;
    font-size: 0.875rem;
}

#prize-history .text-xs.text-gray-400 {
    font-size: 0.75rem;
    color: #9ca3af;
}

#prize-history .text-sm {
    font-size: 0.875rem;
}

#winners-container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    min-height: 30rem;
}

@media (min-width: 640px) {
    #winners-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    #winners-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

#winners-container .col-span-full.text-gray-400.text-center {
    padding: 3rem;
    grid-column: 1 / -1;
}

#winners-container .glass.rounded-xl.p-4 {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.5s;
}

#winners-container .glass.rounded-xl.p-4:hover {
    transform: scale(1.05);
}

#winners-container .text-2xl {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

#winners-container .font-bold.text-lg {
    font-weight: 700;
    font-size: 1.125rem;
}

#winners-container .text-xs.text-gray-400 {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 1.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-top: 3rem;
}

footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

footer p i.fa-heart {
    color: #FF10F0;
}

footer p i.fa-star {
    color: #FFD700;
}

/* 庆祝弹窗 */
#celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

#celebration-modal .relative {
    width: 100%;
    max-width: 3xl;
    margin: 0 1rem;
}

#close-celebration {
    position: absolute;
    top: -3rem;
    right: 0;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

#close-celebration:hover {
    background: rgba(0, 0, 0, 0.5);
}

#celebration-modal .glass.rounded-3xl.p-8 {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

#celebration-modal .absolute.top-0 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.5rem;
    background: linear-gradient(to right, #FFD700, #B9F2FF, #FF10F0);
}

#celebration-modal h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #FFD700, #B9F2FF);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

#celebration-modal p.text-center {
    text-align: center;
    color: #d1d5db;
    margin-bottom: 2rem;
}

#celebration-winners {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    #celebration-winners {
        grid-template-columns: repeat(3, 1fr);
    }
}

#celebration-winners .glass.rounded-xl.p-6 {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

#celebration-winners .w-16.h-16 {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: linear-gradient(to bottom right, rgba(185, 242, 255, 0.2), rgba(108, 92, 231, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

#celebration-winners .text-2xl {
    font-size: 1.5rem;
}

#celebration-winners h3 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
    background: linear-gradient(to right, white, #B9F2FF);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

#celebration-winners p.text-sm {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

#celebration-winners .px-3.py-1 {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

#celebration-modal .text-center {
    text-align: center;
}

#celebration-modal .text-center p {
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

#save-results {
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    color: white;
    background: linear-gradient(to right, #00E676, #00D9FF);
    transition: all 0.3s;
}

#save-results:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* 通知提示 */
#toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(5rem);
    opacity: 0;
    transition: all 0.3s;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#toast i {
    margin-right: 0.5rem;
}

#toast.text-success-green {
    color: #00E676;
}

#toast.text-error-red {
    color: #FF1744;
}

#toast.text-warning-orange {
    color: #FF9500;
}

#toast.text-electric-blue {
    color: #00D9FF;
}

/* 动画类 */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.animate-spin-slow {
    animation: spin 8s linear infinite;
}

.animate-shine {
    animation: shine 2s ease-in-out infinite alternate;
}

.animate-bounce-in {
    animation: bounce-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(108, 92, 231, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(108, 92, 231, 0.8), 0 0 30px rgba(0, 217, 255, 0.6);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce-in {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}
