@charset "UTF-8";

:root {
    --primary-color: #8BC34A; /* 浅绿色 - 森林草地 */
    --bg-color: #F5F5F5; /* 浅灰 - 背景色 */
    --accent-color: #2196F3; /* 蓝色 - 方向箭头 */
    --carrot-color: #FF9800; /* 橙色 - 胡萝卜 */
    --text-color: #333333;
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --btn-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: linear-gradient(rgba(245, 245, 245, 0.8), rgba(245, 245, 245, 0.8)), url('assets/%E6%A3%AE%E6%9E%97%E5%B0%8F%E5%BE%84.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-color);
    font-size: 18px;
    touch-action: manipulation; /* 优化移动端点击体验 */
    transition: background-image 0.5s ease-in-out;
}

#app {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 移除渐变背景，使用body的背景图 */
}

.screen {
    display: none;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    flex-direction: column;
    overflow-y: auto;
}

.screen.active {
    display: flex;
}

/* 登录界面 */
.login-container {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--btn-shadow);
    text-align: center;
    margin: auto;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.3s;
}

input:focus {
    border-color: var(--primary-color);
}

button {
    cursor: pointer;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    transition: transform 0.1s, box-shadow 0.1s;
    font-weight: bold;
}

button:active {
    transform: scale(0.95);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--btn-shadow);
}

.btn-secondary {
    background-color: #ccc;
    color: #333;
}

.btn-large {
    width: 100%;
    font-size: 1.5rem;
    margin-top: 10px;
}

/* 主界面顶部 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: var(--btn-shadow);
}

.user-info, .stats {
    font-weight: bold;
}

/* 关卡选择 */
.level-selection {
    background: white;
    padding: 20px;
    border-radius: 20px;
    flex-grow: 1;
    box-shadow: var(--btn-shadow);
    overflow-y: auto;
}

.chapter-box {
    margin-bottom: 30px;
}

.chapter-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.level-btn {
    background-color: #e8f5e9;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 20px 0;
    font-size: 1.2rem;
}

.level-btn.locked {
    background-color: #f5f5f5;
    color: #aaa;
    border-color: #ddd;
    cursor: not-allowed;
}

/* 游戏界面 */
.game-header {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: var(--btn-shadow);
    backdrop-filter: blur(5px);
}

.game-stats {
    display: flex;
    justify-content: space-around;
    font-weight: bold;
    font-size: 1.2rem;
}

.game-area {
    background: rgba(255, 255, 255, 0.4); /* 使背景半透明，透出底部图片 */
    border-radius: 20px;
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--btn-shadow);
    gap: 15px;
    backdrop-filter: blur(8px); /* 添加模糊效果，保证格子清晰可见 */
}

.sequence-display {
    width: 100%;
    min-height: 80px;
    background: #e3f2fd;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.sequence-message {
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 5px;
}

.sequence-arrows {
    display: flex;
    gap: 10px;
    font-size: 2rem;
    color: var(--accent-color);
}

.board-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.game-board {
    display: grid;
    gap: 2px;
    background-color: #ccc;
    border: 2px solid #999;
}

.cell {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8); /* 稍微降低纯白格子的透明度 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.cell.path {
    background-color: #f1f8e9;
}

.controls-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.control-pad {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    gap: 10px;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.5); /* 半透明背景 */
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    backdrop-filter: blur(5px);
}

.btn-control {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.btn-control:active:not(:disabled) {
    transform: scale(0.95);
    background-color: var(--primary-color);
    color: white;
}

.btn-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: rgba(238, 238, 238, 0.5);
}

.tools-container {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.btn-tool {
    background-color: var(--carrot-color);
    color: white;
    padding: 10px 20px;
    font-size: 1.1rem;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-top: 0;
}

.modal-content p {
    font-size: 1.2rem;
    margin: 10px 0;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 训练报告卡片样式 */
.report-card {
    background: linear-gradient(135deg, #fff9c4, #c8e6c9);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    color: var(--text-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    margin-bottom: 20px;
    border: 4px solid white;
    /* 确保生成图片时有固定的宽度和白色背景兜底 */
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.report-card::before {
    content: '🐰';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 3rem;
    opacity: 0.2;
}

.report-card::after {
    content: '🥕';
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 3rem;
    opacity: 0.2;
}

.report-title {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    font-weight: bold;
}

.report-info {
    background: rgba(255, 255, 255, 0.6);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.report-info p {
    font-size: 1.6rem;
    margin: 10px 0;
    color: #444;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.stat-box {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: 2px solid #eee;
}

.stat-label {
    display: block;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
}

.stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--carrot-color);
    text-shadow: 1px 1px 0px rgba(0,0,0,0.1);
}

.report-footer {
    font-size: 1.3rem;
    color: #777;
    margin-top: 30px;
    border-top: 2px dashed #bbb;
    padding-top: 20px;
    font-weight: bold;
}
