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

:root {
    --primary-color: #ff6b35;
    --primary-dark: #e55025;
    --primary-light: #ff8c42;
    --secondary-color: #feca57;
    --accent-color: #ff9f43;
    --success-color: #26de81;
    --warning-color: #fed330;
    --danger-color: #fc5c65;
    --dark-bg: #2c3e50;
    --light-bg: #ecf0f1;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #dfe6e9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0. 2, 1);
    --gradient-1: linear-gradient(135deg, #ff6b35 0%, #feca57 100%);
    --gradient-2: linear-gradient(135deg, #fc5c65 0%, #eb3b5a 100%);
    --gradient-3: linear-gradient(135deg, #feca57 0%, #fed330 100%);
    --gradient-4: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
    --gradient-5: linear-gradient(135deg, #ff9f43 0%, #fc5c65 100%);
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ff6b35 0%, #feca57 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* 动态背景粒子效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 219, 98, 0.2) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-20px, -20px) rotate(1deg); }
    66% { transform: translate(20px, -10px) rotate(-1deg); }
}

/* 表情下落效果 */
.emoji-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.emoji {
    position: absolute;
    font-size: 24px;
    animation: fall linear infinite;
    opacity: 0.8;
    filter: blur(0.5px);
    transition: opacity 0.3s ease;
}

.emoji:hover {
    opacity: 1;
    filter: none;
    transform: scale(1.2);
}

@keyframes fall {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    95% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes sway {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-30px); }
    75% { transform: translateX(30px); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 50px;
    animation: fadeInDown 0.8s ease-out;
    position: relative;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 10px;
    letter-spacing: 2px;
    animation: float 3s ease-in-out infinite;
    position: relative;
    display: inline-block;
}

header h1::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -25px;
    right: -25px;
    bottom: -15px;
    background: linear-gradient(
        45deg,
        rgba(255, 107, 53, 0.15),
        rgba(254, 202, 87, 0.15),
        rgba(255, 159, 67, 0.15),
        rgba(236, 72, 153, 0.15),
        rgba(252, 92, 101, 0.15),
        rgba(69, 183, 209, 0.15),
        rgba(72, 219, 251, 0.15)
    );
    background-size: 300% 300%;
    border-radius: 25px;
    z-index: -1;
    animation: flowing-light 4s ease-in-out infinite;
}

header h1::after {
    content: '✨ ⭐ ✨';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    letter-spacing: 8px;
    animation: sparkle-pulse 2s ease-in-out infinite;
    z-index: 1;
    white-space: nowrap;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.5));
        transform: scale(1);
    }
    to {
        filter: drop-shadow(0 0 25px rgba(236, 72, 153, 0.8));
        transform: scale(1.02);
    }
}

@keyframes rainbow-flow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes text-glow {
    0% {
        filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.8))
               drop-shadow(0 0 40px rgba(78, 205, 196, 0.6))
               drop-shadow(0 0 60px rgba(69, 183, 209, 0.4));
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    }
    25% {
        filter: drop-shadow(0 0 20px rgba(254, 202, 87, 0.8))
               drop-shadow(0 0 40px rgba(72, 219, 251, 0.6))
               drop-shadow(0 0 60px rgba(255, 107, 157, 0.4));
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(248, 181, 0, 0.8))
               drop-shadow(0 0 40px rgba(0, 210, 211, 0.6))
               drop-shadow(0 0 60px rgba(255, 99, 72, 0.4));
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    }
    75% {
        filter: drop-shadow(0 0 20px rgba(162, 155, 254, 0.8))
               drop-shadow(0 0 40px rgba(253, 121, 168, 0.6))
               drop-shadow(0 0 60px rgba(108, 92, 231, 0.4));
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    }
    100% {
        filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.8))
               drop-shadow(0 0 40px rgba(78, 205, 196, 0.6))
               drop-shadow(0 0 60px rgba(69, 183, 209, 0.4));
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.1; }
    50% { transform: scale(1.05); opacity: 0.2; }
}

@keyframes flowing-light {
    0%, 100% {
        background-position: 0% 50%;
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
    25% {
        background-position: 50% 25%;
        transform: scale(1.02) rotate(0.5deg);
        filter: brightness(1.1);
    }
    50% {
        background-position: 100% 50%;
        transform: scale(1.03) rotate(0deg);
        filter: brightness(1.2);
    }
    75% {
        background-position: 50% 75%;
        transform: scale(1.02) rotate(-0.5deg);
        filter: brightness(1.1);
    }
}

@keyframes sparkle-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.2);
    }
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 25px;
    border-radius: 25px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 15px;
    animation: float 3s ease-in-out infinite;
    position: relative;
}

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

@keyframes subtitle-glow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 0 20px rgba(72, 219, 251, 0.3),
                   inset 0 0 20px rgba(255, 255, 255, 0.1);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 30px rgba(255, 107, 157, 0.5),
                   inset 0 0 30px rgba(254, 202, 87, 0.2);
    }
}

@keyframes border-flow {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.3);
    }
    25% {
        border-color: rgba(72, 219, 251, 0.4);
    }
    50% {
        border-color: rgba(255, 107, 157, 0.4);
    }
    75% {
        border-color: rgba(254, 202, 87, 0.4);
    }
}

/* 通用区块样式 */
section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    transition: transform 0.3s ease;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: 20px 20px 0 0;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-2);
    border-radius: 2px;
    transition: width 0.3s ease;
}

section:hover h2::after {
    width: 100%;
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    user-select: none;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

.btn-secondary {
    background: var(--gradient-2);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(254, 202, 87, 0.3);
}

.btn-secondary:hover {
    background: var(--gradient-3);
    box-shadow: 0 8px 25px rgba(255, 159, 67, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f87171, var(--danger-color));
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.5);
}

.btn-large {
    font-size: 18px;
    padding: 16px 32px;
    border-radius: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 魔法按钮效果 */
.btn-magic {
    background: var(--gradient-5);
    position: relative;
    overflow: hidden;
}

.btn-magic::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.btn-magic:hover::after {
    animation: magic 0.5s ease-in-out;
}

@keyframes magic {
    0% {
        top: -50%;
        left: -50%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        top: 150%;
        left: 150%;
        opacity: 0;
    }
}

/* 标签页样式 */
.input-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(255, 107, 53, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* 文本输入区域 */
.word-manager textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    background: var(--light-bg);
}

.word-manager textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.input-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* 快速添加样式 */
.quick-add-container {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
}

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

#quickWordInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--card-bg);
}

#quickWordInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.quick-word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    min-height: 60px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 2px dashed var(--border-color);
}

.quick-word-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    animation: slideInLeft 0.3s ease-out;
}

.quick-word-item .remove-word {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.quick-word-item .remove-word:hover {
    opacity: 1;
}

.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 导入功能样式 */
.import-container {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
}

.import-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--card-bg);
}

.import-area:hover {
    border-color: var(--primary-color);
    background: rgba(255, 107, 53, 0.05);
}

.import-area.dragover {
    border-color: var(--primary-color);
    background: rgba(255, 107, 53, 0.1);
    transform: scale(1.02);
}

.import-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.6;
}

.import-placeholder p {
    margin: 5px 0;
    color: var(--text-primary);
    font-weight: 500;
}

.import-hint {
    font-size: 0.9rem;
    color: var(--text-secondary) !important;
    font-weight: 400 !important;
}

.import-preview {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 2px solid var(--primary-color);
}

.import-preview h4 {
    margin: 0 0 15px 0;
    color: var(--primary-color);
}

#importPreviewContent {
    max-height: 200px;
    overflow-y: auto;
    background: var(--light-bg);
    padding: 15px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    white-space: pre-line;
    margin-bottom: 15px;
}

.import-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 统计信息样式 */
.word-stats {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    color: white;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .input-tabs {
        gap: 2px;
    }

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

    .quick-input-group {
        flex-direction: column;
    }

    .word-stats {
        gap: 15px;
        justify-content: space-around;
    }

    .stat-item {
        min-width: 80px;
    }

    .stat-value {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .word-stats {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .stat-item {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        min-width: auto;
    }
}

/* 游戏模式选择 */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.mode-btn {
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.mode-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
    transition: left 0.5s;
}

.mode-btn:hover::after {
    left: 100%;
}

.mode-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.mode-btn.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 107, 53, 0.05));
    transform: scale(1.05);
}

.mode-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

.mode-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.mode-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 游戏区域 */
.game-area {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-mode {
    display: none;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.game-mode.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* 幸运转盘样式 */
.slot-container {
    text-align: center;
}

.slot-window {
    background: linear-gradient(135deg, #1e3a8a, #1e1b4b);
    border-radius: 20px;
    padding: 30px;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 4px solid #fbbf24;
    position: relative;
    overflow: hidden;
}

.slot-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.3), transparent);
    animation: slotShine 3s infinite;
}

@keyframes slotShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.slot-reel {
    height: 80px;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-item {
    font-size: 2.5rem;
    font-weight: bold;
    color: #fbbf24;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
    animation: pulse 1.5s infinite;
}

.slot-reel.spinning {
    animation: slotSpin 0.1s linear infinite;
}

@keyframes slotSpin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}


/* 卡牌样式 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

.card {
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    box-shadow: var(--shadow-lg);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: bold;
    color: white;
}

.card-back {
    background: linear-gradient(135deg, #1e3a8a, #1e1b4b);
    border: 2px solid #fbbf24;
}

.card-back {
    background: linear-gradient(135deg, #1e3a8a, #1e1b4b);
    border: 2px solid #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.card-back-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(251, 191, 36, 0.1) 10px, rgba(251, 191, 36, 0.1) 20px),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(251, 191, 36, 0.1) 10px, rgba(251, 191, 36, 0.1) 20px);
}

.card-back-text {
    font-size: 2rem;
    color: #fbbf24;
    font-weight: bold;
    z-index: 2;
}

.card-front {
    background: linear-gradient(135deg, #10b981, #059669);
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.card-word {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    word-break: break-all;
}

.no-cards {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 40px;
    font-size: 1.1rem;
}

/* 刮刮乐样式 */
.lottery-container {
    text-align: center;
}

.lottery-card {
    position: relative;
    width: 300px;
    height: 150px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 3px solid #fbbf24;
    cursor: crosshair;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

#scratchCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.lottery-result {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 移除背景色，让刮开后能看到卡片本身的背景 */
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--dynamic-font-size, 2rem);
    font-weight: bold;
    color: #7c2d12;
    z-index: 1;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    padding: 2px;
    box-sizing: border-box;
    overflow: hidden;
    /* 让单词真正占满空间 */
    text-align: center;
    line-height: 1.0;
    /* 确保不会换行 */
    white-space: nowrap;
    /* 动态字体大小计算的基础样式 */
    --dynamic-font-size: 60px;
}

/* 响应式字体大小调整 */
@media (max-width: 768px) {
    .lottery-result {
        --dynamic-font-size: var(--mobile-font-size, 50px);
    }
}

@media (max-width: 480px) {
    .lottery-result {
        --dynamic-font-size: var(--small-font-size, 40px);
    }
}

/* 英文单词的特殊处理 */
.lottery-result[data-is-english="true"] {
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 控制按钮区域 */
.controls {
    text-align: center;
}

.control-group {
    margin-bottom: 20px;
}

.control-group.hidden {
    display: none;
}

.interactive-hint {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: hintPulse 2s infinite;
}

.interactive-hint p {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@keyframes hintPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-lg);
    }
    50% {
        transform: scale(1.02);
        box-shadow: var(--shadow-xl);
    }
}

.secondary-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 结果显示 */
.result-display {
    text-align: center;
    animation: zoomIn 0.5s ease-out;
}

.result-display.hidden {
    display: none;
}

.result-word {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 20px 0;
    animation: resultGlow 2s ease-in-out infinite;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    padding: 0 10px;
    text-align: center;
}

@keyframes resultGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 30px rgba(255, 107, 53, 0.8);
        transform: scale(1.05);
    }
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* 历史记录 */
.history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background: var(--light-bg);
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--card-bg);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    animation: slideInLeft 0.3s ease-out;
}

.history-word {
    font-weight: 600;
    color: var(--primary-color);
}

.history-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.no-history {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* 对话框样式 */
.dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.dialog.hidden {
    display: none;
}

.dialog-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: dialogSlideIn 0.3s ease-out;
}

.dialog-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

.share-content {
    text-align: center;
    margin: 20px 0;
}

.share-result {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    background: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* 动画定义 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -15px, 0);
    }
    70% {
        transform: translate3d(0, -7px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    section {
        padding: 20px;
        margin-bottom: 20px;
    }

    .mode-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .mode-btn {
        padding: 15px 10px;
    }

    .mode-icon {
        font-size: 2rem;
    }

    .result-word {
        font-size: 2rem;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        padding: 0 5px;
    }

  
    .lottery-card {
        width: 250px;
        height: 125px;
    }

    .secondary-controls {
        flex-direction: column;
        align-items: center;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .mode-grid {
        grid-template-columns: 1fr;
    }

    .card-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .input-actions {
        flex-direction: column;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .btn-large {
        font-size: 16px;
        padding: 14px 28px;
    }

    .result-word {
        font-size: 1.5rem;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        padding: 0 5px;
        line-height: 1.2;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 成功/错误提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideInRight 0.3s ease-out;
}

.toast.success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.toast.info {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ICP备案信息样式 */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.icp-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.icp-info p {
    margin: 5px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.icp-info a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.icp-info a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}