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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, #01baef 0%, #398bf9 100%);
    background-attachment: fixed; /* 固定背景，不随滚动重复 */
    background-size: 100% 100%; /* 背景铺满整个视口 */
    min-height: 100vh; /* 最小高度为视口高度 */
    height: auto; /* 高度自适应内容 */
    overflow-x: hidden; /* 禁止横向滚动 */
    overflow-y: auto; /* 允许纵向滚动 */
    position: relative;
    margin: 0;
    padding: 0;
}

/* 添加背景装饰效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 15%, rgba(255,255,255,0.1) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(255,255,255,0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* 主要内容区域 - 调整以适应绝对定位的模块网格 */
.main-content {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* 改为顶部对齐，为底部模块网格留出空间 */
    padding: 20px;
}

/* 整体页面容器 - 扩展到整个视口 */
.page-container {
    position: relative;
    width: 100vw;
    min-height: 100vh; /* 最小高度为视口高度 */
    height: auto; /* 高度自适应内容 */
    background: transparent;
    overflow: visible; /* 允许内容可见 */
}

/* 学生信息模块 - 改为相对定位 */
.user-section {
    position: absolute;
    left: 22px; /* 按比例缩小 24*0.92≈22 */
    top: 59px; /* 按比例缩小 64*0.92≈59 */
    width: 239px; /* 按比例缩小 260*0.92≈239 */
    height: 55px; /* 按比例缩小 60*0.92≈55 */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 37px; /* 按比例缩小 40*0.92≈37 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 7px 29px rgba(0, 0, 0, 0.1); /* 按比例缩小阴影 */
    z-index: 10;
    overflow: visible;
    display: block;
}

/* 积分模块 - 改为相对定位 */
.score-section {
    position: absolute;
    left: 283px; /* 按比例缩小 308*0.92≈283 */
    top: 59px; /* 按比例缩小 64*0.92≈59 */
    width: 166px; /* 按比例缩小 180*0.92≈166 */
    height: 55px; /* 按比例缩小 60*0.92≈55 */
    z-index: 10;
}

/* 模块容器 - 调整以适应ai-game.css风格的绝对定位 */
.modules-container {
    position: relative; /* 改为相对定位，作为绝对定位模块网格的容器 */
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

.modules-grid {
    display: flex;
    flex-direction: column;
    gap: 12px; /* 按比例缩小 12*0.92≈11 */
    width: calc(100% - 44px); /* 按比例缩小 48*0.92≈44 */
    max-width: 1136px; /* 按比例缩小 1232*0.92≈1134 */
    margin: 0 0;
    position: absolute; /* 完全沿用ai-game.css的绝对定位 */
    bottom: 37px; /* 按比例缩小 40*0.92≈37 */
    left: 50%;
    transform: translateX(-50%); /* 完全沿用ai-game.css的居中方式 */
    padding: 0 0px; /* 按比例缩小 24*0.92≈22 */
}

/* 模块行容器 - 完全沿用ai-game.css的game-row样式 */
.module-row {
    display: flex;
    gap: 12px; /* 按比例缩小 12*0.92≈11 */
    justify-content: center;
    align-items: flex-start; /* 改为顶部对齐，确保列对齐 */
}

/* 第四列小模块容器 - 完全参考ai-game.css的split-card-container */
.small-modules-column {
    display: flex;
    flex-direction: column;
    gap: 12px; /* 按比例缩小 12*0.92≈11 */
    width: 275px; /* 改为275px，与标准卡片一致 */
    /* 总高度：132px + 11px + 132px = 275px，接近276px */
}

/* 小模块卡片尺寸 - 沿用ai-game.css的split-card高度 */
.module-card.small-card {
    width: 275px; /* 改为275px */
    height: 132px; /* 按比例缩小 144*0.92≈132 */
    min-height: 132px !important;
    max-height: 132px !important;
    flex-shrink: 0; /* 防止收缩 */
}

/* 标准模块卡片尺寸和样式 - 完全沿用ai-game.css */
.module-card {
    width: 275px; /* 改为275px */
    height: 276px; /* 按比例缩小 300*0.92≈276 */
    position: relative;
    border-radius: 16px; /* 按比例缩小 16*0.92≈15 */
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.3s; /* 沿用ai-game.css的过渡效果 */
    overflow: hidden;
    box-shadow: 0 7px 29px rgba(0,0,0,0.10); /* 按比例缩小阴影 */
    border: 1px solid rgba(173, 216, 230, 0.3); /* 沿用ai-game.css的边框 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.module-card:hover {
    box-shadow: 0 15px 44px rgba(0,0,0,0.18); /* 按比例缩小阴影 */
    transform: translateY(-4px) scale(1.02); /* 沿用ai-game.css的悬停变换 */
}

/* 基础模块显示顺序 - 确保在所有屏幕尺寸下保持一致 */
.ai-drawing { order: 1; }
.music-creation { order: 2; }
.dragon-lecture { order: 3; }
.dragon-tutor { order: 4; }
.idiom-chain { order: 5; }
.storybook { order: 6; }
.listening-speaking { order: 7; }
.small-modules-column { order: 8; }

/* 用户头像样式 */
.user-avatar {
    position: absolute;
    left: 11px; /* 按比例缩小 12*0.92≈11 */
    top: 11px; /* 按比例缩小 12*0.92≈11 */
    width: 33px; /* 按比例缩小 36*0.92≈33 */
    height: 33px; /* 按比例缩小 36*0.92≈33 */
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 15;
    display: block;
}

.user-avatar:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    display: block;
    opacity: 1;
}

/* 用户信息样式 */
.user-info {
    position: absolute;
    left: 51px; /* 按比例缩小 56*0.92≈51 */
    top: 11px; /* 按比例缩小 12*0.92≈11 */
    color: white;
}

.user-name {
    color: #2634b5;
    font-size: 13px; /* 按比例缩小 14*0.92≈13 */
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    width: 120px; /* 按比例缩小 56*0.92≈51 */
    height: 18px; /* 按比例缩小 20*0.92≈18 */
    display: flex;
    align-items: center;
}

.user-class {
    color: #2634b5;
    font-size: 11px; /* 按比例缩小 12*0.92≈11 */
    line-height: 1.2;
    margin: 2px 0 0 0;
    width: 55px; /* 按比例缩小 60*0.92≈55 */
    height: 16px; /* 按比例缩小 17*0.92≈16 */
    display: flex;
    align-items: center;
}

/* 退出按钮样式 */
.logout-btn {
    position: absolute;
    right: 15px; /* 按比例缩小 16*0.92≈15 */
    top: 10px; /* 按比例缩小 11*0.92≈10 */
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px; /* 按比例缩小 44*0.92≈40 */
    height: 35px; /* 按比例缩小 38*0.92≈35 */
}

.logout-btn i {
    position: absolute;
    left: 11px; /* 按比例缩小 12*0.92≈11 */
    top: 0px;
    width: 18px; /* 按比例缩小 20*0.92≈18 */
    height: 18px; /* 按比例缩小 20*0.92≈18 */
    background-image: url('../images/home-modules/logout-icon.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.logout-btn span {
    position: absolute;
    left: 9px; /* 按比例缩小 10*0.92≈9 */
    top: 18px; /* 按比例缩小 20*0.92≈18 */
    width: 22px; /* 按比例缩小 24*0.92≈22 */
    height: 16px; /* 按比例缩小 17*0.92≈16 */
    color: #2634b5;
    font-size: 11px; /* 按比例缩小 12*0.92≈11 */
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    transform: translateY(-1px);
}

/* 积分容器样式 */
.score-container {
    position: relative;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 37px; /* 按比例缩小 40*0.92≈37 */
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 166px; /* 按比例缩小 180*0.92≈166 */
    height: 55px; /* 按比例缩小 60*0.92≈55 */
    box-sizing: border-box;
}

/* 我的任务快捷按钮 */
.my-tasks-btn {
    position: absolute;
    right: 30px;
    top: 59px;
    background: linear-gradient(135deg, #4959f1 0%, #6b7bff 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(73, 89, 241, 0.3);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-tasks-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(73, 89, 241, 0.4);
    background: linear-gradient(135deg, #6b7bff 0%, #4959f1 100%);
}

.my-tasks-btn span {
    white-space: nowrap;
}

.score-icon {
    position: absolute;
    left: 11px; /* 按比例缩小 12*0.92≈11 */
    top: 50%;
    transform: translateY(-50%);
    width: 33px; /* 按比例缩小 36*0.92≈33 */
    height: 33px; /* 按比例缩小 36*0.92≈33 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-text {
    position: absolute;
    left: 51px; /* 按比例缩小 56*0.92≈51 */
    top: 50%;
    transform: translateY(-50%);
    width: 83px; /* 按比例缩小 90*0.92≈83 */
    height: 18px; /* 按比例缩小 20*0.92≈18 */
    color: #2634b5;
    font-size: 13px; /* 按比例缩小 14*0.92≈13 */
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* 小模块通用样式已在上面的.module-card.small-card中定义 */

/* 小模块样式 - 完全沿用ai-game.css的split-card样式 */
.small-card .card-content {
    padding: 0;
}

.small-card .module-title {
    color: #265bb5; /* 完全沿用ai-game.css */
    font-family: 'Source Han Sans-Bold', 'Source Han Sans', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; /* 完全沿用ai-game.css */
    font-size: 33px; /* 按比例缩小 36*0.92≈33 */
    font-weight: 700;
    line-height: 48px; /* 按比例缩小 52*0.92≈48 */
    margin-bottom: 0px; /* 完全沿用ai-game.css */
    letter-spacing: 0.46px; /* 按比例缩小 0.5*0.92≈0.46 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* 完全沿用ai-game.css */
}

.small-card .module-desc {
    color: #3d6889; /* 完全沿用ai-game.css */
    font-family: 'Source Han Sans-Bold', 'Source Han Sans', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; /* 完全沿用ai-game.css */
    font-size: 17px; /* 按比例缩小 18*0.92≈17 */
    font-weight: 400;
    line-height: 24px; /* 按比例缩小 26*0.92≈24 */
    letter-spacing: 0.28px; /* 按比例缩小 0.3*0.92≈0.28 */
}

/* 模块背景渐变 */
.module-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px; /* 修改为16px，与模块卡片圆角匹配 */
    transition: all 0.3s ease;
}

.chinese-bg {
    background: linear-gradient(180deg, #f9a68b 0%, #fa5f2b 100%);
}

.english-bg {
    background: linear-gradient(180deg, #82fa88 0%, #2abba3 100%);
}

.ai-bg {
    background: linear-gradient(180deg, #ffe785 0%, #fdaa02 100%);
}

.drawing-bg {
    background: linear-gradient(180deg, #fd93da 0%, #e96e67 100%);
}

.story-bg {
    background: linear-gradient(180deg, #ddec82 0%, #62ca1d 100%);
}

.music-bg {
    background: linear-gradient(180deg, #fd93da 0%, #ab50f1 100%);
}

.game-bg {
    background: linear-gradient(180deg, #ddec82 0%, #ffd285 100%);
}

.recognition-bg {
    background: linear-gradient(180deg, #82fa88 0%, #3bd3ba 100%);
}

.lecture-bg {
    background: linear-gradient(180deg, #ffc785 0%, #ff9047 100%);
}

.tasks-bg {
    background: #4959f1;
}

/* 模块内容容器 - 完全沿用ai-game.css的card-info样式 */
.module-content {
    z-index: 2;
    padding: 15px 0px 0px 18px; /* 按比例缩小 16*0.92≈15, 20*0.92≈18 */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    position: relative;
    text-align: left;
}

/* 模块图片 - 完全沿用ai-game.css的card-img样式 */
.module-image {
    background: transparent !important;
    border: none !important;
    position: absolute;
    right: 0;
    bottom: 0;
    width: 166px; /* 按比例缩小 180*0.92≈166 */
    height: 166px;
    z-index: 1;
}

/* 小模块图片 - 沿用ai-game.css的split-card-img样式 */
.module-image.small {
    background: transparent !important;
    border: none !important;
    position: absolute;
    right: 0px;
    bottom: -46px; /* 按比例缩小 -50*0.92≈-46 */
    transform: translateY(-50%); /* 沿用ai-game.css的垂直居中 */
    width: 92px; /* 按比例缩小 100*0.92≈92 */
    height: 92px;
    z-index: 1;
}

.module-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1)); /* 沿用ai-game.css的阴影 */
}

.module-card:hover .module-image img {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transform: scale(1.1);
}

/* card-content样式已整合到module-content中 */

/* 小卡片样式 */
.small-card .card-content {
    padding: 0;
    width: 149px; /* 按比例缩小 162*0.92≈149 */
    height: 72px; /* 按比例缩小 78*0.92≈72 */
}

.small-card .module-title {
    color: #265bb5;
    font-size: 33px; /* 按比例缩小 36*0.92≈33 */
    font-weight: 700;
    font-family: "Source Han Sans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    line-height: 48px; /* 按比例缩小 52*0.92≈48 */
    margin: 0;
    text-align: left;
    letter-spacing: 0;
    transition: all 0.3s ease;
}

.small-card .module-desc {
    color: #3D6BB9;
    font-size: 17px; /* 按比例缩小 18*0.92≈17 */
    font-weight: 400;
    font-family: "Source Han Sans", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
    line-height: 24px; /* 按比例缩小 26*0.92≈24 */
    margin: 0;
    text-align: left;
    letter-spacing: 0;
    width: 149px; /* 按比例缩小 162*0.92≈149 */
    height: 24px; /* 按比例缩小 26*0.92≈24 */
    transition: all 0.3s ease;
}

.module-title {
    color: #265bb5; /* 完全沿用ai-game.css */
    font-family: 'Source Han Sans-Bold', 'Source Han Sans', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; /* 完全沿用ai-game.css */
    font-size: 33px; /* 按比例缩小 36*0.92≈33 */
    font-weight: 700;
    line-height: 48px; /* 按比例缩小 52*0.92≈48 */
    margin-bottom: 0px; /* 完全沿用ai-game.css */
    letter-spacing: 0.5px; /* 完全沿用ai-game.css */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* 完全沿用ai-game.css */
}

.module-desc {
    color: #3d6889; /* 完全沿用ai-game.css */
    font-family: 'Source Han Sans-Bold', 'Source Han Sans', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; /* 完全沿用ai-game.css */
    font-size: 18px;
    font-weight: 400;
    line-height: 26px;
    letter-spacing: 0.3px; /* 完全沿用ai-game.css */
}

/* 模块悬停效果 */
.module-card:hover .module-title {
    transform: translateY(-2px);
    color: #1e4a94;
    text-shadow: 0 3px 6px rgba(38, 91, 181, 0.3);
}

.module-card:hover .module-desc {
    color: #2d5aa3;
    transform: translateY(-1px);
}

/* 飘浮装饰元素 */
.floating-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-emoji {
    position: absolute;
    font-size: 2em;
    opacity: 0.7;
    animation: gentleFloat 6s ease-in-out infinite;
}

/* 动画效果 */
@keyframes sparkle {
    0%, 100% { 
        transform: scale(1) rotate(0deg); 
    }
    50% { 
        transform: scale(1.1) rotate(180deg); 
    }
}

@keyframes gentleFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.7;
    }
    25% { 
        transform: translateY(-15px) rotate(2deg); 
        opacity: 0.8;
    }
    50% { 
        transform: translateY(-8px) rotate(0deg); 
        opacity: 0.9;
    }
    75% { 
        transform: translateY(-20px) rotate(-2deg); 
        opacity: 0.8;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 我的任务模块特殊样式 */
.my-tasks {
    cursor: pointer;
}

.my-tasks .module-content {
    padding: 15px;
    align-items: stretch;
    justify-content: flex-start;
}

.my-tasks .tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

.my-tasks .module-title {
    color: white;
    margin: 0;
    font-size: 1.1em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.my-tasks .tasks-more-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.my-tasks .tasks-more-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.my-tasks .tasks-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

/* 任务加载指示器 */
.task-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

/* 无任务状态 */
.no-tasks {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9em;
    font-style: italic;
}

.my-tasks .task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.my-tasks .task-item:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(3px);
}

.my-tasks .task-title {
    color: #ffffff;
    font-size: 16px;
    flex: 1;
    height: 23px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    font-weight: 400;
    line-height: 1;
}

.my-tasks .task-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.7em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.my-tasks .task-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

.my-tasks .task-btn.classic {
    background: rgba(255, 193, 7, 0.3);
    border-color: rgba(255, 193, 7, 0.5);
    color: white;
}

.my-tasks .task-btn.study {
    background: rgba(40, 167, 69, 0.3);
    border-color: rgba(40, 167, 69, 0.5);
    color: white;
}

.my-tasks .task-btn.essay {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.5);
    color: white;
}

.my-tasks .task-btn.dictation {
    background: rgba(255, 193, 7, 0.3);
    border-color: rgba(255, 193, 7, 0.5);
    color: white;
}

.my-tasks .task-btn.oral {
    background: rgba(23, 162, 184, 0.3);
    border-color: rgba(23, 162, 184, 0.5);
    color: white;
}

.my-tasks .task-btn.ai-drawing {
    background: rgba(156, 39, 176, 0.3);
    border-color: rgba(156, 39, 176, 0.5);
    color: white;
}

.my-tasks .task-btn.ai-music {
    background: rgba(255, 87, 34, 0.3);
    border-color: rgba(255, 87, 34, 0.5);
    color: white;
}

.my-tasks .task-btn.storybook {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
    color: white;
}

.my-tasks .task-btn.explore {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
    color: white;
}

.my-tasks .task-btn.pending {
    background: rgba(255, 152, 0, 0.3);
    border-color: rgba(255, 152, 0, 0.5);
}

.my-tasks .task-btn.completed {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

/* 积分图标样式 */
.score-icon img {
    width: 33px; /* 按比例缩小 36*0.92≈33 */
    height: 33px; /* 按比例缩小 36*0.92≈33 */
    object-fit: contain;
} 

/* 响应式设计 */
@media (max-width: 1280px) {
    .modules-grid {
        max-width: 100%;
        padding: 0 0px; /* 完全沿用ai-game.css */
    }
    
    .module-row {
        gap: 11px; /* 按比例缩小 12*0.92≈11 */
    }
    
    .small-modules-column {
        gap: 11px; /* 按比例缩小 12*0.92≈11 */
    }
    
    .module-card {
        width: 275px; /* 按比例缩小 299*0.92≈275 */
        height: 276px; /* 按比例缩小 300*0.92≈276 */
    }
    
    .module-card.small-card {
        width: 275px;
        height: 132px; /* 按比例缩小 144*0.92≈132 */
        min-height: 132px !important;
        max-height: 132px !important;
    }
}

/* 1920x1080 及更大分辨率 */
@media (min-width: 1900px) {
    .modules-grid {
        max-width: 1400px;
        gap: 15px;
        bottom: 50px;
    }
    
    .module-row {
        gap: 15px;
    }
    
    .module-card {
        width: 320px;
        height: 320px;
    }
    
    .small-modules-column {
        width: 320px;
        gap: 15px;
    }
    
    .module-card.small-card {
        width: 320px;
        height: 152px;
    }
    
    .module-title {
        font-size: 38px;
    }
    
    .module-desc {
        font-size: 20px;
    }
    
    .my-tasks-btn {
        right: 40px;
        top: 70px;
        padding: 14px 28px;
        font-size: 16px;
    }
}

/* 1366x768 分辨率优化 */
@media (max-width: 1400px) and (min-width: 1300px) {
    .modules-grid {
        max-width: 1100px;
        gap: 10px;
        bottom: 30px;
    }
    
    .module-row {
        gap: 10px;
    }
    
    .module-card {
        width: 260px;
        height: 260px;
    }
    
    .small-modules-column {
        width: 260px;
        gap: 10px;
    }
    
    .module-card.small-card {
        width: 260px;
        height: 125px;
    }
    
    .my-tasks-btn {
        right: 25px;
        top: 55px;
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 1400px) {
    .modules-grid {
        max-width: 100%;
        padding: 0 0px; /* 按比例缩小 20*0.92≈18 */
        gap: 11px; /* 按比例缩小 14*0.92≈13 */
    }
    
    .module-row {
        gap: 12px; /* 按比例缩小 14*0.92≈13 */
    }
    
    .small-modules-column {
        gap: 11px; /* 按比例缩小 14*0.92≈13 */
    }
    
    .module-card {
        width: 275px; /* 保持与ai-game.css一致 */
        height: 276px; /* 保持与ai-game.css一致 */
    }
    
    .module-card.small-card {
        width: 275px;
        height: 132px; /* 保持与ai-game.css一致 */
        min-height: 132px !important;
        max-height: 132px !important;
    }
}

/* 平板设备优化 - 保持2*4布局 */
@media (max-width: 1024px) {
    .modules-grid {
        max-width: 100%;
        padding: 0 16px; /* 保持ai-game.css风格的简洁padding */
        gap: 12px;
    }
    
    .module-row {
        gap: 12px;
        min-height: 250px; /* 按比例缩小 */
    }
    
    .small-modules-column {
        gap: 12px;
    }
    
    .module-card {
        width: 250px; /* 按比例缩小 */
        height: 250px;
    }
    
    .module-card.small-card {
        width: 250px;
        height: 120px; /* 按比例缩小 (144 * 250/299 ≈ 120) */
        min-height: 120px !important;
        max-height: 120px !important;
    }
    
    .user-section {
        width: 220px;
        left: 20px;
        top: 20px;
    }
    
    .score-section {
        left: 260px;
        top: 20px;
        width: 160px;
    }
    
    .my-tasks-btn {
        right: 20px;
        top: 20px;
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* 手机横屏或大屏手机 - 改为垂直布局 */
@media (max-width: 768px) {
    .modules-grid {
        max-width: 100%;
        padding: 0 0px; /* 保持ai-game.css风格的简洁padding */
        gap: 10px;
    }
    
    .module-row {
        flex-wrap: wrap; /* 沿用ai-game.css的flex-wrap方式 */
        gap: 10px;
    }
    
    .small-modules-column {
        flex-direction: row; /* 小模块在手机上水平排列 */
        gap: 10px;
        width: 100%;
    }
    
    .module-card {
        width: 100%; /* 手机上卡片占满宽度 */
        height: 200px; /* 适当调整高度 */
        max-width: none;
    }
    
    .module-card.small-card {
        width: calc(50% - 5px); /* 小模块各占一半宽度 */
        height: 100px; /* 按比例调整小模块高度 */
        min-height: 100px !important;
        max-height: 100px !important;
    }
    
    /* 确保模块显示顺序 - 第一行模块 */
    .ai-drawing { order: 1; }
    .music-creation { order: 2; }
    .dragon-lecture { order: 3; }
    .dragon-tutor { order: 4; }
    
    /* 确保模块显示顺序 - 第二行模块 */
    .idiom-chain { order: 5; }
    .storybook { order: 6; }
    .listening-speaking { order: 7; }
    .small-modules-column { order: 8; }
    
    .user-section {
        width: 200px;
        left: 16px;
        top: 16px;
        height: 50px;
    }
    
    .score-section {
        left: 230px;
        top: 16px;
        width: 150px;
        height: 50px;
    }
    
    .module-image {
        width: 70px; /* 按比例缩小以适应小屏幕 */
        height: 70px;
    }
    
    .module-image.small {
        width: 60px; /* 按比例缩小以适应小屏幕 */
        height: 60px;
    }
    
    /* 文字样式在小屏幕上适当调整 */
    .module-title {
        font-size: 28px;
        line-height: 40px;
    }
    
    .module-desc {
        font-size: 16px;
        line-height: 22px;
    }
    
    .small-card .module-title {
        font-size: 28px;
        line-height: 40px;
    }
    
    .small-card .module-desc {
        font-size: 16px;
        line-height: 22px;
    }
    
    .my-tasks-btn {
        position: relative;
        right: auto;
        top: auto;
        margin: 10px auto;
        width: 90%;
        max-width: 300px;
    }
}

/* 手机竖屏 - 完全垂直布局 */
@media (max-width: 480px) {
    .modules-grid {
        padding: 0 10px; /* 保持ai-game.css风格的简洁padding */
        gap: 12px;
        flex-direction: column; /* 强制垂直排列所有模块 */
    }
    
    .module-row {
        flex-direction: row; /* 改为水平排列，避免垂直排列导致的顺序混乱 */
        flex-wrap: wrap;
        gap: 12px;
        min-height: auto;
    }
    
    .small-modules-column {
        flex-direction: column; /* 小模块也垂直排列 */
        gap: 12px;
        width: 100%;
    }
    
    .module-card {
        width: 100%;
        height: 200px; /* 保持合适的高度 */
        max-width: none;
    }
    
    .module-card.small-card {
        width: 100%; /* 小模块也占满宽度 */
        height: 120px; /* 按比例调整小模块高度 */
        min-height: 120px !important;
        max-height: 120px !important;
    }
    
    /* 强制指定模块显示顺序 - 防止响应式布局时顺序混乱 */
    .ai-drawing { order: 1; }
    .music-creation { order: 2; }
    .dragon-lecture { order: 3; }
    .dragon-tutor { order: 4; }
    .idiom-chain { order: 5; }
    .storybook { order: 6; }
    .listening-speaking { order: 7; }
    .small-modules-column { order: 8; }
    
    .user-section {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        margin: 10px 0;
        height: 50px;
    }
    
    .score-section {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        margin: 10px 0;
        height: 50px;
    }
    
    .modules-container {
        position: relative;
        height: auto; /* 在小屏幕上调整容器高度 */
        min-height: 100vh;
    }
    
    .page-container {
        height: auto;
        min-height: 100vh;
        overflow: visible; /* 确保内容不被裁剪 */
    }
    
    .module-image {
        width: 70px; /* 保持与768px断点一致 */
        height: 70px;
    }
    
    .module-image.small {
        width: 60px; /* 保持与768px断点一致 */
        height: 60px;
    }
    
    /* 480px断点文字样式调整 */
    .module-title {
        font-size: 30px;
        line-height: 42px;
    }
    
    .module-desc {
        font-size: 16px;
        line-height: 22px;
    }
}

/* 头像模态框样式 */
.avatar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-modal .modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.avatar-modal .modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.avatar-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.avatar-modal .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.avatar-modal .close-btn:hover {
    background: #f5f5f5;
    color: #666;
}

.avatar-modal .modal-body {
    padding: 24px;
    text-align: center;
}

.avatar-modal .avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
    border: 4px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.avatar-modal .avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-modal .modal-body p {
    margin: 16px 0;
    color: #666;
    font-size: 14px;
}

.avatar-modal .modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.avatar-modal .btn-secondary,
.avatar-modal .btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.avatar-modal .btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

.avatar-modal .btn-secondary:hover {
    background: #e9ecef;
}

.avatar-modal .btn-primary {
    background: #007bff;
    color: white;
}

.avatar-modal .btn-primary:hover {
    background: #0056b3;
} 