@charset "UTF-8";
:root {
    --primary-color: #FF9800; /* 主背景 橙色 */
    --bg-color: #FFB74D; /* 柔和背景 */
    --accent-color: #2196F3; /* 算式数字 蓝色 */
    --success-color: #4CAF50; /* 正确提示 绿色 */
    --error-color: #F44336; /* 错误提示 红色 */
    --neutral-color: #FFFFFF; /* 界面背景 白色 */
    --text-color: #333333;
    --font-family: system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    background-color: var(--primary-color);
    background-image: url('assets/首页背景图.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    font-size: 18px;
    touch-action: manipulation;
}

#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;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: auto;
}

.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;
    position: relative;
    margin-top: 100px; /* 为顶部NPC留出空间 */
}

.login-npc {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: auto;
    z-index: 10;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.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 #FFCC80;
    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, box-shadow 0.1s;
    outline: none;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 5px 0 #F57C00;
}

.btn-secondary {
    background-color: #BDBDBD;
    color: white;
    box-shadow: 0 5px 0 #9E9E9E;
}

.btn-tool {
    background-color: #FFF9C4;
    color: #FBC02D;
    border: 2px solid #FBC02D;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 1.2rem;
    margin: 10px 0;
}

/* 主界面 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 2px dashed var(--primary-color);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

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

.stats {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: bold;
}

.level-selection h2 {
    color: var(--primary-color);
    text-align: center;
}

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

.chapter-card {
    background-color: #FFF3E0;
    border: 2px solid #FFE0B2;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.chapter-card:hover {
    background-color: #FFE0B2;
    transform: translateY(-2px);
}

.chapter-card h3 {
    margin: 0 0 5px 0;
    color: var(--primary-color);
}

.chapter-card p {
    margin: 0;
    color: #424242; /* 加深说明文字颜色，提升对比度 */
    font-weight: 500;
}

/* 游戏界面 */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px dashed #FFCC80;
    margin-bottom: 15px;
}

.game-stats {
    display: flex;
    gap: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
}

.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.equation-area {
    font-size: 4rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    min-height: 80px;
    text-align: center;
}

.visual-aid-area {
    min-height: 80px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 2rem;
}

.answers-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.btn-answer {
    background-color: white;
    border: 3px solid #E0E0E0;
    border-radius: 15px;
    padding: 15px 20px;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    box-shadow: 0 4px 0 #E0E0E0;
}

.btn-answer:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #E0E0E0;
}

.btn-answer.correct {
    border-color: var(--success-color);
    background-color: #E8F5E9;
    box-shadow: 0 4px 0 var(--success-color);
}

.btn-answer.wrong {
    border-color: var(--error-color);
    background-color: #FFEBEE;
    box-shadow: 0 4px 0 var(--error-color);
}

.answer-finger {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.answer-number {
    font-size: 1.8rem; /* 适当增大数字字号 */
    font-weight: 800;  /* 加粗数字 */
    color: #212121;    /* 颜色加深，接近纯黑 */
}

.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 5rem;
    z-index: 1000;
    pointer-events: none;
}

.feedback-overlay.show {
    display: flex;
    animation: popUp 0.5s ease-out forwards;
}

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

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 100;
    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;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

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

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
}

.report-details {
    text-align: left;
    margin: 20px 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

.report-content {
    width: 500px;
}
