/* 1. 全局: 字体和背景 */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Helvetica, Arial, "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
    color: #4a3f35;
    
    /* [背景] 后备颜色 (背景图片已移到 ::before 伪元素) */
    background-color: #f5f1e8; 

    /* === [修复] 强制禁止所有水平滚动 === */
    overflow-x: hidden; 
}

/* * === [修复] 移动端背景模糊问题 ===
 * 我们使用 ::before 伪元素来创建一个固定的背景层。
 * 这比 'background-attachment: fixed' 在移动端上表现更稳定。
*/
body::before {
    content: '';
    position: fixed; /* 固定在视口 */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1; /* 把它放在所有内容的后面 */
    
    /* [背景] 你的背景图片 */
    background-image: url('https://f2.toyhou.se/file/f2-toyhou-se/images/110666844_UaQVFbj3yDSmeyt.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
}


/* 3. 左侧导航栏 */
.sidebar {
    position: fixed;
    top: 0; 
    left: 0;
    
    width: 220px;
    height: 100vh; 
    
    background-color: #6b5b4b; /* 复古的棕褐色 */
    color: #f5f1e8;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto; 
    z-index: 1000;
    box-sizing: border-box; 
    
    /* === [字体] 侧边栏也换成 ZCOOL 字体 === */
    font-family: 'ZCOOL XiaoWei', serif;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    border-bottom: 1px dashed #f5f1e8;
    padding-bottom: 1rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav li {
    margin-bottom: 5px;
}
.sidebar-nav a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #f5f1e8;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0; 
}
.sidebar-nav a:hover {
    background-color: #4a3f35;
    padding-left: 20px;
}
.sidebar-nav a.active {
    background-color: #f5f1e8;
    color: #4a3f35;
    font-weight: bold;
}
.scroll-button {
    width: 100%;
    padding: 10px;
    background-color: rgba(0,0,0,0.2);
    color: white;
    border: 1px solid #f5f1e8;
    border-radius: 0;
    cursor: pointer;
    margin-top: 2rem;
    
    /* [字体] 确保按钮也使用新字体 */
    font-family: 'ZCOOL XiaoWei', serif;
}


/* 4. 右侧内容区 */
.content {
    margin-top: 0; 
    margin-left: 260px; /* 220px 宽度 + 左右 padding 40px */
    padding: 40px;
    box-sizing: border-box; 
}

.content-section {
    /* === [透明度] #fffdfa 对应的 RGBA, 80% 不透明度 === */
    background-color: rgba(255, 253, 250, 0.8); 
    
    padding: 30px;
    margin-bottom: 25px;
    border-radius: 0; 
    border: 1px solid #dcdcdc; 
    box-shadow: 5px 5px 10px rgba(74, 63, 53, 0.1);
    min-height: 50vh; 
}

.content-section h2 {
    font-family: 'ZCOOL XiaoWei', serif;
    color: #4a3f35;
    border-bottom: 2px dashed #cccccc;
    padding-bottom: 10px;
    font-weight: normal; 
    font-style: normal; 
    font-size: 2.2rem; 
    text-align: center;
}

/* === 地图图片样式 === */
.section-map {
    width: 100%; 
    height: auto; 
    border: 2px solid #c8bdae; 
    box-sizing: border-box; 
    margin-bottom: 20px; 
}


/* === 文本排版样式 (h3) === */
.content-section h3 {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 1.6rem; 
    color: #556b2f; 
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    font-weight: normal; 
    font-style: normal;
}
.content-section h4 {
    font-size: 1.1rem;
    color: #4a3f35;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-family: Helvetica, Arial, "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
    font-style: italic; 
}
.content-section ul {
    list-style-type: disc;
    padding-left: 20px;
    line-height: 1.6;
}
.content-section ul li {
    margin-bottom: 10px;
}

/* (滑块样式 bar, trait 保持不变) */
.trait {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0;
    font-size: 0.9rem;
    font-weight: normal;
    color: #333;
}
.trait span {
    width: 100px;
    text-align: center;
}
.bar {
    flex-grow: 1;
    height: 10px;
    background-color: #eee;
    border-radius: 0;
    border: 1px solid #ccc;
    overflow: hidden;
    margin: 0 10px;
}
.bar div {
    height: 100%;
    background-color: #556b2f; 
    border-radius: 0;
}

/* (sidebar-header img 样式保持不变) */
.sidebar-header img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}


/* ================================================= */
/* === 5. 表单样式 (Form Styles) === */
/* ================================================= */
.form-declaration {
    background-color: rgba(255, 230, 230, 0.8);
    border: 1px solid #c00; 
    padding: 15px;
    margin-top: 1rem; 
    margin-bottom: 20px;
    border-radius: 3px;
}
.form-declaration h3 {
    font-family: 'ZCOOL XiaoWei', serif; 
    color: #c00; 
    margin: 0 0 10px 0;
    padding: 0;
    border: none; 
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-family: Helvetica, Arial, "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    background-color: #fff;
    box-sizing: border-box; 
    font-family: Helvetica, Arial, "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 1rem;
    border-radius: 0; 
}

.form-group input[type="file"] {
    font-family: Helvetica, Arial, "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
    width: 100%;
}

.form-note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

.submit-button {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background-color: #556b2f; /* 复古绿 */
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    margin-top: 1rem;
    font-family: 'ZCOOL XiaoWei', serif; 
    font-size: 1.2rem;
    transition: background-color 0.2s;
}
.submit-button:hover {
    background-color: #4a3f35; /* 深棕色 */
}


/* ================================================= */
/* === 6. 角色弹窗 (Modal) 样式 === */
/* ================================================= */

/* 角色链接的简单样式 (在 #contact 部分) */
.character-links {
    list-style: none;
    padding: 0;
}
.character-links a {
    font-size: 1.2rem;
    color: #556b2f; /* 复古绿 */
    text-decoration: none;
    font-family: 'ZCOOL XiaoWei', serif;
}
.character-links a:hover {
    text-decoration: underline;
}


/* 弹窗背景 (黑色半透明遮罩) */
.modal-overlay {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); 
    display: none; /* [关键] 默认隐藏 */
    z-index: 2000; 
    justify-content: center;
    /* [修改] 移除 align-items: center;, 让弹窗从顶部开始 */
    
    /* [新增] 遮罩本身可以滚动 */
    overflow-y: auto; 
    
    padding: 40px 20px; /* [修改] 顶部和底部留出 40px 空间 */
    box-sizing: border-box;
}

/* [关键] 当我们用 JS 添加 'visible' 类时, 弹窗显示 */
.modal-overlay.visible {
    display: flex; 
}

/* 弹窗内容 (现在是一个透明的容器) */
.modal-content {
    background-color: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    
    width: auto; 
    max-width: 800px; 
    
    /* [修改] 移除 max-height, 允许内容撑开 */
    
    overflow: visible; 
    position: relative; 
}

/* 弹窗内的档案图片 */
.modal-profile-image {
    display: block;
    width: 100%; 
    height: auto; 
    
    /* [修改] 移除 max-height, 允许图片使用原始高度 */
}


/* 弹窗关闭按钮 (右上角的 'X') */
.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    
    background: #fff;
    border: none;
    border-radius: 50%; /* 圆形 */
    width: 30px;
    height: 30px;
    
    font-size: 1.5rem; 
    color: #4a3f35;
    cursor: pointer;
    font-family: Arial, sans-serif; 
    
    line-height: 30px;
    text-align: center;
    padding: 0;
    
    z-index: 10; 
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.modal-close:hover {
    color: #c00; 
    background: #eee;
}


/* ================================================= */
/* === 7. [已删除] 角色档案 (Profile) 布局 === */
/* ================================================= */
/* 之前所有的 .char-profile 样式已全部删除 */


/* ================================================= */
/* === 响应式布局 / 手机适配 === */
/* ================================================= */
@media (max-width: 768px) {

    .sidebar {
        position: relative;
        width: 100%;
        top: 0;
        margin-top: 0; 
        height: auto;
        z-index: 999;
        box-shadow: none;
        border-bottom: 2px solid #c8bdae;
    }

    .sidebar-header img {
        max-width: 50%; 
    }
    .sidebar-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .sidebar-nav li {
        margin: 5px;
    }
    .sidebar-nav a {
        padding: 8px 12px;
    }
    
    /* "返回顶部" 浮动按钮 */
    .scroll-button {
        position: fixed; 
        bottom: 20px; 
        right: 20px; 
        width: auto; 
        padding: 10px 15px; 
        margin: 0; /* 重置 margin */
        z-index: 1002; 
        border-radius: 5px; 
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    .content {
        margin-left: 0;
        margin-top: 0; 
        padding: 20px; 
    }
    
    .content-section {
        padding: 20px;
    }

    /* [修改] 弹窗在手机上 */
    .modal-overlay {
        padding: 20px 10px; /* 手机上 padding 更小 */
    }
    .modal-content {
        width: 100%; 
        max-width: 100%; 
        /* [修改] 移除 max-height, 允许滚动 */
    }
    /* 手机上关闭按钮放在图片内部, 否则会出屏 */
    .modal-close {
        top: 5px;
        right: 5px;
        background: rgba(255, 255, 255, 0.7); /* 半透明 */
    }

    .content-section h2 {
        font-size: 1.8rem; 
    }
    .content-section h3 {
        font-size: 1.4rem;
    }
}
