
/* ================= GLOBAL ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body{
    font-family: Arial, sans-serif;
    background: var(--bg, #f6f7fb) !important;
    color: var(--text, #111) !important;
    transition: background .3s, color .3s;
}

/* 🔥 CHỈ áp dụng nền khi KHÔNG phải trang đọc */
body:not(.reading-page) {
    background: #f6f7fb;
}

/* ================= LAYOUT ================= */
.site-wrapper,
.container {
    max-width: 1300px;
    margin: auto;
    padding: 0 15px;
}

.main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-top: 20px;
}

.content {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 10px;
}

/* ================= HEADER ================= */


/* MENU (gọn + không bị override lặp) */
.menu a {
    display: inline-block;
    background: #111;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    margin: 0 4px;
    transition: .2s;
}

.menu a:hover {
    background: #fff;
    color: #111;
    box-shadow: 0 0 0 1px #111 inset;
}

.menu .current-menu-item > a,
.menu .active > a {
    background: #fff;
    color: #111;
    box-shadow: 0 0 0 2px #111 inset;
}

/* ================= FOOTER ================= */
.footer {
    text-align: center;
    padding: 15px 0;
    background: #fff;
    color: #111;
}

/* ================= GRID DEFAULT ================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

/* CARD */
.card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.card h3 {
    font-size: 14px;
    margin-top: 6px;
    padding: 0 6px 8px;
}

/* ================= LIST ================= */
.list .item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

/* ================= HOT GRID (10 TRUYỆN = 2 HÀNG × 5 CỘT) ================= */
.hot-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

/* card hot */
.hot-grid-5 .card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 8px;
}

/* ảnh hot */
.hot-grid-5 .card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
}

/* title hot */
.hot-grid-5 .card h3 {
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.4;
}





/* ================= 
TRANG CHỦ CSSS 
================= */
.section-head h2 a{
    color:inherit;
    text-decoration:none;
}

.section-head h2 a:hover{
    color:#0073aa;
}

/* ===== HOME 2 CỘT ===== */
.home-2col{
    display:flex;
    gap:20px;
}

/* LEFT */
.hot-section{
    flex:1;
}

.home-sidebar{
    width:180px;
    margin-top: 45px;
}


.history-box{
    background:#fff;
    padding:15px;
    border-radius:12px;
    box-shadow:0 2px 10px rgba(0,0,0,.05);
}

.history-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.history-item{
    display:grid;
    grid-template-columns: 1fr auto;
    gap:10px;
    font-size:13px;
    align-items:center;
    border-bottom:1px dashed #eee;
    padding-bottom:6px;
}

.history-item .title{
    text-decoration:none;
    color:#111;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.history-item .chapter{
    color:#f26c3c;
    font-weight:600;
}

.empty{
    font-size:13px;
    color:#888;
}

/* MOBILE */
@media(max-width:991px){

    .home-2col{
        flex-direction:column;
    }

    .home-sidebar{
        width:100%;
        margin-top:0;
    }

    /* HOT SCROLL */
    .hot-grid-5{
        display:flex;
        gap:12px;

        overflow-x:auto;
        overflow-y:hidden;

        padding-bottom:10px;

        scroll-snap-type:x mandatory;
        -webkit-overflow-scrolling:touch;
    }

    .hot-grid-5 .card{
        min-width:140px;
        flex:0 0 auto;

        scroll-snap-align:start;
    }

    /* ẨN SCROLLBAR */
    .hot-grid-5::-webkit-scrollbar{
        display:none;
    }

}




/* =========================
UPDATE LAYOUT
========================= */

.main-1300 {
    max-width: 1300px;
    margin: 40px auto 0;
    padding: 0 15px;
    box-sizing: border-box;
}

.update-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 280px;
    gap: 20px;
    align-items: start;
}

.update-section,
.update-sidebar {
    min-width: 0;
}
.update-sidebar {
    margin-top: 45px;
}







/* =========================
UPDATE ITEM
========================= */

.update-item {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    padding: 14px 16px;

    background: #fff;

    border-radius: 10px;

    box-shadow:
        0 1px 6px rgba(0,0,0,.06);

    transition: .2s;
}

.update-item:hover {
    background: #fafafa;
    transform: translateY(-2px);
}

/* =========================
TITLE
========================= */

.update-item .title {
    flex: 1;

    min-width: 0;

    max-width: 100%;

    overflow: hidden;
}

.update-item .title a {
    display: block;

    width: 100%;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    color: #222;

    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;

    text-decoration: none;
}

/* =========================
META
========================= */

.update-item .meta {
    flex-shrink: 0;

    display: flex;
    align-items: center;

    gap: 18px;
}

/* =========================
GENRE LIST
========================= */

.genre-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    max-width: 240px;
}

/* =========================
GENRE
========================= */

.update-item .genre {
    padding: 4px 10px;

    background: #f2f2f2;

    border-radius: 20px;

    color: #555;

    font-size: 11px;
    font-weight: 600;

    line-height: 1;

    white-space: nowrap;
}

/* =========================
CHAPTER
========================= */

.update-item .chapter {
    flex-shrink: 0;
}

.update-item .chapter a {
    display: inline-block;

    min-width: 90px;

    text-align: center;

    padding: 5px 12px;

    background: #0073aa;

    border-radius: 20px;

    color: #fff;

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;

    transition: .2s;
}

.update-item .chapter a:hover {
    background: #005f8d;
}

/* =========================
TIME
========================= */

.update-item .time {
    flex-shrink: 0;

    width: 90px;

    text-align: right;

    color: #999;

    font-size: 12px;

    white-space: nowrap;
}

/* =========================
MOBILE
========================= */

@media (max-width: 991px) {

    .update-layout{
        grid-template-columns:1fr;
    }

    .update-item{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }

    .update-item .meta{
        width:100%;

        display:grid;
        grid-template-columns:1fr auto 1fr;

        align-items:center;

        gap:10px;
    }

    /* thể loại trái */
    .genre-list{
        justify-content:flex-start;

        max-width:none;
    }

    /* chương giữa */
    .update-item .chapter{
        justify-self:center;
    }

    /* thời gian phải */
    .update-item .time{
        justify-self:end;

        width:auto;

        text-align:right;

        white-space:nowrap;
    }

}






/* =========================
READING HOME
========================= */

.reading-home-section{
    margin-top:40px;
}

.reading-home-section h2{
    margin-bottom:18px;
}

/* slider */
.reading-slider{
    display:flex;
    gap:16px;

    overflow-x:auto;
    overflow-y:hidden;

    padding-bottom:10px;

    scroll-behavior:smooth;

}

/* scrollbar */
.reading-slider::-webkit-scrollbar{
    height:6px;
}

.reading-slider::-webkit-scrollbar-thumb{
    background:#ccc;
    border-radius:20px;
}

/* card */
.reading-card{
    min-width:180px;
    max-width:180px;

    background:#fff;
    border-radius:10px;

    overflow:hidden;

    box-shadow:0 1px 6px rgba(0,0,0,.06);

    flex-shrink:0;

    transition:.2s;
}

.reading-card:hover{
    transform:translateY(-3px);
}

/* thumb */
.reading-card .thumb img{
    width:100%;
    height:240px;
    object-fit:cover;
    display:block;
}

/* info */
.reading-card .info{
    padding:12px;
}

.reading-card h3{
    margin:0 0 8px;
    font-size:14px;
    line-height:1.5;

    height:42px;
    overflow:hidden;
}

.reading-card h3 a{
    color:#222;
    text-decoration:none;
}

/* reader */
.reading-card .reader-count{
    font-size:13px;
    color:#666;
}



a {
    text-decoration: none;
}







.header .container{
    display:flex;
    align-items:center;
    gap:20px;
}

.header-search{
    flex:1;
    position:relative;
    z-index:999999;
}

.yy-search-form{
    display:flex;
    align-items:center;
    width:100%;
    gap:10px;
}

.yy-search-form input[type="text"]{
    flex:1;
    height:42px;
    border:1px solid #ddd;
    border-radius:10px;
    padding:0 14px;
    font-size:16px;
    outline:none;
}

.yy-search-form button{
    height:42px;
    border:none;
    border-radius:10px;
    padding:0 18px;
    cursor:pointer;
    font-size:14px;
}





/* ================= HEADER ================= */

.header{
    background:#fff;
    border-bottom:1px solid #eee;
}

/* ================= TOP BAR ================= */

.header-mobile{
    height:60px;

    display:flex;
    align-items:center;
    gap:88px;

    max-width:1300px;
    margin:auto;

    padding:0 16px;
}

/* ================= MENU BUTTON ================= */

.mobile-menu-btn{
    width:50px;
    height:50px;

    flex-shrink:0;

    display:flex;
    align-items:center;
    justify-content:center;

    border:none;
    border-radius:10px;

    background:transparent;

    font-size:24px;
    cursor:pointer;

    transition:.2s;
}

.mobile-menu-btn:hover{
    background:#f5f5f5;
}

/* ================= LOGO ================= */

.logo{
    flex-shrink:0;

    font-size:22px;
    font-weight:700;
    line-height:1;

    color:#111;
    text-decoration:none;

    white-space:nowrap;
}

/* ================= SEARCH ================= */

.mobile-search-box{
    flex:1;

    display:flex;
    justify-content:flex-end;
}

/* BOX SEARCH */

.mobile-search-box .yy-search{
    width:100%;
    max-width:280px;

    position:relative;

    display:flex;
    align-items:center;
}

/* INPUT */

.mobile-search-box input{
    width:100%;
    height:40px;

    border:1px solid #ddd;
    border-radius:10px;

    padding:0 44px 0 14px;

    outline:none;

    font-size:16px;

    background:#fff;
}

/* BUTTON */

.mobile-search-box #yy-search-btn{
    position:absolute;
    right:6px;
    top:50%;

    transform:translateY(-50%);

    width:30px;
    height:30px;

    border:none;
    border-radius:8px;

    background:#f5f5f5;

    display:flex;
    align-items:center;
    justify-content:center;

    cursor:pointer;
}

/* RESULT */

/* ================= SEARCH RESULT DROPDOWN ================= */

#yy-search-box{
    position:absolute;
    top:calc(100% + 6px);
    left:0;

    width:100%;

    background:#fff;

    border:1px solid #eee;
    border-radius:12px;

    overflow:hidden;

    box-shadow:0 8px 24px rgba(0,0,0,.08);

    max-height:360px;
    overflow-y:auto;
}

/* ================= ITEM ================= */

.yy-search-item{
    display:flex;
    align-items:center;
    gap:10px;

    padding:10px 12px;

    text-decoration:none;
    color:#111;

    transition:.2s;

    border-bottom:1px solid #f5f5f5;
}

.yy-search-item:hover{
    background:#f8f8f8;
}

/* ================= THUMB ================= */

.yy-search-thumb{
    width:42px;
    height:56px;

    flex-shrink:0;

    border-radius:8px;
    overflow:hidden;

    background:#eee;
}

.yy-search-thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
}

/* ================= INFO ================= */

.yy-search-info{
    flex:1;
    min-width:0;
}

.yy-search-title{
    font-size:14px;
    font-weight:600;

    line-height:1.3;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* optional hover image zoom */
.yy-search-item:hover .yy-search-thumb img{
    transform:scale(1.05);
    transition:.2s;
}

/* ================= SIDEBAR ================= */

.mobile-sidebar{
    position:fixed;

    top:0;
    left:0;

    width:280px;
    max-width:85vw;
    height:100vh;

    background:#fff;

    z-index:9999999;

    overflow-y:auto;

    transform:translateX(-100%);
    transition:transform .25s ease;

    box-shadow:0 0 20px rgba(0,0,0,.08);
}

.mobile-sidebar.active{
    transform:translateX(0);
}

/* ================= SIDEBAR TOP ================= */

.sidebar-top{
    height:60px;

    display:flex;
    align-items:center;
    justify-content:space-between;

    padding:0 16px;

    border-bottom:1px solid #eee;
}

.sidebar-logo{
    font-size:20px;
    font-weight:700;
}

.sidebar-top button{
    width:38px;
    height:38px;

    border:none;
    border-radius:10px;

    background:#f5f5f5;

    font-size:20px;

    cursor:pointer;
}

/* ================= MENU ================= */

.mobile-nav{
    display:flex;
    flex-direction:column;

    padding:10px 0;
}

.mobile-nav a,
.mobile-nav .user-logged{
    display:flex;
    align-items:center;

    min-height:48px;

    padding:0 18px;

    color:#111;
    text-decoration:none;

    font-size:16px;
    font-weight:500;

    border-bottom:1px solid #f5f5f5;

    transition:.2s;
}

.mobile-nav a:hover{
    background:#f8f8f8;
}

/* ================= LOGIN ================= */

.login-btn{
    color:#1677ff !important;
    font-weight:600;
}

/* ================= OVERLAY ================= */

.mobile-overlay{
    position:fixed;
    inset:0;

    background:rgba(0,0,0,.45);

    opacity:0;
    visibility:hidden;

    transition:.25s;

    z-index:9999998;

    backdrop-filter:blur(2px);
}

.mobile-overlay.active{
    opacity:1;
    visibility:visible;
}

/* ================= TABLET ================= */

@media (max-width:991px){

    .header-mobile{
        height:58px;
        padding:0 12px;
    }

    .logo{
        font-size:20px;
    }

    .mobile-search-box .yy-search{
        max-width:220px;
    }

}

/* ================= MOBILE ================= */

@media (max-width:767px){

    .header-mobile{
        gap:8px;
        padding:0 10px;
    }

    .logo{
        flex:1;

        font-size:18px;

        overflow:hidden;
        text-overflow:ellipsis;
    }

    .mobile-search-box .yy-search{
        max-width:160px;
    }

    .mobile-search-box input{
        height:38px;
        font-size:16px;
    }

    .mobile-menu-btn{
        width:48px;
        height:48px;
        font-size:32px;
    }

    .mobile-sidebar{
        width:260px;
    }

}

/* ================= LARGE PC ================= */

@media (min-width:1200px){

    .header-mobile{
        padding:0 20px;
    }

    .mobile-search-box .yy-search{
        max-width:320px;
    }

}








/* =========================
PAGE TRUYỆN MỚI
========================= */

.truyen-update-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.update-item{
    display:flex;
    gap:14px;

    padding:12px;

    background:#fff;

    border-radius:14px;

    box-shadow:0 1px 6px rgba(0,0,0,.06);

    transition:.2s;
}

.update-item:hover{
    transform:translateY(-2px);
}

.update-thumb{
    flex:0 0 90px;

    width:90px;
    height:90px;

    overflow:hidden;

    border-radius:12px;
}

.update-thumb img{
    width:100%;
    height:100%;

    object-fit:cover;

    display:block;
}

.update-content{
    flex:1;
    min-width:0;
}

.update-title{
    margin:0 0 6px;
    font-size:16px;
    line-height:1.4;
}

.update-title a{
    color:#111827;

    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;

    overflow:hidden;
}

.update-genre{
    font-size:13px;
    color:#6b7280;

    margin-bottom:8px;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.update-meta{
    display:flex;
    align-items:center;
    gap:12px;

    flex-wrap:wrap;
}

.update-chapter a{
    color:#2563eb;
    font-size:14px;
    font-weight:600;
}

.update-time{
    color:#9ca3af;
    font-size:12px;
}

@media (max-width:768px){

    .update-item{
        display:flex !important;
        flex-direction:row !important;
        align-items:flex-start;
        gap:10px;
    }

    .update-thumb{
        flex:0 0 70px;
        width:70px;
        height:70px;
    }

    .update-content{
        flex:1;
        min-width:0;
        display:flex;
        flex-direction:column;
        gap:4px;
    }

    .update-title{
        font-size:15px;
        line-height:1.3;
    }

    .update-genre{
        font-size:12px;
        white-space:nowrap;
        overflow:hidden;
        text-overflow:ellipsis;
    }

    .update-meta{
        display:flex;
        flex-direction:row;
        gap:10px;
        flex-wrap:wrap;
        align-items:center;
    }

    .update-chapter a{
        font-size:13px;
    }

    .update-time{
        font-size:12px;
    }
}








/* ================= APP UPDATE STYLE ================= */

.app-update {
    margin-top: 20px;
}

.app-update-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* PC = 3 cột */
    gap: 12px;
}

/* CARD */
.app-card {
    display: flex;
    gap: 10px;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: .2s;
}

.app-card:hover {
    transform: translateY(-2px);
}

/* THUMB */
.app-thumb {
    flex: 0 0 70px;
    width: 70px;
    height: 90px;
    overflow: hidden;
    border-radius: 10px;
}

.app-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* INFO */
.app-info {
    flex: 1;
    min-width: 0;
}

/* TITLE */
.app-title {
    font-size: 14px;
    margin: 0 0 6px;
    line-height: 1.4;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-title a {
    color: #111;
    text-decoration: none;
}

/* META */
.app-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: #666;
}

.app-genre {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 6px;
}

.app-chapter {
    color: #f26c3c;
    font-weight: 600;
}

.app-time {
    margin-left: auto;
    color: #999;
}

/* ================= MOBILE ================= */

@media (max-width: 991px) {

    .app-update-grid {
        display: grid;
        grid-auto-flow: column; /* cuộn ngang */
        grid-auto-columns: 85%; /* mỗi cột = 1 “page” */
        grid-template-rows: repeat(2, auto); /* 2 hàng dọc */
        gap: 10px;

        overflow-x: auto;
        overflow-y: hidden;

        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;

        padding-bottom: 10px;
    }

    .app-card {
        scroll-snap-align: start;
        width: 250px;
    }
}


/* ================= header- footer trong suot ================= */
header,
.site-header {
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: none !important;
}

footer,
.site-footer,
.footer {
    background: transparent !important;
    box-shadow: none !important;
    border-top: none !important;
}

header,
footer,
.site-title,
.footer .brand,
.yy-brand {
    color: #f5f1e8;
    text-shadow: 0 1px 1px rgba(255,255,255,0.4);
}