/* 全局基础样式 */
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;
}
h1 {
    font-size: 1.2em;
    margin: 0;
}
.btn-back {
    padding: 8px 15px;
    background-color: #fff;
    color: #1a73e8;
    text-decoration: none;
    border-radius: 5px;
}
.btn-back:hover {
    background-color: #1558b0;
    color: white;
}
a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}
a:hover {
    color: #ffffff;
}
.user-info {
    display: flex;
    align-items: center;
}
.user-info p {
    margin-right: 10px;
}
.user-info a {
    color: white;
    padding: 0 10px;
}

/* 内容 */
.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;
}
.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;
    border-radius: 5px;
}

/* 推荐书籍布局 */
.books {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin: 20px;
}
.book {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}
.book img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: 5px;
}
.book h3 {
    margin: 10px 0 5px;
    font-size: 1.1em;
    color: #1a73e8;
}
.book p {
    font-size: 0.9em;
    color: #555;
}

/* 分类 */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.category {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    width: calc(20.333%); /* 每行三个分类 */
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}


.category h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #1a73e8;
}
.book-list {
    list-style: none;
    padding: 0;
}
.book-list li {
    margin-bottom: 8px;
}
.book-list li a {
    color: #333;
}
.book-list li a:hover {
    color: #1a73e8;
    text-decoration: underline;
}

/* 页脚 */
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: 1em;
    }
    .btn-back {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    .user-info a {
        font-size: 0.9em;
    }
    .content {
        padding: 15px;
    }
    .chapter-content {
        font-size: 1em;
    }
    .category {
        flex: 1 1 100%;
    }
}

/* 卷部分 */
.volume-section {
    margin-bottom: 30px;
}
.volume-section h3 {
    color: #1a73e8;
    font-size: 1.3em;
    margin-bottom: 10px;
}

/* 章节列表 */
.chapter-list {
    list-style: none;
    padding-left: 0;
}
.chapter-list li {
    margin-bottom: 8px;
}
.chapter-list li a {
    display: block;
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    color: #333;
    transition: background-color 0.3s ease;
}
.chapter-list li a:hover {
    background-color: #e8f0fe;
    color: #1a73e8;
    text-decoration: none;
}

@media (max-width: 768px) {
    .chapter-list li a {
        font-size: 0.95em;
        padding: 8px 12px;
    }
}

.two-column-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
}

.book-info {
    width: 35%;
    border-right: 1px solid #ccc;
    padding-right: 20px;
}

.book-cover {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.chapter-list-container {
    width: 65%;
}

.chapter-list {
    list-style-type: none;
    padding-left: 0;
}

.chapter-list li {
    margin: 5px 0;
}

.chapter-list a {
    text-decoration: none;
    color: #0073aa;
}

.chapter-list a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .two-column-layout {
        flex-direction: column;
    }

    .book-info, .chapter-list-container {
        width: 100%;
        padding-right: 0;
        border-right: none;
    }

    .book-cover {
        max-width: 100%;
        height: auto;
    }
}
