/* 主题系统样式 - 支持多种视觉主题切换 */

/* 引入特殊字体 */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Space+Mono:wght@400;700&family=Comfortaa:wght@300;400;600;700&display=swap');

/* ===== 基础主题变量 ===== */
:root {
    /* 默认主题变量 */
    --theme-primary: #D92121;
    --theme-secondary: #FFD700;
    --theme-accent: #FF8C00;
    --theme-background: #FFF8F0;
    --theme-surface: #FFFFFF;
    --theme-text: #8B0000;
    --theme-text-light: #FFFFFF;
    --theme-gradient-from: #FFF8F0;
    --theme-gradient-to: #D92121;
    --theme-gradient-accent: #FFD700;
    --theme-font-primary: "Ma Shan Zheng", cursive, sans-serif;
    --theme-font-secondary: Inter, system-ui, sans-serif;
}

/* ===== 主题切换器UI样式 ===== */
.theme-switcher {
    position: relative;
    display: inline-block;
}

.theme-switcher-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--theme-secondary);
    border-radius: 25px;
    color: var(--theme-text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: 500;
}

.theme-switcher-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.theme-switcher-trigger i {
    font-size: 16px;
    color: var(--theme-secondary);
}

.theme-switcher-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: var(--theme-surface);
    border: 2px solid var(--theme-secondary);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 280px;
    backdrop-filter: blur(20px);
}

.theme-switcher.active .theme-switcher-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-options {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--theme-primary);
    transform: translateX(5px);
}

.theme-option.active {
    background: var(--theme-primary);
    border-color: var(--theme-secondary);
    color: var(--theme-text-light);
}

.theme-preview {
    width: 50px;
    height: 35px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.theme-colors {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 3px;
}

.color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

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

.theme-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--theme-text);
    line-height: 1.2;
}

.theme-desc {
    font-size: 12px;
    color: var(--theme-text);
    opacity: 0.7;
    line-height: 1.2;
}

.theme-option.active .theme-name,
.theme-option.active .theme-desc {
    color: var(--theme-text-light);
}

/* ===== 节日主题（默认） ===== */
.theme-festive {
    --theme-primary: #D92121;
    --theme-secondary: #FFD700;
    --theme-accent: #FF8C00;
    --theme-background: #FFF8F0;
    --theme-surface: #FFFFFF;
    --theme-text: #8B0000;
    --theme-text-light: #FFFFFF;
    --theme-gradient-from: #FFF8F0;
    --theme-gradient-to: #D92121;
    --theme-gradient-accent: #FFD700;
    --theme-font-primary: "Ma Shan Zheng", cursive, sans-serif;
}

.theme-festive body {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(217, 33, 33, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 140, 0, 0.1) 0%, transparent 50%);
    background-size: 200% 200%;
    animation: background-shift 40s ease infinite;
    font-family: var(--theme-font-secondary);
}

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

/* ===== 蹦迪主题 ===== */
.theme-disco {
    --theme-primary: #FF0080;
    --theme-secondary: #00FFFF;
    --theme-accent: #8000FF;
    --theme-background: #000011;
    --theme-surface: #001122;
    --theme-text: #FFFFFF;
    --theme-text-light: #00FFFF;
    --theme-gradient-from: #000011;
    --theme-gradient-to: #FF0080;
    --theme-gradient-accent: #00FFFF;
    --theme-font-primary: "Orbitron", "Arial Black", monospace;
}

.theme-disco body {
    background: linear-gradient(45deg, #000011, #FF0080, #00FFFF, #8000FF);
    background-size: 400% 400%;
    animation: disco-background 8s linear infinite;
    font-family: var(--theme-font-secondary);
    color: var(--theme-text-light);
}

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

@keyframes disco-gradient {
    0% { filter: hue-rotate(0deg) brightness(1); }
    100% { filter: hue-rotate(360deg) brightness(1.2); }
}

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

.theme-disco .core-info-card,
.theme-disco .lottery-3d-container {
    background: rgba(0, 17, 34, 0.9);
    border: 3px solid var(--theme-secondary);
    box-shadow: 
        0 8px 30px rgba(255, 0, 128, 0.3),
        0 0 30px rgba(0, 255, 255, 0.8),
        inset 0 0 20px rgba(255, 0, 128, 0.1);
    backdrop-filter: blur(10px);
    animation: disco-pulse 2s ease-in-out infinite;
}

.theme-disco .card-festive {
    box-shadow: 
        0 8px 30px rgba(255, 0, 128, 0.4),
        0 0 40px rgba(0, 255, 255, 0.6);
}

.theme-disco .text-shadow-festive {
    text-shadow: 
        0 0 10px var(--theme-secondary),
        0 0 20px var(--theme-secondary),
        0 0 30px var(--theme-primary);
}

/* ===== 温馨主题 ===== */
.theme-cozy {
    --theme-primary: #FF6B6B;
    --theme-secondary: #FFE66D;
    --theme-accent: #FF8E53;
    --theme-background: #FFF5E6;
    --theme-surface: #FFFFFF;
    --theme-text: #4A4A4A;
    --theme-text-light: #FFFFFF;
    --theme-gradient-from: #FFF5E6;
    --theme-gradient-to: #FF6B6B;
    --theme-gradient-accent: #FFE66D;
    --theme-font-primary: "Comfortaa", "Poppins", cursive, sans-serif;
}

.theme-cozy body {
    background: linear-gradient(135deg, #FFF5E6, #FFE66D, #FF6B6B);
    background-size: 300% 300%;
    animation: cozy-float 25s ease-in-out infinite;
    font-family: var(--theme-font-secondary);
}

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

@keyframes warm-glow {
    0% { filter: brightness(1) saturate(1); }
    100% { filter: brightness(1.1) saturate(1.1); }
}

@keyframes cozy-breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
}

.theme-cozy .core-info-card,
.theme-cozy .lottery-3d-container {
    background: rgba(255, 245, 230, 0.95);
    border: 3px solid var(--theme-secondary);
    box-shadow: 
        0 8px 30px rgba(255, 107, 107, 0.15),
        0 0 20px rgba(255, 230, 109, 0.4);
    animation: cozy-breathe 4s ease-in-out infinite;
}

.theme-cozy .card-festive {
    box-shadow: 
        0 8px 30px rgba(255, 107, 107, 0.2),
        0 0 25px rgba(255, 230, 109, 0.3);
}

.theme-cozy .text-shadow-festive {
    text-shadow: 
        0 2px 4px rgba(255, 107, 107, 0.3),
        0 0 15px rgba(255, 230, 109, 0.5);
}

/* ===== 星空主题 ===== */
.theme-starry {
    --theme-primary: #667eea;
    --theme-secondary: #764ba2;
    --theme-accent: #f093fb;
    --theme-background: #0c0c1e;
    --theme-surface: #1a1a2e;
    --theme-text: #FFFFFF;
    --theme-text-light: #a8b2d1;
    --theme-gradient-from: #0c0c1e;
    --theme-gradient-to: #667eea;
    --theme-gradient-accent: #f093fb;
    --theme-font-primary: "Space Mono", "Courier New", monospace;
}

.theme-starry body {
    background: 
        radial-gradient(circle at 20% 80%, #667eea 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, #764ba2 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, #0c0c1e 0%, #1a1a2e 100%);
    background-size: 300% 300%;
    animation: starry-twinkle 20s linear infinite;
    font-family: var(--theme-font-secondary);
    color: var(--theme-text-light);
}

@keyframes starry-twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes cosmic-flow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(180deg); }
}

@keyframes star-drift {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-20px); }
}

.theme-starry .core-info-card,
.theme-starry .lottery-3d-container {
    background: rgba(26, 26, 46, 0.9);
    border: 3px solid var(--theme-secondary);
    box-shadow: 
        0 8px 30px rgba(102, 126, 234, 0.2),
        0 0 25px rgba(240, 147, 251, 0.6);
    backdrop-filter: blur(10px);
}

.theme-starry .card-festive {
    box-shadow: 
        0 8px 30px rgba(102, 126, 234, 0.3),
        0 0 35px rgba(240, 147, 251, 0.4);
}

.theme-starry .text-shadow-festive {
    text-shadow: 
        0 0 10px var(--theme-secondary),
        0 0 20px var(--theme-accent),
        0 0 30px var(--theme-primary);
}

/* ===== 通用组件主题样式 ===== */

/* 按钮主题适配 */
.theme-disco button {
    background: linear-gradient(45deg, #FF0080, #00FFFF);
    border: 2px solid var(--theme-secondary);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.theme-cozy button {
    background: linear-gradient(135deg, #FF6B6B, #FFE66D);
    border: 2px solid var(--theme-secondary);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.theme-starry button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: 2px solid var(--theme-secondary);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

/* 输入框主题适配 */
.theme-disco input,
.theme-disco textarea {
    background: rgba(0, 17, 34, 0.8);
    border: 2px solid var(--theme-secondary);
    color: var(--theme-text-light);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.theme-cozy input,
.theme-cozy textarea {
    background: rgba(255, 245, 230, 0.9);
    border: 2px solid var(--theme-secondary);
    color: var(--theme-text);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.2);
}

.theme-starry input,
.theme-starry textarea {
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid var(--theme-secondary);
    color: var(--theme-text-light);
    box-shadow: 0 2px 15px rgba(102, 126, 234, 0.3);
}

/* 导航主题适配 */
.theme-disco #main-header {
    background: rgba(0, 17, 34, 0.9);
    border-bottom: 2px solid var(--theme-secondary);
    box-shadow: 0 5px 20px rgba(255, 0, 128, 0.3);
}

.theme-cozy #main-header {
    background: rgba(255, 245, 230, 0.95);
    border-bottom: 2px solid var(--theme-secondary);
    box-shadow: 0 3px 15px rgba(255, 107, 107, 0.2);
}

.theme-starry #main-header {
    background: rgba(26, 26, 46, 0.9);
    border-bottom: 2px solid var(--theme-secondary);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

/* ===== 响应式设计 ===== */

/* 平板设备 (768px 及以下) */
@media (max-width: 768px) {
    .theme-switcher-menu {
        right: -10px;
        left: auto;
        min-width: 260px;
        max-width: 280px;
    }
    
    .theme-option {
        padding: 10px;
        gap: 12px;
    }
    
    .theme-preview {
        width: 40px;
        height: 30px;
    }
    
    .theme-info {
        gap: 1px;
    }
    
    .theme-name {
        font-size: 13px;
    }
    
    .theme-desc {
        font-size: 11px;
    }

    /* 节日主题响应式 */
    .theme-festive .core-info-card,
    .theme-festive .lottery-3d-container {
        margin: 15px auto;
        padding: 20px;
        max-width: 95%;
    }

    /* 蹦迪主题响应式 */
    .theme-disco .core-info-card,
    .theme-disco .lottery-3d-container {
        margin: 15px auto;
        padding: 18px;
        max-width: 95%;
    }

    /* 温馨主题响应式 */
    .theme-cozy .core-info-card,
    .theme-cozy .lottery-3d-container {
        margin: 15px auto;
        padding: 18px;
        max-width: 95%;
    }

    /* 转盘游戏移动端响应式 */
    #lottery-wheel-game {
        padding: 10px;
    }

    /* 转盘容器移动端适配 */
    #lottery-wheel-game .relative {
        width: 280px;
        height: 280px;
    }

    #lottery-wheel-game .w-80.h-80 {
        width: 280px;
        height: 280px;
    }

    #lottery-wheel-game .w-96.h-96 {
        width: 280px;
        height: 280px;
    }

    /* 转盘按钮移动端适配 */
    #lottery-wheel-game #spin-wheel {
        width: 50px;
        height: 50px;
    }

    #lottery-wheel-game #spin-wheel span {
        font-size: 10px;
    }

    /* 转盘指针移动端适配 */
    #lottery-wheel-game .border-b-yellow-400 {
        border-bottom-width: 30px;
        border-left-width: 15px;
        border-right-width: 15px;
    }

    /* 游戏头部移动端适配 */
    #lottery-wheel-game .absolute.top-4 {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    #lottery-wheel-game .flex.space-x-4 {
        flex-direction: row;
        gap: 8px;
    }

    #lottery-wheel-game .bg-black\/30 {
        padding: 8px 12px;
    }

    #lottery-wheel-game .text-lg {
        font-size: 14px;
    }

    #lottery-wheel-game .text-sm {
        font-size: 12px;
    }
    
    /* 排行榜系统移动端响应式 */
    #ranking-panel {
        top: 80px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
        width: calc(100vw - 20px) !important;
    }

    #ranking-panel .bg-white {
        max-width: none;
        width: 100%;
    }

    #ranking-content {
        max-height: 300px;
    }

    .ranking-tab-btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    #ranking-content .space-y-3 > div {
        padding: 12px;
        margin-bottom: 8px;
    }

    #ranking-content .flex.items-center.space-x-3 {
        gap: 8px;
    }

    #ranking-content .text-2xl {
        font-size: 1.25rem;
    }

    #ranking-content .font-medium {
        font-size: 13px;
    }

    #ranking-content .text-xs {
        font-size: 10px;
    }

    #ranking-content .space-y-2 > div {
        padding: 8px;
    }

    #ranking-content .text-lg {
        font-size: 1rem;
    }

    #ranking-content .text-sm {
        font-size: 11px;
    }

    #lottery-wheel-game .text-xl {
        font-size: 16px;
    }

    /* 历史记录移动端适配 */
    #lottery-wheel-game .absolute.bottom-4 {
        left: 10px;
        right: 10px;
    }

    #lottery-wheel-game .bg-black\/30.backdrop-blur-sm {
        padding: 12px;
    }

    #lottery-wheel-game .flex.space-x-2 {
        flex-direction: column;
        gap: 6px;
    }

    /* 结果弹窗移动端适配 */
    #wheel-result-modal .bg-white {
        margin: 20px;
        padding: 20px;
        max-width: calc(100vw - 40px);
    }

    #wheel-result-modal .text-6xl {
        font-size: 3rem;
    }

    #wheel-result-modal .text-2xl {
        font-size: 1.5rem;
    }

    /* 转盘说明移动端适配 */
    #lottery-wheel-game .text-center.mt-8 {
        margin-top: 20px;
        padding: 0 10px;
    }

    #lottery-wheel-game .text-lg {
        font-size: 14px;
    }

    #lottery-wheel-game .text-sm {
        font-size: 12px;
    }

    /* 星空主题响应式 */
    .theme-starry .core-info-card,
    .theme-starry .lottery-3d-container {
        margin: 15px auto;
        padding: 18px;
        max-width: 95%;
    }

    /* 按钮响应式 */
    .theme-switcher-trigger {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .theme-switcher-trigger i {
        font-size: 15px;
    }
}

/* 手机设备 (480px 及以下) */
@media (max-width: 480px) {
    .theme-switcher-trigger {
        padding: 6px 10px;
        font-size: 12px;
        gap: 5px;
    }
    
    .theme-switcher-trigger i {
        font-size: 14px;
    }
    
    .theme-switcher-menu {
        right: -15px;
        left: auto;
        min-width: 240px;
        max-width: 260px;
        margin-top: 8px;
    }
    
    .theme-options {
        padding: 12px;
        gap: 8px;
    }
    
    .theme-option {
        padding: 8px;
        gap: 10px;
        border-radius: 8px;
    }
    
    .theme-preview {
        width: 35px;
        height: 25px;
        border-radius: 6px;
    }
    
    .color-dot {
        width: 6px;
        height: 6px;
    }

    /* 转盘游戏小屏手机适配 */
    #lottery-wheel-game .relative {
        width: 240px;
        height: 240px;
    }

    #lottery-wheel-game .w-80.h-80,
    #lottery-wheel-game .w-96.h-96 {
        width: 240px;
        height: 240px;
    }

    #lottery-wheel-game #spin-wheel {
        width: 40px;
        height: 40px;
    }

    #lottery-wheel-game #spin-wheel span {
        font-size: 9px;
    }

    /* 排行榜小屏适配 */
    #ranking-panel {
        top: 70px !important;
        right: 5px !important;
        left: 5px !important;
        width: calc(100vw - 10px) !important;
    }

    #ranking-content {
        max-height: 250px;
    }

    .ranking-tab-btn {
        font-size: 11px;
        padding: 6px 8px;
    }

    #ranking-content .space-y-3 > div {
        padding: 10px;
        margin-bottom: 6px;
    }

    #ranking-content .flex.items-center.space-x-3 {
        gap: 6px;
    }

    #ranking-content .text-2xl {
        font-size: 1.125rem;
    }

    #ranking-content .text-lg {
        font-size: 0.875rem;
    }

    #ranking-content .text-sm {
        font-size: 10px;
    }
}

/* 红包游戏小屏手机适配 */
    #red-envelope-game .absolute.top-4 {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }

    #red-envelope-game .flex.space-x-4 {
        flex-wrap: wrap;
        gap: 6px;
    }

    #red-envelope-game .bg-black\/30 {
        padding: 6px 10px;
    }

    #red-envelope-game .absolute.top-4.right-4 {
        flex-direction: column;
        gap: 6px;
        align-items: flex-end;
    }

    #red-envelope-game button {
        font-size: 12px;
        padding: 6px 10px;
    }

    #difficulty-modal .bg-white {
        margin: 10px;
        padding: 16px;
        max-width: calc(100vw - 20px);
    }

    #game-over-modal .bg-white {
        margin: 10px;
        padding: 16px;
        max-width: calc(100vw - 20px);
    }

    #difficulty-modal .space-y-3 > button {
        padding: 12px;
        margin-bottom: 8px;
    }

    #difficulty-modal .text-2xl {
        font-size: 1.5rem;
    }

    #game-over-modal .text-6xl {
        font-size: 3rem;
    }

    #game-over-modal .text-2xl {
        font-size: 1.5rem;
    }
    
    .theme-name {
        font-size: 12px;
        line-height: 1.1;
    }
    
    .theme-desc {
        font-size: 10px;
        line-height: 1.1;
    }

    /* 游戏容器响应式调整 */
    .theme-festive .game-container,
    .theme-disco .game-container,
    .theme-cozy .game-container,
    .theme-starry .game-container {
        margin: 10px;
        padding: 15px;
        border-radius: 12px;
        border-width: 2px;
    }

    /* 卡片响应式 */
    .theme-festive .core-info-card,
    .theme-disco .core-info-card,
    .theme-cozy .core-info-card,
    .theme-starry .core-info-card {
        margin: 12px auto;
        padding: 16px;
        border-radius: 12px;
        border-width: 2px;
    }

    /* 倒计时响应式 */
    .theme-festive .countdown-container,
    .theme-disco .countdown-container,
    .theme-cozy .countdown-container,
    .theme-starry .countdown-container {
        margin: 25px auto;
        padding: 20px;
        border-radius: 12px;
        max-width: 600px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .countdown-item {
        padding: 8px 12px;
        min-width: 60px;
        font-size: 20px;
        margin: 0 3px;
    }
/* 修复：移除多余的右大括号 */

/* 超小屏幕 (320px 及以下) */
@media (max-width: 320px) {
    .theme-switcher-menu {
        min-width: 220px;
        max-width: 240px;
        right: -20px;
    }
    
    .theme-option {
        padding: 6px;
        gap: 8px;
    }
    
    .theme-preview {
        width: 30px;
        height: 22px;
    }
    
    .color-dot {
        width: 5px;
        height: 5px;
    }
    
    .theme-name {
        font-size: 11px;
    }
    
    .theme-desc {
        font-size: 9px;
    }

    .countdown-item {
        padding: 6px 8px;
        min-width: 50px;
        font-size: 18px;
        margin: 0 2px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .theme-switcher-menu {
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .theme-option {
        padding: 6px 8px;
    }
    
    .theme-preview {
        width: 30px;
        height: 22px;
    }
    
    .theme-info {
        gap: 0;
    }
    
    .theme-name {
        font-size: 12px;
    }
    
    .theme-desc {
        font-size: 10px;
    }
}

/* 高分辨率屏幕优化 */
@media (min-width: 1200px) {
    .theme-switcher-menu {
        min-width: 300px;
    }
    
    .theme-option {
        padding: 15px;
        gap: 18px;
    }
    
    .theme-preview {
        width: 60px;
        height: 40px;
    }
    
    .theme-name {
        font-size: 15px;
    }
    
    .theme-desc {
        font-size: 13px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .theme-option {
        padding: 14px;
        margin: 2px 0;
        border-radius: 12px;
        min-height: 44px; /* 符合触摸目标最小尺寸 */
    }
    
    .theme-switcher-trigger {
        min-height: 44px;
        padding: 10px 16px;
    }
    
    .theme-option:hover {
        transform: none; /* 移除hover效果 */
    }
    
    .theme-option:active {
        transform: scale(0.98);
        background: rgba(255, 255, 255, 0.15);
    }
}

/* 打印样式优化 */
@media print {
    .theme-switcher,
    .theme-switcher-menu {
        display: none !important;
    }
    
    .theme-festive,
    .theme-disco,
    .theme-cozy,
    .theme-starry {
        background: white !important;
        color: black !important;
    }
    
    .core-info-card,
    .lottery-3d-container {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* 深色模式系统检测 */
@media (prefers-color-scheme: dark) {
    .theme-festive {
        --theme-background: #2a1810;
        --theme-surface: #3d2a20;
        --theme-text: #FFF8F0;
    }
}

/* ===== 游戏特定主题适配 ===== */
.theme-disco .game-container {
    background: rgba(0, 17, 34, 0.95);
    border: 3px solid var(--theme-secondary);
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.5),
        inset 0 0 20px rgba(255, 0, 128, 0.2);
}

.theme-cozy .game-container {
    background: rgba(255, 245, 230, 0.95);
    border: 3px solid var(--theme-secondary);
    box-shadow: 
        0 0 20px rgba(255, 230, 109, 0.4),
        inset 0 0 15px rgba(255, 107, 107, 0.1);
}

.theme-starry .game-container {
    background: rgba(26, 26, 46, 0.95);
    border: 3px solid var(--theme-secondary);
    box-shadow: 
        0 0 25px rgba(240, 147, 251, 0.5),
        inset 0 0 20px rgba(102, 126, 234, 0.2);
}

/* ===== 特殊效果 ===== */

/* 蹦迪主题霓虹灯效果 */
.theme-disco .neon-text {
    color: var(--theme-secondary);
    text-shadow: 
        0 0 5px var(--theme-secondary),
        0 0 10px var(--theme-secondary),
        0 0 20px var(--theme-secondary),
        0 0 40px var(--theme-primary);
    animation: neon-flicker 2s infinite alternate;
}

@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 
            0 0 5px var(--theme-secondary),
            0 0 10px var(--theme-secondary),
            0 0 20px var(--theme-secondary),
            0 0 40px var(--theme-primary);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* 温馨主题柔和光晕 */
.theme-cozy .soft-glow {
    box-shadow: 
        0 0 20px rgba(255, 230, 109, 0.4),
        0 0 40px rgba(255, 107, 107, 0.2),
        inset 0 0 20px rgba(255, 245, 230, 0.5);
}

/* 星空主题星空效果 */
.theme-starry .star-field {
    position: relative;
    overflow: hidden;
}

.theme-starry .star-field::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, var(--theme-secondary), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--theme-accent), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--theme-secondary), transparent),
        radial-gradient(1px 1px at 130px 80px, var(--theme-accent), transparent),
        radial-gradient(2px 2px at 160px 30px, var(--theme-secondary), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: star-drift 45s linear infinite;
    opacity: 0.6;
}

/* ===== 性能优化 ===== */
.theme-switcher *,
.theme-option *,
.core-info-card *,
.lottery-3d-container * {
    will-change: auto;
}

.theme-disco *,
.theme-cozy *,
.theme-starry * {
    will-change: transform, opacity;
}

/* 减少动画的媒体查询 */
@media (prefers-reduced-motion: reduce) {
    .theme-disco body,
    .theme-cozy body,
    .theme-starry body {
        animation: none;
    }
    
    .theme-disco .core-info-card,
    .theme-cozy .core-info-card,
    .theme-starry .core-info-card {
        animation: none;
    }
    
    .theme-switcher-trigger:hover {
        transform: none;
    }
}