/* 导入中文字体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&display=swap');

/* 全局样式 */
:root {
    --primary-color: #8B0000;
    --secondary-color: #C41E3A;
    --accent-color: #FFB6C1;
    --text-color: #2C1810;
    --bg-color: #FDF5E6;
    --border-color: #8B4513;
    --shadow-color: rgba(139, 69, 19, 0.2);
    --scroll-color: #8B4513;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--scroll-color);
    border-radius: 4px;
}

/* ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
} */

body {
    font-family: 'Noto Serif SC', serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    background: linear-gradient(135deg, #f8f0e3 0%, #faf4ed 50%, #f6ede1 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(to bottom, rgba(139, 0, 0, 0.95), rgba(139, 0, 0, 0.85));
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow-color);
}

.navbar-brand, .nav-link {
    color: #FDF5E6 !important;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* .navbar-brand:hover, .nav-link:hover {
    color: var(--accent-color) !important;
} */

/* 容器样式 */
.container {
    padding: 8px;
}

/* 卡片基础样式 */
.card {
    background: rgba(253, 245, 230, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-color);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
}

.card-header {
    background: rgba(139, 0, 0, 0.1);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

/* 按钮样式 */
.btn {
    border-radius: 4px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #FDF5E6;
}

/* .btn-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
} */

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* .btn-outline-primary:hover {
    background: var(--primary-color);
    color: #FDF5E6;
} */

/* 表单样式 */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(139, 0, 0, 0.25);
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* 列表样式 */
.list-group-item {
    background: rgba(253, 245, 230, 0.95);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    border-radius: 4px !important;
    transition: all 0.3s ease;
}

/* .list-group-item:hover {
    background: rgba(253, 245, 230, 0.98);
    transform: translateX(5px);
} */

/* 游戏界面样式 */
.game-container {
    background: rgba(253, 245, 230, 0.95);
    /* border: 2px solid var(--border-color); */
    /* border-radius: 8px; */
    box-shadow: 0 4px 20px var(--shadow-color);
    padding: 20px;
    margin-top: 20px;
}

.game-page {
    position: relative;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.dialogue-box {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #FDF5E6;
    padding: 20px;
    min-height: 150px;
    border-top: 2px solid var(--border-color);
}

/* 选项按钮样式 */
.btn-option {
    background: rgba(139, 0, 0, 0.9);
    color: #FDF5E6;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    padding: 12px 20px;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* .btn-option:hover {
    background: var(--secondary-color);
    transform: translateX(5px);
} */

.btn-option::after {
    content: '›';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    opacity: 0.7;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .game-page {
        min-height: 300px;
    }
    
    .dialogue-box {
        min-height: 120px;
        padding: 15px;
    }
    
    .btn-option {
        padding: 10px 15px;
    }
}

/* 编辑器特定样式 */
.editor-container {
    background: rgba(253, 245, 230, 0.95);
    /* border: 2px solid var(--border-color); */
    /* border-radius: 8px; */
    /* box-shadow: 0 4px 20px var(--shadow-color); */
    padding: 20px;
    /* margin-top: 20px; */
}

.editor-sidebar {
    background: rgba(253, 245, 230, 0.9);
    border-right: 2px solid var(--border-color);
    padding: 15px;
    height: 100%;
    min-height: 600px;
}

/* 章节列表样式 */
.chapter-list {
    list-style: none;
    padding: 0;
}

.chapter-item {
    background: rgba(253, 245, 230, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

/* .chapter-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-color);
} */

.chapter-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    border-radius: 8px 0 0 8px;
}

/* 登录注册表单样式 */
.auth-container {
    max-width: 400px;
    margin: 40px auto;
    /* background: rgba(253, 245, 230, 0.95); */
    /* border: 2px solid var(--border-color); */
    border-radius: 8px;
    padding: 30px;
    /* box-shadow: 0 4px 20px var(--shadow-color); */
}

.auth-title {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8em;
    font-weight: 600;
}

/* 警告和错误提示样式 */
.alert {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #dc3545;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
    color: #28a745;
}

/* 主页样式 */
.homepage {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.homepage .container {
    position: relative;
    max-width: 100%;
    max-height: 100vh;
    aspect-ratio: 1920/1080;
    font-size: 0;
}

.homepage .main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.homepage .button-container {
    position: absolute;
    left: 50%;
    top: 70.2%;
    transform: translate(-50%, -50%);
    width: 15.6%;
    height: 7.4%;
    background: transparent;
    border: none;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: none;
    transition: all 0.3s ease;
}

.homepage .button-container:hover {
    background: transparent;
    box-shadow: none;
    transform: translate(-50%, -50%) scale(1.05);
}

.homepage .start-button {
    color: #fff;
    text-decoration: none;
    font-family: "楷体", "楷体_GB2312", KaiTi, "华文楷体", STKaiti, serif;
    font-size: 1.67vw;
    white-space: nowrap;
    letter-spacing: 4px;
    font-weight: bold;
}

/* 英文和日文字体调整 */
html[lang="en"] .homepage .start-button {
    font-family: "Times New Roman", serif;
    letter-spacing: 2px;
}

html[lang="ja"] .homepage .start-button {
    font-family: "Noto Sans JP", "Hiragino Sans", "ヒラギノ角ゴ Pro W3", "Meiryo", serif;
    letter-spacing: 3px;
}

/* 音乐控制按钮样式 */
.music-control {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.music-control:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* 语言选择器位置调整 */
.language-selector-header {
    top: 20px;
    right: 20px;
    z-index: 1001;
}