/* 基础样式 */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

/* 头部样式 */
header {
    padding: 10px 20px;
    background-color: #1a73e8;
    color: white;
}

/* 将标题、返回按钮和用户信息放在同一行 */
.header-content {
    display: flex;
    justify-content: space-between; /* 分布在两端 */
    align-items: center; /* 垂直居中对齐 */
    width: 100%; /* 使其占满整个宽度 */
}

/* 书名和章节标题样式 */
h1 {
    font-size: 1.0em; /* 调整标题字体大小 */
    margin: 0;
    flex-grow: 1; /* 让标题占据剩余空间 */
}

/* 返回按钮样式 */
.btn-back {
    padding: 8px 15px;
    background-color: #fff;
    color: #1a73e8;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1em;
}

.btn-back:hover {
    background-color: #1558b0;
    color: white;
}

/* 用户信息部分 */
.user-info {
    display: flex;
    align-items: center; /* 垂直居中对齐 */
}

.user-info p {
    margin-right: 10px; /* 用户名和退出按钮之间的间距 */
}

.user-info a {
    color: white;
    text-decoration: none;
    padding: 0 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1em;
    }

    .btn-back {
        padding: 6px 12px;
        font-size: 0.9em;
    }

    .user-info a {
        font-size: 0.9em;
    }
}


/* 内容区域样式 */
.content {

    padding: 20px;
    padding-bottom: 80px; /* 给内容区域增加底部内边距 */
    background-color: white;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
	    margin-top: 20px; /* 给内容区域顶部添加间距，避免与header重叠 */
}

/* 章节内容样式 */
.chapter-content {
    font-size: 1.2em;
    line-height: 1.6;
    color: #333;
}

/* 章节导航样式 */
.chapter-navigation {
    text-align: center;
    margin-top: 20px;
}

.chapter-navigation a {
    padding: 10px 20px;
    background-color: #1a73e8;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px;
    position: fixed;
    width: 100%;
    bottom: 0;
}

footer p {
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 调整标题和返回按钮在小屏幕上的样式 */
    header h1 {
        font-size: 1.2em;
    }

    .btn-back {
        padding: 6px 12px;
        font-size: 0.9em;
    }

    /* 调整内容区域和章节内容在小屏幕上的样式 */
    .content {
        padding: 15px;
    }

    .chapter-content {
        font-size: 1em;
    }
}

/* 新版移动头部样式 */
.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #1a73e8;
    color: white;
}

.left-section,
.right-section {
    flex: 0 0 auto;
}

.center-section {
    flex: 1;
    display: flex; /* ✅ 添加这一行让内部内容可使用 flex 对齐 */
    align-items: center;
    justify-content: flex-start; /* ✅ 让标题靠左 */
    overflow: hidden;
}

.center-section .title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.6em;
    font-weight: bold;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.4em;
    color: white;
    cursor: pointer;
    padding: 5px 10px;
}


/* 折叠菜单 */
.menu-panel {
    display: none;
    flex-direction: column;
    background-color: #f0f0f0;
    padding: 10px;
}

.menu-panel a,
.menu-panel .user-info,
.menu-panel button {
    margin: 5px 0;
    display: block;
    font-size: 1em;
    text-align: left;
}

.menu-panel .btn-back {
    background-color: #1a73e8;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
}

/* 响应式交互 */
@media (max-width: 768px) {
    .menu-panel.active {
        display: flex;
    }
}

