/*
Theme Name: Ebook Theme
Theme URI: http://yourwebsite.com/
Author: Your Name
Author URI: http://yourwebsite.com/
Description: 简洁扁平化设计的图书主题，支持首页轮播、推荐书籍、图书详情页、弹窗下载、多网盘。
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ebook-theme
Tags: one-column, two-columns, right-sidebar, responsive-layout, custom-menu, featured-images
*/

/* 通用样式 */
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
}

a {
    color: #0073aa;
    text-decoration: none;
}
a:hover {
    color: #005177;
}

/* 头部和导航 */
header {
    background-color: #fff;
    border-bottom: 1px solid #eaeaea;
    padding: 15px 20px;
}
header h1 {
    margin: 0;
    font-size: 24px;
    color: #0073aa;
}
nav {
    margin-top: 10px;
}
nav a {
    margin-right: 15px;
    font-weight: bold;
}

/* 首页轮播 */
.home-carousel {
    position: relative;
    overflow: hidden;
    margin: 20px auto;
    max-width: 1200px;
    border-radius: 8px;
}
.home-carousel .carousel-item {
    display: none;
}
.home-carousel .carousel-item img {
    width: 100%;
    aspect-ratio: 13.6/21;
    object-fit: cover;
    border-radius: 8px;
}

/* 图书列表 */
.ebook-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 20px;
}
.ebook-item {
    background-color: #fff;
    width: calc(25% - 15px);
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}
.ebook-item:hover {
    transform: translateY(-5px);
}
.ebook-item img {
    width: 100%;
    aspect-ratio: 13.6/21;
    object-fit: cover;
}
.ebook-item .ebook-title {
    font-size: 18px;
    margin: 10px;
}

/* 单本图书页面 */
.ebook-single-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 15px;
}
.ebook-header {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.ebook-thumbnail {
    flex: 0 0 200px;
    margin-right: 20px;
}
.ebook-thumbnail img {
    width: 100%;
    aspect-ratio: 13.6/21;
    object-fit: cover;
    border-radius: 8px;
}
.ebook-info {
    flex: 1;
}
.ebook-info h1 {
    font-size: 28px;
    margin-top: 0;
    color: #0073aa;
}
.ebook-info p {
    margin: 5px 0;
}

/* 章节、简介、作者 */
.ebook-section {
    background-color: #fff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.ebook-section h2 {
    font-size: 20px;
    color: #0073aa;
    margin-bottom: 10px;
}

/* 目录折叠 */
button.toggle-catalog {
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    margin-bottom: 10px;
}
button.toggle-catalog:hover {
    background-color: #005177;
}
.catalog-content {
    border-left: 3px solid #0073aa;
    padding-left: 10px;
    margin-top: 5px;
}

/* 弹窗下载 */
.download-popup {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
}
.download-popup .popup-content {
    background: #fff;
    max-width: 500px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    position: relative;
}
.download-popup .close-popup {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
}
.download-popup input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.download-popup button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.download-popup button:hover {
    background-color: #005177;
}

/* 响应式 */
@media screen and (max-width: 1024px) {
    .ebook-item { width: calc(33% - 15px); }
    .ebook-header { flex-direction: column; }
    .ebook-thumbnail { margin-right: 0; margin-bottom: 15px; }
}
@media screen and (max-width: 768px) {
    .ebook-item { width: calc(50% - 10px); }
}
@media screen and (max-width: 480px) {
    .ebook-item { width: 100%; margin-bottom: 15px; }
    header h1 { font-size: 20px; }
    .ebook-info h1 { font-size: 22px; }
}
