:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --warning-color: #f97316;
    
    --bg-primary: rgba(248, 250, 252, 0.95);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-tertiary: rgba(241, 245, 249, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.25);
    --bg-glass-hover: rgba(255, 255, 255, 0.35);
    --bg-dark-glass: rgba(0, 0, 0, 0.1);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: rgba(226, 232, 240, 0.3);
    --border-light: rgba(241, 245, 249, 0.3);
    --border-glass: rgba(255, 255, 255, 0.18);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glass: 0 8px 32px rgba(31, 38, 135, 0.37);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    --glass-blur: blur(16px);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

/* 移动端滚动优化 */
body.mobile {
    -webkit-overflow-scrolling: touch;
    background-attachment: scroll; /* 移动端使用scroll以提高性能 */
}

html {
    scroll-behavior: smooth;
}

@supports (backdrop-filter: blur(10px)) {
    body {
        background: 
            radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
            linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        background-attachment: fixed;
    }
}

#game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    scroll-margin-top: 0;
    position: relative;
}

/* 确保游戏内容区域有足够的滚动空间 */
.game-main {
    flex: 1;
    padding: 2rem;
    position: relative;
    min-height: calc(100vh - 80px); /* 减去header高度 */
}

/* 设备检测和响应式断点 */
.mobile-only { display: none; }
.tablet-only { display: none; }
.desktop-only { display: block; }

/* 设备特定优化 */
@media (hover: none) and (pointer: coarse) {
    /* 触摸设备优化 */
    .mobile-only { display: block; }
    .desktop-only { display: none; }
    
    /* 增大触摸目标 */
    button, .level-item, .mode-card {
        min-height: 44px;
    }
}

@media (hover: hover) and (pointer: fine) {
    /* 鼠标设备优化 */
    .desktop-only { display: block; }
    .mobile-only { display: none; }
}

/* Glass morphism effects */
.glass {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--shadow-glass);
}

.glass-strong {
    background: var(--bg-glass-hover);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--shadow-glass);
}

/* 头部样式 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: var(--glass-border);
    box-shadow: var(--shadow-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all var(--transition-normal);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.level-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.9rem;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 4px;
    transition: width var(--transition-normal);
    width: 0%;
}

.header-right {
    display: flex;
    gap: 1.5rem;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stats-item i {
    color: var(--primary-color);
}

/* 主游戏区域 */
.game-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.screen {
    width: 100%;
    max-width: 900px;
    transition: all var(--transition-slow);
}

.screen.hidden {
    display: none;
}

/* 欢迎屏幕 */
.welcome-content {
    text-align: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
}

.game-title {
    margin-bottom: 1rem;
}

.title-en {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-zh {
    display: block;
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0.5rem;
}

.game-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: transform var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 按钮样式 */
.cta-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-button {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-button:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-button.secondary {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.action-button.show-answer {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.action-button.show-answer:hover {
    background: #ea580c;
    border-color: #ea580c;
    color: white;
}

.answer-display {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--warning-color);
    color: white;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
}

.answer-display.show {
    opacity: 1;
    transform: translateY(0);
}

.answer-display i {
    margin-right: 0.5rem;
}

/* 游戏屏幕 */
.word-display-area {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
}

.word-card {
    text-align: center;
}

.word-meaning {
    margin-bottom: 2rem;
}

.meaning-text {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.meaning-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.meaning-hint.show {
    opacity: 1;
}

.example-sentence {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-color);
    font-size: 1.1rem;
    line-height: 1.5;
    min-height: 60px;
}

.example-sentence i {
    color: var(--primary-color);
    font-size: 1rem;
    flex-shrink: 0;
}

.example-word-blank {
    display: inline-block;
    border-bottom: 2px solid var(--primary-color);
    min-width: 50px;
    height: 2px;
    background: var(--primary-color);
    margin: 0 2px;
    position: relative;
    top: 2px;
}

.typing-area {
    margin-bottom: 2rem;
}

.word-input {
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1.25rem;
    text-align: center;
    transition: all var(--transition-normal);
    background: var(--bg-tertiary);
}

.word-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

.word-input.correct {
    border-color: var(--secondary-color);
    background: rgb(16 185 129 / 0.1);
}

.word-input.incorrect {
    border-color: var(--danger-color);
    background: rgb(239 68 68 / 0.1);
    animation: shake 0.5s ease-in-out;
}

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

.input-feedback {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

.word-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* 反馈区域 */
.feedback-area {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.typing-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* 结果屏幕 */
.result-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.result-header {
    margin-bottom: 2rem;
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: bounce 0.6s ease-in-out;
}

.result-icon i {
    font-size: 2rem;
    color: white;
}

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

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.result-stat {
    text-align: center;
}

.result-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.result-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 进度屏幕 */
.progress-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

.progress-content h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

.level-progress {
    margin-bottom: 2rem;
}

.level-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.level-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.level-details h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.level-details p {
    color: var(--text-secondary);
}

.mastery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.mastery-word {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.mastery-word.mastered {
    background: var(--secondary-color);
    color: white;
}

.mastery-word.learning {
    background: var(--accent-color);
    color: white;
}

.mastery-word.new {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.progress-stat i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.stat-title {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-number {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* 通知系统 */
.notification-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    pointer-events: none;
}

.notification {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    pointer-events: auto;
    max-width: 300px;
}

.notification.success {
    border-left: 4px solid var(--secondary-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

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

/* 模态框 */
.modal {
    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;
    padding: 2rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    animation: modalIn 0.3s ease-out;
}

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

.level-up-animation {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: pulse 1s ease-in-out infinite;
}

.level-up-animation i {
    font-size: 2rem;
    color: white;
}

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

.level-up-rewards {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.reward-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-left,
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .progress-bar {
        width: 150px;
    }
    
    .game-main {
        padding: 1rem;
    }
    
    .welcome-content,
    .result-content,
    .progress-content {
        padding: 2rem 1.5rem;
    }
    
    .title-en {
        font-size: 2rem;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .typing-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .meaning-text {
        font-size: 1.5rem;
    }
    
    .word-input {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}

/* 词汇管理样式 */
.vocabulary-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.vocabulary-header {
    text-align: center;
    margin-bottom: 2rem;
}

.vocabulary-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.vocabulary-header p {
    color: var(--text-secondary);
}

.vocabulary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-group {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.action-group h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.action-group button {
    width: 100%;
    margin-bottom: 0.5rem;
}

.action-button.danger {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.action-button.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.vocabulary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card i {
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-card .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.vocabulary-list-container {
    margin-bottom: 2rem;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.list-header h3 {
    font-size: 1.25rem;
}

.list-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    width: 200px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.vocabulary-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}

.word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.word-item:hover {
    background: var(--bg-tertiary);
}

.word-item:last-child {
    border-bottom: none;
}

.word-info {
    flex: 1;
}

.word-en {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

.word-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 0.25rem;
}

.word-level {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.word-level.custom {
    background: var(--accent-color);
}

.word-actions {
    display: flex;
    gap: 0.5rem;
}

.word-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.progress-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color var(--transition-normal);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* 预设词汇包样式 */
.preset-list {
    margin: 1.5rem 0;
}

.preset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    transition: all var(--transition-normal);
}

.preset-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
}

.preset-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.preset-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.preset-badge {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.preset-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-normal);
}

.preset-btn:hover {
    background: var(--primary-dark);
}

/* 上传格式说明样式 */
.upload-formats {
    margin: 1.5rem 0;
}

.format-info {
    margin-bottom: 2rem;
}

.format-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.format-info pre {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-color);
    overflow-x: auto;
}

.format-info code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* 响应式词汇管理 */
@media (max-width: 768px) {
    .vocabulary-content {
        padding: 1.5rem;
    }
    
    .vocabulary-actions {
        grid-template-columns: 1fr;
    }
    
    .vocabulary-stats {
        grid-template-columns: 1fr;
    }
    
    .list-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .list-filters {
        justify-content: space-between;
    }
    
    .search-input {
        width: auto;
        flex: 1;
    }
    
    .word-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .word-actions {
        justify-content: flex-end;
    }
    
    .preset-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

/* 设备特定样式 */
.device-mobile .tablet-only,
.device-mobile .desktop-only {
    display: none !important;
}

.device-mobile .mobile-only {
    display: block !important;
}

.device-tablet .mobile-only,
.device-tablet .desktop-only {
    display: none !important;
}

.device-tablet .tablet-only {
    display: block !important;
}

.device-desktop .mobile-only,
.device-desktop .tablet-only {
    display: none !important;
}

.device-desktop .desktop-only {
    display: block !important;
}

/* 设备特定适配 */
.device-mobile {
    --header-padding: 1rem;
    --card-padding: 1rem;
    --font-scale: 0.9;
}

.device-tablet {
    --header-padding: 1.25rem;
    --card-padding: 1.5rem;
    --font-scale: 1;
}

.device-desktop {
    --header-padding: 2rem;
    --card-padding: 2rem;
    --font-scale: 1;
}

/* Enhanced responsive design with better breakpoints */
@media (max-width: 1200px) {
    .desktop-only { display: none; }
    .tablet-only { display: block; }
    
    .game-header {
        padding: var(--header-padding, 1rem 1.5rem);
    }
    
    .game-modes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .welcome-content,
    .result-content,
    .progress-content {
        padding: calc(var(--card-padding, 1.5rem) * 1.5) var(--card-padding, 1.5rem);
    }
}

@media (max-width: 768px) {
    .tablet-only { display: none; }
    .mobile-only { display: block; }
    
    .game-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .header-left,
    .header-right {
        flex: 1;
        min-width: 0;
        justify-content: space-between;
    }
    
    .header-right {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .stats-item {
        font-size: 0.8rem;
        text-align: center;
    }
    
    .progress-bar {
        width: 120px;
    }
    
    .word-card {
        padding: 1.5rem;
        margin: 1rem 0.5rem;
    }
    
    .meaning-text {
        font-size: 1.5rem;
        line-height: 1.4;
    }
    
    .word-input {
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    .word-actions {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .action-button {
        flex: 1;
        min-width: calc(50% - 0.375rem);
    }
    
    .typing-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.75rem 0.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .game-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 1rem;
    }
    
    .header-left,
    .header-right {
        justify-content: center;
    }
    
    .progress-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .progress-bar {
        width: 100%;
        max-width: 200px;
    }
    
    .word-card {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .meaning-text {
        font-size: 1.25rem;
    }
    
    .word-input {
        font-size: 1rem;
        padding: 0.875rem;
    }
    
    .word-actions {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
        min-width: auto;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .typing-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .result-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 0;
        width: 100%;
        max-width: none;
        border-radius: var(--radius-lg);
    }
    
    /* 移动端游戏模式优化 */
    .game-modes {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .mode-card {
        padding: 1.5rem;
    }
    
    .mode-icon {
        font-size: 2.5rem;
    }
    
    .mode-card h3 {
        font-size: 1.1rem;
    }
    
    .mode-card p {
        font-size: 0.85rem;
    }
    
    /* 移动端关卡选择器优化 */
    .level-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .level-item {
        padding: 0.75rem;
    }
    
    .level-number {
        font-size: 1.2rem;
    }
    
    .level-name {
        font-size: 0.8rem;
    }
    
    .level-description {
        font-size: 0.7rem;
    }
    
    .level-progress {
        font-size: 0.65rem;
    }
}

/* Enhanced glass morphism for cards */
.word-card,
.feature-card,
.result-content,
.welcome-content,
.progress-content,
.vocabulary-content,
.level-item {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--shadow-glass);
    transition: all var(--transition-normal);
}

/* 游戏模式选择样式 */
.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.mode-card {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

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

.mode-card.selected {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-xl), 0 0 30px rgba(99, 102, 241, 0.4);
}

.mode-card.selected:hover {
    background: var(--primary-dark);
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.mode-card.selected .mode-icon {
    color: white;
}

.mode-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.mode-card p {
    margin-bottom: 1rem;
    opacity: 0.8;
    font-size: 0.9rem;
}

.mode-features {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 500;
}

.mode-card.selected .feature-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 关卡选择器样式 */
.level-selector {
    margin: 2rem 0;
    text-align: center;
    transition: all var(--transition-normal);
}

.level-selector.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.level-selector h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.level-item {
    padding: 1rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: center;
    position: relative;
    transition: all var(--transition-normal);
}

.level-item:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
}

.level-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-dark-glass);
}

.level-item.selected {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.4);
}

.level-item.selected:hover {
    background: var(--primary-dark);
}

.level-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.level-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.level-description {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.level-progress {
    font-size: 0.7rem;
    opacity: 0.9;
}

.level-item .lock-icon {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--text-muted);
}

.level-item.completed::after {
    content: '✓';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.word-card:hover,
.feature-card:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
}

/* Enhanced animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: var(--shadow-glass); }
    50% { box-shadow: var(--shadow-glass), 0 0 20px rgba(99, 102, 241, 0.4); }
}

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

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* Apply animations */
.screen {
    animation: fadeInScale 0.5s var(--transition-normal);
}

.word-card {
    animation: slideInUp 0.6s var(--transition-bounce);
}

.game-header {
    animation: slideInDown 0.4s var(--transition-normal);
}

.feature-card {
    animation: fadeInScale 0.5s var(--transition-normal);
    animation-delay: calc(var(--i, 0) * 0.1s);
}

.cta-button {
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.3);
}

.cta-button:active {
    transform: translateY(0);
}

/* Error states with animation */
.word-input.error {
    animation: shake 0.5s ease-in-out;
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Success states */
.word-input.success {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

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

/* Improved touch targets for mobile */
@media (max-width: 768px) {
    .cta-button,
    .action-button {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .word-input {
        min-height: 44px;
        font-size: 1.1rem;
    }
    
    .stats-item {
        min-height: 40px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 0.5rem;
    }
}

/* 主题切换按钮 */
.theme-toggle {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    color: var(--text-secondary);
    margin-left: 1rem;
}

.theme-toggle:hover {
    background: var(--bg-glass-hover);
    color: var(--primary-color);
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 1rem;
    transition: transform var(--transition-normal);
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

/* 暗色主题变量 */
:root[data-theme="dark"] {
    --bg-primary: rgba(15, 23, 42, 0.95);
    --bg-secondary: rgba(30, 41, 59, 0.95);
    --bg-tertiary: rgba(51, 65, 85, 0.95);
    --bg-glass: rgba(15, 23, 42, 0.4);
    --bg-glass-hover: rgba(30, 41, 59, 0.5);
    --bg-dark-glass: rgba(0, 0, 0, 0.3);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --border-color: rgba(51, 65, 85, 0.5);
    --border-light: rgba(30, 41, 59, 0.5);
    --border-glass: rgba(255, 255, 255, 0.15);
}

:root[data-theme="dark"] body {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    background-attachment: fixed;
}

:root[data-theme="dark"] @supports (backdrop-filter: blur(10px)) {
    body {
        background: 
            radial-gradient(circle at 20% 80%, rgba(30, 41, 59, 0.4) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(51, 65, 85, 0.4) 0%, transparent 50%),
            linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        background-attachment: fixed;
    }
}

/* 系统默认主题支持 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-primary: rgba(15, 23, 42, 0.95);
        --bg-secondary: rgba(30, 41, 59, 0.95);
        --bg-tertiary: rgba(51, 65, 85, 0.95);
        --bg-glass: rgba(15, 23, 42, 0.4);
        --bg-glass-hover: rgba(30, 41, 59, 0.5);
        --bg-dark-glass: rgba(0, 0, 0, 0.3);
        
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        
        --border-color: rgba(51, 65, 85, 0.5);
        --border-light: rgba(30, 41, 59, 0.5);
        --border-glass: rgba(255, 255, 255, 0.15);
    }
    
    :root:not([data-theme]) body {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        background-attachment: fixed;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --bg-glass: rgba(255, 255, 255, 0.9);
        --bg-glass-hover: rgba(255, 255, 255, 0.95);
        --border-glass: 2px solid #000;
    }
    
    .glass,
    .glass-strong {
        border: 2px solid var(--text-primary);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .feature-card:hover,
    .word-card:hover,
    .cta-button:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .game-header,
    .word-actions,
    .feedback-area,
    .result-actions,
    .progress-actions {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .word-card,
    .feature-card,
    .result-content {
        background: white;
        border: 1px solid black;
        box-shadow: none;
    }
}