/* 小说内页样式 */
.novel-detail {
    background: white;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.novel-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.novel-cover {
    width: 210px;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.novel-info {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

/* 标题：强制多行换行，不隐藏，不省略 */
.novel-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

.novel-author {
    color: #666;
    font-size: 16px;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.novel-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.novel-tag {
    padding: 4px 12px;
    background: #f0f7ff;
    color: #1890ff;
    border-radius: 15px;
    font-size: 14px;
    word-break: break-all;
}

/* 统计信息：响应式 */
.novel-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.stat-item {
    text-align: center;
    min-width: 80px;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    display: block;
}

.stat-label {
    font-size: 14px;
    color: #999;
}

/* 描述：支持长文本换行 */
.novel-description {
    color: #666;
    line-height: 1.8;
    margin-bottom: 25px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    text-align: justify;
    max-width: 100%;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #1890ff;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    background: #fff;
    color: #1890ff;
    border: 1px solid #1890ff;
}

.btn-secondary:hover {
    background: #f0f7ff;
}

.novel-tabs {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.novel-tab {
    padding: 15px 0;
    color: #666;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    position: relative;
}

.novel-tab.active {
    color: #1890ff;
}

.novel-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #1890ff;
}

/* 章节列表 */
.chapter-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chapter-section {
    margin-bottom: 20px;
}

.chapter-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.chapter-item {
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0; /* 关键：Grid 布局中允许收缩 */
}

.chapter-item:hover {
    border-color: #1890ff;
    background: #f0f7ff;
}

.chapter-item.active {
    border-color: #1890ff;
    background: #e6f7ff;
}

.chapter-item-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;        /* 占满父容器 */
    max-width: 100%;     /* 不超出 */
    min-width: 0;        /* 关键：允许收缩 */
    display: block;
}

.chapter-item-time {
    font-size: 12px;
    color: #999;
}

/* 阅读区域 */
.reading-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.chapter-nav-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.chapter-nav-controls {
    display: flex;
    gap: 10px;
}

.chapter-nav-btn {
    padding: 8px 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.chapter-nav-btn:hover {
    background: #e8e8e8;
}

.reading-content {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    min-height: 400px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.reading-content p {
    margin-bottom: 1.5em;
    line-height: 40px;
}

.sidebar {
    position: fixed;
    right: calc((100% - 1350px) / 2 + 20px);
    bottom: 80px;
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

.sidebar-button {
    width: 62px;
    height: 66px;
    background-color: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid #e8e8e8;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .recommendation-container {
        flex-direction: column;
    }
    
    .top10-ranking {
        width: 100%;
    }
    
    .novel-header {
        flex-direction: column;
        text-align: center;
    }
    
    .novel-cover {
        margin: 0 auto;
    }
    
    .novel-stats {
        justify-content: center;
        gap: 20px;
    }
    
    .action-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .headerMain {
        padding: 15px;
    }

    .nav-links a {
        text-decoration: none;
        color: #000000;
        font-size: 14px;
        font-weight: 500;
        padding: 0;
        position: relative;
        transition: all 0.3s ease;
    }

    .btn-primary,
    .btn-secondary {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .menu-toggle {
        display: block;
    }
    
    .search-box {
        display: none;
    }
    
    .novel-detail {
        padding: 15px;
    }
    
    .novel-title {
        font-size: 24px;
    }
    
    .chapter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .reading-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .section-header {
        padding-left: 8px;
    }

    .chapter-nav-controls button {
        font-size: 14px;
        padding: 8px 20px;
        margin-top: 14px;
    }

    .chapter-grid {
        grid-template-columns: 1fr;
    }
    
    .reading-content {
        font-size: 16px;
    }
    
    .novel-tabs {
        gap: 20px;
    }

    /* 手机端：统计信息纵向排列 */
    .novel-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stat-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        text-align: left;
        min-width: auto;
    }

    .stat-label {
        margin-right: 10px;
        font-weight: bold;
    }
}