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

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.container {
    width: 100%;
    height: 100vh;
    position: relative;
}

/* 屏幕切换 */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* 登录页面样式 */
#login-screen {
    background: linear-gradient(45deg, #FF9800, #FFC107);
    justify-content: center;
    align-items: center;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.app-header {
    margin-bottom: 30px;
}

.app-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.app-header h1 {
    font-size: 2.5em;
    color: #4CAF50;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.app-description {
    font-size: 1.1em;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-welcome h2 {
    color: #4CAF50;
    margin-bottom: 10px;
}

.login-welcome p {
    color: #666;
    margin-bottom: 20px;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wechat-btn {
    background: #07C160;
    color: white;
}

.wechat-btn:hover {
    background: #06AD56;
    transform: translateY(-2px);
}

.guest-btn {
    background: #2196F3;
    color: white;
}

.guest-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.developer-btn {
    background: linear-gradient(45deg, #FF5722, #FF9800);
    color: white;
    border: 3px solid #E65100;
    font-size: 18px;
    font-weight: bold;
    padding: 18px 35px;
    box-shadow: 0 8px 25px rgba(255, 87, 34, 0.4);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 30px;
}

.developer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.developer-btn:hover::before {
    left: 100%;
}

.developer-btn:hover {
    background: linear-gradient(45deg, #E64A19, #F57C00);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 87, 34, 0.6);
    border-color: #D84315;
}

.developer-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.5);
}

.developer-btn.active {
    background: linear-gradient(45deg, #D84315, #E65100);
    border-color: #BF360C;
    box-shadow: 0 0 30px rgba(255, 87, 34, 0.8);
    animation: developerPulse 1.5s infinite;
    transform: scale(1.1);
}

@keyframes developerPulse {
    0% {
        box-shadow: 0 0 30px rgba(255, 87, 34, 0.8);
        transform: scale(1.1);
    }
    50% {
        box-shadow: 0 0 50px rgba(255, 87, 34, 1), 0 0 70px rgba(255, 152, 0, 0.6);
        transform: scale(1.15);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 87, 34, 0.8);
        transform: scale(1.1);
    }
}

/* 添加开发者模式按钮的特殊标识 */
.developer-btn::after {
    content: '🔧';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #FFD700;
    color: #333;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: spin 2s linear infinite;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-icon {
    font-size: 20px;
}

/* 主界面样式 */
#main-screen {
    background: linear-gradient(135deg, #E8F5E8, #C8E6C9);
}

/* 用户信息栏样式 */
.user-info {
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #666;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-details {
    flex: 1;
    margin-left: 15px;
}

.user-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.user-level, .user-score {
    font-size: 14px;
    color: #666;
    margin-bottom: 3px;
}

.user-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.icon-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

/* 进度指示器样式 */
.progress-indicator {
    background: white;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

/* 关卡选择样式 */
.level-selection {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.level-selection h2 {
    text-align: center;
    font-size: 2em;
    color: #4CAF50;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* 主题sections样式 */
.theme-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.theme-section h3 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.theme-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--theme-color, #4CAF50);
    border-radius: 2px;
}

.forest-theme {
    --theme-color: var(--forest-color);
    --theme-light: var(--forest-light);
    --theme-dark: var(--forest-dark);
    border-left: 5px solid var(--theme-color);
}

.space-theme {
    --theme-color: var(--space-color);
    --theme-light: var(--space-light);
    --theme-dark: var(--space-dark);
    border-left: 5px solid var(--theme-color);
}

.town-theme {
    --theme-color: var(--town-color);
    --theme-light: var(--town-light);
    --theme-dark: var(--town-dark);
    border-left: 5px solid var(--theme-color);
}

.ocean-theme {
    --theme-color: var(--ocean-color);
    --theme-light: var(--ocean-light);
    --theme-dark: var(--ocean-dark);
    border-left: 5px solid var(--theme-color);
}

.castle-theme {
    --theme-color: var(--castle-color);
    --theme-light: var(--castle-light);
    --theme-dark: var(--castle-dark);
    border-left: 5px solid var(--theme-color);
}

.farm-theme {
    --theme-color: var(--farm-color);
    --theme-light: var(--farm-light);
    --theme-dark: var(--farm-dark);
    border-left: 5px solid var(--theme-color);
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    align-items: stretch; /* 确保所有卡片高度一致 */
}

.level-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 280px; /* 设置最小高度确保一致性 */
    height: auto; /* 允许内容撑开但不超出容器 */
}

.level-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-card.locked:hover {
    transform: none;
}

.level-card.completed {
    border-color: #4CAF50;
    background: linear-gradient(45deg, #E8F5E8, #C8E6C9);
}

.level-card.unlocked {
    border-color: #2196F3;
}

.level-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 10px;
    flex-shrink: 0; /* 防止图标被压缩 */
}

.level-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 8px;
    flex-shrink: 0; /* 防止标题被压缩 */
    line-height: 1.3; /* 改善文本行高 */
}

.level-description {
    font-size: 0.9em;
    color: #666;
    text-align: center;
    margin-bottom: 15px;
    flex-grow: 1; /* 描述文本填充剩余空间 */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4; /* 改善文本行高 */
}

.level-status {
    font-size: 24px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* 防止状态被压缩 */
    margin-top: auto; /* 将状态推到底部 */
}

.level-number {
    width: 60px;
    height: 60px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.level-info h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 8px;
}

.level-info p {
    color: #666;
    margin-bottom: 15px;
}

.stars {
    color: #FFD700;
    font-size: 18px;
}

.reward {
    background: #FF9800;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 8px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.btn-tertiary {
    background: #FF9800;
    color: white;
}

.btn-tertiary:hover {
    background: #F57C00;
    transform: translateY(-2px);
}

.btn-success {
    background: #4CAF50;
    color: white;
    font-size: 18px;
    padding: 15px 30px;
}

.btn-warning {
    background: #FF9800;
    color: white;
    font-size: 18px;
    padding: 15px 30px;
}

.btn-danger {
    background: #F44336;
    color: white;
    font-size: 18px;
    padding: 15px 30px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
}

/* 游戏界面样式 */
#game-screen {
    background: linear-gradient(135deg, #87CEEB, #98FB98);
}

.game-header {
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.game-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.level-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.level-info #current-level {
    font-size: 18px;
    font-weight: bold;
    color: #4CAF50;
}

.level-info #level-title {
    font-size: 16px;
    color: #666;
}

.level-title h3 {
    font-size: 1.5em;
    color: #4CAF50;
}

.game-score {
    font-size: 18px;
    font-weight: bold;
    color: #FF9800;
}

.game-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.game-content {
    flex: 1;
    padding: 20px;
}

.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.story-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.character-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #E8F5E8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
}

.story-text {
    flex: 1;
    font-size: 1.1em;
    color: #333;
    line-height: 1.6;
}

.game-area {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-canvas {
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #f9f9f9;
    max-width: 100%;
    height: auto;
}

.control-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.commands {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.command-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: bold;
}

.command-btn.forward {
    border-color: #F44336;
    color: #F44336;
}

.command-btn.forward:hover {
    background: #F44336;
    color: white;
}

.command-btn.turn {
    border-color: #2196F3;
    color: #2196F3;
}

.command-btn.turn:hover {
    background: #2196F3;
    color: white;
}

.command-btn.condition {
    border-color: #9C27B0;
    color: #9C27B0;
}

.command-btn.condition:hover {
    background: #9C27B0;
    color: white;
}

.execution-area {
    border-top: 2px solid #eee;
    padding-top: 20px;
}

.command-sequence {
    min-height: 60px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.command-sequence.empty::before {
    content: "拖拽命令到这里";
    color: #999;
    font-style: italic;
}

.command-item {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 5px;
}

.command-item.forward {
    background: #ffebee;
    border: 1px solid #f44336;
}

.command-item.turn {
    background: #e3f2fd;
    border: 1px solid #2196f3;
}

.command-item.condition {
    background: #f3e5f5;
    border: 1px solid #9c27b0;
}

.command-item .remove-btn {
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* 设置界面样式 */
#settings-screen {
    background: linear-gradient(135deg, #E8F5E8, #C8E6C9);
    justify-content: center;
    align-items: center;
}

.settings-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.settings-header h2 {
    font-size: 2em;
    color: #4CAF50;
    margin: 0;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-group h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.setting-item label {
    font-size: 16px;
    color: #333;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.setting-item input[type="range"] {
    width: 150px;
}

.setting-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.setting-item button {
    padding: 8px 16px;
    margin: 0 5px;
}

/* 消息提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 20px;
}

.toast-text {
    font-size: 16px;
    color: #333;
}

.toast.success {
    border-left: 4px solid #4CAF50;
}

.toast.error {
    border-left: 4px solid #F44336;
}

.toast.warning {
    border-left: 4px solid #FF9800;
}

.toast.info {
    border-left: 4px solid #2196F3;
}

/* 加载界面样式 */
#loading-screen {
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 18px;
    margin-top: 20px;
}

/* 胜利界面样式 */
#victory-screen {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    justify-content: center;
    align-items: center;
}

.victory-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.victory-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.victory-animation {
    margin-bottom: 30px;
}

.trophy {
    font-size: 80px;
    color: #FFD700;
    animation: bounce 2s infinite;
}

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

.victory-container h2 {
    font-size: 2.5em;
    color: #4CAF50;
    margin-bottom: 20px;
}

.badge {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    display: inline-block;
}

.badge img {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}

.badge img::before {
    content: "🏆";
}

.badge span {
    vertical-align: middle;
}

.reward-info {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

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

.victory-header {
    margin-bottom: 30px;
}

.victory-header h2 {
    font-size: 2.5em;
    color: #4CAF50;
    margin-bottom: 20px;
}

.victory-stars {
    font-size: 40px;
    margin-bottom: 20px;
}

.victory-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.victory-stats .stat-item {
    text-align: center;
}

.victory-stats .stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.victory-stats .stat-item span:last-child {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
}

/* 控制按钮样式 */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .levels-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .level-card {
        padding: 15px;
        min-height: 240px; /* 移动端调整最小高度 */
    }
    
    .theme-game-container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .theme-story-section, .theme-game-area {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .theme-grid, .theme-grid-2, .theme-grid-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .theme-card {
        min-height: 240px; /* 移动端调整最小高度 */
        padding: 15px;
    }
    
    .theme-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .user-actions {
        justify-content: center;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .victory-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .settings-container {
        width: 95%;
        padding: 20px;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* 游戏UI样式 */
.game-ui {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.commands-panel, .sequence-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

.commands-panel h3, .sequence-panel h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.commands-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.command-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #007bff;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.command-btn:hover {
    background: #0056b3;
}

.command-sequence {
    min-height: 60px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.command-sequence.empty {
    justify-content: center;
    align-items: center;
}

.empty-message {
    color: #666;
    font-style: italic;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #e9ecef;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    position: relative;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.remove-btn:hover {
    background: #c82333;
}

.control-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-primary {
    background: #28a745;
    color: white;
}

.btn-primary:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

#game-canvas {
    border: 2px solid #333;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.game-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 18px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 魔法城堡主题样式 */
.castle-theme {
    background: linear-gradient(135deg, #4A148C, #7B1FA2, #9C27B0);

    color: white;
    font-family: 'Arial', sans-serif;
}

.castle-theme .story-section {
    background: rgba(74, 20, 140, 0.8);
    padding: 20px;
    border-radius: 15px;
    margin: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.castle-theme .game-area {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin: 20px;
    backdrop-filter: blur(10px);
}

/* 第41关：魔法钥匙样式 */
.castle-doors {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

.door {
    text-align: center;
    margin: 10px;
}

.door-body {
    width: 120px;
    height: 160px;
    border-radius: 10px;
    border: 3px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.door.opened .door-body {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.door-name {
    font-size: 14px;
    margin-bottom: 10px;
    color: white;
    font-weight: bold;
}

.door-keyhole {
    font-size: 24px;
}

.door-key-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #ddd;
}

.keys-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.key-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-weight: bold;
}

.key-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.progress-display {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.step-indicator {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
}

/* 第42关：咒语样式 */
.spell-sequence {
    margin: 20px 0;
}

.spell-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.spell-item.shown {
    background: rgba(76, 175, 80, 0.3);
}

.spell-text {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
}

.spell-count {
    color: #FFD700;
    font-weight: bold;
}

.pattern-analysis {
    margin: 20px 0;
}

.pattern-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
}

.pattern-item {
    padding: 8px 0;
    font-size: 16px;
}

.spell-input {
    margin: 20px 0;
}

.input-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-area input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(5px);
}

.input-area input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* 蝴蝶动画 */
@keyframes butterfly-fly {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(15deg); }
    50% { transform: translateY(-10px) rotate(-15deg); }
    75% { transform: translateY(-30px) rotate(10deg); }
    100% { transform: translateY(-50px) rotate(0deg); opacity: 0; }
}

/* 第43关：植物生长样式 */
.growth-examples {
    margin: 20px 0;
}

.example-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.example-case {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.case-input {
    font-size: 16px;
    margin-bottom: 10px;
}

.case-output {
    font-size: 18px;
    font-weight: bold;
    color: #4CAF50;
}

.pattern-hint {
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 10px;
    color: #FFD700;
}

.growth-calculator {
    margin: 20px 0;
}

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

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group label {
    font-weight: bold;
    min-width: 80px;
}

.input-group input {
    padding: 8px;
    border: none;
    border-radius: 5px;
    width: 80px;
    text-align: center;
}

.calculation-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.calc-formula {
    font-size: 18px;
    font-family: monospace;
    color: #FFD700;
}

.calc-result {
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
}

.answer-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.answer-input input {
    padding: 10px;
    border: none;
    border-radius: 5px;
    width: 120px;
    text-align: center;
}

.magic-bean {
    text-align: center;
    margin: 20px 0;
}

.bean-container {
    position: relative;
    height: 150px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bean-stalk {
    width: 20px;
    background: #8BC34A;
    border-radius: 10px;
    transition: height 2s ease-in-out;
}

.bean-seed {
    font-size: 30px;
    position: absolute;
    bottom: 0;
}

/* 第44关：potion调配样式 */
.materials-display, .potions-display {
    margin: 20px 0;
}

.materials-grid, .potions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.material-item, .potion-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.material-icon, .potion-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

.material-name, .potion-name {
    font-size: 16px;
    margin-bottom: 5px;
}

.material-count, .potion-count {
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
}

.recipes-display {
    margin: 20px 0;
}

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

.recipe-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.recipe-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.recipe-ingredients {
    margin: 15px 0;
}

.ingredient {
    padding: 5px 0;
    font-size: 14px;
}

.make-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.make-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.optimization-hint {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 152, 0, 0.2);
    border-radius: 10px;
    border-left: 4px solid #FF9800;
}

.hint-text {
    font-size: 16px;
    color: #FFD700;
}

/* potion动画 */
@keyframes potion-glow {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0; }
}

/* 第45关：台阶样式 */
.stairs-container {
    position: relative;
    height: 700px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.stairs {
    position: relative;
    width: 400px;
    height: 600px;
}

.step {
    position: absolute;
    width: 100%;
    height: 60px;
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.step:nth-child(1) { bottom: 0; }
.step:nth-child(2) { bottom: 60px; }
.step:nth-child(3) { bottom: 120px; }
.step:nth-child(4) { bottom: 180px; }
.step:nth-child(5) { bottom: 240px; }
.step:nth-child(6) { bottom: 300px; }
.step:nth-child(7) { bottom: 360px; }
.step:nth-child(8) { bottom: 420px; }
.step:nth-child(9) { bottom: 480px; }
.step:nth-child(10) { bottom: 540px; }

.step-number {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: bold;
    color: #333;
    z-index: 10;
}

.step-left, .step-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step-left {
    background: rgba(255, 0, 0, 0.3);
}

.step-right {
    background: rgba(0, 0, 255, 0.3);
}

.step-left.correct-side, .step-right.correct-side {
    background: rgba(0, 255, 0, 0.5);
}

.step.stepped {
    background: rgba(255, 215, 0, 0.3);
    border-color: #FFD700;
}

.side-label {
    font-size: 14px;
    color: white;
    font-weight: bold;
}

.player-character {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    z-index: 20;
    transition: bottom 0.5s ease;
}

.controls-panel {
    margin: 20px 0;
}

.step-info {
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.current-step {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
}

.step-rule {
    font-size: 16px;
    color: #4CAF50;
    margin-top: 5px;
}

.step-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
}

.side-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.side-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.magic-controls {
    text-align: center;
    margin: 15px 0;
}

.progress-info {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.progress-text, .mistakes-count {
    font-size: 16px;
    color: #FFD700;
}

/* 咒语闪烁动画 */
@keyframes sparkle {
    0% { opacity: 1; transform: scale(0.5); }
    50% { opacity: 0.8; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(0.8); }
}

/* 第46关：水晶球样式 */
.crystal-ball {
    text-align: center;
    margin: 20px 0;
    padding: 30px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-radius: 50%;
    width: 200px;
    height: 200px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.magic-apple {
    transition: font-size 0.5s ease-in-out;
}

.spell-sequence {
    margin: 20px 0;
}

.sequence-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
}

.symbol-card {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.symbol-card.current {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.2);
}

.symbol {
    font-size: 30px;
    margin-bottom: 10px;
}

.symbol-meaning {
    font-size: 14px;
    color: #ddd;
}

.spell-controls {
    margin: 20px 0;
}

.symbol-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.symbol-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.symbol-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.progress-display {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.round-info, .apple-size {
    font-size: 16px;
    color: #FFD700;
    margin: 5px 0;
}

/* 魔法发光动画 */
@keyframes magic-glow {
    0% { filter: drop-shadow(0 0 5px #FFD700); }
    50% { filter: drop-shadow(0 0 20px #FFD700); }
    100% { filter: drop-shadow(0 0 5px #FFD700); }
}

/* 第47关：魔法书样式 */
.magic-book {
    background: rgba(139, 69, 19, 0.8);
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.book-cover {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 15px;
}

.book-title {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 10px;
}

.current-chapter {
    font-size: 18px;
    color: #DDD;
}

.book-pages {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 20px;
    border-radius: 10px;
    min-height: 150px;
}

.page-display {
    text-align: center;
}

.page-content {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.chapter-progress {
    margin: 20px 0;
}

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

.chapter-card {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.chapter-card.current {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.2);
}

.chapter-card.completed {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
}

.chapter-number {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.chapter-pages {
    font-size: 14px;
    color: #DDD;
    margin-bottom: 5px;
}

.chapter-status {
    font-size: 12px;
    color: #FFD700;
}

.reading-controls {
    margin: 20px 0;
}

.page-counter {
    text-align: center;
    margin: 15px 0;
    font-size: 16px;
    color: #FFD700;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.pattern-discovery {
    margin: 20px 0;
}

.pattern-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.pattern-item {
    padding: 8px 0;
    font-size: 16px;
    text-align: center;
}

.pattern-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.pattern-input input {
    padding: 10px;
    border: none;
    border-radius: 5px;
    width: 120px;
    text-align: center;
}

/* 书本发光动画 */
@keyframes book-glow {
    0% { box-shadow: 0 0 10px #FFD700; }
    50% { box-shadow: 0 0 30px #FFD700; }
    100% { box-shadow: 0 0 10px #FFD700; }
}

/* 第48关：礼物分发样式 */
.children-display {
    margin: 20px 0;
}

.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.child-group {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.child-group.total {
    background: rgba(255, 215, 0, 0.2);
}

.group-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

.group-name {
    font-size: 16px;
    margin-bottom: 5px;
}

.group-count {
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
}

.gift-rules {
    margin: 20px 0;
}

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

.rule-card {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.rule-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.rule-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.rule-detail {
    font-size: 14px;
    color: #DDD;
}

.calculation-area {
    margin: 20px 0;
}

.calculation-steps {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.calc-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.calc-label {
    font-weight: bold;
    min-width: 120px;
}

.calc-formula {
    font-size: 16px;
    color: #FFD700;
}

.answer-input {
    margin: 15px 0;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.input-group label {
    font-weight: bold;
    min-width: 120px;
}

.input-group input {
    padding: 8px;
    border: none;
    border-radius: 5px;
    width: 100px;
    text-align: center;
}

.gift-distribution {
    margin: 20px 0;
}

.distribution-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.gift-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.gift-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

.gift-name {
    font-size: 16px;
    margin-bottom: 5px;
}

.gift-count {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
}

/* 礼物掉落动画 */
@keyframes gift-fall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(200px) rotate(360deg); opacity: 0; }
}

/* 第49关：镜子反射样式 */
.mirror-chamber {
    margin: 20px 0;
}

.mirror-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mirror {
    position: absolute;
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.mirror.active {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.left-mirror {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.up-mirror {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.mirror-face {
    font-size: 30px;
    margin-bottom: 10px;
}

.mirror-label {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.mirror-effect {
    font-size: 12px;
    color: #DDD;
}

.reflection-area {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.original-object {
    position: absolute;
    font-size: 40px;
    z-index: 5;
}

.reflected-object {
    position: absolute;
    font-size: 40px;
    opacity: 0.7;
    transition: all 0.5s ease;
}

.reflected-object.center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.reflected-object.right {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.reflected-object.down {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.reflected-object.right-down {
    bottom: 20px;
    right: 20px;
}

.mirror-controls {
    margin: 20px 0;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
}

.mirror-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.mirror-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.mirror-btn.active {
    background: rgba(255, 215, 0, 0.5);
    border: 2px solid #FFD700;
}

.reflection-analysis {
    margin: 20px 0;
}

.analysis-steps {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.step-number {
    width: 30px;
    height: 30px;
    background: #FFD700;
    color: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-text {
    font-size: 16px;
}

.reflection-status {
    margin: 20px 0;
}

.status-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.status-label {
    font-weight: bold;
}

.status-value {
    color: #FFD700;
}

/* 第50关：烟花排列样式 */
.fireworks-designer {
    margin: 20px 0;
}

.pattern-setup {
    margin: 15px 0;
}

.color-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.color-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.color-btn.red {
    background: #f44336;
}

.color-btn.green {
    background: #4CAF50;
}

.color-btn.yellow {
    background: #FFEB3B;
    color: #333;
}

.color-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.quantity-control input {
    width: 60px;
    padding: 8px;
    border: none;
    border-radius: 5px;
    text-align: center;
}

.sequence-display {
    margin: 15px 0;
}

.sequence-preview, .pattern-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.firework-item {
    font-size: 24px;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.firework-item.red {
    background: rgba(244, 67, 54, 0.3);
}

.firework-item.green {
    background: rgba(76, 175, 80, 0.3);
}

.firework-item.yellow {
    background: rgba(255, 235, 59, 0.3);
}

.empty-sequence, .empty-pattern {
    color: #888;
    font-style: italic;
}

.repeat-control {
    margin: 20px 0;
}

.repeat-options {
    margin: 15px 0;
}

.repeat-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.info-item {
    padding: 5px 0;
    font-size: 16px;
}

.repeat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.repeat-input input {
    width: 60px;
    padding: 8px;
    border: none;
    border-radius: 5px;
    text-align: center;
}

.final-pattern {
    margin: 20px 0;
}

.pattern-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.stat-item span {
    font-weight: bold;
    color: #FFD700;
}

.launch-control {
    text-align: center;
    margin: 20px 0;
}

/* 烟花发射动画 */
@keyframes firework-launch {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-30px) scale(1.2); opacity: 0.8; }
    100% { transform: translateY(-60px) scale(1.5); opacity: 0; }
}

@keyframes explosion {
    0% { transform: scale(0.5); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .castle-theme .game-area {
        margin: 10px;
        padding: 15px;
    }
    
    .castle-doors {
        flex-direction: column;
        align-items: center;
    }
    
    .keys-container {
        flex-direction: column;
        align-items: center;
    }
    
    .stairs-container {
        height: 500px;
    }
    
    .stairs {
        width: 300px;
        height: 450px;
    }
    
    .step {
        height: 45px;
    }
    
    .step:nth-child(1) { bottom: 0; }
    .step:nth-child(2) { bottom: 45px; }
    .step:nth-child(3) { bottom: 90px; }
    .step:nth-child(4) { bottom: 135px; }
    .step:nth-child(5) { bottom: 180px; }
    .step:nth-child(6) { bottom: 225px; }
    .step:nth-child(7) { bottom: 270px; }
    .step:nth-child(8) { bottom: 315px; }
    .step:nth-child(9) { bottom: 360px; }
    .step:nth-child(10) { bottom: 405px; }
    
    .mirror-container {
        width: 300px;
        height: 300px;
    }
    
    .sequence-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* 农场主题样式 (51-60关) */
.farm-theme {
    background: linear-gradient(135deg, #8BC34A, #4CAF50, #FF9800);

    color: white;
    font-family: 'Arial', sans-serif;
}

.farm-theme .story-section {
    background: rgba(139, 195, 74, 0.8);
    padding: 20px;
    border-radius: 15px;
    margin: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.farm-theme .game-area {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin: 20px;
    backdrop-filter: blur(10px);
}

/* 第51关：小鸡喂食样式 */
.feeding-schedule {
    margin: 20px 0;
}

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

.schedule-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.schedule-item.known {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
}

.schedule-item.unknown {
    border-color: #FF9800;
    background: rgba(255, 152, 0, 0.2);
}

.time-display {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FFD700;
}

.amount-display {
    font-size: 16px;
    margin-bottom: 10px;
}

.chickens-display {
    font-size: 20px;
    margin-bottom: 10px;
}

.feeding-options {
    margin: 20px 0;
}

.option-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.feed-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: #FF9800;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.feed-btn:hover {
    background: #F57C00;
    transform: translateY(-2px);
}

.chicken-animation {
    text-align: center;
    margin: 20px 0;
    height: 100px;
    position: relative;
}

.chicken-container {
    position: relative;
    height: 100%;
    width: 100%;
}

.chicken {
    font-size: 40px;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* 小鸡喂食动画 */
@keyframes rice-fall {
    0% { transform: translateY(-50px); opacity: 1; }
    100% { transform: translateY(50px); opacity: 0; }
}

@keyframes chicken-eating {
    0%, 100% { transform: translateX(-50%) scale(1); }
    25% { transform: translateX(-50%) scale(1.1) rotate(-5deg); }
    50% { transform: translateX(-50%) scale(1.1) rotate(5deg); }
    75% { transform: translateX(-50%) scale(1.1) rotate(-5deg); }
}

/* 第52关：奶牛挤奶样式 */
.milking-rules {
    margin: 20px 0;
}

.rules-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.rule-item {
    display: flex;
    margin: 10px 0;
    padding: 8px 0;
}

.rule-label {
    font-weight: bold;
    min-width: 100px;
    color: #FFD700;
}

.rule-content {
    color: #DDD;
}

.cow-farm {
    margin: 20px 0;
}

.cows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.cow-card {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.cow-card.odd {
    border-color: #FF9800;
}

.cow-card.even {
    border-color: #2196F3;
}

.cow-card.milked {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
}

.cow-number {
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 5px;
}

.cow-icon {
    font-size: 30px;
    margin: 10px 0;
}

.cow-status {
    font-size: 14px;
    margin-bottom: 10px;
}

.milk-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.milk-btn:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
}

.milk-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.progress-panel {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sequence-list {
    font-size: 18px;
    margin: 10px 0;
}

.sequence-item {
    background: #FFD700;
    color: #333;
    padding: 5px 10px;
    border-radius: 15px;
    margin: 0 5px;
    font-weight: bold;
}

.time-counter {
    font-size: 16px;
    margin: 10px 0;
}

.time-label {
    color: #DDD;
}

.time-value {
    color: #FFD700;
    font-weight: bold;
}

/* 挤奶动画 */
@keyframes milk-fill {
    0% { transform: scale(0.5) translateY(20px); opacity: 0; }
    50% { transform: scale(1.1) translateY(0); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes cleaning-action {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-15deg); }
    50% { transform: scale(1.2) rotate(15deg); }
    75% { transform: scale(1.2) rotate(-15deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes rest-action {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* 第53关：羊毛收集样式 */
.sheep-farm {
    margin: 20px 0;
}

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

.sheep-group {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.sheep-type {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FFD700;
}

.sheep-count {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.sheep-wool {
    font-size: 14px;
    color: #DDD;
    margin-bottom: 10px;
}

.sheep-display {
    font-size: 24px;
    margin-top: 10px;
}

.wool-calculation {
    margin: 20px 0;
}

.calc-steps {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.calc-step {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.calc-label {
    font-weight: bold;
    min-width: 120px;
    color: #FFD700;
}

.calc-formula {
    font-size: 16px;
    color: #DDD;
}

.calculation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.calc-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: #2196F3;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.calc-btn:hover:not(:disabled) {
    background: #1976D2;
    transform: translateY(-2px);
}

.calc-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.wool-collection {
    margin: 20px 0;
}

.wool-display {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.wool-counter, .bag-counter {
    text-align: center;
}

.wool-icon, .bag-icon {
    font-size: 30px;
    display: block;
    margin-bottom: 5px;
}

.wool-count, .bag-count {
    font-size: 24px;
    font-weight: bold;
    color: #FFD700;
}

.wool-unit, .bag-unit {
    font-size: 14px;
    color: #DDD;
}

.packing-area {
    text-align: center;
    margin: 20px 0;
}

.pack-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    background: #FF9800;
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.pack-btn:hover:not(:disabled) {
    background: #F57C00;
    transform: translateY(-2px);
}

.pack-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.remaining-wool {
    margin-top: 15px;
    font-size: 16px;
    color: #FFD700;
}

/* 羊毛收集动画 */
@keyframes wool-collect {
    0% { transform: scale(0.5) translateY(-20px); opacity: 1; }
    50% { transform: scale(1.2) translateY(0); opacity: 0.8; }
    100% { transform: scale(0.8) translateY(20px); opacity: 0; }
}

@keyframes bag-pack {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* 第54关：小猪迷宫样式 */
.maze-rules {
    margin: 20px 0;
}

.rules-list {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.rule-item {
    padding: 8px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.maze-display {
    margin: 20px 0;
}

.maze-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    max-width: 400px;
    margin: 0 auto;
    background: #333;
    padding: 10px;
    border-radius: 10px;
}

.maze-cell {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.maze-cell.wall {
    background: #8B4513;
}

.maze-cell.path {
    background: #90EE90;
}

.pig-controls {
    margin: 20px 0;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.control-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: #FF9800;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.control-btn:hover:not(:disabled) {
    background: #F57C00;
    transform: translateY(-2px);
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.current-status {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.status-item {
    padding: 5px 0;
    font-size: 16px;
}

/* 第55关：鸭群游泳样式 */
.duck-pond {
    margin: 20px 0;
}

.pond-display {
    background: rgba(0, 191, 255, 0.2);
    padding: 20px;
    border-radius: 15px;
    margin: 15px 0;
    position: relative;
}

.duck-row {
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.duck-row.hidden {
    opacity: 0.5;
}

.duck-row.shown {
    opacity: 1;
}

.row-label {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FFD700;
}

.duck-formation {
    font-size: 24px;
    margin: 10px 0;
}

.duck-count {
    font-size: 18px;
    color: #DDD;
    margin-top: 10px;
}

.answer-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.answer-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: #2196F3;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.answer-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.calculation-help {
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 10px;
    border-left: 4px solid #FFD700;
}

.calc-hint {
    font-size: 16px;
    color: #FFD700;
}

/* 游泳动画 */
@keyframes ripple-effect {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
}

@keyframes duck-swimming {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(0); }
    75% { transform: translateX(10px); }
}

/* 第56关：播种计划样式 */
.planting-pattern {
    margin: 20px 0;
}

.pattern-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.pattern-cycle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
}

.pattern-item {
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.pattern-item.corn {
    background: #FFD700;
    color: #333;
}

.pattern-item.wheat {
    background: #DEB887;
    color: #333;
}

.pattern-note {
    text-align: center;
    margin-top: 15px;
    font-size: 16px;
    color: #FFD700;
}

.farm-field {
    margin: 20px 0;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.row-number {
    font-size: 16px;
    font-weight: bold;
    min-width: 60px;
    color: #FFD700;
}

.crop-display {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.crop-name {
    font-size: 14px;
    color: #DDD;
}

.planting-controls {
    margin: 20px 0;
    text-align: center;
}

.cycle-position {
    font-size: 16px;
    color: #FFD700;
    margin: 10px 0;
}

.planting-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.plant-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.plant-btn.corn {
    background: #FFD700;
    color: #333;
}

.plant-btn.wheat {
    background: #DEB887;
    color: #333;
}

.plant-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.target-question {
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 152, 0, 0.2);
    border-radius: 10px;
    border-left: 4px solid #FF9800;
    color: #FFD700;
}

/* 播种动画 */
@keyframes seed-grow {
    0% { transform: scale(0.5) translateY(20px); opacity: 0; }
    50% { transform: scale(1.2) translateY(0); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* 第57关：清洁时间样式 */
.cleaning-schedule {
    margin: 20px 0;
}

.schedule-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.info-item {
    padding: 8px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stable-display {
    margin: 20px 0;
}

.stables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.stable-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stable-item.cleaned {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
}

.stable-number {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 5px;
}

.stable-icon {
    font-size: 30px;
    margin: 10px 0;
}

.stable-status {
    font-size: 14px;
    margin-bottom: 10px;
}

.time-calculator {
    margin: 20px 0;
}

.calculation-steps {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.calc-step {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.calc-step.total {
    border-top: 2px solid #FFD700;
    border-bottom: none;
    font-weight: bold;
    color: #FFD700;
}

.step-label {
    color: #DDD;
}

.step-value {
    color: #FFD700;
    font-weight: bold;
}

.cleaning-controls {
    margin: 20px 0;
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 16px;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.action-btn:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
}

.action-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.answer-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
}

.answer-section label {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
    color: #FFD700;
}

.answer-section input {
    padding: 10px;
    border: none;
    border-radius: 5px;
    width: 120px;
    text-align: center;
    margin: 0 10px;
}

.submit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: #2196F3;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

/* 第58关：鸡蛋分类样式 */
.egg-inventory {
    margin: 20px 0;
}

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

.egg-type {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.egg-type.white {
    border-color: #FFF;
}

.egg-type.red {
    border-color: #F44336;
}

.egg-type.broken {
    border-color: #FF9800;
}

.egg-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.egg-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FFD700;
}

.egg-count {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.egg-rule {
    font-size: 14px;
    color: #DDD;
}

.packaging-calculator {
    margin: 20px 0;
}

.calc-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 15px 0;
}

.calc-section {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.calc-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FFD700;
}

.boxing-display {
    margin: 20px 0;
}

.boxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.box-type {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.box-icon {
    font-size: 30px;
    margin-bottom: 5px;
}

.box-name {
    font-size: 14px;
    margin-bottom: 5px;
    color: #DDD;
}

.box-count {
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
}

.total-boxes {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 152, 0, 0.2);
    border-radius: 10px;
    border-left: 4px solid #FF9800;
    color: #FFD700;
    font-size: 18px;
}

/* 装箱动画 */
@keyframes box-pack {
    0% { transform: scale(0.5) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(0deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* 第59关：运输车装载样式 */
.truck-specs {
    margin: 20px 0;
}

.specs-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.spec-item {
    padding: 8px 0;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.truck-display {
    margin: 20px 0;
}

.truck-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 15px 0;
}

.truck-bed {
    background: #8B4513;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    min-height: 100px;
}

.cargo-area {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 10px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 24px;
}

.cargo-placeholder {
    color: #888;
    font-style: italic;
}

.weight-meter {
    background: #333;
    border-radius: 10px;
    padding: 10px;
}

.weight-bar {
    background: #666;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.weight-fill {
    background: linear-gradient(90deg, #4CAF50, #FF9800, #F44336);
    height: 100%;
    transition: width 0.3s ease;
}

.weight-text {
    text-align: center;
    color: #FFD700;
    font-weight: bold;
}

.loading-calculation {
    margin: 20px 0;
}

.loading-controls {
    margin: 20px 0;
}

.load-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: #FF9800;
    color: white;
    cursor: pointer;
    font-size: 16px;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.load-btn:hover {
    background: #F57C00;
    transform: translateY(-2px);
}

/* 装载动画 */
@keyframes item-load {
    0% { transform: scale(0.5) translateY(-50px); opacity: 0; }
    50% { transform: scale(1.2) translateY(0); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* 第60关：动物表演样式 */
.performance-schedule {
    margin: 20px 0;
}

.schedule-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
}

.performance-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.animal-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.performance-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #FFD700;
}

.performance-count {
    font-size: 18px;
    color: #DDD;
}

.round-info {
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 152, 0, 0.2);
    border-radius: 10px;
    border-left: 4px solid #FF9800;
    color: #FFD700;
}

.calculation-display {
    margin: 20px 0;
}

.calc-breakdown {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.calc-item {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.calc-item.total {
    border-top: 2px solid #FFD700;
    border-bottom: none;
    font-weight: bold;
    color: #FFD700;
}

.performance-stage {
    margin: 20px 0;
}

.stage-display {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 15px 0;
    position: relative;
    min-height: 150px;
}

.current-performer {
    text-align: center;
    margin-bottom: 20px;
}

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

.performer-icon {
    font-size: 60px;
}

.performer-text {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700;
}

.performance-counter {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.counter-item {
    font-size: 16px;
    color: #FFD700;
}

.performance-controls {
    margin: 20px 0;
    text-align: center;
}

.performance-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    background: #FF9800;
    color: white;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.performance-btn:hover:not(:disabled) {
    background: #F57C00;
    transform: translateY(-2px);
}

.performance-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 表演动画 */
@keyframes performance-action {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-10deg); }
    50% { transform: scale(1.3) rotate(10deg); }
    75% { transform: scale(1.2) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .farm-theme .game-area {
        margin: 10px;
        padding: 15px;
    }
    
    .schedule-grid, .sheep-stats, .cows-grid, .stables-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .schedule-display {
        flex-direction: column;
        align-items: center;
    }
    
    .pattern-cycle {
        flex-wrap: wrap;
    }
    
    .option-buttons, .planting-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .control-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .maze-grid {
        grid-template-columns: repeat(10, 25px);
    }
    
    .maze-cell {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
}

/* =================== 主题统一框架 =================== */

/* 主题颜色变量定义 */
:root {
    --forest-color: #4CAF50;
    --forest-light: #E8F5E8;
    --forest-dark: #2E7D32;
    
    --space-color: #2196F3;
    --space-light: #E3F2FD;
    --space-dark: #1565C0;
    
    --town-color: #FF9800;
    --town-light: #FFF3E0;
    --town-dark: #E65100;
    
    --ocean-color: #00BCD4;
    --ocean-light: #E0F2F1;
    --ocean-dark: #00695C;
    
    --castle-color: #9C27B0;
    --castle-light: #F3E5F5;
    --castle-dark: #4A148C;
    
    --farm-color: #8BC34A;
    --farm-light: #F1F8E9;
    --farm-dark: #33691E;
}

/* 通用主题样式框架 */
.theme-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.theme-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--theme-color, #4CAF50);
}

.theme-section h3 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.theme-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--theme-color, #4CAF50);
    border-radius: 2px;
}

/* 具体主题的颜色应用 */
.forest-theme {
    --theme-color: var(--forest-color);
    --theme-light: var(--forest-light);
    --theme-dark: var(--forest-dark);
}

.space-theme {
    --theme-color: var(--space-color);
    --theme-light: var(--space-light);
    --theme-dark: var(--space-dark);
}

.town-theme {
    --theme-color: var(--town-color);
    --theme-light: var(--town-light);
    --theme-dark: var(--town-dark);
}

.ocean-theme {
    --theme-color: var(--ocean-color);
    --theme-light: var(--ocean-light);
    --theme-dark: var(--ocean-dark);
}

.castle-theme {
    --theme-color: var(--castle-color);
    --theme-light: var(--castle-light);
    --theme-dark: var(--castle-dark);
}

.farm-theme {
    --theme-color: var(--farm-color);
    --theme-light: var(--farm-light);
    --theme-dark: var(--farm-dark);
}

/* =================== 游戏内统一界面框架 =================== */

/* 所有主题的通用游戏界面样式 */
.theme-game-container {
    background: linear-gradient(135deg, var(--theme-light), white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-height: 500px;
}

.theme-story-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-left: 4px solid var(--theme-color);
}

.theme-story-section .character-avatar {
    font-size: 60px;
    text-align: center;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

.theme-story-section .story-text {
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    text-align: center;
    background: var(--theme-light);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid var(--theme-color);
}

.theme-game-area {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 2px solid var(--theme-color);
}

.theme-game-area h3 {
    color: var(--theme-dark);
    font-size: 1.4em;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--theme-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 统一按钮样式 */
.theme-btn {
    background: var(--theme-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.theme-btn:hover {
    background: var(--theme-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.theme-btn:active {
    transform: translateY(0);
}

.theme-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.theme-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* 统一输入框样式 */
.theme-input {
    border: 2px solid var(--theme-color);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.theme-input:focus {
    outline: none;
    border-color: var(--theme-dark);
    box-shadow: 0 0 0 3px rgba(var(--theme-color), 0.1);
    background: var(--theme-light);
}

/* 统一卡片样式 */
.theme-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: 2px solid var(--theme-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 280px; /* 与level-card统一最小高度 */
    height: auto;
}

.theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--theme-color), var(--theme-dark));
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* 主题卡片内容布局 */
.theme-card h4 {
    flex-shrink: 0;
    margin-bottom: 10px;
    color: var(--theme-dark);
}

.theme-card p {
    flex-grow: 1;
    margin-bottom: 15px;
    line-height: 1.4;
}

.theme-card .theme-btn {
    margin-top: auto;
    align-self: flex-start;
}

/* 统一进度条样式 */
.theme-progress {
    background: #f0f0f0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.theme-progress-fill {
    background: linear-gradient(90deg, var(--theme-color), var(--theme-dark));
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
}

.theme-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 35%, 
        rgba(255,255,255,0.3) 35%, 
        rgba(255,255,255,0.3) 65%, 
        transparent 65%);
    animation: progress-shimmer 2s linear infinite;
}

@keyframes progress-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 统一网格布局 */
.theme-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch; /* 确保所有卡片高度一致 */
}

.theme-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
}

.theme-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
}

/* 统一动画效果 */
@keyframes theme-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes theme-slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

.theme-animation-fadeIn {
    animation: theme-fadeIn 0.6s ease-out;
}

.theme-animation-slideIn {
    animation: theme-slideIn 0.6s ease-out;
}

.theme-animation-bounce {
    animation: theme-bounce 1s ease-in-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .theme-game-container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .theme-story-section, .theme-game-area {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .theme-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .theme-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
} 

/* 开发者模式按钮显示动画 */
.developer-btn.show-animation {
    animation: developerShow 0.8s ease-out;
}

@keyframes developerShow {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.5);
        box-shadow: 0 0 0 rgba(255, 87, 34, 0);
    }
    50% {
        opacity: 0.8;
        transform: translateY(10px) scale(1.1);
        box-shadow: 0 20px 40px rgba(255, 87, 34, 0.6);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: 0 8px 25px rgba(255, 87, 34, 0.4);
    }
}

/* 开发者模式按钮的特殊边框效果 */
.developer-btn {
    background: linear-gradient(45deg, #FF5722, #FF9800);
    color: white;
    border: 3px solid #E65100;
    font-size: 18px;
    font-weight: bold;
    padding: 18px 35px;
    box-shadow: 0 8px 25px rgba(255, 87, 34, 0.4);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 30px;
}

.developer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.developer-btn:hover::before {
    left: 100%;
}

.developer-btn:hover {
    background: linear-gradient(45deg, #E64A19, #F57C00);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 87, 34, 0.6);
    border-color: #D84315;
}

.developer-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.5);
}

.developer-btn.active {
    background: linear-gradient(45deg, #D84315, #E65100);
    border-color: #BF360C;
    box-shadow: 0 0 30px rgba(255, 87, 34, 0.8);
    animation: developerPulse 1.5s infinite;
    transform: scale(1.1);
}

@keyframes developerPulse {
    0% {
        box-shadow: 0 0 30px rgba(255, 87, 34, 0.8);
        transform: scale(1.1);
    }
    50% {
        box-shadow: 0 0 50px rgba(255, 87, 34, 1), 0 0 70px rgba(255, 152, 0, 0.6);
        transform: scale(1.15);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 87, 34, 0.8);
        transform: scale(1.1);
    }
}

/* 添加开发者模式按钮的特殊标识 */
.developer-btn::after {
    content: '🔧';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #FFD700;
    color: #333;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    animation: spin 2s linear infinite;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 开发者模式按钮容器样式 */
.developer-btn-container {
    position: relative;
    margin-top: 10px;
    padding: 5px;
    background: linear-gradient(45deg, rgba(255, 87, 34, 0.1), rgba(255, 152, 0, 0.1));
    border-radius: 35px;
    border: 2px dashed rgba(255, 87, 34, 0.3);
}

.developer-btn-container::before {
    content: '⚡';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFD700;
    color: #333;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    animation: bounce 1s infinite;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10;
}

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