/*
Theme Name: Cấm Thư
Author: Admin
Description: Giao diện tuỳ chỉnh cho hệ sinh thái truyện Cấm Thư.
Version: 1.3 (Đã tối ưu và loại bỏ trùng lặp)
*/

/* ==========================================================================
GLOBAL & TIỆN ÍCH CƠ BẢN
========================================================================== */
.camthu-body {
    background: #f4f6f8;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* MỞ RỘNG KHUNG ĐỌC TRUYỆN RA RỘNG BẰNG TRANG CHỦ */
.camthu-reading-container,
.noi-dung-chuong-wrapper {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto;
    padding: 0 20px;
}

/* CHỮA BỆNH RỚT CHỮ CÁI KHI ZOOM HOẶC ĐỌC TRÊN ĐIỆN THOẠI */
.noidung-chuong,
.reading-content,
.post-content {
    word-break: normal !important;
    overflow-wrap: break-word !important;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* ==========================================================================
2. HEADER & NAVIGATION
========================================================================== */
#camthu-main-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease-in-out, top 0.3s ease-in-out;
}

/* Nút bật/tắt thanh menu (thay cho tự ẩn khi cuộn).
   - Khi thanh ĐANG HIỆN: nút nằm ngay dưới thanh, mũi tên LÊN (▲) -> ấn để ẩn.
   - Khi thanh ĐANG ẨN:  nút dính đỉnh màn hình, mũi tên XUỐNG (▼) -> ấn để hiện lại. */
#camthu-header-toggle {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    width: 46px;
    height: 24px;
    border: none;
    border-radius: 0 0 12px 12px;
    background: #2c3e50;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    display: none; /* Ẩn mặc định trên mọi thiết bị; chỉ bật lại ở chế độ đọc chương mobile */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: top 0.3s ease-in-out;
    padding: 0;
}
#camthu-header-toggle:active {
    background: #2980b9;
}

/* ============================================================
   CHẾ ĐỘ ĐỌC CHƯƠNG TRÊN MOBILE (<=768px):
   - Thanh menu TỰ ẨN, chỉ còn nút mũi tên (▼) để người dùng ấn
     khi cần kéo menu xuống; ấn lần nữa (▲) để ẩn đi.
   - Header đổi sang position: fixed (ra khỏi luồng layout) để
     nội dung truyện chiếm trọn màn hình khi menu đang ẩn.
   ============================================================ */
@media (max-width: 768px) {
    body.camthu-reading #camthu-header-toggle {
        display: flex; /* chỉ hiện nút mũi tên ở màn hình đọc chương mobile */
    }
    body.camthu-reading #camthu-main-header {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        transform: translateY(-100%); /* mặc định ẩn menu khi vào đọc chương */
    }
}

.header-flex-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left-section {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.site-logo {
    font-size: 28px;
    font-weight: bold;
    color: #2980b9;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-icon { font-size: 58px; }

/* Dropdown Menu */
.camthu-nav-item { position: relative; display: inline-block; cursor: pointer; padding: 10px; font-weight: bold; color: #2c3e50; }
.camthu-dropdown-content { display: none; position: absolute; top: 100%; left: 0; background-color: #fff; min-width: 200px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1); z-index: 101; border-radius: 8px; padding: 10px; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.dropdown-the-loai { grid-template-columns: repeat(7, 1fr); min-width: 900px; max-width: 100vw; overflow-x: auto; text-align: center; }
/* [FIX] Tablet 769-1024px: menu 7 cột 900px tràn viewport. Ép xuống 4 cột cho vừa. */
@media (max-width: 1024px) and (min-width: 769px) {
    .dropdown-the-loai { grid-template-columns: repeat(4, 1fr); min-width: 600px; }
}
.dropdown-xep-hang { grid-template-columns: 1fr; }
.empty-category-msg { padding: 10px; color: #999; font-size: 13px; }

@media (min-width: 769px) {
    .camthu-nav-item:hover .camthu-dropdown-content { display: grid; }
}

.camthu-dropdown-content a { color: #333; padding: 8px 12px; text-decoration: none; display: block; border-radius: 4px; font-size: 14px; font-weight: normal; }
.camthu-dropdown-content a:hover { background-color: #f1f1f1; color: #2980b9; }

/* Header Actions */
.header-actions { display: flex; gap: 20px; align-items: center; }
.search-trigger { background: #f1f3f5; padding: 8px 15px; border-radius: 20px; cursor: pointer; color: #7f8c8d; display: flex; align-items: center; gap: 8px; }
.notification-wrapper { position: relative; display: inline-block; cursor: pointer; margin-right: 15px; }
.notification-icon { font-size: 22px; }
.notification-badge { display: none; position: absolute; top: -5px; right: -8px; background: #e74c3c; color: #fff; font-size: 11px; font-weight: bold; border-radius: 50%; padding: 2px 6px; box-shadow: 0 0 5px rgba(0,0,0,0.2); }
.notification-dropdown { display: none; position: absolute; top: 150%; right: -50px; width: 320px; max-width: 90vw; background: #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.2); border-radius: 8px; z-index: 999; overflow: hidden; border: 1px solid #eee; }
.notification-dropdown-header { background: #f4f6f8; padding: 10px 15px; font-weight: bold; color: #2c3e50; border-bottom: 1px solid #ddd; }
.notification-dropdown-content { max-height: 350px; overflow-y: auto; text-align: left; }
.notification-loading { padding: 15px; text-align: center; color: #7f8c8d; font-size: 13px; }
.notification-item { padding: 12px 15px; border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s; }
.notification-item-msg { font-size: 13px; color: #34495e; line-height: 1.4; }
.notification-item-time { font-size: 11px; color: #95a5a6; margin-top: 5px; }

/* Nút Header */
.btn-profile { text-decoration: none; background: #fdf2e9; color: #d35400; padding: 8px 15px; border-radius: 20px; font-weight: bold; border: 1px solid #fae5d3; }
.btn-app { text-decoration: none; background: #eaf6fd; color: #1f6aa5; padding: 8px 15px; border-radius: 20px; font-weight: bold; border: 1px solid #d6eaf8; white-space: nowrap; }
.btn-app:hover { background: #d6eaf8; }
.btn-logout { text-decoration: none; color: #7f8c8d; font-weight: bold; }
.btn-login { text-decoration: none; color: #2c3e50; font-weight: bold; }
.btn-register { text-decoration: none; background: #2980b9; color: white; padding: 8px 15px; border-radius: 20px; font-weight: bold; }

/* Search Overlay */
#camthu-search-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.98); z-index: 9999; flex-direction: column; align-items: center; padding-top: 100px; }
#camthu-search-close { position: absolute; top: 30px; right: 40px; font-size: 40px; cursor: pointer; color: #7f8c8d; }
#camthu-search-input-full { width: 80%; max-width: 800px; padding: 20px; font-size: 24px; border: none; border-bottom: 3px solid #3498db; outline: none; background: transparent; }
#camthu-search-results { width: 80%; max-width: 800px; margin-top: 30px; max-height: 60vh; overflow-y: auto; text-align: left; }
.search-overlay-title { color: #2c3e50; margin-bottom: 10px; }
.search-overlay-subtitle { color: #7f8c8d; margin-bottom: 30px; }
.search-item { padding: 15px; border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 15px; text-decoration: none; color: inherit; transition: background 0.2s; }
.search-item:hover { background: #f9f9f9; }
.search-item-img { width: 60px; aspect-ratio: 1 / 1 !important; height: auto !important; object-fit: cover; border-radius: 4px; }
.search-item-title { margin: 0 0 5px 0; color: #2980b9; font-size: 16px; }
.search-item-author { font-size: 13px; color: #7f8c8d; }
.search-loading-msg, .notification-empty-msg { text-align: center; color: #999; font-size: 13px; padding: 15px; }
.search-view-all { text-align: center; margin-top: 20px; }
.search-view-all-link { color: #d35400; font-weight: bold; text-decoration: none; }
.search-error-msg { text-align: center; color: #e74c3c; }

/* ==========================================================================
3. CÁC NÚT BẤM (BUTTONS) & ADMIN LAYOUT
========================================================================== */
.camthu-btn-save, .camthu-btn-edit, .camthu-btn-delete, .camthu-btn-page { color: #fff; border: none; border-radius: 4px; cursor: pointer; transition: opacity 0.2s ease-in-out; }
.camthu-btn-save { background: #3498db; padding: 4px 8px; }
.camthu-btn-edit { background: #f39c12; padding: 4px 10px; }
.camthu-btn-delete { background: #e74c3c; padding: 4px 10px; }
.camthu-btn-page { background: #2980b9; padding: 6px 12px; }
.camthu-btn-save:hover, .camthu-btn-edit:hover, .camthu-btn-delete:hover, .camthu-btn-page:hover { opacity: 0.85; }

.camthu-btn-success { flex: 1; background: #27ae60; color: white; border: none; padding: 8px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.camthu-btn-danger { flex: 1; background: #e74c3c; color: white; border: none; padding: 8px; border-radius: 4px; cursor: pointer; font-weight: bold; text-decoration: none; text-align: center; display: block; }
.camthu-btn-primary { flex: 1; background: #3498db; color: white; text-decoration: none; padding: 8px; border-radius: 4px; font-weight: bold; text-align: center; display: block; }

/* Quản lý chương Admin */
.camthu-admin-chuong-row { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid #eee; gap: 10px; }
.camthu-admin-chuong-left { display: flex; align-items: center; gap: 5px; }
.camthu-admin-chuong-input { width: 50px; padding: 4px; border: 1px solid #ccc; border-radius: 4px; text-align: center; }
.camthu-admin-chuong-title { margin-left: 5px; font-weight: bold; }
.camthu-admin-chuong-right { display: flex; gap: 5px; }
.camthu-admin-pagination { margin-top: 15px; text-align: center; }
.camthu-page-info { font-weight: bold; margin: 0 10px; }

/* Thanh công cụ chọn/xóa hàng loạt chương (modal Quản Lý Chương) */
.camthu-chuong-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #ddd; background: #f7f7f7; }
.camthu-chuong-tool-selall { font-weight: bold; display: flex; align-items: center; gap: 5px; }
.camthu-chuong-tool-range { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.camthu-chuong-tool-range input { padding: 4px; border: 1px solid #ccc; border-radius: 4px; text-align: center; }
.camthu-chuong-selinfo { color: #555; font-size: 13px; font-style: italic; }
.camthu-chuong-check { flex: 0 0 auto; }

/* User Profile & Meta Boxes */
.camthu-profile-row-highlight { background: #fdf2e9; }
.camthu-label-highlight { color: #d35400; }
.camthu-approval-select { padding: 5px; font-weight: bold; }
.camthu-meta-select, .camthu-meta-input { width: 100%; padding: 5px; }
.camthu-meta-hr { margin: 15px 0; }
.camthu-meta-highlight-box { background: #fdf2e9; padding: 10px; border-left: 3px solid #e67e22; }
.camthu-checkbox-highlight { color: #d35400; }
.camthu-text-error { color: #e74c3c; }
.camthu-text-success { color: #27ae60; }
.camthu-rut-tien-box { margin-top: 20px; padding: 15px; background: #fff; border-left: 4px solid #3498db; }
.camthu-rut-tien-select { width: 100%; max-width: 400px; padding: 5px; }

/* Admin Panels Grid & Cards */
.camthu-admin-h1 { color: #2980b9; font-weight: bold; margin-bottom: 20px; }
.camthu-admin-h1-green { color: #27ae60; font-weight: bold; margin-bottom: 20px; }
.camthu-grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.camthu-card { background: #fff; padding: 15px; border-radius: 8px; border: 1px solid #ddd; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.camthu-card-rut { background: #fff; padding: 20px; border-radius: 8px; border: 1px solid #ddd; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.camthu-card-title { margin: 0 0 10px 0; color: #d35400; }
.camthu-card-title-dark { margin: 0 0 10px 0; color: #2c3e50; }
.camthu-card-meta { margin: 5px 0; font-size: 13px; }
.camthu-card-excerpt { background: #f9f9f9; padding: 10px; border-radius: 4px; font-size: 13px; height: 80px; overflow-y: auto; margin-bottom: 15px; }
.camthu-card-info-box { background: #fdf2e9; padding: 10px; border-radius: 4px; font-size: 13px; margin-bottom: 15px; }
.camthu-card-actions { display: flex; gap: 10px; margin-top: 15px; }
.camthu-empty-state { background: #fff; padding: 30px; text-align: center; border-radius: 8px; color: #7f8c8d; font-size: 16px; }

/* ==========================================================================
4. MODAL XÁC THỰC (AUTH OVERLAY)
========================================================================== */
.camthu-auth-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 10000; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.camthu-auth-box { background: #fff; width: 90%; max-width: 450px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); overflow: hidden; position: relative; animation: slideDown 0.3s ease-out; }
@keyframes slideDown { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.camthu-auth-header { display: flex; border-bottom: 1px solid #eee; }
.camthu-auth-tab { flex: 1; text-align: center; padding: 15px; font-weight: bold; color: #7f8c8d; cursor: pointer; background: #f9f9f9; transition: 0.2s; }
.camthu-auth-tab.active { color: #2980b9; background: #fff; border-bottom: 3px solid #3498db; }
.camthu-auth-body { padding: 25px; }
.camthu-auth-form { display: none; }
.camthu-auth-form.active { display: block; }
.camthu-form-group { margin-bottom: 15px; }
.camthu-form-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #2c3e50; font-size: 14px; }
.camthu-form-group input, .camthu-form-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font-size: 14px; }
.camthu-form-group input:focus { border-color: #3498db; outline: none; }
.camthu-btn-submit { width: 100%; padding: 12px; background: #2980b9; color: #fff; border: none; border-radius: 6px; font-weight: bold; font-size: 16px; cursor: pointer; margin-top: 10px; transition: 0.2s; }
.camthu-btn-submit:hover { background: #2471a3; }
.camthu-auth-close { position: absolute; top: 12px; right: 15px; font-size: 24px; color: #999; cursor: pointer; line-height: 1; z-index: 10; }
.camthu-auth-close:hover { color: #e74c3c; }
#camthu-bank-info { display: none; background: #fdf2e9; padding: 15px; border-radius: 6px; border: 1px dashed #e67e22; margin-bottom: 15px; }
.bank-note { font-size: 12px; color: #d35400; margin-bottom: 10px; line-height: 1.4; }

/* ==========================================================================
5. DANH SÁCH & COMPONENT TRUYỆN DÙNG CHUNG
========================================================================== */
.camthu-home-wrapper, .camthu-list-wrapper { max-width: 1200px; margin: 30px auto; padding: 0 20px; font-family: 'Segoe UI', Arial, sans-serif; }
.section-title, .camthu-list-title { position: relative; border-bottom: 2px solid #e0e0e0; padding-bottom: 12px; color: #2c3e50; font-size: 26px; font-weight: 800; margin-bottom: 25px; display: flex; align-items: center; gap: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.section-title::after { content: ""; position: absolute; bottom: -2px; left: 0; width: 120px; height: 4px; background: linear-gradient(to right, #e67e22, #f1c40f); border-radius: 4px; }

/* Hàng tiêu đề section: heading bên trái + nút "Xem Toàn Bộ" bên phải (cùng hàng) */
.camthu-section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 25px; }
.camthu-section-head .section-title { margin-bottom: 0; }
.camthu-btn-xem-tat-ca { display: inline-block; background: #2980b9; color: #fff; padding: 8px 22px; border-radius: 25px; text-decoration: none; font-weight: bold; font-size: 14px; box-shadow: 0 4px 6px rgba(41,128,185,0.3); transition: 0.3s; white-space: nowrap; }
.camthu-btn-xem-tat-ca:hover { background: #2471a3; color: #fff; }
.camthu-list-title { border-bottom-color: #3498db; font-size: 24px; text-transform: none; font-weight: bold; letter-spacing: normal; }
.camthu-list-title .term-name { color: #2980b9; }

/* Khung lưới thẻ truyện dùng chung */
.truyen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; margin-bottom: 40px; }
.truyen-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); position: relative; transition: all 0.3s ease; }
/* [FIX] Trang BXH / danh sách: ép đúng 5 cột (4 hàng x 5 = 20 truyện) thay vì
   auto-fill 6 cột (làm hàng cuối chỉ có 2 truyện). Cột rộng hơn -> ảnh bìa & tên
   to lên tương ứng với mật độ 5 bộ/hàng. */
.camthu-list-wrapper .truyen-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; }
/* BẺ KHÓA INLINE STYLE CHIỀU CAO 220PX TRONG PHP BẰNG !IMPORTANT */
.truyen-thumb { aspect-ratio: 1 / 1 !important; width: 100% !important; height: auto !important; overflow: hidden; background: #eee; } 
.truyen-thumb img { width: 100% !important; height: 100% !important; object-fit: cover !important; aspect-ratio: 1 / 1 !important; max-width: 100% !important; }
.truyen-info { padding: 12px; text-align: center; }
.truyen-title { margin: 0 0 5px 0; font-size: 14px !important; color: #2c3e50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.truyen-author { font-size: 12px; color: #7f8c8d; margin-bottom: 5px; }

/* Style cụ thể theo trang */
.camthu-home-wrapper .truyen-card { width: 180px; }
/* [FIX] scale(1.2) quá giật + làm card biên tràn khỏi grid. Giảm xuống 1.04. */
.camthu-home-wrapper .truyen-card:hover { transform: scale(1.04); z-index: 10; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.camthu-list-wrapper .truyen-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.15); }

/* Thành phần bên trong thẻ truyện */
.truyen-card-link, .truyen-link { text-decoration: none; color: inherit; display: block; }
.truyen-stats-views { font-size: 12px; color: #e74c3c; font-weight: bold; }
.truyen-stats-revenue { font-size: 12px; color: #27ae60; font-weight: bold; }
.truyen-stats-author { font-size: 12px; color: #7f8c8d; }

/* ===== Nhãn "Hoàn Thành" (ribbon chéo góc trên-phải ảnh bìa) =====
   Đặt làm con của .truyen-card (position:relative + overflow:hidden + border-radius:8px
   → tự cắt góc ribbon cho vừa vặn). pointer-events:none để không chắn link. */
.camthu-ribbon-done {
    position: absolute;
    top: 14px;
    right: -34px;
    width: 100px;
    transform: rotate(45deg);
    background: #27ae60;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    text-align: center;
    padding: 3px 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,.25);
    pointer-events: none;
}
/* Biến thể nhỏ cho thumb ngang 80px (.tv-thumb-vuong): pill ngang dải dưới, không xoay. */
.camthu-ribbon-done.sm {
    top: auto; bottom: 0; left: 0; right: 0;
    width: 100%;
    transform: none;
    font-size: 8px;
    padding: 2px 0;
    border-radius: 0;
}

/* [FIX] Trang BXH / danh sách: tăng kích cỡ tên truyện & thông số cho phù hợp
   lưới 5 cột (card rộng hơn -> chữ to hơn, dễ đọc hơn). Ảnh bìa tự to theo cột
   nhờ width:100% + aspect-ratio 1/1 của .truyen-thumb. */
.camthu-list-wrapper .truyen-title { font-size: 16px !important; line-height: 1.3; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; min-height: 2.6em; }
.camthu-list-wrapper .truyen-info { padding: 14px 12px; }
.camthu-list-wrapper .truyen-stats-views,
.camthu-list-wrapper .truyen-stats-revenue { font-size: 14px; }
.camthu-list-wrapper .truyen-stats-author { font-size: 13px; }
.camthu-list-wrapper .rank-badge { width: 34px; height: 34px; font-size: 16px; top: 12px; left: 12px; }

/* Bộ lọc kỳ xếp hạng (Tháng / Năm / Tổng) trên trang BXH */
.bxh-ky-filter { display: flex; gap: 10px; margin: 0 0 25px 0; flex-wrap: wrap; }
.bxh-ky-btn { display: inline-block; padding: 9px 20px; border-radius: 999px; background: #fff; border: 1px solid #d9d9d9; color: #566; font-size: 15px; font-weight: 600; text-decoration: none; transition: all 0.2s ease; }
.bxh-ky-btn:hover { border-color: #3498db; color: #3498db; }
.bxh-ky-btn.is-active { background: linear-gradient(to right, #3498db, #2980b9); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(52,152,219,0.35); } 

.truyen-card.de-cu .hover-desc { position: absolute; top: 0; left: 0; width: 100%; height: 260px; background: rgba(44, 62, 80, 0.95); color: #fff; padding: 15px; box-sizing: border-box; font-size: 13px; line-height: 1.5; opacity: 0; transition: 0.3s; overflow: hidden; }
.truyen-card.de-cu:hover .hover-desc { opacity: 1; }
.btn-dat-truoc { display: block; background: #e67e22; color: #fff; text-decoration: none; padding: 8px; border-radius: 4px; font-size: 13px; font-weight: bold; margin-top: 10px; transition: 0.2s; text-align: center; cursor: pointer; }
.btn-dat-truoc:hover { background: #d35400; }
.top-badge { position: absolute; top: 10px; left: 10px; background: #e74c3c; color: white; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 10; }
.rank-badge { position: absolute; top: 10px; left: 10px; width: 30px; height: 30px; background: #34495e; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 10; }
.rank-1 { background: #f1c40f; } .rank-2 { background: #bdc3c7; } .rank-3 { background: #cd7f32; }

/* Phân trang danh sách */
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }
.pagination .page-numbers { padding: 8px 15px; background: #fff; border: 1px solid #ddd; border-radius: 4px; text-decoration: none; color: #2c3e50; font-weight: bold; transition: 0.2s; }
.pagination .page-numbers.current { background: #2980b9; color: #fff; border-color: #2980b9; }
.pagination .page-numbers:hover:not(.current) { background: #f4f6f8; }
.camthu-empty-message, .no-posts-message { color: #7f8c8d; font-size: 16px; text-align: center; }

/* ==========================================================================
6. TRANG CHI TIẾT TRUYỆN & CHƯƠNG ĐỌC 
========================================================================== */
.camthu-truyen-container { max-width: 1200px; margin: 30px auto; padding: 20px; font-family: 'Segoe UI', Arial, sans-serif; }
.truyen-info-wrapper { display: flex; gap: 20px; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); margin-bottom: 30px; }
.truyen-cover-wrapper { flex: 0 0 380px; }
.truyen-cover-img { width: 100% !important; aspect-ratio: 1 / 1 !important; height: auto !important; object-fit: cover !important; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); } 
.truyen-cover-placeholder { width: 100% !important; aspect-ratio: 1 / 1 !important; height: auto !important; background: #eee; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #999; } 
.truyen-info-content { flex: 1; }
.truyen-title { margin-top: 0; color: #2c3e50; font-size: 38px; }
.truyen-meta { margin-bottom: 15px; font-size: 14px; color: #7f8c8d; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.badge-mien-phi { background: #e67e22; color: #fff; padding: 4px 10px; border-radius: 12px; font-weight: bold; }
.badge-gia { background: #e67e22; color: #fff; padding: 4px 10px; border-radius: 12px; font-weight: bold; }
.btn-tu-sach, .btn-doc-tiep { background: #e67e22; color: white; border: none; padding: 5px 15px; border-radius: 20px; font-weight: bold; cursor: pointer; transition: 0.2s; text-decoration: none; }
.btn-doc-tiep { display: none; }

.box-tom-tat { max-height: 200px; overflow: hidden; position: relative; transition: max-height 0.4s ease-out; margin-bottom: 20px; }
.tom-tat-content { line-height: 1.6; color: #444; text-align: justify; }
.bong-mo-tom-tat { position: absolute; bottom: 0; left: 0; width: 100%; height: 80px; background: linear-gradient(to bottom, transparent, #fff); text-align: center; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; }
.btn-xem-them { background: #fdf2e9; color: #d35400; border: 1px solid #fae5d3; padding: 6px 20px; border-radius: 20px; cursor: pointer; font-weight: bold; font-size: 13px; }
.bang-phong-than { margin-top: 25px; background: #fff8e1; border: 1px solid #ffe082; padding: 15px; border-radius: 8px; }
.bang-phong-than-title { margin: 0 0 10px 0; color: #d35400; }
.donator-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.donator-item { margin-bottom: 8px; border-bottom: 1px dashed #ffe082; padding-bottom: 8px; display: flex; justify-content: space-between; }
.donator-amount { color: #d35400; font-weight: bold; }
.donator-empty { margin: 0; font-size: 13px; color: #b7950b; }
.chuong-wrapper { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.chuong-title { border-bottom: 2px solid #3498db; padding-bottom: 10px; margin-top: 0; color: #2980b9; }
.bulk-unlock-box { background: #eef7fc; padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #3498db; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.bulk-unlock-label { color: #2980b9; }
.bulk-input { width: 70px; padding: 5px; border: 1px solid #ccc; border-radius: 4px; }
.btn-bulk-unlock { background: #e67e22; color: white; border: none; padding: 6px 15px; border-radius: 4px; font-weight: bold; cursor: pointer; }
.danh-sach-chuong { list-style: none; padding: 0; margin: 0; column-count: 2; column-gap: 20px; }
.camthu-chuong-list-item { margin-bottom: 10px; border-bottom: 1px dashed #eee; padding-bottom: 10px; }
.camthu-chuong-list-link { text-decoration: none; color: #2c3e50; font-size: 15px; display: block; transition: 0.2s; }
.camthu-chuong-list-link:hover { color: #3498db; }
.chuong-pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 20px; }
.loading-msg, .empty-msg { text-align: center; column-span: all; color: #999; padding: 20px; }
.pagination-btn { padding: 6px 12px; border: 1px solid; border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.pagination-btn-active { background: #2980b9; color: #fff; border-color: #2980b9; }
.pagination-btn-inactive { background: #fff; color: #2c3e50; border-color: #ddd; }
.pagination-dots { padding: 5px 8px; color: #7f8c8d; font-weight: bold; user-select: none; }
.pagination-nav { background-color: #f8f9fa; font-weight: bold; }

/* Bảng màu Reading Themes (Nền chương truyện) */
.theme-default { background-color: #f4ecd8 !important; color: #2c3e50 !important; }
.theme-light { background-color: #ffffff !important; color: #333333 !important; }
.theme-dark { background-color: #1a1a1a !important; color: #cccccc !important; }
.theme-dark .camthu-reading-container { box-shadow: none !important; border: 1px solid #333; }
.theme-dark h1, .theme-dark h3 a, .theme-dark .camthu-tool-btn { color: #bdc3c7 !important; }
.theme-dark .camthu-tool-bar { background: #2c2c2c !important; border-bottom: 1px solid #444; }
.camthu-reading-container { max-width: 1200px !important; width: 100% !important; margin: 30px auto; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); font-family: 'Palatino Linotype', 'Book Antiqua', 'Times New Roman', serif; transition: background-color 0.3s, color 0.3s; box-sizing: border-box !important; overflow-x: hidden; }

/* Thanh công cụ đọc truyện */
.camthu-tool-bar { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 25px; padding: 10px; background: rgba(0,0,0,0.03); border-radius: 8px; }
.camthu-tool-btn { background: transparent; border: 1px solid #ccc; padding: 6px 15px; border-radius: 20px; cursor: pointer; font-weight: bold; color: #555; font-size: 14px; transition: all 0.2s; }
.camthu-tool-btn:hover { background: #e0e0e0; color: #000; }
#full-text-area { font-size: 18px; line-height: 1.8; text-align: justify; }
#full-text-area p { text-indent: 2em; margin-top: 0; margin-bottom: 15px; }
#chuong-content-area, #full-text-area { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }

/* Các cấu trúc chuyển từ file PHP sang */
.camthu-chapter-header { text-align: center; border-bottom: 2px dashed #ccc; padding-bottom: 20px; margin-bottom: 25px; }
.camthu-chapter-header h3 { margin: 0 0 10px 0; font-size: 16px; }
.camthu-truyen-link { text-decoration: none; color: #2980b9; }
.camthu-chapter-title { margin: 0; font-size: 26px; line-height: 1.4; }

.camthu-loading { text-align: center; padding: 50px; color: #e67e22; font-weight: bold; }
.camthu-spoil-box { opacity: 0.7; padding: 20px; border-left: 4px solid #bdc3c7; margin-bottom: 20px; font-style: italic; }
.camthu-locked-box { text-align: center; padding: 30px; background: rgba(241, 196, 15, 0.1); border: 1px solid #f1c40f; border-radius: 8px; }
.camthu-locked-title { margin-top: 0; color: #d35400; }
.camthu-unlock-msg { color: #d35400; margin-bottom: 20px; }
.camthu-auto-unlock-label { cursor: pointer; font-size: 14px; margin-top: 15px; display: inline-block; }

.btn-unlock-action { background: #e74c3c; color: white; border: none; padding: 12px 30px; font-size: 16px; font-weight: bold; border-radius: 25px; cursor: pointer; box-shadow: 0 4px 6px rgba(231,76,60,0.3); transition: 0.3s; }
.btn-unlock-action:hover { background: #c0392b; box-shadow: 0 6px 8px rgba(231,76,60,0.5); }
.btn-action-bottom { padding: 10px 20px !important; }

.camthu-bottom-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #ddd; flex-wrap: wrap; gap: 10px; }
.camthu-nav-center { display: flex; gap: 10px; }
.camthu-btn { text-decoration: none; } 

.camthu-donate-box { margin-top: 40px; padding: 20px; background: rgba(230, 126, 34, 0.05); border: 1px dashed #e67e22; border-radius: 8px; text-align: center; }
.camthu-donate-title { margin-top: 0; color: #d35400; }
.camthu-donate-desc { font-size: 18px; color: #d35400; margin-bottom: 15px; }
.camthu-donate-buttons { display: flex; justify-content: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }

.btn-donate-lt { background: #f1c40f !important; color: #333 !important; border: none !important; }
.btn-donate-lt:hover { background: #e2b607 !important; color: #000 !important; }

.camthu-comment-box { margin-top: 40px; padding: 25px; background: #bdc3c7; border-radius: 8px; box-shadow: 0 2px 10px rgba(231,76,60,0.3); }
.camthu-comment-title { color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 10px; margin-top: 0; }

.camthu-toc-list { list-style: none; padding: 0; margin: 0; }
.camthu-toc-item { margin-bottom: 8px; }
.camthu-toc-link { display: block; padding: 12px; color: #2c3e50; text-decoration: none; border-radius: 4px; transition: 0.2s; border: 1px solid #eee; }
.camthu-toc-link:hover { background: #f9f9f9; }
.camthu-toc-link.active { background: #eef7fc; border-left: 4px solid #3498db; font-weight: bold; }

.camthu-form-group { margin-bottom: 15px; }
.camthu-form-group label { font-weight: bold; display: block; margin-bottom: 5px; }
.camthu-form-control { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
.btn-submit-report { width: 100%; background: #c0392b; color: #fff; padding: 12px; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-submit-report:hover { background: #a93226; }

.camthu-alert-auth { padding: 40px 20px; background: rgba(241, 196, 15, 0.08); border: 1px solid #f1c40f; border-radius: 8px; }
.btn-login-action { background: #2980b9; color: white; border: none; padding: 10px 25px; font-size: 16px; font-weight: bold; border-radius: 20px; cursor: pointer; transition: 0.2s; }
.btn-login-action:hover { background: #2471a3; }
.camthu-alert-error { border: 2px solid #e74c3c; padding: 15px; border-radius: 8px; background: #fadbd8; margin: 20px 0; }
.camthu-alert-error-code { background: #fff; padding: 10px; display: block; margin-top: 10px; font-size: 13px; text-align: left; color: #333; border: 1px solid #ccc; word-wrap: break-word; }

/* ==========================================================================
7. BÌNH LUẬN (COMMENTS AREA)
========================================================================== */
.comment-wrapper { margin-top: 40px; padding: 25px; background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.comment-title { color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 10px; margin-top: 0; }
.comments-area .comments-title-custom { color: #2c3e50; font-size: 18px; margin-bottom: 20px; }
.comment-reply-title span { font-size: 18px; color: #d35400; }
.comment-notes-before { color: #7f8c8d; font-size: 13px; margin-top: 0; font-style: italic; }
.comment-form-comment { margin-bottom: 15px; }
.comment-form-author-email { display: flex; gap: 15px; margin-bottom: 15px; }
.comment-form-author-email input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 4px; transition: border-color 0.2s; }
.comment-form-author-email input:focus { border-color: #2980b9; outline: none; }
#respond .submit-btn, .submit-btn { background: #27ae60; color: #fff; border: none; padding: 12px 25px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 15px; }
#respond .submit-btn:hover, .submit-btn:hover { background: #2ecc71; transform: translateY(-2px); }
.submit-btn.loading { opacity: 0.7; cursor: not-allowed; }
#respond a { color: #e74c3c; text-decoration: none; }
.login-required-notice { text-align: center; padding: 25px; background: #fdf2e9; border: 1px dashed #e67e22; border-radius: 8px; margin-top: 20px; }
.login-required-notice p { color: #d35400; font-weight: bold; margin-bottom: 15px; font-size: 16px; margin-top: 0; }
.login-required-notice button, .btn-login-to-comment { background: #2980b9; color: #fff; border: none; padding: 10px 25px; border-radius: 20px; cursor: pointer; font-weight: bold; font-size: 15px; transition: background 0.2s; }
.login-required-notice button:hover, .btn-login-to-comment:hover { background: #3498db; transform: translateY(-2px); }

/* Giao diện Đàm đạo Hiện đại */
.camthu-modern-comments { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); margin-top: 40px; font-family: 'Segoe UI', Arial, sans-serif; }
.camthu-comment-respond-wrapper { background: #fdfdfd; padding: 20px; border-radius: 8px; border: 1px solid #eee; margin-bottom: 40px; }
#reply-title { font-size: 18px; color: #d35400; font-weight: bold; margin-bottom: 10px; display: block; }
.comment-form-flex { display: flex; gap: 15px; align-items: flex-start; }
.current-user-avatar img { width: 50px; height: 50px; border-radius: 50%; border: 2px solid #eef7fc; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.comment-input-wrapper { flex: 1; }
.comment-input-wrapper textarea { width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: 8px; resize: vertical; font-size: 15px; background: #f9f9f9; transition: 0.3s; box-sizing: border-box; }
.comment-input-wrapper textarea:focus { background: #fff; border-color: #3498db; outline: none; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1); }
.form-submit-wrapper { text-align: right; margin-top: 10px; }
.comments-header-flex { border-bottom: 2px solid #f1f1f1; margin-bottom: 25px; padding-bottom: 10px; }
.comments-title-custom { font-size: 18px; color: #2c3e50; margin: 0; }
.highlight-count { color: #e74c3c; font-size: 22px; font-weight: 900; }
.camthu-comment-list { list-style: none; padding: 0; margin: 0; }
.camthu-comment-list li.comment { margin-bottom: 25px; }
.camthu-comment-list .comment-body { position: relative; background: #fdfdfd; border: 1px solid #eee; padding: 20px 20px 20px 85px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); min-height: 88px; }
.camthu-comment-list .comment-author .avatar { position: absolute !important; left: 20px !important; top: 20px !important; width: 48px !important; height: 48px !important; max-width: 48px !important; max-height: 48px !important; border-radius: 50% !important; object-fit: cover !important; margin: 0 !important; display: block !important; box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important; }
.camthu-comment-list .comment-author { font-size: 15px; margin: 0 0 6px 0; line-height: 1.2; display: block; }
.camthu-comment-list .comment-author b.fn, .camthu-comment-list .comment-author b.fn a { color: #2980b9; font-weight: bold; text-decoration: none; }
.camthu-comment-list .comment-author .says { display: none !important; }
.camthu-comment-list .comment-meta, .camthu-comment-list .commentmetadata { font-size: 12px; margin: 0 0 15px 0; line-height: 1.2; display: flex; align-items: center; gap: 10px; }
.camthu-comment-list .comment-meta a, .camthu-comment-list .commentmetadata a { color: #95a5a6; text-decoration: none; }
.camthu-comment-list .comment-meta a:hover { color: #3498db; }
.camthu-comment-list .comment-content, .camthu-comment-list .comment-body > p { font-size: 15px; color: #34495e; line-height: 1.6; padding-top: 15px; border-top: 1px dashed #e0e0e0; margin: 0; }
.camthu-comment-list .comment-content p { margin: 0 0 10px 0; }
.camthu-comment-list .comment-content p:last-child { margin: 0; }
.camthu-comment-list .reply { margin-top: 15px; text-align: right; }
.camthu-comment-list .reply a { font-size: 13px; font-weight: bold; color: #e67e22; background: #fdf2e9; padding: 6px 16px; border-radius: 20px; text-decoration: none; transition: 0.2s; display: inline-block; }
.camthu-comment-list .reply a:hover { background: #e67e22; color: #fff; }
.camthu-comment-list ul.children { list-style: none; padding-left: 45px; margin-top: 20px; }
.camthu-comment-list ul.children .comment-body { background: #fff; border: 1px solid #eef0f2; }
.comment-pagination { text-align: center; margin-top: 30px; }
.comment-pagination .page-numbers { padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; text-decoration: none; color: #2c3e50; font-weight: bold; margin: 0 3px; }
.comment-pagination .page-numbers.current { background: #3498db; color: #fff; border-color: #3498db; }

/* ==========================================================================
8. HỆ THỐNG / TÀI KHOẢN / MINIGAME
========================================================================== */
/* Ban System */
body.ban-system-body { background-color: #f4f6f9; margin: 0; padding: 20px; font-family: Arial, sans-serif; }
.ban-system-container { max-width: 1000px; margin: 0 auto; background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.ban-system-title { text-align: center; color: #333; margin-bottom: 30px; }

/* Dashboard Tài Khoản */
.dashboard-container { max-width: 1100px; margin: 30px auto; display: flex; gap: 25px; font-family: 'Segoe UI', Arial, sans-serif; align-items: flex-start; }
.dashboard-sidebar { flex: 0 0 280px; background: #fff; padding: 25px; border-radius: 12px; box-shadow: 0 2px 15px rgba(0,0,0,0.05); position: sticky; top: 90px; }
.dashboard-main { flex: 1; background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 2px 15px rgba(0,0,0,0.05); min-height: 500px; }
.sidebar-menu { list-style: none; padding: 0; margin: 20px 0 0 0; }
.sidebar-menu li { margin-bottom: 8px; }
.sidebar-menu button { width: 100%; text-align: left; padding: 12px 15px; background: transparent; border: none; font-size: 15px; font-weight: bold; color: #7f8c8d; border-radius: 8px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 10px; }
.sidebar-menu button:hover { background: #f4f6f8; color: #2c3e50; }
.sidebar-menu button.active { background: #eef7fc; color: #2980b9; }
.tab-content { display: none; animation: fadeIn 0.3s ease-out; }
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.camthu-input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; margin-bottom: 15px; font-size: 14px; }
.camthu-input:focus { border-color: #3498db; outline: none; }
.camthu-btn { background: #2980b9; color: #fff; border: none; padding: 12px 25px; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.camthu-btn:hover { background: #2471a3; }

/* Nạp Linh Thạch */
.camthu-login-msg { text-align: center; padding: 50px; }
.camthu-login-link { color: #e74c3c; text-decoration: none; }
.camthu-login-link:hover { text-decoration: underline; }
.camthu-nap-tien-container { max-width: 500px; margin: 0 auto; padding: 25px; border: 1px solid #e0e0e0; border-radius: 10px; font-family: sans-serif; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.camthu-nap-tien-container h2 { text-align: center; margin-top: 0; }
.camthu-so-du-text { text-align: center; font-size: 16px; }
.camthu-so-du-value { color: #27ae60; font-size: 20px; }
.camthu-quy-dinh { background: #f8f9fa; padding: 15px; border-left: 4px solid #f39c12; margin-bottom: 20px; font-size: 14px; }
.camthu-quy-dinh-title { margin: 0 0 8px 0; }
.camthu-quy-dinh-list { margin: 0; padding-left: 20px; }
.camthu-input-group { margin-bottom: 20px; }
.camthu-input-label { font-weight: bold; display: block; margin-bottom: 8px; }
.camthu-input-field { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 6px; box-sizing: border-box; font-size: 16px; }
.camthu-btn-qr { background: #2980b9; color: white; width: 100%; padding: 12px; margin-top: 10px; border: none; border-radius: 6px; font-weight: bold; font-size: 16px; cursor: pointer; transition: background 0.3s ease; }
.camthu-btn-qr:hover { background: #2471a3; }
.camthu-qr-area { text-align: center; display: none; padding-top: 15px; border-top: 1px solid #eee; }
.camthu-qr-title { margin-bottom: 10px; }
.camthu-qr-img { max-width: 100%; height: auto; border: 1px solid #ddd; border-radius: 8px; padding: 10px; }
.camthu-qr-note { margin-top: 15px; font-size: 15px; }
.camthu-qr-note-value { color: #c0392b; font-size: 22px; letter-spacing: 1px; }
.camthu-manual-info { margin-top: 25px; border-top: 1px dashed #ccc; padding-top: 20px; font-size: 14px; }
.camthu-manual-title { margin-top: 0; }
.camthu-manual-row { margin: 5px 0; }
.camthu-manual-value { font-size: 16px; }
.camthu-manual-highlight { color: #c0392b; }

/* ==========================================================================
9. TỔNG HỢP CSS DÀNH CHO ĐIỆN THOẠI (MOBILE RESPONSIVE)
========================================================================== */
/* [FIX] Tablet 769-1024px: các .truyen-grid có inline style 5-6 cột -> card ~120px,
   title 11px khó bấm. Ép xuống 4 cột (override inline cần !important). */
@media (max-width: 1024px) and (min-width: 769px) {
    .truyen-grid[style] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 12px !important; }
}
@media (max-width: 768px) {
    /* Header Thu Gọn */
    .header-flex-container { padding: 10px !important; gap: 8px !important; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
    .site-logo { order: 1; margin-right: auto !important; font-size: 28px !important; }
    .logo-icon { font-size: 28px !important; }
    .search-trigger { order: 2; padding: 6px 10px !important; border-radius: 8px !important; font-size: 12px !important; }
    .search-trigger span { display: none; }
    .notification-wrapper { order: 3; margin-right: 2px !important; }
    .notification-icon { font-size: 18px !important; margin-right: 5px !important; }
    .btn-profile, .btn-login { order: 4; padding: 6px 10px !important; font-size: 13px !important; }
    .btn-logout, .btn-register { order: 5; padding: 6px 10px !important; font-size: 13px !important; }
    .header-left-section, .header-actions { display: contents !important; }
    .header-flex-container::before { content: " "; width: 100%; order: 6; height: 0; margin: 0; }

    /* Menu Hàng 2 */
    .camthu-nav-item { order: 7; width: calc(50% - 4px) !important; background: #fdf2e9; border: 1px solid #fae5d3; border-radius: 6px; text-align: center; padding: 8px 0 !important; margin: 0 !important; font-size: 14px !important; box-sizing: border-box; }
    .camthu-dropdown-content { position: static; display: none; width: 100%; box-shadow: none; grid-template-columns: 1fr !important; min-width: 100% !important; max-height: 40vh; overflow-y: auto; border: 1px solid #ddd; border-top: none; border-radius: 0 0 6px 6px; top: 100% !important; left: 0 !important; }
    .camthu-nav-item.active .camthu-dropdown-content { display: grid !important; }
    .camthu-dropdown-content a { padding: 10px; font-size: 15px; border-bottom: 1px solid #f1f1f1; }

    /* Lưới Truyện & Layout (Ép buộc 3 cột, chống tràn và đè ảnh) */
    .camthu-home-wrapper { padding: 0 5px !important; overflow: hidden !important; }
    .section-title { font-size: 16px !important; margin-top: 15px !important; }
    div[style*="display: flex; gap: 30px;"] { flex-direction: column !important; gap: 15px !important; display: flex !important; }
    
    .truyen-grid { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; width: 100% !important; box-sizing: border-box !important; }
    .truyen-card { width: 100% !important; min-width: 0 !important; max-width: 100% !important; overflow: hidden !important; box-sizing: border-box !important; margin: 0 !important; }
    .truyen-thumb { width: 100% !important; height: auto !important; aspect-ratio: 1 / 1 !important; overflow: hidden !important; }
    .truyen-thumb img { width: 100% !important; height: 100% !important; max-width: 100% !important; object-fit: cover !important; aspect-ratio: 1 / 1 !important; }
    .truyen-info { padding: 5px 0 !important; width: 100% !important; overflow: hidden !important; }
    .truyen-title { font-size: 11px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; margin: 0 !important; }
    .truyen-author { font-size: 10px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
    .hover-desc { display: none !important; }

    /* Search Overlay */
    #camthu-search-input-full { width: 95%; font-size: 16px; padding: 15px; }
    #camthu-search-results { width: 95%; }
    #camthu-search-close { right: 20px; top: 15px; }

    /* Giao Diện Các Trang Con */
    .thong-tin-truyen-container, .truyen-detail-layout, .truyen-detail-flex { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; flex-direction: column !important; }
    .thong-tin-truyen-container img { width: auto !important; height: auto !important; display: inline-block !important; margin: 0 !important; }
    .thong-tin-truyen-container img.emoji { width: 1em !important; height: 1em !important; display: inline !important; margin: 0 0.1em !important; vertical-align: -0.1em !important; box-shadow: none !important; }
    .truyen-cover-wrapper { width: 100% !important; text-align: center; margin-bottom: 20px; flex: none; }
    .thong-tin-truyen-container img.truyen-cover-img, .truyen-cover-img, .truyen-cover-placeholder { width: 65% !important; max-width: 250px !important; aspect-ratio: 1 / 1 !important; object-fit: cover !important; height: auto !important; margin: 0 auto !important; display: block !important; border-radius: 12px !important; box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important; }
    .truyen-info-wrapper { flex-direction: column; }
    .danh-sach-chuong { column-count: 1; }
    .nhom-nut-hanh-dong { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 15px; }
    .nhom-nut-hanh-dong a, .nhom-nut-hanh-dong button { width: 100% !important; box-sizing: border-box; padding: 12px !important; font-size: 15px !important; }
    /* [FIX] Trước đây chọn mọi <p> trên trang (footer, widget, comment, modal) -> ép 100vw,
       vỡ layout component không liên quan. Giờ chỉ thu hẹp khối giới thiệu truyện.
       Paragraph nội dung chương đã được xử lý riêng ở #full-text-area p phía dưới. */
    .gioi-thieu-truyen { width: 100% !important; max-width: 100% !important; box-sizing: border-box; word-wrap: break-word; }

    /* Bình Luận Mobile */
    .camthu-modern-comments { padding: 15px; margin-top: 20px; }
    .camthu-comment-list .comment-body { padding: 15px 15px 15px 65px; min-height: 70px; }
    .camthu-comment-list .comment-author .avatar { left: 10px !important; top: 15px !important; width: 40px !important; height: 40px !important; }
    .camthu-comment-list ul.children { padding-left: 15px; }
    .comment-form-author-email { flex-direction: column; }
    .current-user-avatar { display: none; }

    /* Modal Auth Mobile */
    .camthu-auth-box { width: 95%; max-height: 90vh; overflow-y: auto; }
    .camthu-auth-body { padding: 15px; }
    .camthu-auth-tab { padding: 12px; font-size: 14px; }

    /* Khung Đọc Truyện Mobile */
    .camthu-reading-container { max-width: 100% !important; padding: 15px !important; margin: 10px auto !important; border-radius: 0 !important; }
    #full-text-area, #full-text-area p { max-width: 100% !important; box-sizing: border-box !important; word-wrap: break-word !important; overflow-wrap: break-word !important; }
    .camthu-tool-bar { gap: 5px; padding: 5px; }
    .camthu-tool-btn { padding: 6px 10px; font-size: 12px; flex: 1 1 auto; } 
    .chuong-content-read { padding: 10px !important; font-size: 18px !important; line-height: 1.6 !important; }

    /* Trang Tài Khoản Mobile */
    .dashboard-container { flex-direction: column !important; gap: 15px; margin: 15px auto; padding: 0 10px; }
    .dashboard-sidebar { flex: auto !important; width: 100% !important; position: static !important; box-sizing: border-box; padding: 15px; }
    .dashboard-main { flex: auto !important; width: 100% !important; box-sizing: border-box; padding: 15px; min-height: auto; }
    .sidebar-menu { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0 0 !important; }
    .sidebar-menu li { margin-bottom: 0 !important; flex: 1 1 calc(50% - 8px); }
    .sidebar-menu li:last-child { margin-top: 0 !important; border-top: none !important; padding-top: 0 !important; }
    .sidebar-menu button, .sidebar-menu li a { width: 100%; justify-content: center !important; text-align: center !important; padding: 10px 5px !important; font-size: 13px !important; box-sizing: border-box; border-radius: 8px; background: #f9f9f9; }
    .sidebar-menu button.active { background: #eef7fc !important; border: 1px solid #3498db; }
    .form-table, .form-table tbody, .form-table tr, .form-table th, .form-table td { display: block !important; width: 100% !important; box-sizing: border-box !important; }
    .form-table tr { margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
    .form-table th { padding: 0 0 5px 0 !important; text-align: left; }
    .form-table td { padding: 0 !important; }
    .form-table input[type="text"], .form-table input[type="number"], .form-table input[type="password"], .form-table select { width: 100% !important; box-sizing: border-box !important; padding: 12px !important; font-size: 16px !important; }
}

/* ==========================================================================
GIAO DIỆN TRANG THƯ VIỆN TRUYỆN (DANH SÁCH NGANG 2 CỘT)
========================================================================== */
.thu-vien-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Ép 2 cột trên PC */
    gap: 20px;
}

.thu-vien-card-ngang {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: 0.3s;
    overflow: hidden;
    height: 100px; /* Cố định chiều cao thẻ bằng 100px */
}

.tv-link-bao-quat {
    display: flex;
    text-decoration: none;
    color: inherit;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
    gap: 15px;
}

.tv-thumb-vuong {
    flex: 0 0 80px; /* Cố định avatar 80x80px */
    height: 80px;
    border-radius: 6px;
    position: relative; /* neo cho .camthu-ribbon-done.sm */
    overflow: hidden;
    background: #eee;
}

.tv-thumb-vuong img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.tv-info-3-hang {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Ép 3 dòng tự động giãn cách khít với chiều cao avatar 80px */
    overflow: hidden;
    padding: 2px 0;
}

.tv-title {
    margin: 0;
    font-size: 16px;
    color: #2980b9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.tv-author {
    font-size: 13px;
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-time {
    font-size: 12px;
    color: #95a5a6;
    font-style: italic;
}

/* ==========================================================================
   MÀU NỀN WEBSITE (tùy chọn hồ sơ — KHÔNG ảnh hưởng trang đọc chương)
   Class site-bg-* thêm vào <body> qua body_class filter (functions.php) theo
   user_meta _camthu_site_bg. Trang đọc chương (single-chuong) KHÔNG nhận class này
   -> reader dùng bảng màu riêng (camthu_theme localStorage). site-bg-white = mặc định
   (không có rule nào -> giữ nguyên diện mạo trắng hiện tại).
   ========================================================================== */

/* --- KHUNG TÙY CHỌN trong hồ sơ --- */
.camthu-site-bg-prefs { background:#fff; border:1px solid #e3e6e8; border-radius:8px; padding:16px 18px; margin-bottom:20px; }
.camthu-site-bg-title { margin:0 0 6px 0; color:#2c3e50; font-size:18px; }
.camthu-site-bg-desc { margin:0 0 14px 0; color:#7f8c8d; font-size:13px; line-height:1.5; }
.camthu-site-bg-options { display:flex; gap:10px; flex-wrap:wrap; }
.camthu-site-bg-opt { border:2px solid #ddd; border-radius:8px; padding:10px 16px; font-size:15px; font-weight:bold; cursor:pointer; background:#fff; color:#2c3e50; transition:0.2s; }
.camthu-site-bg-opt:hover { border-color:#3498db; }
.camthu-site-bg-opt.is-selected { border-color:#27ae60; box-shadow:0 0 0 2px rgba(39,174,96,0.15); }
/* Mô tả nhỏ swatch màu cho từng nút */
.camthu-site-bg-opt.camthu-site-bg-sw-white  { border-left:6px solid #ffffff; }
.camthu-site-bg-opt.camthu-site-bg-sw-sepia  { border-left:6px solid #f4ecd8; }
.camthu-site-bg-opt.camthu-site-bg-sw-dark   { border-left:6px solid #1a1a1a; }
.camthu-site-bg-msg { margin-top:10px; font-size:13px; font-weight:bold; min-height:18px; }

/* --- CHẾ ĐỘ GIẤY CŨ (sepia) --- */
body.site-bg-sepia { background:#f4ecd8 !important; color:#4a3f2a !important; }
body.site-bg-sepia #camthu-main-header { background:#f0e6cc !important; box-shadow:0 2px 10px rgba(120,90,40,0.12) !important; }
body.site-bg-sepia .site-logo { color:#8a5a2b !important; }
body.site-bg-sepia .camthu-nav-item { color:#5a4a2a !important; }
body.site-bg-sepia .truyen-card,
body.site-bg-sepia .camthu-card,
body.site-bg-sepia .camthu-card-rut,
body.site-bg-sepia .camthu-empty-state,
body.site-bg-sepia .truyen-info-wrapper,
body.site-bg-sepia .thu-vien-card-ngang,
body.site-bg-sepia .camthu-site-bg-prefs { background:#faf3e0 !important; border-color:#e0d4b0 !important; }
body.site-bg-sepia .camthu-card-excerpt { background:#f0e6cc !important; color:#5a4a2a !important; }
body.site-bg-sepia .truyen-title,
body.site-bg-sepia .camthu-card-title-dark,
body.site-bg-sepia .section-title,
body.site-bg-sepia .camthu-list-title,
body.site-bg-sepia .tv-title { color:#5a4a2a !important; }
body.site-bg-sepia .truyen-author,
body.site-bg-sepia .camthu-card-meta,
body.site-bg-sepia .truyen-meta,
body.site-bg-sepia .tv-author,
body.site-bg-sepia .tv-time { color:#7a6a4a !important; }
body.site-bg-sepia .camthu-dropdown-content,
body.site-bg-sepia .notification-dropdown { background:#faf3e0 !important; border-color:#e0d4b0 !important; box-shadow:0 8px 16px rgba(120,90,40,0.15) !important; }
body.site-bg-sepia .camthu-dropdown-content a { color:#4a3f2a !important; }
body.site-bg-sepia .camthu-dropdown-content a:hover { background:#f0e6cc !important; color:#8a5a2b !important; }
body.site-bg-sepia .notification-dropdown-header { background:#f0e6cc !important; color:#5a4a2a !important; border-bottom-color:#e0d4b0 !important; }
body.site-bg-sepia .notification-item { border-bottom-color:#e0d4b0 !important; }
body.site-bg-sepia .notification-item-msg { color:#5a4a2a !important; }
body.site-bg-sepia #camthu-search-overlay { background:rgba(244,236,216,0.98) !important; }
body.site-bg-sepia #camthu-search-input-full { color:#5a4a2a !important; }
body.site-bg-sepia .search-item { border-bottom-color:#e0d4b0 !important; }
body.site-bg-sepia .search-item:hover { background:#f0e6cc !important; }
body.site-bg-sepia .camthu-auth-box { background:#faf3e0 !important; }
body.site-bg-sepia .camthu-auth-tab { background:#f0e6cc !important; color:#7a6a4a !important; }
body.site-bg-sepia .camthu-input,
body.site-bg-sepia .camthu-input-field { background:#fffdf5 !important; border-color:#d8c890 !important; color:#4a3f2a !important; }
body.site-bg-sepia .camthu-empty-message,
body.site-bg-sepia .no-posts-message { color:#7a6a4a !important; }

/* --- CHẾ ĐỘ TỐI (dark) --- */
body.site-bg-dark { background:#1a1a1a !important; color:#c8c8c8 !important; }
body.site-bg-dark #camthu-main-header { background:#242424 !important; box-shadow:0 2px 10px rgba(0,0,0,0.5) !important; }
body.site-bg-dark .site-logo { color:#5dade2 !important; }
body.site-bg-dark .camthu-nav-item { color:#ccc !important; }
body.site-bg-dark .btn-app, body.site-bg-dark .btn-profile { color:#e0e0e0 !important; }
body.site-bg-dark .truyen-card,
body.site-bg-dark .camthu-card,
body.site-bg-dark .camthu-card-rut,
body.site-bg-dark .camthu-empty-state,
body.site-bg-dark .truyen-info-wrapper,
body.site-bg-dark .thu-vien-card-ngang,
body.site-bg-dark .camthu-site-bg-prefs { background:#2a2a2a !important; border-color:#3a3a3a !important; box-shadow:0 2px 8px rgba(0,0,0,0.4) !important; }
body.site-bg-dark .camthu-card-excerpt { background:#333 !important; color:#bbb !important; }
body.site-bg-dark .truyen-card:hover,
body.site-bg-dark .camthu-list-wrapper .truyen-card:hover { box-shadow:0 5px 15px rgba(0,0,0,0.6) !important; }
body.site-bg-dark .truyen-title,
body.site-bg-dark .camthu-card-title-dark,
body.site-bg-dark .section-title,
body.site-bg-dark .camthu-list-title,
body.site-bg-dark .tv-title { color:#e0e0e0 !important; }
body.site-bg-dark .section-title { border-bottom-color:#444 !important; }
body.site-bg-dark .truyen-author,
body.site-bg-dark .camthu-card-meta,
body.site-bg-dark .truyen-meta,
body.site-bg-dark .tv-author,
body.site-bg-dark .tv-time { color:#999 !important; }
body.site-bg-dark .truyen-thumb,
body.site-bg-dark .tv-thumb-vuong,
body.site-bg-dark .truyen-cover-placeholder { background:#333 !important; }
body.site-bg-dark .camthu-dropdown-content,
body.site-bg-dark .notification-dropdown { background:#2a2a2a !important; border-color:#3a3a3a !important; box-shadow:0 8px 16px rgba(0,0,0,0.6) !important; }
body.site-bg-dark .camthu-dropdown-content a { color:#ccc !important; }
body.site-bg-dark .camthu-dropdown-content a:hover { background:#3a3a3a !important; color:#5dade2 !important; }
body.site-bg-dark .notification-dropdown-header { background:#333 !important; color:#e0e0e0 !important; border-bottom-color:#3a3a3a !important; }
body.site-bg-dark .notification-item { border-bottom-color:#3a3a3a !important; }
body.site-bg-dark .notification-item-msg { color:#ccc !important; }
body.site-bg-dark #camthu-search-overlay { background:rgba(20,20,20,0.98) !important; }
body.site-bg-dark #camthu-search-input-full { color:#e0e0e0 !important; border-bottom-color:#3498db !important; }
body.site-bg-dark #camthu-search-close { color:#aaa !important; }
body.site-bg-dark .search-item { border-bottom-color:#3a3a3a !important; color:#ccc !important; }
body.site-bg-dark .search-item:hover { background:#333 !important; }
body.site-bg-dark .search-item-title { color:#5dade2 !important; }
body.site-bg-dark .search-item-author { color:#999 !important; }
body.site-bg-dark .camthu-auth-box { background:#2a2a2a !important; }
body.site-bg-dark .camthu-auth-header { border-bottom-color:#3a3a3a !important; }
body.site-bg-dark .camthu-auth-tab { background:#222 !important; color:#999 !important; }
body.site-bg-dark .camthu-auth-tab.active { background:#2a2a2a !important; color:#e0e0e0 !important; }
body.site-bg-dark .camthu-auth-form label { color:#ccc !important; }
body.site-bg-dark .camthu-input,
body.site-bg-dark .camthu-input-field,
body.site-bg-dark .camthu-auth-form input[type="text"],
body.site-bg-dark .camthu-auth-form input[type="email"],
body.site-bg-dark .camthu-auth-form input[type="password"],
body.site-bg-dark .camthu-auth-form select { background:#333 !important; border-color:#444 !important; color:#e0e0e0 !important; }
body.site-bg-dark .camthu-empty-message,
body.site-bg-dark .no-posts-message { color:#999 !important; }
body.site-bg-dark .camthu-card-info-box { background:#3a3020 !important; color:#e0d0b0 !important; }

/* HIỆU CHỈNH TRÊN ĐIỆN THOẠI: Tự động gom về 1 CỘT */
@media (max-width: 768px) {
    .thu-vien-grid-2col {
        grid-template-columns: 1fr !important; /* Mobile thành 1 cột */
        gap: 12px;
    }
}

/* ==========================================================================
NÚT VỀ ĐẦU TRANG (back-to-top)
- Nằm cố định góc dưới phải, hiện khi cuộn xuống quá 400px.
- Tự适应 cả 3 nền white/sepia/dark: nền xanh dương nổi bật trên mọi nền.
========================================================================== */
#camthu-back-to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: #3498db;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
}
#camthu-back-to-top.camthu-btt-show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#camthu-back-to-top:hover {
    background: #2980b9;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}
#camthu-back-to-top:active {
    transform: translateY(1px);
}
#camthu-back-to-top svg { display: block; }
@media (max-width: 768px) {
    #camthu-back-to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; }
}

/* ==========================================================================
THANH CÔNG CỤ ĐỌC (floating side toolbar) — chỉ ở trang đọc chương
- Nổi cố định bên phải, vertically centered, luôn hiện khi cuộn lên/xuống.
- Gộp: chương trước / mục lục / chương sau / cỡ chữ +− / giao diện / báo lỗi / thưởng.
- Tự thích ứng giao diện Tối của trang đọc (theme-dark trên #camthu-theme-wrapper).
- Chừa gutter phải cho nội dung (tránh đè lên chữ) ở các màn < 1380px.
========================================================================== */
.camthu-float-tools {
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9000; /* dưới modal auth (10000) để modal đè lên */
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #e3e6e8;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.camthu-float-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #444;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}
.camthu-float-btn:hover { background: #eaeaea; border-color: #ccc; }
.camthu-float-btn:active { transform: scale(0.93); }
.camthu-float-btn:disabled { opacity: 0.32; cursor: not-allowed; }
.camthu-float-btn:disabled:hover { background: transparent; border-color: transparent; }
.camthu-float-divider { height: 1px; background: #e0e0e0; margin: 3px 5px; }

/* Giao diện đọc Tối */
#camthu-theme-wrapper.theme-dark .camthu-float-tools {
    background: rgba(44, 44, 44, 0.96);
    border-color: #444;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
#camthu-theme-wrapper.theme-dark .camthu-float-btn { color: #bdc3c7; }
#camthu-theme-wrapper.theme-dark .camthu-float-btn:hover { background: #3a3a3a; border-color: #555; }
#camthu-theme-wrapper.theme-dark .camthu-float-divider { background: #444; }

/* Chừa lối bên phải cho thanh công cụ (chỉ trang đọc chương có .camthu-reading-container) */
@media (max-width: 1379px) {
    .camthu-reading-container { padding-right: 76px !important; }
}
@media (max-width: 768px) {
    .camthu-float-tools { right: 6px; gap: 4px; padding: 6px; }
    .camthu-float-btn { width: 36px; height: 36px; font-size: 16px; }
    .camthu-float-divider { margin: 2px 4px; }
    .camthu-reading-container { padding-right: 60px !important; }
}

/* ==========================================================================
MỤC LỤC CHƯƠNG (modal lớn hơn + phân trang đầu/cuối + ô đi đến trang)
- Ghi đè khung .camthu-auth-box (mặc định 450px) chỉ cho modal mục lục.
========================================================================== */
.camthu-toc-box {
    width: 92% !important;
    max-width: 780px !important;
    max-height: 86vh !important;
    display: flex !important;
    flex-direction: column !important;
}
.camthu-toc-body {
    overflow-y: auto;
    flex: 1;
    background: #fdfdfd;
    padding: 14px 18px 18px 18px;
}
.camthu-toc-list { list-style: none; padding: 0; margin: 0; }
.camthu-toc-loading { padding: 14px 10px; color: #888; font-size: 15px; }
/* Mỗi mục chương to hơn, dễ bấm */
.camthu-toc-list .camthu-chuong-list-item {
    margin-bottom: 6px;
    border-bottom: 1px dashed #eee;
    padding: 2px 0;
}
.camthu-toc-list .camthu-chuong-list-link {
    text-decoration: none;
    color: #2c3e50;
    font-size: 17px;
    line-height: 1.9;
    display: block;
    padding: 5px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.camthu-toc-list .camthu-chuong-list-link:hover { color: #3498db; background: #f2f6fa; }
/* Chương đang đọc: nổi bật (thay vì inline style cứng) */
.camthu-toc-list .camthu-toc-current {
    font-weight: bold !important;
    color: #fff !important;
    background: #e67e22 !important;
    border-radius: 6px;
}

/* Thanh phân trang mục lục */
.camthu-toc-pagination {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.camthu-toc-nav {
    padding: 7px 14px;
    font-size: 15px;
    font-weight: bold;
    border: 1px solid #ccc;
    background: #fff;
    color: #2c3e50;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.15s;
    line-height: 1;
}
.camthu-toc-nav:hover:not(:disabled) { background: #e8f1fb; border-color: #3498db; color: #2980b9; }
.camthu-toc-nav:disabled { opacity: 0.4; cursor: not-allowed; }
.camthu-toc-go { background: #3498db; color: #fff; border-color: #3498db; }
.camthu-toc-go:hover:not(:disabled) { background: #2980b9; color: #fff; border-color: #2980b9; }
.camthu-toc-goto { color: #555; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.camthu-toc-goto-input {
    width: 60px;
    padding: 6px 8px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    text-align: center;
}

@media (max-width: 768px) {
    .camthu-toc-box { width: 96% !important; max-width: none !important; max-height: 90vh !important; }
    .camthu-toc-body { padding: 10px 12px 14px 12px; }
    .camthu-toc-list .camthu-chuong-list-link { font-size: 16px; line-height: 1.8; }
    .camthu-toc-nav { padding: 6px 11px; font-size: 14px; }
    .camthu-toc-goto-input { width: 52px; }
}

/* ==========================================================================
Nút nghe truyện — HỘP THÔNG BÁO giữa màn hình dẫn sang website audio (KHÔNG TTS camthu)
- Lớp phủ mờ toàn màn + hộp trắng giữa, chữ to, link nút xanh nổi bật click được.
========================================================================== */
#camthu-tts-toast {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.25s ease;
}
#camthu-tts-toast.camthu-toast-show {
    display: flex;
    opacity: 1;
}
.camthu-tts-box {
    position: relative;
    background: #fff;
    border-radius: 18px;
    padding: 34px 30px 30px;
    width: 440px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45);
    animation: camthu-tts-pop 0.25s ease;
}
.camthu-tts-text {
    font-size: 21px;
    line-height: 1.5;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 22px;
}
/* Link = nút xanh nổi bật, click mở tab mới */
.camthu-tts-link {
    display: inline-block;
    font-size: 25px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #27ae60, #219150);
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(39, 174, 96, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.camthu-tts-link:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 22px rgba(39, 174, 96, 0.55);
}
.camthu-tts-close {
    position: absolute;
    top: 6px;
    right: 14px;
    font-size: 28px;
    color: #b0b0b0;
    cursor: pointer;
    line-height: 1;
    user-select: none;
    transition: color 0.15s;
}
.camthu-tts-close:hover { color: #333; }
@keyframes camthu-tts-pop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@media (max-width: 768px) {
    .camthu-tts-box { width: 92vw; padding: 28px 20px 24px; }
    .camthu-tts-text { font-size: 19px; margin-bottom: 18px; }
    .camthu-tts-link { font-size: 22px; padding: 12px 26px; }
}