/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-border: #e5e5e5;
    --color-text-primary: #374151;
    --color-text-secondary: #6b7280;
    --color-accent: #3b82f6;
    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --color-primary-light: #dbeafe;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-purple: #8b5cf6;
    --color-selected: #dbeafe;
    --color-correct: #d1fae5;
    --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);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    font-size: 18px;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
}

/* 顶部导航 */
.top-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.025em;
}

.header-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

/* 语言切换按钮特殊样式 */
#languageBtn {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

#languageBtn:hover {
    background: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    color: white;
}

.nav-btn svg {
    width: 16px;
    height: 16px;
}

/* 游戏状态栏 */
.game-status {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
}

.status-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.hearts {
    display: flex;
    gap: 0.25rem;
}

.heart {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-error);
    color: transparent;
    font-size: 0;
    transition: all 0.3s ease;
}

.heart.lost {
    background: var(--color-border);
}

.progress-text {
    font-weight: 600;
    color: var(--color-accent);
}

/* 今日通关统计 */
.daily-stats {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
}

.daily-stats-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.stats-icon {
    font-size: 1.25rem;
    opacity: 0.7;
}

.stats-text {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-align: center;
}

.stats-text strong {
    color: var(--color-accent);
    font-weight: 700;
    margin: 0 0.25rem;
}

/* 主游戏区域 */
.game-main {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 已解决的分组 */
.solved-groups {
    margin-bottom: 1rem;
}

.solved-group {
    color: white;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    animation: slideDown 0.5s ease-out;
    box-shadow: var(--shadow-md);
}

/* 不同分组的颜色方案 */
.solved-group:nth-child(1) {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.solved-group:nth-child(2) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.solved-group:nth-child(3) {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.solved-group:nth-child(4) {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.solved-group h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.solved-group .words {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

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

/* 词语网格 */
.word-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

/* 动态网格布局 */
.word-grid[data-count="1"] { grid-template-columns: 1fr; }
.word-grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.word-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.word-grid[data-count="4"] { grid-template-columns: repeat(4, 1fr); }

.word-card {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    min-height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.1;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    overflow-wrap: break-word;
}

/* 长单词自动调整字体大小 */
.word-card[data-length="long"] {
    font-size: 0.75rem;
    letter-spacing: 0.2px;
    padding: 0.5rem 0.25rem;
}

.word-card[data-length="very-long"] {
    font-size: 0.65rem;
    letter-spacing: 0.1px;
    padding: 0.4rem 0.2rem;
    line-height: 1.05;
}

.word-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.word-card.selected {
    background: var(--color-selected);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.word-card.correct {
    background: var(--color-correct);
    border-color: #a7f3d0;
    color: #065f46;
    pointer-events: none;
}

.word-card.error {
    background: #fecaca;
    border-color: var(--color-error);
    color: var(--color-error);
    animation: shake 0.3s ease-in-out;
}

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

/* 游戏控制区域样式 */
.game-controls {
    display: none; /* 隐藏整个控制区域 */
}

/* 难度选择器 */
.difficulty-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.difficulty-selector label {
    font-weight: 600;
    color: var(--color-text-primary);
}

.difficulty-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.difficulty-select:hover {
    border-color: var(--color-primary);
}

.difficulty-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* 生成模式切换开关 */
.generation-mode {
    display: flex;
    align-items: center;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border-radius: 12px;
    transition: background-color 0.3s ease;
}

.slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input[type="checkbox"]:checked + .slider {
    background: var(--color-primary);
}

.toggle-switch input[type="checkbox"]:checked + .slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-weight: 600;
    color: var(--color-text-primary);
}

/* 谜题信息显示 */
.puzzle-info {
    display: none !important; /* 强制隐藏谜题信息 */
}

/* 游戏操作按钮 */
.game-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* 基础控制按钮样式 */
.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.control-btn svg {
    width: 16px;
    height: 16px;
}

.submit-btn {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.submit-btn:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.submit-btn:disabled {
    background: var(--color-border);
    color: #9ca3af;
    border-color: var(--color-border);
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.secondary-btn:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 控制按钮增强样式 */
.control-btn.primary {
    background: var(--color-primary);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
}

.control-btn.primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 内容区域通用样式 */
.game-guide,
.faq-section,
.about-game {
    padding: 1.5rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.game-guide {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.faq-section {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.about-game {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

/* 标题样式 */
.guide-content h2,
.faq-content h2,
.about-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--color-text-primary);
}

/* 游戏指南区域 */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.guide-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--color-bg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.guide-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.guide-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.guide-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text-primary);
}

.guide-item p {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* 游戏技巧区域 */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.tip-category {
    background: var(--color-bg);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.tip-category h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.tip-category ul {
    list-style: none;
    padding: 0;
}

.tip-category li {
    padding: 0.5rem 0;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    position: relative;
    padding-left: 1.25rem;
    line-height: 1.5;
}

.tip-category li::before {
    content: "•";
    color: var(--color-accent);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* FAQ区域 */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    padding: 1rem 1rem 0;
}

.faq-answer {
    padding: 0 1rem 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-size: 0.875rem;
}

.faq-answer p {
    margin-bottom: 1rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.faq-groups {
    margin: 1rem 0;
}

.faq-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.faq-group-color {
    width: 1rem;
    height: 1rem;
    border-radius: var(--radius-sm);
}

.faq-group-color.yellow { background: #fbbf24; }
.faq-group-color.green { background: #10b981; }
.faq-group-color.blue { background: #3b82f6; }
.faq-group-color.purple { background: #8b5cf6; }

.faq-rules {
    margin: 1rem 0;
}

.faq-rule {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.faq-rule::before {
    content: counter(rule-counter);
    counter-increment: rule-counter;
    position: absolute;
    left: 0;
    top: 0;
    background: var(--color-accent);
    color: white;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.faq-rules {
    counter-reset: rule-counter;
}

/* 关于游戏区域 */
.about-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

.about-text strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* 页脚 */
.game-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 2rem 1rem 1rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

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

.footer-links h4,
.footer-tags h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    padding: 0.25rem 0;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--color-accent);
    transform: translateX(2px);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--color-bg);
    color: var(--color-text-secondary);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.footer-bottom {
    max-width: 800px;
    margin: 2rem auto 0;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    background: var(--color-surface);
}

.modal-header h2 {
    color: var(--color-text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

.modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.modal-body ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.modal-body h4 {
    color: var(--color-text-primary);
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

/* 模态框特定样式 */
.modal-groups {
    margin-top: 1.5rem;
}

.modal-group {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.modal-group h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.modal-group p {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 1rem 2rem 2rem 2rem;
    flex-shrink: 0;
    background: var(--color-surface);
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.primary-btn {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.primary-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.secondary-btn {
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.secondary-btn:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 玩法说明特定样式 */
.how-to-play-content {
    margin-bottom: 2rem;
}

.play-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-number {
    background: var(--color-accent);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--color-text-primary);
}

.step-content p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.difficulty-levels {
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
}

.difficulty-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.difficulty-color {
    width: 1rem;
    height: 1rem;
    border-radius: var(--radius-sm);
}

.difficulty-color.easy { background: var(--color-success); }
.difficulty-color.medium { background: var(--color-warning); }
.difficulty-color.hard { background: var(--color-error); }
.difficulty-color.expert { background: var(--color-purple); }

/* 关于页面特定样式 */
.about-content ul {
    list-style: none;
    padding: 0;
}

.about-content ul li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.about-content ul li::before {
    content: "✓";
    color: var(--color-success);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.version-info {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-top: 1.5rem;
}

.version-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.tutorial-content {
    text-align: left;
}

.tutorial-intro {
    font-size: 1.125rem;
    font-weight: 500;
    text-align: center;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        padding: 0 0.75rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav-btn {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .nav-btn span {
        display: none;
    }
    
    .intro-stats {
        flex-direction: column;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .status-content {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .word-grid {
        gap: 0.375rem;
        margin-bottom: 1rem;
    }
    
    .word-card {
        font-size: 0.8rem;
        padding: 0.65rem 0.4rem;
        min-height: 65px;
        font-weight: 700;
        letter-spacing: 0.25px;
        line-height: 1.05;
    }

    /* 移动端长单词样式 */
    .word-card[data-length="long"] {
        font-size: 0.65rem;
        letter-spacing: 0.15px;
        padding: 0.4rem 0.2rem;
    }

    .word-card[data-length="very-long"] {
        font-size: 0.55rem;
        letter-spacing: 0.1px;
        padding: 0.35rem 0.15rem;
        line-height: 1.0;
    }
    
    .solved-group {
        padding: 0.875rem;
        margin-bottom: 0.375rem;
    }
    
    .solved-group h3 {
        font-size: 0.95rem;
        margin-bottom: 0.375rem;
    }
    
    .solved-group .words {
        font-size: 0.85rem;
    }
    
    .game-guide,
    .faq-section,
    .about-game {
        padding: 1rem 0.75rem;
    }
    
    .game-main {
        padding: 0.75rem;
    }
    
    .daily-stats {
        padding: 0.5rem;
    }
    
    .daily-stats-content {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .stats-text {
        font-size: 0.8rem;
    }
    
    .guide-content h2,
    .faq-content h2,
    .about-content h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .guide-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .faq-item {
        padding: 1rem;
    }
    
    .faq-question {
        font-size: 1rem;
    }
    
    .faq-answer {
        font-size: 0.9rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .tag-list {
        justify-content: center;
    }
    
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
    
    .play-step {
        flex-direction: column;
        text-align: center;
    }
    
    .game-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .game-main {
        padding: 0.5rem;
    }
    
    .daily-stats {
        padding: 0.5rem;
    }
    
    .daily-stats-content {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .stats-text {
        font-size: 0.75rem;
    }
    
    .word-grid {
        gap: 0.25rem;
        margin-bottom: 1rem;
    }
    
    .word-card {
        font-size: 0.75rem;
        padding: 0.6rem 0.35rem;
        min-height: 60px;
        font-weight: 700;
        letter-spacing: 0.2px;
        line-height: 1.0;
    }

    /* 超小屏幕长单词样式 */
    .word-card[data-length="long"] {
        font-size: 0.6rem;
        letter-spacing: 0.1px;
        padding: 0.35rem 0.15rem;
    }

    .word-card[data-length="very-long"] {
        font-size: 0.5rem;
        letter-spacing: 0.05px;
        padding: 0.3rem 0.1rem;
        line-height: 0.95;
    }
    
    .control-btn {
        width: 100%;
        justify-content: center;
    }
    
    .guide-content h2,
    .faq-content h2,
    .about-content h2 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .guide-item,
    .faq-item {
        padding: 0.75rem;
    }
    
    .game-guide,
    .faq-section,
    .about-game {
        padding: 0.75rem 0.5rem;
    }
    
    .faq-question {
        font-size: 0.9rem;
    }
    
    .faq-answer {
        font-size: 0.8rem;
    }
    
    .solved-group {
        padding: 0.75rem;
        margin-bottom: 0.375rem;
    }
    
    .solved-group h3 {
        font-size: 0.9rem;
        margin-bottom: 0.375rem;
    }
    
    .solved-group .words {
        font-size: 0.8rem;
    }
}

/* Toast 动画样式 */
@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

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

@keyframes toastSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 模态框分组状态样式 */
.modal-group.solved {
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
}

.modal-group.solved:nth-child(1) {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.modal-group.solved:nth-child(2) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.modal-group.solved:nth-child(3) {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.modal-group.solved:nth-child(4) {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.modal-group.unsolved {
    background: #fef3c7;
    border-color: #fbbf24;
}

.modal-group.solved h4 {
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-group.unsolved h4 {
    color: #92400e;
}

.modal-group.solved p {
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.modal-group.unsolved p {
    color: #9ca3af;
}

/* Toast 提示框样式 */
.toast {
    position: fixed;
    top: 200px; /* 默认位置，JavaScript会动态调整 */
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 500;
    z-index: 10001;
    max-width: min(500px, 90vw);
    width: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    text-align: center;
    white-space: pre-line;
    line-height: 1.4;
    pointer-events: none;
    /* 确保不会出现在页面底部的安全措施 */
    min-height: fit-content;
    max-height: 200px;
    overflow-y: auto;
}

/* 右侧显示的Toast样式 */
.toast-right {
    max-width: 280px;
    width: 280px;
    text-align: left;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.toast-hint {
    position: relative;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

.toast-hint.toast-right {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    box-shadow: 0 25px 30px -10px rgba(59, 130, 246, 0.3), 0 15px 15px -5px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.toast-hint::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--radius-lg);
    z-index: -1;
}

/* Toast 动画 */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* 右侧Toast的进入动画 */
@keyframes toastSlideInRight {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.95);
    }
}

/* 右侧Toast的退出动画 */
@keyframes toastSlideOutRight {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(30px) scale(0.95);
    }
}

/* 移动端 Toast 适配 */
@media (max-width: 1000px) {
    .toast-right {
        /* 在小屏幕上回退到普通Toast样式 */
        max-width: min(500px, 90vw);
        width: auto;
        text-align: center;
        padding: 16px 24px;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 768px) {
    .toast {
        left: 1rem;
        right: 1rem;
        transform: none;
        max-width: none;
        width: auto;
        font-size: 14px;
        padding: 14px 20px;
        /* 移动端确保合理的位置范围 */
        top: 160px !important;
        min-top: 120px;
        max-height: 150px;
    }
    
    .toast-right {
        left: 1rem;
        right: 1rem;
        transform: none;
        max-width: none;
        width: auto;
        text-align: center;
        padding: 14px 20px;
    }
    
    @keyframes toastSlideIn {
        from {
            opacity: 0;
            transform: translateY(-30px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
    
    @keyframes toastSlideOut {
        from {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
        to {
            opacity: 0;
            transform: translateY(-30px) scale(0.95);
        }
    }
}

@media (max-width: 480px) {
    .toast {
        font-size: 13px;
        padding: 12px 16px;
        left: 0.75rem;
        right: 0.75rem;
        /* 小屏幕设备固定安全位置 */
        top: 140px !important;
        max-height: 120px;
    }
    
    .toast-right {
        font-size: 13px;
        padding: 12px 16px;
        left: 0.75rem;
        right: 0.75rem;
    }
} 