/* 基础样式 */
@font-face {
    font-family: 'GameFont';
    src: url('front.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: transparent;
    color: #333333;
}

body,
input,
textarea,
select,
button {
    font-family: 'GameFont', '微软雅黑', Arial, sans-serif;
}

/* 页面容器 */
#app {
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* 页面样式 */
.page {
    width: 100%;
    height: auto;
    min-height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}

.page.active {
    display: block;
}

/* 背景 */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #FFF8DC;
    z-index: 0;
}

.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/wallpaper.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.5;
    z-index: -1;
    /* 优化移动端背景显示 */
    background-attachment: fixed;
}

/* 响应式背景优化 */
@media (max-width: 768px) {
    .background::before {
        background-size: cover;
        background-position: center;
        opacity: 0.3;
    }
}

/* 内容容器 */
.content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

/* 文字描边效果 */
.outlined-text {
    color: #333333;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: bold;
}

.outlined-text.success {
    color: #4CAF50;
}

.outlined-text.error {
    color: #FF5252;
}

/* 主标题 */
h1.outlined-text {
    font-size: 42px;
    margin-bottom: 20px;
}

/* 装饰文字 */
.decoration {
    font-size: 24px;
    color: #FF6B6B;
    margin: 10px 0;
}

/* 圆角按钮 */
.rounded-button {
    background-color: #FFB366;
    color: #333333;
    border: none;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 22px;
    font-family: 'GameFont', '微软雅黑', Arial, sans-serif;
    font-weight: bold;
    cursor: pointer;
    margin: 15px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    border: 3px solid #FFFFFF;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.rounded-button:hover {
    background-color: #FF9933;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.rounded-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rounded-button.small {
    padding: 8px 15px;
    font-size: 12px;
    margin: 5px;
}

.rounded-button.success {
    background-color: #4CAF50;
    color: #FFFFFF;
}

.rounded-button.success:hover {
    background-color: #66BB6A;
}

.rounded-button.error {
    background-color: #FF5252;
    color: #FFFFFF;
}

.rounded-button.error:hover {
    background-color: #FF3333;
}

/* 按钮组 */
.button-group {
    margin: 20px 0;
}

/* 响应式按钮组布局 */
@media (max-width: 768px) {
    .button-group {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin: 20px 0;
    }
    
    .button-group .rounded-button {
        flex: 1;
        margin: 0;
        max-width: 120px;
        padding: 10px 15px;
        font-size: 16px;
    }
}

/* 管理按钮 */
.manage-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
}

/* 返回首页按钮 */
.home-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
}

/* 底部文字 */
.bottom-text {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: #DEB887;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* BGM开关按钮 */
.bgm-toggle-btn {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #FFB366;
    color: #333333;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 3px solid #FFFFFF;
}

.bgm-toggle-btn:hover {
    background-color: #FF9933;
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.bgm-toggle-btn:active {
    transform: translateX(-50%) translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 设置页面样式 */
.settings-container {
    background-color: #FFFFFF;
    border: 2px solid #DEB887;
    padding: 30px;
    margin: 20px auto;
    max-width: 400px;
}

.setting-item {
    margin: 20px 0;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.setting-item input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

/* 管理题库页面 */
.title {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    z-index: 1;
}

.button-row {
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 1;
}

.button-row .rounded-button {
    padding: 10px 20px;
    font-size: 14px;
}

/* 题库列表容器 */
.bank-list-container {
    position: absolute;
    top: 220px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 60%;
    overflow-y: auto;
    z-index: 1;
}

/* 题库列表 */
.bank-list {
    background-color: rgba(255, 248, 220, 0.8);
}

/* 题库项 */
.bank-item {
    background-color: #FFFFFF;
    border: 1px solid #DEB887;
    margin: 10px 20px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bank-item-info {
    font-size: 14px;
}

.bank-item-buttons {
    display: flex;
    gap: 10px;
}

.bank-item-buttons .rounded-button {
    padding: 5px 15px;
    font-size: 12px;
}

/* 编辑页面样式 */
.edit-header {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    width: 90%;
    text-align: center;
}

.edit-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 10px 0;
}

.edit-info input {
    padding: 8px;
    border: 1px solid #DEB887;
    border-radius: 5px;
    font-size: 12px;
}

#question-info {
    font-size: 14px;
    margin-left: 30px;
}

.edit-container {
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    height: 60%;
    display: flex;
    gap: 20px;
    z-index: 1;
}

.edit-left, .edit-right {
    flex: 1;
    background-color: #FFFFFF;
    border: 2px solid #DEB887;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.edit-left h3, .edit-right label {
    font-size: 14px;
    margin-bottom: 10px;
}

/* 图片上传按钮 */
.image-button {
    flex: 1;
    border: 2px dashed #DEB887;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    background-color: #FFF8DC;
    transition: all 0.3s ease;
}

.image-button:hover {
    border-color: #FF9933;
    background-color: #FFF5E0;
}

.image-button span {
    font-size: 16px;
    color: #666;
}

.image-button img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 表单样式 */
.form-item {
    margin: 20px 0;
}

.form-item input {
    width: 100%;
    padding: 10px;
    border: 1px solid #DEB887;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 5px;
}

/* 编辑按钮组 */
.edit-buttons {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1;
}

.edit-buttons .rounded-button {
    padding: 8px 15px;
    font-size: 12px;
}

/* 游戏页面样式 */
.game-info {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    display: flex;
    gap: 20px;
}

.game-info span {
    font-size: 12px;
}

.game-container {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    display: flex;
    gap: 20px;
    z-index: 1;
    margin-bottom: 150px;
}

.game-left, .game-right {
    flex: 1;
    background-color: #FFFFFF;
    border: 3px solid #FFFFFF;
    box-shadow: 0 0 0 3px #FFF8DC;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 游戏图片容器 */
#game-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #FFF8DC;
    border: 2px dashed #DEB887;
}

#game-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* 游戏右侧 */
.game-right h3 {
    font-size: 16px;
    margin-bottom: 20px;
}

#game-answer-input {
    font-size: 18px;
    padding: 10px;
    border: 1px solid #DEB887;
    border-radius: 5px;
    width: 220px;
    text-align: center;
    margin-bottom: 10px;
}

.divider {
    width: 220px;
    height: 3px;
    background-color: #333333;
    margin: 10px 0;
}

#result-text {
    font-size: 14px;
    margin: 15px 0;
    min-height: 20px;
}

/* 统计容器 */
.stats-container {
    background-color: #FFFFFF;
    border: 2px solid #DEB887;
    padding: 20px 40px;
    margin: 20px auto;
    max-width: 400px;
}

.stats-container h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.stats-container div {
    font-size: 14px;
    margin: 8px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1.outlined-text {
        font-size: 32px;
        margin-bottom: 15px;
    }
    
    .decoration {
        font-size: 20px;
    }
    
    .rounded-button {
        padding: 12px 24px;
        font-size: 18px;
        margin: 10px;
        min-width: 120px;
        min-height: 44px;
    }
    
    .rounded-button.small {
        padding: 10px 18px;
        font-size: 14px;
        min-width: 80px;
        min-height: 40px;
    }
    
    .edit-container {
        flex-direction: column;
        height: auto;
        top: 200px;
        bottom: 150px;
        gap: 15px;
        width: 95%;
    }
    
    .game-container {
        flex-direction: column;
        height: auto;
        top: 100px;
        bottom: 100px;
        gap: 15px;
        width: 95%;
    }
    
    .edit-buttons {
        flex-wrap: wrap;
        bottom: 20px;
        justify-content: center;
        gap: 8px;
    }
    
    .edit-buttons .rounded-button {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .button-row {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .button-row .rounded-button {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .edit-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        flex-direction: column;
        align-items: center;
    }
    
    .edit-info input {
        width: 90%;
        max-width: 300px;
        padding: 10px;
        font-size: 14px;
    }
    
    #question-info {
        margin-left: 0;
        margin-top: 10px;
        font-size: 16px;
    }
    
    /* 游戏页面优化 */
    .game-info {
        top: 70px;
        right: 10px;
        left: 10px;
        justify-content: space-between;
    }
    
    .game-info span {
        font-size: 14px;
    }
    
    #game-answer-input {
        width: 90%;
        max-width: 300px;
        font-size: 18px;
        padding: 12px;
        margin-bottom: 15px;
    }
    
    #game-question {
        font-size: 18px;
        margin-bottom: 20px;
        text-align: center;
    }
    
    /* 游戏页面按钮组优化 - 手机端 */
    .game-right .button-group {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0 10px;
    }
    
    .game-right .button-group .rounded-button {
        flex: 1;
        max-width: none;
        padding: 10px 8px;
        font-size: 14px;
        margin: 0 5px;
        min-width: auto;
    }
    
    /* 编辑页面优化 */
    .edit-left, .edit-right {
        padding: 15px;
    }
    
    .form-item input {
        padding: 12px;
        font-size: 16px;
    }
    
    .image-button span {
        font-size: 14px;
        text-align: center;
        padding: 10px;
    }
    
    /* 题库项优化 */
    .bank-item {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        padding: 15px;
    }
    
    .bank-item-info {
        font-size: 14px;
        text-align: center;
    }
    
    .bank-item-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .bank-item-buttons .rounded-button {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    /* 统计容器优化 */
    .stats-container {
        padding: 20px;
        margin: 15px;
    }
    
    .stats-container h3 {
        font-size: 20px;
    }
    
    .stats-container div {
        font-size: 16px;
    }
    
    /* 底部文字 */
    .bottom-text {
        font-size: 12px;
        bottom: 15px;
    }
}

@media (max-width: 480px) {
    h1.outlined-text {
        font-size: 26px;
    }
    
    h3.outlined-text {
        font-size: 16px;
    }
    
    .rounded-button {
        padding: 14px 24px;
        font-size: 18px;
        margin: 12px;
        min-width: 140px;
    }
    
    .rounded-button.small {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .settings-container {
        padding: 20px;
        margin: 10px;
        width: 95%;
    }
    
    .stats-container {
        padding: 20px;
        margin: 10px;
        width: 95%;
    }
    
    .bank-list-container {
        width: 95%;
        top: 200px;
        height: 65%;
    }
    
    .manage-btn {
        top: 15px;
        right: 15px;
    }
    
    .home-btn {
        top: 15px;
        left: 15px;
    }
    
    .content {
        padding: 0 15px;
    }
    
    /* 调整输入框大小 */
    input[type="text"] {
        font-size: 16px;
        padding: 12px;
    }
    
    input[type="range"] {
        height: 6px;
    }
    
    /* 游戏图片容器 */
    #game-image-container {
        width: 100%;
        height: 300px;
    }
    
    #game-image {
        max-width: 95%;
        max-height: 95%;
    }
    
    /* 编辑图片按钮 */
    .image-button {
        height: 250px;
    }
    
    /* 装饰文字 */
    .decoration {
        font-size: 18px;
    }
    
    /* 结果文本 */
    #result-text {
        font-size: 16px;
        margin: 20px 0;
    }
    
    /* 分隔线 */
    .divider {
        width: 90%;
        max-width: 250px;
    }
}

/* 加载进度条样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 248, 220, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-container {
    text-align: center;
    width: 80%;
    max-width: 500px;
}

.loading-container h2 {
    font-size: 28px;
    margin-bottom: 30px;
    color: #333333;
}

.progress-bar-container {
    background-color: #FFFFFF;
    border: 2px solid #DEB887;
    border-radius: 25px;
    padding: 5px;
    margin: 0 auto 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 30px;
    background-color: #FFB366;
    border-radius: 20px;
    width: 0%;
    transition: width 0.3s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#progress-text {
    font-size: 20px;
    margin-top: 10px;
    color: #333333;
    font-weight: bold;
}

/* 响应式加载进度条 */
@media (max-width: 768px) {
    .loading-container h2 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .progress-bar-container {
        max-width: 300px;
    }
    
    .progress-bar {
        height: 25px;
    }
    
    #progress-text {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .loading-container h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .progress-bar-container {
        max-width: 250px;
    }
    
    .progress-bar {
        height: 20px;
    }
    
    #progress-text {
        font-size: 16px;
    }
}