@charset "UTF-8";
:root {
    --primary-color: #87CEEB; /* 天蓝色 */
    --bg-color: #FFE4B5; /* 鹿皮色 */
    --accent-color: #FF6B6B; /* 珊瑚红 */
    --neutral-color: #F5F5F5; /* 白烟色 */
    --text-color: #333333;
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: linear-gradient(rgba(255, 228, 181, 0.8), rgba(255, 228, 181, 0.8)), url('assets/%E6%97%A7%E7%89%A9%E4%BB%93%E5%BA%93.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    font-size: 18px; /* 大字体 */
}

#app {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

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

.screen.active {
    display: flex;
}

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

h1 {
    font-size: 2.5rem;
    color: var(--accent-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;
}

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

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

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

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

.btn-primary:hover {
    background-color: #ff5252;
}

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

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

.btn-secondary:hover {
    background-color: #6ebde6;
}

.btn-tool {
    background-color: #FFA500;
    color: white;
    width: 100%;
    margin-top: 10px;
}

/* 头部 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--neutral-color);
    padding: 15px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

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

/* 关卡选择 */
.level-selection h2 {
    text-align: center;
    color: var(--accent-color);
    font-size: 2rem;
}

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

.chapter-box {
    background-color: var(--neutral-color);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.chapter-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

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

.level-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 0;
    font-size: 1.2rem;
    border-radius: 10px;
}

.level-btn.locked {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 游戏界面 */
.game-header {
    flex-wrap: wrap;
    gap: 10px;
}

.game-stats {
    display: flex;
    gap: 15px;
    font-size: 1.2rem;
    font-weight: bold;
}

.timer {
    color: var(--accent-color);
}

.board-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.game-board {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* 卡牌样式 */
.card {
    position: relative;
    width: 100%;
    padding-bottom: 133%; /* 3:4 比例 */
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    border-radius: 10px;
}

.card.flipped, .card.matched {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid #fff;
    box-sizing: border-box;
}

.card-back {
    background-color: var(--primary-color);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.2) 10px, rgba(255,255,255,0.2) 20px);
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.card-front {
    background-color: var(--neutral-color);
    transform: rotateY(180deg);
}

.card-front img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--neutral-color);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    min-width: 300px;
}

.modal-content h2 {
    color: var(--accent-color);
    font-size: 2rem;
    margin-top: 0;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}
