/**
 * styles.css - 公共样式文件
 * 包含所有游戏共享的样式定义、响应式布局和动画效果
 * 
 * 代码结构：
 * 1. 全局样式和CSS变量
 * 2. 布局组件样式
 * 3. 按钮和交互元素样式
 * 4. 游戏通用样式
 * 5. 动画和过渡效果
 * 6. 响应式媒体查询
 */

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

/* CSS变量定义 */
:root {
    /* 安全区域变量 - 适配不同设备的刘海屏和底部安全区 */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);

    /* 微信浏览器特殊处理 */
    --wechat-nav-height: 0px;
    --wechat-toolbar-height: 0px;

    /* 主题颜色 - 统一管理应用中的颜色方案 */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f5576c;
    --success-color: #43e97b;
    --success-secondary: #38f9d7;
    --warning-color: #fa709a;
    --warning-secondary: #fee140;
    --error-color: #ff0000;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #fff;

    /* 背景渐变 - 预定义常用渐变效果 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --gradient-tertiary: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --gradient-success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    /* 间距系统 - 统一管理空间尺寸 */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 25px;
    --spacing-xxl: 30px;

    /* 边框半径 - 统一管理圆角大小 */
    --border-radius-sm: 10px;
    --border-radius-md: 15px;
    --border-radius-lg: 20px;
    --border-radius-xl: 25px;
    --border-radius-xxl: 30px;
    --border-radius-full: 50%;

    /* 字体大小 - 统一管理文字尺寸 */
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-xxl: 24px;
    --font-size-xxxl: 28px;
    --font-size-h1: 36px;

    /* 动画过渡 - 统一管理动画时间和缓动函数 */
    --transition-fast: 0.3s ease;
    --transition-normal: 0.5s ease;
    --transition-slow: 0.6s ease;
    --animation-ease: ease-in-out;

    /* 阴影效果 - 统一管理阴影样式 */
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 12px 35px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/**
 * 基础HTML和Body样式
 * 设置全局字体、背景和布局
 */
html,
body {
    font-family: 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
    background: var(--gradient-primary);
    color: var(--text-primary);
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;
}

body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    min-width: 100vw;
    overflow: hidden;
    /* 安全区域处理 - 适配刘海屏和底部安全区 */
    padding-top: var(--safe-area-inset-top);
    padding-bottom: var(--safe-area-inset-bottom);
    padding-left: var(--safe-area-inset-left);
    padding-right: var(--safe-area-inset-right);
    box-sizing: border-box;
}

/**
 * 触摸行为控制
 * 阻止页面滚动但允许单词卡片横向滚动
 */
.container,
.menu,
.game-container {
    touch-action: pan-x;
}

/**
 * 主容器布局
 * 控制页面整体结构和响应式行为
 */
.container {
    width: 100%;
    min-height: 100%;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

/* 竖屏时移除最大宽度限制 */
@media (orientation: portrait) {
    .container {
        max-width: none;
        padding: var(--spacing-sm);
    }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 设置控件样式 */
.control-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.control-label {
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 10px;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f093fb 0%, #fff 100%);
    transition: .4s;
    border-radius: 34px;
    box-shadow: var(--shadow-sm);
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked+.toggle-label {
    background: var(--gradient-info);
}

.toggle-input:checked+.toggle-label:before {
    transform: translateX(30px);
}

/* 按钮基础样式 */
.btn {
    background: var(--gradient-primary);
    color: var(--text-light);
    border: none;
    padding: var(--spacing-xs);
    border-radius: var(--border-radius-xxl);
    font-size: var(--font-size-lg);
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    margin: var(--spacing-sm);
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow;
}



.btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn.back-btn {
    background: var(--gradient-info);
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    z-index: 100;
    margin: 0;
    padding: var(--spacing-sm);
     font-size: var(--font-size-md);
border-radius: var(--border-radius-md);
}

.btn.pause-btn {
    /* background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%); */
    font-size: var(--font-size-xs);
    width: 40%;
    margin: 0;
    box-sizing: border-box;
    border-radius: var(--border-radius-lg);
}

/* 超链接样式按钮 */
.btn.line-btn {
    background: transparent;
    color: var(--primary-color);
    border: none;
    padding: 0;
    font-size: var(--font-size-xs);
    font-weight: normal;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: none;
    margin: var(--spacing-xs);
    text-decoration: underline;
    text-decoration-color: var(--primary-color);
    text-underline-offset: 2px;
    white-space: nowrap;
}

.btn.line-btn:hover {
    color: var(--secondary-color);
    text-decoration-color: var(--secondary-color);
    background: rgba(102, 126, 234, 0.05);
}

.btn.line-btn:active {
    transform: none;
    box-shadow: none;
}

/* 菜单样式 */
.menu {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    padding: 40px 30px calc(30px + env(safe-area-inset-bottom, 20px)) 30px;
    box-shadow: var(--shadow-xl);
    text-align: center;
    margin: auto;
    width: 100%;
    position: relative;
    overflow-x: hidden;
    box-sizing: border-box;
    max-width: 100%;
    min-height: calc(100vh - 40px);
}



.menu h1 {
    color: var(--primary-color);
    font-size: var(--font-size-h1);
    margin-bottom: var(--spacing-xl);
    margin-top: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.menu h2 {
    color: var(--secondary-color);
    font-size: var(--font-size-xxxl);
    margin-bottom: var(--spacing-lg);
}

/* 单元选择器 */
.unit-selector {
    margin-top: 20px;
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* 关卡选择器 */
.level-selector {
    margin-top: 20px;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* 卡片基础样式 - 单元卡片和关卡卡片共用 */
.unit-card,
.level-card {
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    will-change: transform, box-shadow;
}



.unit-card {
    background: var(--gradient-secondary);
    justify-content: space-between;
}

.level-card {
    background: var(--gradient-tertiary);
}

.unit-card h3 {
    color: var(--primary-color);
    font-size: var(--font-size-xxl);
    margin: 0;
    margin-right: var(--spacing-md);
    white-space: nowrap;
}

.level-card h3 {
    color: var(--accent-color);
    font-size: var(--font-size-xl);
    margin: 0;
    margin-right: var(--spacing-sm);
    white-space: nowrap;
}

.unit-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-xl);
    margin: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

.level-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: 5px 0 5px auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.level-card .stars {
    margin: 5px 0 0 0;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.stars {
    font-size: var(--font-size-xl);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/**
 * 游戏容器样式
 * 包含游戏头部和游戏内容区域
 */
.game-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 244, 255, 0.95));
    border-radius: var(--border-radius-xl);
    padding: 25px 25px env(safe-area-inset-bottom, 25px) 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    width: 100%;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

/**
 * 游戏头部样式
 * 包含游戏信息栏和控制按钮
 */
.game-header {
    width: 100%;
    padding: var(--spacing-xs);
    background: rgba(102, 126, 234, 0.1);
    border-radius: var(--border-radius-md);
    gap: var(--spacing-lg);
}

.game-info {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
}

.game-info .unit-name,
.game-info .game-name {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

.game-info .unit-name {
    flex: 0 0 auto;
    min-width: 60px;
    max-width: 30%;
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    font-weight: bold;
}

.game-info .game-name {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
    min-width: 100px;
    max-width: 40%;
    color: var(--secondary-color);
    font-size: var(--font-size-md);
    font-weight: 500;
}

/* 进度条样式 - 合并了所有重复定义 */
.progress {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: bold;
    color: var(--primary-color);
}

/* 游戏内容区域 */
.game-content {
    width: 100%;
    flex: 1;
    background: linear-gradient(135deg, #ffffff, #f8faff);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: inset 0 3px 15px rgba(0, 0, 0, 0.08), 0 4px 15px rgba(102, 126, 234, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: auto;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

/* 游戏结束界面 */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gradient-primary);
    color: white;
    padding: 50px 30px 40px;
    border-radius: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-over h2 {
    font-size: 36px;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #fff, #f0f8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.result {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    margin-bottom: 35px;
}

.result p {
    margin: 15px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 0;
    padding: 0 15px;
}

/* 游戏结束按钮样式 - 继承基础按钮样式 */
.game-over-buttons .btn {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    margin: 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}



/* 星星和时间显示样式 */
#finalStars {
    font-size: 32px;
    font-weight: bold;
    margin: 0 5px;
}

#finalTime {
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    margin: 0 5px;
}

/* 公共答案选项样式 - 用于问答游戏、填空游戏等 */
.answers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.answer-option {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border: none;
    border-radius: 20px;
    padding: 20px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.answer-option.correct {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    animation: correctPulse 0.6s ease-in-out;
}

.answer-option.wrong {
    border: 3px solid #f44336;
    animation: wrongBorderFlash 0.6s ease-in-out;
}

.error-message {
    margin-top: 20px;
    padding: 12px 20px;
    color: #f44336;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes wrongBorderFlash {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }

    100% {
        box-shadow: 0 0 20px 10px rgba(244, 67, 54, 0.5);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 公共动画效果 - 各游戏可以复用的动画 */
@keyframes correctPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes wrongShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

@keyframes matchFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

@keyframes fall {
    0% {
        top: -100px;
    }

    100% {
        top: 100%;
    }
}

@keyframes correctPop {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

@keyframes bubble {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes redFlash {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
        border-color: transparent;
    }

    50% {
        box-shadow: 0 0 20px 10px rgba(255, 0, 0, 0.8);
        border-color: #ff0000;
    }
}

@keyframes matchSuccess {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0.5;
        transform: scale(0.3);
    }
}

@keyframes bubblePop {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 响应式媒体查询 */

/* 大屏设备 */
@media (min-width: 1200px) {
    .game-container {
        max-width: 1100px;
        margin: 0 auto;
    }
}

/* 平板设备 */
@media (max-width: 1024px) {
    .game-container {
        padding: 15px 15px calc(15px + env(safe-area-inset-bottom, 20px)) 15px;
    }
}

/* 中等屏幕 */
@media (max-height: 900px) {
    .menu {
        padding: 30px 25px calc(25px + env(safe-area-inset-bottom, 20px)) 25px;
    }

    .menu h1 {
        font-size: 32px;
        margin-bottom: 25px;
    }

    .menu h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .units-grid {
        gap: 15px;
        margin-top: 15px;
    }

    .unit-card {
        padding: 18px;
    }

    .unit-card h3 {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .unit-card p {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .stars {
        font-size: 18px;
    }
}

/* 手机设备 */
@media (max-width: 768px) {
    .game-container {
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 20px)) 10px;
        min-height: calc(100vh - 40px);
    }

    .progress {
        width: 100%;
    }
    
    .menu {
        padding: 25px 20px calc(20px + env(safe-area-inset-bottom, 20px)) 20px;
    }
    
    .menu h1 {
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .menu h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .units-grid {
        gap: 12px;
        margin-top: 12px;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .unit-card {
        padding: 15px;
    }

    .unit-card h3 {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .unit-card p {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .stars {
        font-size: 16px;
    }

    .unit-selector {
        margin-top: 15px;
    }
    
    .game-info .unit-name {
        font-size: var(--font-size-lg);
        min-width: 60px;
    }
    
    .game-info .game-name {
        font-size: var(--font-size-sm);
    }
}

/* 小屏幕手机 */
@media (max-width: 480px) {
    .menu {
        padding: 25px 15px calc(15px + env(safe-area-inset-bottom, 20px)) 15px;
    }

    .menu h1 {
        font-size: 22px;
        margin-bottom: 15px;
        margin-top: 0;
    }

    .unit-card h3,
    .level-card h3 {
        font-size: 20px;
    }

    .units-grid,
    .level-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 15px;
    }

    .unit-card {
        padding: 15px;
        margin-bottom: 10px;
    }

    .unit-card p {
        font-size: 12px;
    }

    /* 游戏信息栏响应式 */
    .game-info .unit-name {
        font-size: var(--font-size-md);
        min-width: 50px;
    }

    .game-info .game-name {
        font-size: var(--font-size-xs);
    }
}

/* 超小屏幕手机 */
@media (max-width: 360px) {
    .game-info .unit-name {
        font-size: var(--font-size-sm);
        min-width: 45px;
    }

    .game-info .game-name {
        font-size: 11px;
    }
}

/* 横屏优化 */
@media (orientation: landscape) {}

/* 模态弹窗样式 */
.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: 10000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #ffffff, #f8faff);
    border-radius: var(--border-radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: var(--font-size-xxl);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

#gameManualContent {
    font-size: var(--font-size-md);
    line-height: 1.8;
    color: var(--text-primary);
}

#gameManualContent h3 {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
}

#gameManualContent h3:first-child {
    margin-top: 0;
}

#gameManualContent p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

#gameManualContent ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

#gameManualContent li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

#gameManualContent strong {
    color: var(--primary-color);
    font-weight: bold;
}

/* 响应式 - 模态弹窗 */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        max-height: 85vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h2 {
        font-size: var(--font-size-xl);
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 28px;
    }

    .modal-body {
        padding: 20px;
    }

    #gameManualContent {
        font-size: var(--font-size-sm);
    }

    #gameManualContent h3 {
        font-size: var(--font-size-lg);
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 90%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 12px 15px;
    }

    .modal-header h2 {
        font-size: var(--font-size-lg);
    }

    .modal-close {
        width: 30px;
        height: 30px;
        font-size: 24px;
    }

    .modal-body {
        padding: 15px;
    }

    #gameManualContent {
        font-size: var(--font-size-xs);
        line-height: 1.6;
    }

    #gameManualContent h3 {
        font-size: var(--font-size-md);
        margin-top: 15px;
        margin-bottom: 8px;
    }

    #gameManualContent p {
        margin-bottom: 12px;
    }
}