* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 顶部导航栏 */
.header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    margin-right: 40px;
}



/* 主要内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 面包屑导航 */
.breadcrumb {
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.comic-info {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comic-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.comic-cover {
    width: 200px;
    height: 263px; /* 200px * 1.315 保持封面比例 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.comic-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.comic-cover-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    text-align: center;
    line-height: 1.4;
    z-index: 1;
}

.comic-details {
    flex: 1;
}

.comic-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.comic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.meta-label {
    font-weight: bold;
    margin-right: 5px;
    color: #333;
}

.comic-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
}

.comic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background: #f0f0f0;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.tag:hover {
    background: #e0e0e0;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* 章节列表 */
.chapters-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.chapter-item {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
    font-size: 14px;
    min-width: 0; /* 关键：允许flex项目收缩到内容宽度以下 */
}

.chapter-item:hover {
    background: #e9ecef;
}

.chapter-title {
    display: block; 
    width: 100%; 
    font-weight: bold;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0; /* 关键：确保文本截断生效 */
}

.chapter-date {
    font-size: 12px;
    color: #666;
}

/* 相关推荐 */
.recommendations {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.recommendation-item {
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s;
}

.recommendation-item:hover {
    transform: translateY(-2px);
}

.recommendation-cover {
    width: 100%;
    height: 0;
    padding-bottom: 131.76%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 6px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.recommendation-cover-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.recommendation-title {
    font-size: 13px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recommendation-chapter {
    font-size: 11px;
    color: #666;
}

/* 页脚 */
.footer {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 30px 0;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: #007bff;
    text-decoration: none;
    margin: 0 10px;
    font-size: 14px;
}

.footer-info {
    color: #666;
    font-size: 12px;
    line-height: 1.6;
}
@media (max-width: 1024px) {
    .chapters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }

    .comic-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .comic-cover {
        width: 150px;
        height: 197px; /* 150px * 1.315 */
    }

    .comic-title {
        font-size: 20px;
    }

    .comic-meta {
        justify-content: center;
    }

    .chapters-grid {
        grid-template-columns: 1fr;
    }

    .recommendations-grid {
        grid-template-columns: repeat(3, 1fr);
    }


    .search-box input {
        width: 150px;
    }
    .chapters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 15px;
    }

    .logo {
        font-size: 20px;
    }

    .comic-cover {
        width: 120px;
        height: 158px; /* 120px * 1.315 */
    }

    .comic-title {
        font-size: 18px;
    }

    .recommendations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 推荐栅格 - 响应式布局 */
.recommendations-grid {
    display: grid;
    gap: 20px;
    align-items: start;
}

/* 大屏幕 (1200px+): 6列 */
@media (min-width: 1200px) {
    .recommendations-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 中大屏幕 (1024px - 1199px): 5列 */
@media (min-width: 1024px) and (max-width: 1199px) {
    .recommendations-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 平板横屏 (768px - 1023px): 4列 */
@media (min-width: 768px) and (max-width: 1023px) {
    .recommendations-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* 小屏幕/手机 (最大768px): 3列 */
@media (max-width: 767px) {
    .recommendations-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

