/* 基础样式 */
:root {
    --main-bg: #f4e9d8;
    --dark-brown: #5d4037;
    --light-brown: #8d6e63;
}

body {
    background: var(--main-bg) url('images/微信图片_20250502140956.jpg');
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    background: var(--main-bg) url('images/bg-pattern.png');
    /* 改为： */
    background-size: cover;
    background-position: center;
}

.index-page {
    background-image: url('images/微信图片_20250502140957.jpg');
}

/* 为答题页添加特殊背景 */
.answer-page {
    background-image: url('');
}

html, body {
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.container {
    height: 100vh; /* 100%视口高度 */
    display: flex;
    flex-direction: column;
    padding: 0; /* 移除默认padding */
    overflow: hidden; /* 禁止容器滚动 */
}

.main-content {
    flex: 1;
    overflow-y: auto; /* 允许内容区域滚动 */
    padding: 1rem;
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
}

/* 头部样式 */
.header {
    margin: 2rem 0;
    text-align: center;
}

.logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

h1 {
    color: black;
    font-size: 2.2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    position: relative;
    top: 20px;
}

h2 {
    color: black;
    font-size: 1.4rem;
    margin-top: -0.5rem;
}

h3 {
    color: black;
    font-size: 1rem;
    text-align: center;
}

/* 难度按钮组 */
.difficulty-buttons {
    display: grid;
    gap: 1rem;
    margin: -1rem 0;
}

.btn {
    padding: 15px;
    border-radius: 25px;
    border: none;
    font-size: 1.1rem;
    background: #6d4c41;
    color: white;
    transition: 0.2s;
}

.prev-btn {
    background: #8d6e63 !important;
}

.btn.easy { background: #a1887f; color: white; }
.btn.medium { background: #6d4c41; color: white; }
.btn.hard { background: #4e342e; color: white; }

/* 移动端点击优化 */
@media (max-width: 480px) {
    .btn {
        padding: 1.5rem;
        font-size: 1.2rem;
    }
}

.btn:active {
    transform: scale(0.95);
}

/* 页脚样式 */
.footer {
    flex-shrink: 0;
    padding: 1rem;
    position: relative;
    top: -100px;
}

.footer .sound{
    position: relative;
    left: 16px;
}
.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
    font-weight: bolder;
}

#soundToggle{
    font-weight: bolder;
    position: relative;
    left: 100px;
}
/* 选项样式 */
.options {
    max-height: 48vh;
    overflow-y: auto;
}

.option {
    display: block;
    margin: 10px;
    padding: 15px;
    background: #fff5ee;
    border-radius: 10px;
    transition: 0.2s;
    position:relative;
    top: 10px;
}

.correct {
    animation: flashGreen 1s;
}

@keyframes flashGreen {
    0% { background: #a5d6a7; }
    100% { background: transparent; }
}

.option:hover {
    background: #ffe4c4;
}

input[type="radio"],
input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* 填空题输入框 */
#answerInput {
    width: 80%;
    margin: 20px auto;
    padding: 12px;
    border: 2px solid var(--light-brown);
    border-radius: 8px;
    display: block;
}

/* 提交按钮容器 */
.submit-box {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 1rem;
}

.submit-btn {
    width: 100%;
    background: #6d4c41 !important;
    font-size: 1.2rem;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

/* 输入框仅在填空题显示 */
#answerInput {
    display: none; 
    margin: 20px auto;
}

.progress-bar {
    height: 4px;
    background: #d7ccc8;
    margin: 10px 0;
}

.progress {
    height: 100%;
    background: #6d4c41;
    transition: width 0.3s;
}

.question-card {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    position: relative;
    top: 12px;
    font-weight: bolder;
}

.answer-box{
position: relative;
top: -330px;
}

.nav-buttons {
    position: sticky;
    bottom: 0;
    background: var(--main-bg);
    padding: 10px;
    display: grid;
    gap: 10px;
    position: relative;
    bottom: 60px;
}

.result-card{
    text-align: center;
    position: relative;
    top: 100px;
}
.final-score{
    font-size: 18px;
    font-weight: bolder;
}
.score-number{
    color: red;
    font-size: 35px;
}
.btn1{
    position: relative;
    top: 20px;
    padding: 15px;
    border-radius: 25px;
    border: none;
    font-size: 1.1rem;
    background: #6d4c41;
    color: white;
    transition: 0.2s;
}

/* 优化提示样式 */
#musicAlert {
    position: fixed;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40,40,40,0.9);
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    animation: bounce 1.5s infinite;
    display: none;
    z-index: 1000;
}

@keyframes bounce {
    0%, 100% { transform: translate(-50%, -10px); }
    50% { transform: translate(-50%, 10px); }
}

/* 移动端适配 */
@media (max-width: 768px) {
    #musicAlert {
        width: 80%;
        text-align: center;
        font-size: 13px;
        padding: 10px 20px;
    }
}
/* 结果页专用背景 */
.result-page-bg {
    background-image: url('images/111.jpg') !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 清除原有页面背景继承 */

