/* 详情页面样式 */

/* 面包屑导航 */
.breadcrumb-container {
    background: #f8f9fa;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #0056b3;
}

.breadcrumb .separator {
    color: #999;
    margin: 0 4px;
}

.breadcrumb .current {
    color: #333;
    font-weight: 500;
}

/* 主要内容区域 */
.main-content {
    background: #ffffff;
    min-height: calc(100vh - 200px);
    padding: 60x 0;
}

.detail-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 作品信息卡片 */
.manga-info-card {
    display: flex;
    gap: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* 作品封面 */
.manga-cover {
    width: 250px;
    height: 350px;
}

.cover-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding-left: 30px;
}

.cover-img {
    width: 220px;
    height: 300px;
}

/* 作品详情 */
.manga-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: space-between;
    min-width: 0;
}

/* 标题和评分在同一行 */
.title-rating-row {
    padding-top: 20px;
    padding-right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
}

.manga-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.2;
}

/* 评分区域 */
.manga-rating {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #ddd;
    font-size: 1.3rem;
    transition: color 0.3s ease;
}

.star.filled {
    color: #ff6b35;
}

.star.half-filled {
    background: linear-gradient(90deg, #ff6b35 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rating-score {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.rating-count {
    font-size: 1rem;
    color: #666;
}

/* 元信息 */
.manga-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.meta-label {
    font-weight: 600;
    color: #666;
    min-width: 40px;
    flex-shrink: 0;
}

.meta-value {
    color: #333;
    font-size: 1rem;
}

/* 作品描述 */
.manga-description {
    margin-top: 15px;
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.manga-description h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex-shrink: 0;
}

.manga-description p {
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
    margin: 0;
    flex: 1;
}

/* 操作按钮 */
.manga-actions {
    margin-bottom: 25px;
}

.start-reading {
    width: 144px;
    height: 42px;
    background: #ff6b35;
    color: white;
    border: none;
    padding: 0;
    border-radius: 21px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.start-reading:hover {
    background: #e55a2b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* 章节列表区域 */
.chapters-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    padding: 30px;
}

.chapters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    padding-left: 10px;
    padding-top: 10px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.update-info {
    font-size: 0.9rem;
    color: #666;
}

/* 章节过滤器 */
.chapter-filters {
    padding-left: 10px;

    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    cursor: pointer;
    border-radius: 21px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.filter-btn:hover:not(.active) {
    border-color: #ff6b35;
    color: #ff6b35;
}

/* 章节网格 */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chapter-item:hover {
    border-color: #ff6b35;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
}

.chapter-item.locked {
    opacity: 0.7;
    cursor: not-allowed;
}

.chapter-item.locked:hover {
    border-color: #f0f0f0;
    box-shadow: none;
}

.chapter-title {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.lock-icon {
    color: #ff6b35;
    font-size: 0.8rem;
}

/* 深色模式 */
.night-mode .breadcrumb-container {
    background: #1a1a1a;
    border-bottom-color: #333;
}

.night-mode .breadcrumb {
    color: #999;
}

.night-mode .breadcrumb .current {
    color: #e0e0e0;
}

.night-mode .main-content {
    background: #0d1117;
}

.night-mode .manga-info-card {
    background: #161b22;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.night-mode .cover-image {
    border-color: #555;
    background: #0d1117;
}

.night-mode .manga-title {
    color: #e0e0e0;
}

.night-mode .star {
    color: #555;
}

.night-mode .star.filled {
    color: #ff6b35;
}

.night-mode .star.half-filled {
    background: linear-gradient(90deg, #ff6b35 50%, #555 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.night-mode .rating-score {
    color: #e0e0e0;
}

.night-mode .meta-label {
    color: #999;
}

.night-mode .meta-value {
    color: #e0e0e0;
}

.night-mode .manga-description h3 {
    color: #e0e0e0;
}

.night-mode .manga-description p {
    color: #999;
}

.night-mode .chapters-section {
    background: #161b22;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.night-mode .section-title {
    color: #e0e0e0;
}

.night-mode .update-info {
    color: #999;
}

.night-mode .filter-btn {
    background: #161b22;
    border-color: #333;
    color: #999;
}

.night-mode .filter-btn.active {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.night-mode .filter-btn:hover:not(.active) {
    border-color: #ff6b35;
    color: #ff6b35;
}

.night-mode .chapter-item {
    background: #161b22;
    border-color: #333;
}

.night-mode .chapter-item:hover {
    border-color: #ff6b35;
}

.night-mode .chapter-title {
    color: #e0e0e0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .manga-info-card {
        flex-direction: column;
        text-align: center;
    }
    
    .manga-cover {
        width: 150px;
        height: 200px;
        margin: 0 auto;
    }
    
    .title-rating-row {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .manga-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .manga-description {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
    }
    
    .chapter-filters {
        flex-wrap: wrap;
    }
    
    .manga-title {
        font-size: 1.5rem;
    }
    
    .start-reading {
        width: 100%;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .manga-info-card {
        padding: 20px;
    }
    
    .chapters-section {
        padding: 20px;
    }
    
    .manga-title {
        font-size: 1.3rem;
    }
    
    .chapter-filters {
        gap: 5px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* 评论和推荐区域 */
.comments-recommendations {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

/* 左侧内容 */
.left-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* 防止内容溢出 */
}

/* 评论区域 */
.comments-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    padding: 20px;
}

.comments-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.comments-count {
    font-size: 0.9rem;
    color: #666;
}

/* 评论表单 */
.comment-form {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-input-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0; /* 防止内容溢出 */
}

.comment-input-area .comment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.char-count {
    font-size: 0.8rem;
    color: #999;
}

.comment-input {
    width: 100%;
    max-width: 777px;
    height: 88px;
    background: #FFFFFF;
    border-radius: 0px 44px 44px 44px;
    border: 1px solid #999999;
    padding: 12px 20px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}

.comment-input:focus {
    border-color: #ff6b35;
}

.comment-submit-btn {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-submit-btn:hover {
    background: #e55a2b;
}

/* 评论列表 */
.comments-list {
    margin-bottom: 20px;
}

.comment-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-content {
    flex: 1;
    min-width: 0; /* 防止内容溢出 */
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.comment-user-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.comment-user {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.comment-date {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}

.comment-text {
    color: #333;
    line-height: 1.5;
    margin: 0;
    word-wrap: break-word; /* 长文本自动换行 */
}

.comment-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.like-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.like-btn:hover {
    color: #ff6b35;
}

/* 评论分页 */
.comments-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap; /* 分页按钮可以换行 */
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover {
    border-color: #ff6b35;
    color: #ff6b35;
}

.page-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap; /* 页码可以换行 */
}

.page-number {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.page-number.active {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.page-number:hover:not(.active) {
    border-color: #ff6b35;
    color: #ff6b35;
}

.page-ellipsis {
    color: #999;
    padding: 8px 4px;
}

/* 同类推荐 */
.similar-recommendations {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    padding: 20px;
    height: 130px;
    display: flex;
    flex-direction: column;
}

.similar-recommendations .section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    padding: 0;
    position: relative;
}

.similar-recommendations .section-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #f7931e);
    border-radius: 2px;
}

.similar-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    flex: 1;
    align-content: flex-start;
    overflow: hidden;
}

.similar-link {
    color: #666;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.similar-link:hover {
    color: #333;
    text-decoration: underline;
}

/* 右侧推荐 */
.right-sidebar {
    width: 280px;
    flex-shrink: 0;
    min-width: 0; /* 防止内容溢出 */
}

.recommendations-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    padding: 30px;
}

.recommendations-section .section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    padding: 0;
    position: relative;
}

.recommendations-section .section-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #f7931e);
    border-radius: 2px;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.recommendation-item {
    display: flex;
    gap: 15px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.recommendation-item:hover {
    transform: translateX(5px);
}

.rec-cover {
    width: 60px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.rec-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rec-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rec-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.rec-author, .rec-genre, .rec-update {
    font-size: 0.8rem;
    color: #666;
    margin: 2px 0;
}

/* 深色模式 */
.night-mode .comments-section,
.night-mode .similar-recommendations,
.night-mode .recommendations-section {
    background: #161b22;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.night-mode .comments-title {
    color: #e0e0e0;
}

.night-mode .comments-count {
    color: #999;
}

.night-mode .comment-input {
    background: #2d2d2d;
    border-color: #555;
    color: #e0e0e0;
}

.night-mode .char-count {
    color: #999;
}

.night-mode .comment-input:focus {
    border-color: #ff6b35;
}

.night-mode .comment-user {
    color: #e0e0e0;
}

.night-mode .comment-text {
    color: #e0e0e0;
}

.night-mode .comment-item {
    border-bottom-color: #333;
}

.night-mode .page-btn,
.night-mode .page-number {
    background: #2d2d2d;
    border-color: #555;
    color: #999;
}

.night-mode .page-number.active {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

.night-mode .page-number:hover:not(.active) {
    border-color: #ff6b35;
    color: #ff6b35;
}

.night-mode .similar-link {
    color: #999;
}

.night-mode .similar-link:hover {
    color: #e0e0e0;
    text-decoration: underline;
}

.night-mode .similar-recommendations .section-title {
    color: #e0e0e0;
}

.night-mode .similar-recommendations .section-title::before {
    background: linear-gradient(90deg, #ff6b35, #f7931e);
}

.night-mode .rec-title {
    color: #e0e0e0;
}

.night-mode .rec-author,
.night-mode .rec-genre,
.night-mode .rec-update {
    color: #999;
}

.night-mode .recommendations-section .section-title {
    color: #e0e0e0;
}

.night-mode .recommendations-section .section-title::before {
    background: linear-gradient(90deg, #ff6b35, #f7931e);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .comments-recommendations {
        flex-direction: column;
        gap: 15px;
    }
    
    .right-sidebar {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .comment-input {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .comments-recommendations {
        padding: 0 10px;
    }
    
    .comment-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .comment-input-area {
        flex-direction: column;
        gap: 10px;
    }
    
    .comment-submit-btn {
        width: 100%;
    }
    
    .recommendations-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .recommendation-item {
        flex-direction: column;
        text-align: center;
    }
    
    .rec-cover {
        width: 100%;
        height: 120px;
        margin: 0 auto;
    }
    
    .similar-links {
        gap: 10px;
    }
    
    .similar-link {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .comment-input {
        height: 60px;
        font-size: 0.8rem;
    }
    
    .comments-pagination {
        gap: 5px;
    }
    
    .page-btn, .page-number {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}
