/* 图书详情页面样式 */

/* 图书详情第一栏：封面和信息 */
.book-detail-header {
    display: flex;
    padding: 20px;
    gap: 16px;
    background-color: #f5f7fa;
    border-bottom: 1px solid #e5e7eb;
    align-items: flex-start;
    box-sizing: border-box;
}

/* 图书封面容器 */
.book-cover-container {
    flex: 0 0 auto;
    border: 0.5px solid rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.5);
}

/* 图书封面 */
.book-detail-cover {
    width: 113px;
    height: calc(113px * 1.5 - 10px); /* 2/3比例减10px高度 */
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: #f0f0f0;
    display: block !important;
    margin: 0;
    padding: 0;
    transform: translateY(0); /* 移除不必要的偏移 */
    opacity: 1 !important;
    visibility: visible !important;
}
/* 默认封面 */
.book-detail-default-cover {
    width: 113px;
    height: calc(113px * 1.5 - 10px); /* 2/3比例减10px高度 */
    background-color: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    color: #666666;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin: 0;
    padding: 0;
    transform: translateY(0); /* 移除不必要的偏移 */
}

/* 图书信息容器 */
.book-info-container {
    flex: 1 1 auto;
    min-width: 0;
}

/* 图书标题 */
.book-detail-title {
    margin: 0 0 4px 0 !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    font-family: "SimHei", "STHeiti", "黑体", sans-serif !important;
    color: #1a1a1a !important;
    line-height: 1.3;
    word-wrap: break-word;
}

/* 图书作者 */
.book-author {
    margin: 4px 0 8px 0 !important;
    font-size: 14px !important;
    color: #666666 !important;
    font-weight: 300 !important;
}

/* 图书阅读人数 */
.book-views {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #999999;
    font-weight: 400;
}

/* 图书简介 - 控制在2行 */
.book-description {
    font-size: 14px;
    color: #666666 !important;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    font-weight: 400;
}

/* 图书目录标题 */
.book-contents-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
}

/* 图书内容列表 */
.entity-list.book-contents {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* 去掉目录文字前方的icon text-chapter竖条 */
.chapter.entity-list-item .icon.text-chapter {
    display: none !important;
}

/* 章节列表项 */
.chapter.entity-list-item {
    padding: 12px 0 !important;
    border-bottom: none !important;
    transition: background-color 0.2s ease;
}

/* 章节列表项悬停效果 */
.chapter.entity-list-item:hover {
    background-color: #f5f7fa;
}

/* 章节列表项 */
.chapter.entity-list-item {
    padding: 12px 0 0 0 !important;
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

/* 章节展开区域 */
.chapter.chapter-expansion {
    border-top: none !important;
    margin-top: 0 !important;
    padding-left: 0 !important;
}

/* 章节列表项与展开区域之间的间距 */
.entity-list-item + .chapter-expansion {
    padding: 0 16px 8px 0 !important;
}

/* 去掉章节展开区域的icon */
.chapter.chapter-expansion .icon.text-chapter {
    display: none !important;
}

/* 章节内容切换按钮 */
.chapter-contents-toggle {
    margin-left: 0 !important;
    padding: 0 0 8px 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    width: 100% !important;
    text-align: left !important;
}

/* 章节内容列表 */
.chapter-contents-list {
    margin: 0 !important;
    padding: 0 !important;
}

/* 实体列表项子元素容器 */
.entity-list-item-children {
    margin: 0 !important;
    padding: 0 !important;
}

/* 页面列表项 */
.page.entity-list-item {
    padding: 12px 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
    transition: background-color 0.2s ease;
    margin-left: 0 !important;
}

/* 页面列表项悬停效果 */
.page.entity-list-item:hover {
    background-color: #f5f7fa;
}

/* 目录序号样式 - 垂直水平居中，完全移除背景和边框 */
.chapter-index {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 100% !important;
    margin-right: 12px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    position: relative !important;
    top: 0 !important;
    z-index: auto !important;
}

.chapter-index-number {
    font-size: 12px !important;
    color: #999999 !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: auto !important;
    outline: none !important;
}

/* 章节和页面列表项的布局 */
.chapter.entity-list-item,
.page.entity-list-item {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    flex-direction: row !important;
    background: transparent !important;
    border: none !important;
}

/* 实体列表项内容区域 - 与展开区域在同一容器内 */
.entity-list-item .content {
    margin-left: 0 !important;
    padding-left: 0 !important;
    flex: 1 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 章节展开区域 - 确保与标题在同一容器内 */
.chapter.chapter-expansion {
    width: 100% !important;
    margin-top: 0 !important;
    padding-left: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* 确保最后一个页面列表项没有底部边框 */
.entity-list-item-children .page.entity-list-item:last-child {
    border-bottom: none !important;
}

/* 深色模式支持 */
html.dark-mode .book-detail-header {
    background-color: #1a1a1a;
    border-bottom-color: #3d3d3d;
}

html.dark-mode .book-cover-container {
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

html.dark-mode .book-detail-cover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.dark-mode .book-detail-default-cover {
    background-color: #2d2d2d;
    color: #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html.dark-mode .book-detail-title {
    color: #ffffff;
}

html.dark-mode .book-author {
    color: rgba(255, 255, 255, 0.8);
}

html.dark-mode .book-views {
    color: rgba(255, 255, 255, 0.6);
}

html.dark-mode .book-description {
    color: rgba(255, 255, 255, 0.8);
}

html.dark-mode .book-contents-title {
    color: #ffffff;
}

html.dark-mode .chapter-list-item {
    border-bottom-color: #3d3d3d;
}

html.dark-mode .chapter-list-item:hover {
    background-color: #2d2d2d;
}

html.dark-mode .page-list-item {
    border-bottom-color: #3d3d3d;
    background-color: #1a1a1a;
}

html.dark-mode .page-list-item:hover {
    background-color: #2d2d2d;
}

/* 图书操作功能区 */
.book-detail-actions {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 20px;
    background-color: #ffffff;
    box-sizing: border-box;
}

/* 单个操作项 */
.book-action-item {
    flex: 1;
    text-align: center;
    position: relative;
}

/* 操作项分隔线 */
.book-action-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 30px;
    background-color: #e5e7eb;
}

/* 操作链接 */
.book-action-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666666;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 8px;
}

/* 操作图标 */
.book-action-icon {
    font-size: 20px;
    margin-bottom: 6px;
    display: block;
    line-height: 1;
    color: #999999;
}

/* 操作文字 */
.book-action-text {
    font-size: 12px;
    font-weight: 700 !important;
    color: #666666 !important;
    line-height: 1;
}

/* 深色模式支持 */
html.dark-mode .book-detail-actions {
    background-color: #1a1a1a;
    border-bottom-color: #3d3d3d;
}

/* 深色模式下的操作项分隔线 */
html.dark-mode .book-action-item:not(:last-child)::after {
    background-color: #3d3d3d;
}

html.dark-mode .book-action-link {
    color: rgba(255, 255, 255, 0.7);
}

/* 页面背景色 */
body {
    background-color: #f6f6f6;
}

/* 标签式切换页面 */
.book-tabs-container {
    width: 100%;
    background-color: #ffffff;
}

/* 标签导航 */
.book-tabs-nav {
    display: flex;
    justify-content: flex-start;
    margin-top: 4px;
    padding: 12px 16px 0 16px !important;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    white-space: nowrap;
    background-color: #ffffff;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 隐藏滚动条 */
.book-tabs-nav::-webkit-scrollbar {
    display: none;
}

/* 标签按钮 */
.book-tab-btn {
    min-width: auto;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #666666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-right: 8px;
}

/* 第一个标签的左padding为0 */
.book-tabs-nav .book-tab-btn:first-child {
    padding-left: 0 !important;
}

/* 激活状态的标签按钮 */
.book-tab-btn.active {
    color: #1a1a1a;
    font-weight: 600;
    font-size: 15px;
}

/* 激活状态的标签按钮底部边框 */
.book-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 2px;
    background-color: #1a1a1a;
}

/* 标签按钮悬停效果 */
.book-tab-btn:hover {
    color: #1a1a1a;
}

/* 标签内容 */
.book-tabs-content {
    width: 100%;
}

/* 标签面板 */
.book-tab-panel {
    display: none;
}

/* 激活状态的标签面板 */
.book-tab-panel.active {
    display: block;
}

/* 简介内容样式 */
.book-intro-content {
    padding: 16px 0;
}

.book-intro-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.5;
}

.book-intro-author {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #666666;
    font-weight: 500;
}

.book-intro-full {
    font-size: 16px !important;
    font-weight: 300 !important;
    font-family: "SimHei", "STHeiti", "黑体", sans-serif !important;
    color: #333333 !important;
    line-height: 1.7; /* 加宽行间距2px */
}

/* 评论内容样式 */
.book-comments-content {
    padding: 16px;
    text-align: center;
}

/* 推荐内容样式 */
.book-recommendations-content {
    padding: 0;
    text-align: left;
}

/* 推荐图书列表 */
.related-books-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* 推荐图书列表项 */
.related-book-item {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-direction: row !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: background-color 0.2s ease;
    margin: 0;
    gap: 8px !important;
}

/* 推荐标题样式 */
.recommendations-title {
    padding: 24px 0 16px 0 !important;
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    color: #1a1a1a !important;
    line-height: 1.8;
}

/* 深色模式支持 */
html.dark-mode .recommendations-title {
    color: #ffffff !important;
}

/* 推荐图书封面容器 */
.related-book-cover {
    flex: 0 0 60px;
    width: 60px;
    height: 80px;
    margin-right: 12px;
    border: 0.5px solid rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 推荐图书封面图片 */
.related-book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* 推荐图书默认封面 */
.related-book-default-cover {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #666666;
}

/* 深色模式支持 */
html.dark-mode .related-book-cover {
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

html.dark-mode .related-book-default-cover {
    background-color: #2d2d2d;
    color: #e5e7eb;
}

/* 推荐图书列表项悬停效果 */
.related-book-item:hover {
    background-color: #f5f7fa;
}

/* 推荐图书信息 */
.related-book-info {
    flex: 1;
}

/* 推荐图书标题 */
.related-book-title {
    margin: 0 0 4px 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    line-height: 1.4;
    word-wrap: break-word;
}

/* 推荐图书元信息 */
.related-book-meta {
    margin: 0 !important;
    font-size: 12px !important;
    color: #999999 !important;
    line-height: 1.3;
}

/* 深色模式支持 */
html.dark-mode .related-book-item {
    border-bottom-color: #3d3d3d;
    color: #ffffff;
}

html.dark-mode .related-book-item:hover {
    background-color: #2d2d2d;
}

html.dark-mode .related-book-title {
    color: #ffffff !important;
}

html.dark-mode .related-book-meta {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* 深色模式支持 */
html.dark-mode .book-tabs-container {
    background-color: #1a1a1a;
}

html.dark-mode .book-tabs-nav {
    background-color: #1a1a1a;
    border-bottom-color: #3d3d3d;
}

html.dark-mode .book-tab-btn {
    color: rgba(255, 255, 255, 0.7);
}

html.dark-mode .book-tab-btn.active {
    color: #ffffff;
    font-size: 15px;
}

html.dark-mode .book-tab-btn.active::after {
    background-color: #ffffff;
    width: 8px;
    left: 50%;
    transform: translateX(-50%);
}

html.dark-mode .book-tab-btn:hover {
    color: #ffffff;
}

html.dark-mode .book-intro-title {
    color: #ffffff;
}

html.dark-mode .book-intro-author {
    color: rgba(255, 255, 255, 0.8);
}

html.dark-mode .book-intro-views {
    color: rgba(255, 255, 255, 0.6);
}

html.dark-mode .book-intro-full {
    color: rgba(255, 255, 255, 0.8);
}

/* 隐藏本页的菜单栏 */
.mobile-menu {
    display: none !important;
}

/* 固定底部操作栏 */
.book-bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* 加入书架按钮 */
.add-to-shelf-btn {
    flex: 1;
    margin-right: 10px;
    padding: 12px 20px;
    background-color: transparent;
    border-radius: 100px; /* 两端半圆样式 */
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* 确保加入书架按钮与图标按钮水平居中 */
.book-bottom-actions form,
.book-bottom-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 立即阅读按钮 */
.read-now-btn {
    flex: 2;
    padding: 12px 20px;
    background-color: #1e84e4; /* 微信读书的绿色 */
    border: none;
    border-radius: 100px; /* 两端半圆样式 */
    font-size: 16px; /* 字体调大 */
    font-weight: 600;
    color: #ffffff !important;/* 白色文字，使用!important确保不被其他样式覆盖 */
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.read-now-btn a {
    color: #ffffff !important; /* 确保链接文字也是白色 */
}
/* 立即阅读按钮图标 */
.read-now-btn .icon {
    color: #ffffff; /* 白色图标 */
    margin-right: 8px;
    font-size: 18px; /* 图标调大 */
}

/* 加入书架按钮图标 */
.add-to-shelf-btn .icon {
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 按钮悬停效果 */
.add-to-shelf-btn:hover {
    background-color: #e5e7eb;
}

.read-now-btn:hover {
    background-color: #06b354; /* 加深绿色 */
}

/* 深色模式支持 */
html.dark-mode .book-bottom-actions {
    background-color: #1a1a1a;
    border-top-color: #3d3d3d;
}

html.dark-mode .add-to-shelf-btn {
    background-color: #2d2d2d;
    border-color: #3d3d3d;
    color: rgba(255, 255, 255, 0.8);
}

html.dark-mode .add-to-shelf-btn:hover {
    background-color: #3d3d3d;
}

html.dark-mode .read-now-btn {
    background-color: #07c160;
}

html.dark-mode .read-now-btn:hover {
    background-color: #06b354;
}

/* 小屏幕适配 - 保持左右结构 */
@media (max-width: 480px) {
    .book-detail-header {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        padding: 20px;
        gap: 16px;
    }
    
    .book-cover-container {
        margin-bottom: 0;
    }
    
    .book-detail-cover,
    .book-detail-default-cover {
        width: 113px;
        height: calc(113px * 1.5 - 10px); /* 2/3比例减10px高度 */
    }
    
    .book-detail-title {
        font-size: 16px;
    }
    
    .book-contents-title {
        font-size: 16px;
    }
}

/* 强制设置view-toggle-container中.svg-icon的margin-inline-end为0 */
.view-toggle-container .svg-icon {
    margin-inline-end: 0 !important;
}

/* 修改view-toggle-btn按钮样式 */
.view-toggle-btn {
    background-color: transparent !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

/* 增强SVG图标的高亮效果 */
.view-toggle-btn .svg-icon {
    fill: #666666 !important;
    transition: fill 0.2s ease !important;
}

/* 悬停时的效果 */
.view-toggle-btn:hover .svg-icon {
    fill: #07c160 !important; /* 使用主题的主色调 */
}

/* 激活状态的效果 */
.view-toggle-btn.active .svg-icon {
    fill: #07c160 !important; /* 使用主题的主色调 */
}

/* 深色模式下的样式 */
body.dark-mode .view-toggle-btn .svg-icon {
    fill: #cccccc !important;
}

body.dark-mode .view-toggle-btn:hover .svg-icon {
    fill: #07c160 !important; /* 使用主题的主色调 */
}

body.dark-mode .view-toggle-btn.active .svg-icon {
    fill: #07c160 !important; /* 使用主题的主色调 */
}

