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

body {
    font-family: 'Comic Neue', cursive, sans-serif;
    background: linear-gradient(135deg, #f5f1eb, #ede7d9);
    min-height: 100vh;
    color: #4a3f36;
    overflow-x: auto;
    /* 大屏幕优化：基础字体大小增大 */
    font-size: 18px;
}

.container {
    max-width: 1400px; /* 增大最大宽度适应大屏 */
    margin: 0 auto;
    padding: 30px; /* 增大内边距 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 游戏标题和状态栏 - 大屏优化 */
.game-header {
    background: linear-gradient(135deg, #faf8f3, #f0ede5);
    padding: 30px 120px 30px 30px; /* 右侧增加更多内边距为按钮留空间 */
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(107, 91, 115, 0.15);
    border: 2px solid #e8e1d5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative; /* 添加相对定位 */
}

.title-section {
    flex: 1;
    min-width: 400px; /* 增大最小宽度 */
}

.game-header h1 {
    font-size: 3.5rem; /* 显著增大标题字体 */
    color: #d4b896;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15); /* 增强文字阴影 */
}

.subtitle {
    font-size: 1.5rem; /* 增大副标题 */
    color: #6b5f53;
    font-weight: 400;
}

/* 奖励状态栏 - 大屏优化 */
.reward-bar {
    display: flex;
    flex-direction: column;
    gap: 15px; /* 增大间距 */
    min-width: 250px; /* 增大最小宽度 */
}

.level-info {
    display: flex;
    align-items: center;
    gap: 15px; /* 增大间距 */
    justify-content: center;
}

.level-text {
    font-size: 1.4rem; /* 增大字体 */
    font-weight: bold;
    color: #2d3436;
}

.difficulty-indicator {
    display: flex;
    gap: 3px; /* 增大间距 */
}

.difficulty-indicator span {
    font-size: 1.3rem; /* 增大星星大小 */
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.difficulty-indicator span.active {
    opacity: 1;
    animation: twinkle 1.5s infinite ease-in-out;
}

.score-info {
    display: flex;
    gap: 20px; /* 增大间距 */
    justify-content: center;
    align-items: center;
}

.coins, .stars, .streak {
    display: flex;
    align-items: center;
    gap: 8px; /* 增大图标与文字间距 */
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    color: white;
    padding: 8px 16px; /* 增大内边距 */
    border-radius: 20px; /* 增大圆角 */
    font-weight: bold;
    font-size: 1.1rem; /* 增大字体 */
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.15); /* 增强阴影 */
    transition: transform 0.2s ease;
}

.coins:hover, .stars:hover, .streak:hover {
    transform: scale(1.05);
}

.stars {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
}

.streak {
    background: linear-gradient(135deg, #fd79a8, #e84393);
}

/* 目标显示增强 - 大屏优化 */
.target-display {
    background: #faf8f3;
    border-radius: 20px; /* 增大圆角 */
    padding: 30px; /* 增大内边距 */
    margin-bottom: 40px; /* 增大外边距 */
    animation: slideInUp 0.6s ease-out 0.2s both;
    box-shadow: 0 6px 30px rgba(107, 91, 115, 0.15); /* 增强阴影 */
    border: 2px solid #e8e1d5; /* 增粗边框 */
}

.target-items {
    display: flex;
    justify-content: center;
    gap: 30px; /* 增大间距 */
    margin-bottom: 30px; /* 增大底部间距 */
    flex-wrap: wrap;
}

.target-item {
    background: #00b894;
    color: white;
    padding: 20px 35px; /* 增大内边距 */
    border-radius: 30px; /* 增大圆角 */
    display: flex;
    align-items: center;
    gap: 15px; /* 增大间距 */
    font-size: 1.4rem; /* 增大字体 */
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4); /* 增强阴影 */
    transform: scale(1);
    transition: transform 0.2s ease;
    min-height: 70px; /* 增加最小高度便于触控 */
}

.target-item:hover {
    transform: scale(1.05);
}

.target-item .icon {
    font-size: 2rem; /* 增大图标 */
}

.target-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px; /* 增大内边距 */
    border-radius: 15px; /* 增大圆角 */
    margin-left: 8px;
    font-size: 1.3rem; /* 增大数字字体 */
}

.challenge-info {
    background: #fd79a8;
    color: white;
    padding: 20px 35px; /* 增大内边距 */
    border-radius: 30px; /* 增大圆角 */
    display: flex;
    align-items: center;
    gap: 15px; /* 增大间距 */
    font-size: 1.4rem; /* 增大字体 */
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(253, 121, 168, 0.4); /* 增强阴影 */
    animation: pulse 2s infinite ease-in-out;
    min-height: 70px; /* 增加最小高度 */
}

/* 游戏主区域 - 大屏优化 */
.game-area {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px; /* 增大区域间距 */
    flex: 1;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

/* 动物面板增强 - 大屏优化 */
.animal-panel {
    background: #faf8f3;
    border-radius: 20px; /* 增大圆角 */
    padding: 30px; /* 增大内边距 */
    box-shadow: 0 6px 30px rgba(107, 91, 115, 0.15); /* 增强阴影 */
    border: 2px solid #e8e1d5; /* 增粗边框 */
    display: flex;
    flex-direction: column;
    min-height: 600px; /* 增加最小高度 */
}

.animal-panel h3 {
    color: #8680b8;
    font-size: 2rem; /* 增大标题字体 */
    margin-bottom: 30px; /* 增大底部间距 */
    text-align: center;
}

.animal-section {
    margin-bottom: 35px; /* 增大间距 */
    flex-shrink: 0;
}

.animal-section h4 {
    color: #4a3f36;
    margin-bottom: 20px; /* 增大底部间距 */
    font-size: 1.5rem; /* 增大字体 */
}

.animal-source {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px; /* 增大高度 */
    padding: 30px; /* 增大内边距 */
    border: 3px dashed #e8e1d5; /* 增粗边框 */
    border-radius: 20px; /* 增大圆角 */
    background: #fefefe;
    margin-bottom: 25px; /* 增大底部间距 */
    position: relative;
    transition: all 0.3s ease;
}

.animal-source:hover {
    border-color: #00b894;
    background: #f8fffd;
}

/* 学习提示区 - 大屏优化 */
.learning-tips {
    margin-top: auto;
    padding: 20px; /* 增大内边距 */
    background: linear-gradient(135deg, #f3efea, #e8e1d5);
    border-radius: 15px; /* 增大圆角 */
    border-left: 6px solid #d4b896; /* 增粗左边框 */
    flex-shrink: 0;
}

.learning-tips h4 {
    color: #4a3f36;
    margin-bottom: 15px; /* 增大底部间距 */
    font-size: 1.3rem; /* 增大字体 */
}

.tip-content {
    color: #6b5f53;
    font-size: 1.1rem; /* 增大字体 */
    line-height: 1.5; /* 增大行高 */
}

/* 动物样式 - 大屏触控优化 */
.animal {
    width: 100px; /* 增大动物尺寸 */
    height: 100px; /* 增大动物尺寸 */
    background: #f3efea;
    border: 4px solid #e0d7cc; /* 增粗边框 */
    border-radius: 20px; /* 增大圆角 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* 触控优化 */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.animal:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(107, 91, 115, 0.3); /* 增强阴影 */
}

.animal.dragging {
    opacity: 0.5;
    transform: rotate(5deg) scale(1.1); /* 增大拖拽时的缩放 */
    z-index: 1000;
}

.animal.chicken {
    border-color: #d4b896;
    background: linear-gradient(135deg, #d4b896, #c9a876);
}

.animal.rabbit {
    border-color: #9b96c4;
    background: linear-gradient(135deg, #9b96c4, #8680b8);
}

.animal-body {
    font-size: 2.5rem; /* 增大动物表情 */
    margin-bottom: 8px; /* 增大间距 */
    animation: bounce 2s infinite ease-in-out;
}

.animal-info {
    font-size: 0.9rem; /* 增大信息字体 */
    font-weight: bold;
    color: white;
    background: rgba(74, 63, 54, 0.4); /* 增强背景不透明度 */
    padding: 4px 10px; /* 增大内边距 */
    border-radius: 10px; /* 增大圆角 */
}

/* 笼子区域 - 大屏优化 */
.cage-area {
    background: #faf8f3;
    border-radius: 20px; /* 增大圆角 */
    padding: 30px; /* 增大内边距 */
    box-shadow: 0 6px 30px rgba(107, 91, 115, 0.15); /* 增强阴影 */
    display: flex;
    flex-direction: column;
    border: 2px solid #e8e1d5; /* 增粗边框 */
    min-height: 800px; /* 增加最小高度，避免第三行遮挡 */
}

.cage-area h3 {
    color: #c7a4b8;
    font-size: 2rem; /* 增大标题字体 */
    margin-bottom: 30px; /* 增大底部间距 */
    text-align: center;
}

.cage {
    flex: 1;
    border: 4px dashed #c9a876; /* 增粗边框 */
    border-radius: 20px; /* 增大圆角 */
    position: relative;
    background: linear-gradient(135deg, #f3efea, #e8e1d5);
    transition: all 0.3s ease;
    margin-bottom: 30px; /* 增大底部间距 */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 550px; /* 增加最小高度，避免第三行遮挡 */
}

.cage.drag-over {
    border-color: #8faa96;
    background: linear-gradient(135deg, rgba(143, 170, 150, 0.2), rgba(143, 170, 150, 0.1));
    transform: scale(1.02);
}

.cage.shake {
    animation: shake 0.5s ease-in-out;
}

.cage-hint {
    color: #c9a876;
    font-size: 1.5rem; /* 增大提示字体 */
    font-weight: bold;
    text-align: center;
    pointer-events: none;
}

.animals-in-cage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* 适应更大的动物尺寸 */
    gap: 20px; /* 增大间距 */
    padding: 25px; /* 增大内边距 */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    align-content: start;
    overflow-y: auto; /* 改为允许垂直滚动 */
    overflow-x: hidden; /* 防止水平溢出 */
    max-height: 100%; /* 确保不超出笼子高度 */
}

.animals-in-cage .animal {
    width: 100px; /* 保持与源动物一致的大小 */
    height: 100px;
    animation: popIn 0.4s ease-out;
    transition: all 0.3s ease; /* 添加平滑过渡效果 */
}

/* 移动端动态缩放 - 优化尺寸，更早触发缩放 */
.animals-in-cage.scale-small {
    grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); /* 从70px增大到75px */
    gap: 15px; /* 从12px增大到15px */
    padding: 20px; /* 从15px增大到20px */
}

.animals-in-cage.scale-small .animal {
    width: 75px; /* 从70px增大到75px */
    height: 75px;
}

.animals-in-cage.scale-tiny {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); /* 从55px增大到60px */
    gap: 12px; /* 从10px增大到12px */
    padding: 18px; /* 从12px增大到18px */
}

.animals-in-cage.scale-tiny .animal {
    width: 60px; /* 从55px增大到60px */
    height: 60px;
}

.animals-in-cage.scale-micro {
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)); /* 从45px增大到50px */
    gap: 10px; /* 从8px增大到10px */
    padding: 15px; /* 从10px增大到15px */
}

.animals-in-cage.scale-micro .animal {
    width: 50px; /* 从45px增大到50px */
    height: 50px;
}

.animals-in-cage.scale-mini {
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); /* 从38px增大到42px */
    gap: 8px; /* 从6px增大到8px */
    padding: 12px; /* 从8px增大到12px */
}

.animals-in-cage.scale-mini .animal {
    width: 42px; /* 从38px增大到42px */
    height: 42px;
}

/* 调整动物体内的字体大小 - 优化字体尺寸 */
.animals-in-cage.scale-small .animal .animal-body {
    font-size: 2.3rem; /* 从2.2rem增大 */
}

.animals-in-cage.scale-small .animal .animal-info {
    font-size: 0.8rem; /* 从0.75rem增大 */
}

.animals-in-cage.scale-tiny .animal .animal-body {
    font-size: 2rem; /* 从1.8rem增大 */
}

.animals-in-cage.scale-tiny .animal .animal-info {
    font-size: 0.7rem; /* 从0.65rem增大 */
}

.animals-in-cage.scale-micro .animal .animal-body {
    font-size: 1.7rem; /* 从1.5rem增大 */
}

.animals-in-cage.scale-micro .animal .animal-info {
    font-size: 0.6rem; /* 从0.55rem增大 */
}

.animals-in-cage.scale-mini .animal .animal-body {
    font-size: 1.4rem; /* 从1.2rem增大 */
}

.animals-in-cage.scale-mini .animal .animal-info {
    font-size: 0.55rem; /* 从0.5rem增大 */
}

/* 当前状态显示增强 - 大屏优化 */
.current-status {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px; /* 增大底部间距 */
    flex-wrap: wrap;
    gap: 15px; /* 增大间距 */
}

.status-item {
    background: #8faa96;
    color: white;
    padding: 15px 20px; /* 增大内边距 */
    border-radius: 25px; /* 增大圆角 */
    display: flex;
    align-items: center;
    gap: 12px; /* 增大间距 */
    font-weight: bold;
    font-size: 1.2rem; /* 增大字体 */
    transition: transform 0.2s ease;
    flex: 1;
    min-width: 160px; /* 增大最小宽度 */
    justify-content: center;
    min-height: 60px; /* 增加最小高度 */
}

.status-item:hover {
    transform: scale(1.05);
}

.status-item .icon {
    font-size: 1.5rem; /* 增大图标 */
}

.current-number {
    background: rgba(255, 255, 255, 0.3);
    padding: 5px 12px; /* 增大内边距 */
    border-radius: 12px; /* 增大圆角 */
    margin-left: 8px;
    font-size: 1.1rem; /* 增大数字字体 */
}

.difference-display {
    background: #c7a4b8 !important;
}

/* 尝试计数 - 大屏优化 */
.attempt-counter {
    background: #f3efea;
    border: 3px solid #e8e1d5; /* 增粗边框 */
    border-radius: 15px; /* 增大圆角 */
    padding: 20px; /* 增大内边距 */
    text-align: center;
    margin-bottom: 20px; /* 增大底部间距 */
    font-size: 1.1rem; /* 增大字体 */
}

.hint-counter {
    color: #7d6d5a;
    font-size: 1rem; /* 增大字体 */
    margin-bottom: 15px; /* 增大底部间距 */
}

/* 反馈区域 - 大屏优化 */
.feedback {
    padding: 20px; /* 增大内边距 */
    border-radius: 15px; /* 增大圆角 */
    text-align: center;
    font-weight: bold;
    font-size: 1.3rem; /* 增大字体 */
    margin-bottom: 25px; /* 增大底部间距 */
    transition: all 0.3s ease;
    animation: slideInUp 0.4s ease-out;
    min-height: 60px; /* 增加最小高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback.success {
    background: rgba(143, 170, 150, 0.2);
    color: #5a4e42;
    border: 2px solid #8faa96;
}

.feedback.warning {
    background: rgba(212, 184, 150, 0.2);
    color: #5a4e42;
    border: 2px solid #d4b896;
}

.feedback.error {
    background: rgba(199, 164, 184, 0.2);
    color: #5a4e42;
    border: 2px solid #c7a4b8;
}

/* 控制按钮增强 - 大屏触控优化 */
.controls {
    display: flex;
    justify-content: center;
    gap: 25px; /* 增大按钮间距 */
    flex-wrap: wrap;
}

.btn {
    padding: 18px 36px; /* 显著增大按钮内边距 */
    border: none;
    border-radius: 30px; /* 增大圆角 */
    font-size: 1.3rem; /* 增大字体 */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    color: white;
    box-shadow: 0 4px 15px rgba(107, 91, 115, 0.25); /* 增强阴影 */
    min-width: 180px; /* 设置最小宽度 */
    min-height: 60px; /* 设置最小高度，便于触控 */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent; /* 添加边框为后续状态做准备 */
}

.btn:hover {
    transform: translateY(-3px); /* 增大悬停效果 */
    box-shadow: 0 6px 20px rgba(107, 91, 115, 0.35); /* 增强悬停阴影 */
}

.btn:active {
    transform: translateY(-1px); /* 点击时的反馈 */
    box-shadow: 0 3px 10px rgba(107, 91, 115, 0.3);
}

/* 触控设备按钮优化 */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 70px; /* 触控设备增加按钮高度 */
        padding: 20px 40px; /* 增大触控区域 */
        font-size: 1.4rem; /* 增大触控设备字体 */
    }
    
    .btn:hover {
        transform: none; /* 移除悬停效果 */
        box-shadow: 0 4px 15px rgba(107, 91, 115, 0.25);
    }
    
    .btn:active {
        transform: scale(0.98); /* 触控反馈 */
        opacity: 0.9;
    }
}

.btn-primary {
    background: linear-gradient(135deg, #8faa96, #7a9584);
    border-color: #7a9584;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7a9584, #6b8675);
}

.btn-secondary {
    background: linear-gradient(135deg, #d4b896, #c9a876);
    border-color: #c9a876;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #c9a876, #be9d67);
}

.btn-hint {
    background: linear-gradient(135deg, #9b96c4, #8680b8);
    border-color: #8680b8;
}

.btn-hint:hover {
    background: linear-gradient(135deg, #8680b8, #7970a9);
}

.btn-info {
    background: linear-gradient(135deg, #c7a4b8, #b794a8);
    border-color: #b794a8;
}

.btn-info:hover {
    background: linear-gradient(135deg, #b794a8, #a88599);
}

/* 成功弹窗增强 */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(74, 63, 54, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.success-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #faf8f3;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    transform: scale(0.8);
    transition: all 0.3s ease;
    border: 2px solid #e8e1d5;
    box-shadow: 0 10px 30px rgba(107, 91, 115, 0.3);
}

.modal-content h2 {
    color: #00b894;
    margin-bottom: 20px;
    font-size: 2rem;
}

.modal-content p {
    color: #636e72;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.celebration {
    font-size: 2rem;
    margin: 20px 0;
    animation: celebration 1s ease-in-out infinite;
}

/* 奖励显示 */
.reward-summary {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.reward-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.reward-icon {
    font-size: 1.5rem;
    animation: bounce 1s infinite ease-in-out;
}

.reward-text {
    color: #2d3436;
}

.bonus-info {
    margin-top: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
    border-radius: 10px;
    animation: pulse 1s infinite ease-in-out;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 自定义题目表单样式 - 大屏优化 */
.custom-form {
    padding: 30px 0; /* 增大内边距 */
}

.form-group {
    margin-bottom: 35px; /* 增大间距 */
}

.form-group label {
    display: block;
    margin-bottom: 12px; /* 增大间距 */
    font-weight: bold;
    color: #4a3f36;
    font-size: 1.4rem; /* 增大标签字体 */
}

.form-input {
    width: 100%;
    padding: 18px 20px; /* 增大内边距 */
    border: 3px solid #e8e1d5; /* 增粗边框 */
    border-radius: 15px; /* 增大圆角 */
    font-size: 1.2rem; /* 增大字体 */
    font-family: inherit;
    background: #fefefe;
    transition: all 0.3s ease;
    min-height: 60px; /* 增加最小高度便于触控 */
}

.form-input:focus {
    outline: none;
    border-color: #00b894;
    background: #f8fffd;
    box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.15); /* 增强焦点效果 */
}

.form-input:invalid {
    border-color: #e17055;
}

.form-hint {
    display: block;
    margin-top: 8px; /* 增大间距 */
    font-size: 1rem; /* 增大提示字体 */
    color: #6b5f53;
    font-style: italic;
}

.validation-info {
    margin: 30px 0; /* 增大间距 */
    padding: 20px; /* 增大内边距 */
    border-radius: 15px; /* 增大圆角 */
    background: #f8f9fa;
    border: 2px solid #e9ecef; /* 增粗边框 */
}

.validation-result {
    margin-bottom: 15px; /* 增大间距 */
    font-weight: bold;
    font-size: 1.2rem; /* 增大字体 */
}

.validation-result.valid {
    color: #00b894;
}

.validation-result.invalid {
    color: #e17055;
}

.solution-preview {
    padding: 15px; /* 增大内边距 */
    background: #e8f5e8;
    border-radius: 12px; /* 增大圆角 */
    border-left: 6px solid #00b894; /* 增粗左边框 */
    margin-top: 15px; /* 增大间距 */
    font-size: 1.1rem; /* 增大字体 */
}

.form-buttons {
    display: flex;
    gap: 20px; /* 增大间距 */
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px; /* 增大顶部间距 */
}

/* 教学弹窗优化 */
.tutorial-modal, .progress-modal, .custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6); /* 增强背景遮罩 */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
    padding: 20px; /* 添加内边距 */
}

.tutorial-modal.show, .progress-modal.show, .custom-modal.show {
    display: flex;
}

.tutorial-content, .progress-content, .custom-content {
    max-width: 700px; /* 增大最大宽度 */
    max-height: 85vh; /* 调整最大高度 */
    overflow-y: auto;
    position: relative;
    background: #faf8f3; /* 确保背景色 */
    border-radius: 20px; /* 增大圆角 */
    border: 2px solid #e8e1d5; /* 增粗边框 */
    box-shadow: 0 10px 40px rgba(107, 91, 115, 0.3); /* 增强阴影 */
    padding: 30px; /* 增大内边距 */
}

.close-btn {
    position: absolute;
    top: 20px; /* 增大距离 */
    right: 25px; /* 增大距离 */
    background: #e17055;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px; /* 增大尺寸 */
    height: 40px; /* 增大尺寸 */
    font-size: 1.5rem; /* 增大字体 */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #d63031;
    transform: scale(1.1);
}

/* 触控设备弹窗优化 */
@media (hover: none) and (pointer: coarse) {
    .close-btn {
        width: 50px; /* 触控设备增大关闭按钮 */
        height: 50px;
        font-size: 1.8rem;
    }
    
    .form-input {
        min-height: 70px; /* 触控设备增大输入框 */
        padding: 20px 25px;
        font-size: 1.3rem;
    }
    
    .form-group label {
        font-size: 1.5rem; /* 触控设备增大标签 */
    }
}

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

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

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1deg); }
    75% { transform: rotate(-1deg); }
}

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

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

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

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

@keyframes success {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(1deg); }
    50% { transform: scale(1.1) rotate(0deg); }
    75% { transform: scale(1.05) rotate(-1deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.cage.success {
    animation: success 0.6s ease-in-out;
    border-color: #00b894;
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.1), rgba(0, 184, 148, 0.05));
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .target-items {
        gap: 15px;
    }
    
    .controls {
        gap: 15px;
    }
    
    .game-header {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .btn-home-top-right {
        position: absolute;
        top: 20px;
        right: 20px;
        z-index: 10;
    }
    
    .game-header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .target-item {
        font-size: 1.1rem;
        padding: 15px 25px;
    }
    
    /* 移动端笼子区域高度调整 */
    .cage-area {
        min-height: 600px; /* 移动端适当减小但保证足够高度 */
    }
    
    .cage {
        min-height: 400px; /* 移动端笼子高度 */
    }
    
    .animal {
        width: 80px;
        height: 80px;
    }
    
    .animal-body {
        font-size: 2.5rem;
    }
    
    .animals-in-cage {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 15px;
        padding: 20px;
    }
    
    .animals-in-cage .animal {
        width: 80px;
        height: 80px;
    }
    
    /* 移动端动态缩放 - 更早触发缩放 */
    .animals-in-cage.scale-small {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 12px;
        padding: 15px;
    }
    
    .animals-in-cage.scale-small .animal {
        width: 60px;
        height: 60px;
    }
    
    .animals-in-cage.scale-tiny {
        grid-template-columns: repeat(auto-fit, minmax(45px, 1fr));
        gap: 8px;
        padding: 12px;
    }
    
    .animals-in-cage.scale-tiny .animal {
        width: 45px;
        height: 45px;
    }
    
    .animals-in-cage.scale-micro {
        grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
        gap: 6px;
        padding: 10px;
    }
    
    .animals-in-cage.scale-micro .animal {
        width: 35px;
        height: 35px;
    }
    
    .animals-in-cage.scale-mini {
        grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
        gap: 4px;
        padding: 8px;
    }
    
    .animals-in-cage.scale-mini .animal {
        width: 30px;
        height: 30px;
    }
    
    .current-status {
        flex-direction: column;
        gap: 10px;
    }
    
    .status-item {
        font-size: 1rem;
        padding: 12px 16px;
        min-width: auto;
        min-height: 50px;
    }
    
    .reward-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .score-info {
        gap: 10px;
        justify-content: center;
    }
    
    .coins, .stars, .streak {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 90%;
    }
    
    .tutorial-tabs {
        flex-direction: column;
    }
    
    .progress-stats {
        grid-template-columns: 1fr;
    }
    
    .custom-content {
        padding: 20px;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px; /* 减小容器内边距 */
    }
    
    .game-header {
        padding: 15px 60px 15px 15px; /* 进一步减小内边距，但保持按钮空间 */
    }
    
    .game-header h1 {
        font-size: 1.8rem; /* 进一步减小标题 */
    }
    
    .subtitle {
        font-size: 0.9rem; /* 减小副标题 */
    }
    
    /* 小屏幕设备上的右上角按钮进一步调整 */
    .btn-home-top-right {
        top: 8px;
        right: 8px;
        padding: 5px 10px;
        font-size: 0.65rem;
    }
    
    /* 小屏幕笼子区域高度调整 */
    .cage-area {
        min-height: 500px; /* 小屏幕适当减小高度 */
    }
    
    .cage {
        min-height: 320px; /* 小屏幕笼子高度 */
    }

    .target-item,
    .status-item {
        font-size: 1rem; /* 减小字体 */
        padding: 12px 20px; /* 减小内边距 */
        min-height: 50px; /* 减小最小高度 */
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 1rem;
        width: 100%;
        max-width: 250px;
    }
    
    .animal {
        width: 70px;
        height: 70px;
    }
    
    .animal-body {
        font-size: 1.8rem;
    }
    
    .coins, .stars, .streak {
        padding: 4px 8px;
        font-size: 0.9rem;
    }
    
    .target-display {
        padding: 20px;
    }
    
    .controls {
        gap: 10px;
    }
    
    .custom-content {
        margin: 10px 5px;
        max-height: 90vh;
    }
    
    .custom-content h2 {
        font-size: 1.5rem;
    }
    
    .form-input {
        padding: 12px 15px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .form-group label {
        font-size: 1rem;
    }
}

/* 源动物特殊样式 */
.animal.source-animal {
    position: relative;
    border: 2px dashed #00b894;
    background: linear-gradient(135deg, #ffffff, #f8f9ff);
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 184, 148, 0.2);
}

.animal.source-animal::after {
    content: "可重复拖拽";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #00b894;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.animal.source-animal:hover::after {
    opacity: 1;
}

.animal.source-animal:hover {
    transform: scale(1.15);
    border-color: #fd79a8;
    box-shadow: 0 6px 25px rgba(253, 121, 168, 0.3);
}

/* 大屏幕教室显示器优化 */
@media (min-width: 1400px) {
    body {
        font-size: 20px; /* 进一步增大基础字体 */
    }
    
    .container {
        max-width: 1600px; /* 更大的最大宽度 */
        padding: 40px; /* 更大的内边距 */
    }
    
    .game-header h1 {
        font-size: 4rem; /* 超大标题 */
    }
    
    .subtitle {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 22px 44px; /* 更大的按钮 */
        font-size: 1.5rem;
        min-height: 80px;
        min-width: 220px;
    }
    
    .target-item {
        padding: 25px 45px;
        font-size: 1.6rem;
        min-height: 80px;
    }
    
    .animal {
        width: 120px; /* 更大的动物 */
        height: 120px;
        border: 5px solid #e0d7cc;
    }
    
    .animal-body {
        font-size: 3rem; /* 更大的动物表情 */
    }
    
    .cage {
        min-height: 400px; /* 更大的笼子 */
    }
    
    .animals-in-cage {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 25px;
        padding: 30px;
    }
    
    .animals-in-cage .animal {
        width: 120px;
        height: 120px;
    }
}

/* 触控设备优化增强 */
@media (hover: none) and (pointer: coarse) {
    .animal:hover {
        transform: none;
        box-shadow: none;
    }
    
    .animal:active {
        transform: scale(1.1);
        box-shadow: 0 8px 25px rgba(107, 91, 115, 0.3);
    }
    
    /* 大屏触控设备特殊优化 */
    .animal.source-animal::after {
        opacity: 1; /* 始终显示提示 */
        bottom: -35px;
        font-size: 1rem;
        padding: 4px 12px;
    }
    
    /* 增强触控反馈 */
    .target-item:active,
    .status-item:active {
        transform: scale(0.98);
        box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    }
    
    .animal.source-animal:active {
        transform: scale(1.2);
        border-color: #fd79a8;
        box-shadow: 0 8px 30px rgba(253, 121, 168, 0.4);
    }
}

/* 原有响应式设计调整 */
@media (max-width: 1200px) {
    .game-area {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .target-items {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* 教学标签页样式 */
.tutorial-tabs {
    display: flex;
    margin-bottom: 25px; /* 增大间距 */
    border-bottom: 3px solid #e9ecef; /* 增粗边框 */
}

.tab-btn {
    flex: 1;
    padding: 15px 20px; /* 增大内边距 */
    border: none;
    background: transparent;
    color: #636e72;
    font-size: 1.2rem; /* 增大字体 */
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent; /* 增粗底边框 */
    min-height: 60px; /* 增加最小高度 */
}

.tab-btn.active {
    color: #6c5ce7;
    border-bottom-color: #6c5ce7;
}

.tab-btn:hover {
    color: #6c5ce7;
    background: rgba(108, 92, 231, 0.1);
}

.tutorial-content-area {
    min-height: 350px; /* 增加最小高度 */
}

.tab-content {
    display: none;
}

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

.method-steps {
    margin-top: 25px; /* 增大间距 */
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px; /* 增大间距 */
    padding: 20px; /* 增大内边距 */
    background: #f8f9fa;
    border-radius: 15px; /* 增大圆角 */
    border-left: 6px solid #6c5ce7; /* 增粗左边框 */
}

.step-number {
    background: #6c5ce7;
    color: white;
    width: 40px; /* 增大尺寸 */
    height: 40px; /* 增大尺寸 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 20px; /* 增大间距 */
    flex-shrink: 0;
    font-size: 1.2rem; /* 增大字体 */
}

.step p {
    color: #2d3436;
    margin: 0;
    line-height: 1.6; /* 增大行高 */
    font-size: 1.1rem; /* 增大字体 */
}

/* 进度显示样式 */
.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* 增大最小宽度 */
    gap: 25px; /* 增大间距 */
    margin-bottom: 35px; /* 增大间距 */
}

.stat-card {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    padding: 25px; /* 增大内边距 */
    border-radius: 20px; /* 增大圆角 */
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); /* 增强阴影 */
}

.stat-number {
    font-size: 3rem; /* 增大字体 */
    font-weight: bold;
    margin-bottom: 12px; /* 增大间距 */
}

.stat-label {
    font-size: 1.1rem; /* 增大字体 */
    opacity: 0.8;
}

.level-progress h3 {
    color: #2d3436;
    margin-bottom: 25px; /* 增大间距 */
    text-align: center;
    font-size: 1.5rem; /* 增大字体 */
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); /* 增大最小尺寸 */
    gap: 12px; /* 增大间距 */
}

.level-badge {
    aspect-ratio: 1;
    border-radius: 12px; /* 增大圆角 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem; /* 增大字体 */
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 70px; /* 增加最小高度 */
}

.level-badge.completed {
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
}

.level-badge.current {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    color: white;
    animation: pulse 1s infinite ease-in-out;
}

.level-badge.locked {
    background: #e9ecef;
    color: #b2bec3;
}

/* 右上角返回首页按钮样式 */
.btn-home-top-right {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    font-size: 0.85rem;
    min-width: auto;
    min-height: auto;
    z-index: 10;
    white-space: nowrap;
}

/* 返回首页按钮样式 */
.btn-home {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
}

.btn-home:hover {
    background: linear-gradient(135deg, #0984e3, #74b9ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 185, 255, 0.4);
}

.btn-home:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #0984e3, #5a9bd4);
}

/* 触控设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn-home {
        padding: 15px 30px;
        font-size: 1.1rem;
        min-height: 50px;
    }
    
    .btn-home:hover {
        transform: none;
        background: linear-gradient(135deg, #0984e3, #74b9ff);
    }
    
    .btn-home:active {
        transform: scale(0.95);
        background: linear-gradient(135deg, #0984e3, #5a9bd4);
    }
}

/* 版权信息样式 */
.copyright-footer {
    margin-top: 40px;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright-info {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 800px;
    margin: 0 auto;
}

.copyright-line {
    font-size: 0.9rem;
    margin: 0;
    color: #4a3f36;
    line-height: 1.6;
    text-align: center;
}

.copyright-line strong {
    color: #6b5b73;
    text-shadow: none;
}

.main-copyright {
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: #4a3f36;
}

.developer-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.developer-name {
    font-size: 1.1rem;
    color: #6b5b73;
    margin: 0;
    text-shadow: none;
}

.website-info, .wechat-info {
    font-size: 0.95rem;
    margin: 0;
    color: #4a3f36;
}

.website-label, .wechat-label {
    color: #6b5f53;
}

.website-link {
    color: #0984e3;
    text-decoration: none;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(9, 132, 227, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(9, 132, 227, 0.3);
}

.website-link:hover {
    color: #0056b3;
    background: rgba(9, 132, 227, 0.2);
    border-color: rgba(9, 132, 227, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(9, 132, 227, 0.3);
}

.wechat-name {
    color: #00b894;
    text-shadow: none;
}

/* 版权信息移动端适配 */
@media (max-width: 768px) {
    .copyright-footer {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .copyright-info {
        padding: 15px;
        margin: 0 15px;
        max-width: none;
    }
    
    .copyright-line {
        font-size: 0.85rem;
        line-height: 1.8;
    }
    
    .website-link {
        padding: 3px 6px;
        font-size: 0.85rem;
    }
} 