/* 115lu Book Template Styles - Lengdang */

/* --- Variables & Reset --- */
:root {
    --primary-color: #2a6bf2;
    --secondary-color: #4ade80;
    --text-main: #374151;
    --text-sub: #6b7280;
    --bg-light: #f8fafc;
    --border-color: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-main);
    background-color: #fff;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--primary-color); }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; }

/* --- Layout Containers --- */
.layout-container {
    width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
@media (max-width: 1200px) {
    .layout-container { width: 100%; }
}

.main-container {
    padding-top: 20px;
    padding-bottom: 40px;
}

/* Header Styles */
.lengdang-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.lengdang-header .header-inner {
    width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    padding: 0 15px;
}
.logo { margin-right: 30px; flex-shrink: 0; }
.logo img { height: 40px; }

/* Navigation - Left Aligned */
.lengdang-nav {
    display: flex;
    gap: 20px;
    margin-left: 0; /* Reduced spacing */
    overflow-x: auto; /* Allow scrolling if too many items */
    justify-content: flex-start; /* Force items to start from left */
    flex-grow: 0;
}
.lengdang-nav a {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    padding: 22px 10px;
    position: relative;
    white-space: nowrap; /* CRITICAL: Prevent text wrapping */
    border-bottom: 2px solid transparent;
}
.lengdang-nav a.active, .lengdang-nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
/* Removed :after style as we use border-bottom now for cleaner look */

.lengdang-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto; /* Push to right */
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    color: var(--text-sub);
    font-size: 14px;
}
.breadcrumb a { margin: 0 5px; color: var(--text-sub); }
.breadcrumb a:hover { color: var(--primary-color); }

/* Book Store Layout (Sidebar + Main) */
.book-store-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.sidebar {
    width: 260px;
    flex-shrink: 0;
}
.main-content {
    flex: 1;
    min-width: 0;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    line-height: 1;
}

/* Category List in Sidebar */
.category-list li { margin-bottom: 10px; }
.category-list a {
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    background: #f8fafc;
    transition: all 0.2s;
}
.category-list a:hover, .category-list a.current, .category-list a.active {
    background: var(--primary-color);
    color: #fff;
}

/* Ranking List */
.ranking-list { display: flex; flex-direction: column; gap: 15px; }
.ranking-item { display: flex; align-items: flex-start; gap: 10px; }
.rank-num {
    width: 24px;
    height: 24px;
    background: #e5e7eb;
    color: #fff;
    text-align: center;
    line-height: 24px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}
.rank-num.rank-1 { background: #ef4444; }
.rank-num.rank-2 { background: #f97316; }
.rank-num.rank-3 { background: #f59e0b; }
.rank-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rank-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.rank-meta { font-size: 12px; color: var(--text-sub); }

/* Sort Bar */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}
.sort-item {
    padding: 4px 12px;
    border-radius: 20px;
    color: var(--text-sub);
}
.sort-item.active, .sort-item:hover {
    background: #eff6ff;
    color: var(--primary-color);
    font-weight: 500;
}

/* Pagination Wrapper */
.pagination-wrapper {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

/* --- Page: Detail --- */
.book-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Header Card */
.book-header-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    gap: 40px;
}
.book-cover-large {
    width: 260px;
    min-height: 360px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background: #f8fafc;
    display: flex; /* Fix for image alignment */
}
.book-cover-large img { 
    width: 100%; 
    height: auto; 
    min-height: 100%;
    object-fit: cover; 
    display: block; 
}

.book-main-info { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; /* Distribute content vertically */
    padding-bottom: 2px; /* Slight buffer */
}
.detail-title { font-size: 28px; margin-bottom: 10px; color: #1f2937; } /* Reduced margin */
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px; /* Reduced margin */
    font-size: 14px;
    color: var(--text-sub);
    background: #f9fafb;
    padding: 15px;
    border-radius: 6px;
}
.meta-item { display: flex; align-items: center; white-space: nowrap; }

.detail-tags { margin-bottom: 15px; display: flex; flex-wrap: wrap; gap: 10px; } /* Reduced margin */
.tag-chip {
    padding: 4px 10px;
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 4px;
    font-size: 12px;
    transition: 0.2s;
}
.tag-chip:hover { background: #0284c7; color: #fff; }

.detail-intro {
    flex: 1;
    margin-bottom: 0; /* Removed bottom margin to align with cover bottom */
    background: transparent;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Push content to bottom */
}




.detail-actions { display: flex; gap: 20px; margin-top: auto; }
.btn {
    padding: 0 30px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary { background: var(--primary-color); color: #fff; box-shadow: 0 4px 6px -1px rgba(42, 107, 242, 0.2); }
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }
.btn-outline { border: 1px solid #d1d5db; color: #374151; background: #fff; }
.btn-outline:hover { border-color: #9ca3af; background: #f9fafb; }
.btn-text { color: var(--text-sub); padding: 0 20px; }
.btn-text:hover { color: var(--primary-color); }

/* Content + Sidebar Wrapper */
.content-sidebar-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.detail-content { flex: 1; min-width: 0; }
.detail-sidebar { width: 300px; flex-shrink: 0; }

.content-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.article-content {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}
.article-content p { margin-bottom: 20px; }

/* Chapter Nav */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 50px;
}
.nav-prev, .nav-next {
    flex: 1;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.nav-label { display: block; font-size: 12px; color: var(--text-sub); margin-bottom: 5px; }

/* Mini Book List (Sidebar) */
.mini-book-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #f3f4f6;
}
.mini-book-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.mini-cover {
    width: 60px;
    flex-shrink: 0;
    aspect-ratio: 3/4;
    border-radius: 4px;
    overflow: hidden;
    background: #f1f5f9;
}
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-info { flex: 1; min-width: 0; }
.mini-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mini-author { font-size: 12px; color: var(--text-sub); }

/* Book Card Overlay Button */
.book-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.book-card:hover .book-overlay { opacity: 1; }
.read-btn {
    background: var(--primary-color);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transform: translateY(10px);
    transition: transform 0.2s;
}
.book-card:hover .read-btn { transform: translateY(0); }
.book-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 6px;
}
.book-desc {
    font-size: 12px;
    color: #9ca3af;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .book-store-layout, .book-header-card, .content-sidebar-wrapper { flex-direction: column; }
    .sidebar, .detail-sidebar { width: 100%; }
    .book-cover-large { width: 140px; margin: 0 auto; }
    .book-header-card { text-align: center; align-items: center; }
    .detail-actions { justify-content: center; }
    .detail-meta { justify-content: center; }
}

/* --- Components: Header & Footer --- */
.lengdang-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    text-align: center;
    color: var(--text-sub);
    font-size: 14px;
    margin-top: 40px;
}
.footer-links a { margin: 0 10px; }

/* --- Component: Search Hero --- */
.search-hero {
    background: #f1f5f9;
    padding: 40px 0;
    text-align: center;
}
.search-box {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
}
.search-box input {
    flex: 1;
    height: 50px;
    padding: 0 20px;
    border: 1px solid #cbd5e1;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    outline: none;
}
.search-box button {
    width: 120px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    font-size: 18px;
    cursor: pointer;
}
.search-box button:hover { background: #1d4ed8; }

/* --- Component: Book Card (Standard) --- */
.book-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    /* border: 1px solid var(--border-color); */
    /* border-radius: 8px; */
    overflow: hidden;
    transition: transform 0.2s;
}
/* .book-card:hover { transform: translateY(-3px); } */
.book-cover {
    width: 100%;
    aspect-ratio: 3/4;
    background: #e2e8f0;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.book-card:hover .book-cover img { transform: scale(1.05); }
.book-info { padding: 10px 0; }
.book-title {
    font-size: 16px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.book-author {
    font-size: 13px;
    color: var(--text-sub);
}

/* --- Component: Section Header --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.section-title {
    font-size: 20px;
    color: var(--text-main);
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: -12px;
    padding-bottom: 10px;
    display: inline-block;
}
.section-more { font-size: 14px; color: var(--text-sub); }

/* --- Page: Index --- */
.recommend-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
@media (max-width: 992px) { .recommend-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) { .recommend-grid { grid-template-columns: repeat(3, 1fr); } }

.category-block {
    margin-bottom: 30px;
}
.cat-book-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.cat-book-item {
    display: flex;
    gap: 15px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.cat-book-cover {
    width: 80px;
    height: 110px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}
.cat-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.cat-book-info { flex: 1; min-width: 0; }
.cat-book-title { font-size: 16px; margin-bottom: 5px; }
.cat-book-desc {
    font-size: 13px;
    color: var(--text-sub);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    line-height: 1.5;
}
.cat-book-meta { font-size: 12px; color: #9ca3af; }

/* --- Page: List --- */
.filter-box {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}
.filter-row { display: flex; margin-bottom: 15px; border-bottom: 1px dashed #f3f4f6; padding-bottom: 10px; }
.filter-row:last-child { border-bottom: none; margin-bottom: 0; }
.filter-label { width: 80px; color: var(--text-sub); font-weight: bold; }
.filter-items a {
    display: inline-block;
    margin-right: 15px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
}
.filter-items a.active, .filter-items a:hover {
    background: var(--primary-color);
    color: #fff;
}

.book-list-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}
@media (max-width: 768px) { .book-list-grid { grid-template-columns: repeat(3, 1fr); } }

/* --- Page: Detail --- */
.book-detail-card {
    background: #fff;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}
.detail-cover {
    width: 240px;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}
.detail-info { flex: 1; }


/* --- Sidebar Components --- */
.rank-list li {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}
.rank-num {
    width: 20px;
    height: 20px;
    background: #e5e7eb;
    color: #fff;
    text-align: center;
    line-height: 20px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 10px;
}
.rank-list li:nth-child(1) .rank-num { background: #ef4444; }
.rank-list li:nth-child(2) .rank-num { background: #f97316; }
.rank-list li:nth-child(3) .rank-num { background: #f59e0b; }
.rank-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.rank-click { font-size: 12px; color: #9ca3af; }

/* Pagination */
.pagination {
    margin-top: 30px;
    text-align: center;
}
.pagination li { display: inline-block; margin: 0 4px; }
.pagination li a, .pagination li span {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 4px;
    color: var(--text-main);
}
.pagination li.active span, .pagination li a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}


@media (max-width: 768px) {
    .intro-ad-banner { flex-direction: column; height: auto; gap: 15px; }
    .intro-ad-item.left { width: 100%; height: 60px; }
    .intro-ad-item.right { width: 100%; height: 80px; }
    .intro-book-cover { width: 100px; height: auto; margin: 0 auto; }
    .intro-ad-item.left .ad-placeholder { writing-mode: horizontal-tb; }
}



/* --- New Added Styles for Book Detail Redesign --- */
.book-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}
/* JD Union Module Styles */
.jd-union-module {
    display: inline-flex;
    align-items: center;
    gap: 0; /* Remove gap completely for seamless look */
    height: 100px; /* Increased height */
    text-decoration: none;
    transition: transform 0.2s ease;
}
.jd-union-module:hover {
    transform: translateY(-2px);
}
.jd-ad-img {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
}
.jd-book-cover {
    height: 90%; /* Slightly smaller than container to look contained, or 100% if user wants flush */
    width: auto;
    object-fit: contain;
    border: 1px solid #eee; /* Subtle border for the book */
    background: #fff;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 32px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.action-btn i { margin-right: 8px; font-size: 18px; }
.btn-read {
    background: #ef4444; /* Red color often used for 'Read' */
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.btn-read:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
    color: #fff;
}
.btn-download {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #374151;
}
.btn-download:hover {
    border-color: #2a6bf2;
    color: #2a6bf2;
    background: #f0f9ff;
}

/* Book Summary Short */
.book-summary-short {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed #e2e8f0;
}


