<style>
    body {
        font-family: "Arial", Tahoma, sans-serif;
        background:#f3f6fa;
        margin:0;
    }

    header {
        background: linear-gradient(90deg,#ff6b6b,#e5239d);
        padding:18px 0;
        color:white;
        box-shadow:0 3px 10px rgba(0,0,0,0.1);
    }
    .header-wrap{
        max-width:1600px;
        margin:auto;
        display:flex;
        justify-content:space-between;
        align-items:center;
    }

    nav a{
        color:white;
        text-decoration:none;
        margin:0 12px;
        font-weight:600;
    }

    .banner{
        padding:35px 0;
        text-align:center;
        background:linear-gradient(120deg,#6fb3ff,#8bc6ff,#a8e6ff);
        color:white;
        box-shadow:0 3px 15px rgba(0,0,0,0.1);
    }

  .layout {
    display: flex;
    width: 100%;
    max-width: 1600px;  /* Cho laptop */
    margin: 0 auto;
}

.content {
    width: 100%;
}


    /* Sidebar */
    .sidebar{
        width:260px;
        background:white;
        padding:15px;
        border-radius:12px;
        box-shadow:0 3px 10px rgba(0,0,0,0.1);
        height:max-content;
    }

    .cat-item{
        padding:10px;
        border-radius:8px;
        background:#f7f7f7;
        margin-bottom:6px;
        display:flex;
        justify-content:space-between;
        text-decoration:none;
        color:#222;
        align-items:center;
        font-size:14px;
    }
    .cat-item:hover{background:#ffd8a8;}

    .content{flex:1;}

    .card{
        background:white;
        padding:20px;
        border-radius:12px;
        margin-bottom:20px;
        box-shadow:0 3px 10px rgba(0,0,0,0.1);
    }

    .section-title{
        margin:0 0 12px 0;
        font-size:18px;
        font-weight:600;
        text-transform:uppercase;
    }

    .filter-row input,
    .filter-row select {
        padding:10px;
        border-radius:6px;
        border:1px solid #ccc;
        font-size:14px;
    }

    .book-grid{
        display:grid;
        grid-template-columns:repeat(4, 1fr);
        gap:20px;
    }

    .book-item{
        background:white;
        padding:10px;
        border-radius:12px;
        box-shadow:0 3px 10px rgba(0,0,0,0.08);
        text-align:center;
        transition:.2s;
        font-size:14px;
    }
    .book-item:hover{
        transform:translateY(-5px);
        box-shadow:0 6px 14px rgba(0,0,0,0.15);
    }

    .book-item img{
        width:250px;
        height:300px!important;
        object-fit:cover;
        border-radius:10px;
    }

    .btn{
        background:#ff6b6b;
        color:white;
        padding:6px 14px;
        text-decoration:none;
        border-radius:6px;
        font-size:13px;
        display:inline-block;
        margin:4px;
    }

    footer {
        margin-top:40px;
        background:#ff1c83;
        color:#fdf9f9;
        padding:25px 0;
        text-align:center;
        font-size:14px;
    }
    .view-tag {
    background:#f1f1f1;
    padding:4px 10px;
    border-radius:20px;
    font-size:12px;
    display:inline-block;
    margin-top:5px;
    color:#444;
}
.book-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff384e;
    color: white;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
    box-shadow:0 2px 6px rgba(0,0,0,0.25);
}
.book-item {
    position: relative;
}
/* Hàng meta: lượt xem + tim */
.meta-row {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin:6px 0 2px;
    font-size:13px;
    color:#555;
}

/* Nút tim */
.heart-btn {
    display:inline-flex;
    align-items:center;
    gap:4px;
    border:none;
    background:transparent;
    cursor:pointer;
    font-size:13px;
    color:#ff6b6b;
    position:relative;
    padding:2px 4px;
}

.heart-icon {
    font-size:16px;
    display:inline-block;
}

/* Pop nhẹ khi click */
.heart-pop {
    animation:heart-pop .35s ease-out;
}

@keyframes heart-pop {
    0%   { transform:scale(1); }
    30%  { transform:scale(1.4); }
    60%  { transform:scale(0.9); }
    100% { transform:scale(1); }
}

/* Tim bay kiểu TikTok */
.flying-heart {
    position:absolute;
    bottom:0;
    right:10px;
    font-size:14px;
    opacity:0.9;
    animation:heart-float 900ms ease-out forwards;
    pointer-events:none;
}

@keyframes heart-float {
    0% {
        transform:translate(0,0) scale(0.8);
        opacity:1;
    }
    100% {
        transform:translate(var(--hx), -60px) scale(1.4);
        opacity:0;
    }
}
/* ===== DANH MỤC ICON HÀNG NGANG ===== */
.category-icons {
    display:flex;
    gap:25px;
    overflow-x:auto;
    padding:10px 5px;
    margin-bottom:20px;
}

.category-box {
    min-width:100px;
    text-align:center;
    padding:12px 10px;
    border:2px solid #ffb3b3;
    border-radius:10%;
    width:90px;
    height:90px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    cursor:pointer;
    transition:.25s;
    background:white;
}

.category-box:hover {
    transform:translateY(-5px);
    box-shadow:0 4px 12px rgba(0,0,0,0.15);
    border-color:#ff6b6b;
}

.category-box img {
    width:32px;
    height:32px;
    margin-bottom:5px;
}

.category-label {
    font-size:13px;
    font-weight:600;
    color:#333;
}

.category-count {
    font-size:12px;
    color:#777;
}
/* ===== Button chung ===== */
.btn {
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:8px 16px;
    border-radius:8px;
    font-size:14px;
    font-weight:600;
    text-decoration:none;
    cursor:pointer;
    transition:0.25s;
    border:none;
}

/* Đọc sách */
.btn-read {
    background:#ff6b6b;
    color:white;
    box-shadow:0 3px 6px rgba(255,107,107,0.3);
}
.btn-read:hover {
    background:#ff5252;
    transform:translateY(-2px);
}

/* Tải file */
.btn-download {
    background:#4a90e2;
    color:white;
    box-shadow:0 3px 6px rgba(74,144,226,0.3);
}
.btn-download:hover {
    background:#2d7adf;
    transform:translateY(-2px);
}

/* Icon mắt & tim */
.view-icon {
    margin-right:4px;
}
/* ---------- SLIDER ---------- */
.slider-container {
    width: 100%;
    height: 100%;
    margin: 0 auto 20px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .6s ease-in-out;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* hoặc "cover" tùy ý */
    border-radius: 14px;
}


/* Nút next/prev */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border: none;
    font-size: 28px;
    padding: 6px 12px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: 0.25s;
}

.slider-btn:hover {
    background:white;
    transform: translateY(-50%) scale(1.15);
}

.prev { left: 15px; }
.next { right: 15px; }
.slider-track {
    display: flex;
    height: 100%;
    transition: transform .6s ease-in-out;
}
/*css thông điệp*/

/* ===================== THEME CHUNG ===================== */
:root{
    --primary:       #ff6b6b;
    --primary-dark:  #ff4b5a;
    --secondary:     #4a90e2;
    --bg-page:       #f3f6fb;
    --card-radius:   18px;
    --shadow-soft:   0 10px 25px rgba(15, 23, 42, 0.08);
}

/* Nền trang mịn hơn */
body{
    background: radial-gradient(circle at top, #ffe3eb 0, #f3f6fb 38%, #edf2ff 100%);
}

/* Header nổi nhẹ */
header{
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    position:sticky;
    top:0;
    z-index:100;
}

/* Link menu trên cùng */
header nav a{
    padding:6px 12px;
    border-radius:20px;
    transition:.25s;
}
header nav a:hover{
    background:rgba(255,255,255,0.18);
    transform:translateY(-1px);
}

/* Card chung */
.card{
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-soft);
    position:relative;
    overflow:hidden;
}
.card::before{
    content:"";
    position:absolute;
    inset:0;
    background: radial-gradient(circle at top, rgba(255,255,255,.35), transparent 55%);
    opacity:0;
    pointer-events:none;
    transition:.35s;
}
.card:hover::before{
    opacity:1;
}

/* ===================== STRIP THÔNG ĐIỆP ===================== */
.library-notice{
    margin:14px auto 8px;
    max-width:1400px;
    display:flex;
    gap:16px;
    align-items:center;
    justify-content:space-between;
    padding:10px 18px;
    background:linear-gradient(90deg,#fff7f7,#ffe4f2);
    border-radius:14px;
    border:1px solid rgba(255,107,107,.25);
    box-shadow:0 12px 30px rgba(255,107,107,.16);
    position:relative;
    overflow:hidden;
}
.library-notice::before{
    content:"";
    position:absolute;
    inset:-40%;
    background:radial-gradient(circle at 0 0,rgba(255,255,255,.75),transparent 50%);
    transform:translateX(-60%);
    opacity:.3;
    animation:notice-glow 6s infinite linear;
}
@keyframes notice-glow{
    0%{ transform:translateX(-60%); }
    50%{ transform:translateX(40%);  }
    100%{transform:translateX(140%); }
}

.notice-item{
    font-size:14px;
    color:#333;
    display:flex;
    align-items:center;
    gap:6px;
    position:relative;
    z-index:1;
}
.notice-item strong{
    font-weight:700;
}
.notice-item:nth-child(1){ color:#e53935; }
.notice-item:nth-child(2){ color:#ff9800; }
.notice-item:nth-child(3){ color:#2e7d32; }

/* ===================== ICON DANH MỤC NGANG ===================== */
.category-icons{
    margin-top:12px;
}
.category-box{
    border-radius:18px;
    border:1px solid rgba(255,107,107,.35);
    box-shadow:0 8px 20px rgba(15,23,42,0.06);
    position:relative;
    overflow:hidden;
}
.category-box img{
    transition:.35s;
}
.category-box:hover img{
    transform:translateY(-4px) scale(1.05);
}
.category-box::after{
    content:"";
    position:absolute;
    bottom:-40px;
    right:-40px;
    width:70px;
    height:70px;
    background:radial-gradient(circle,rgba(255,255,255,.8),transparent 60%);
    opacity:0;
    transition:.35s;
}
.category-box:hover::after{
    opacity:1;
}

/* ===================== BOOK ITEM ===================== */
.book-item{
    border-radius:18px;
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease;
    background:#ffffff;
}
.book-item:hover{
    transform:translateY(-6px) scale(1.01);
    box-shadow:0 16px 32px rgba(15,23,42,0.18);
}
.book-item img{
    border-radius:14px;
}

/* Badge “nhãn” trên ảnh */
.ribbon-tag{
    backdrop-filter: blur(4px);
}

/* Lượt xem + tim */
.meta-row{
    margin-top:8px;
    font-size:13px;
}
.meta-row .views{
    display:flex;
    align-items:center;
    gap:4px;
}

/* Tim */
.heart-btn{
    padding:3px 8px;
    border-radius:999px;
    background:rgba(255,107,107,.08);
    transition:.25s;
}
.heart-btn:hover{
    background:rgba(255,107,107,.18);
    transform:translateY(-1px);
}

/* ===================== BUTTONS ===================== */
.btn{
    border-radius:999px;
    padding:8px 18px;
    font-size:14px;
    font-weight:600;
    position:relative;
    overflow:hidden;
}
.btn::before{
    content:"";
    position:absolute;
    inset:0;
    background:radial-gradient(circle at 0 0,rgba(255,255,255,.4),transparent 60%);
    opacity:0;
    transform:translateX(-60%);
    transition:.4s;
}
.btn:hover::before{
    opacity:1;
    transform:translateX(40%);
}

.btn-read{
    background:var(--primary);
}
.btn-download{
    background:var(--secondary);
}

/* Icon trong nút */
.btn-read::after,
.btn-download::after{
    content:"";
}

/* ===================== HIỆU ỨNG NHẸ KHI CARD VÀ SÁCH XUẤT HIỆN ===================== */
.card,
.book-item{
    animation:fade-up .4s ease-out;
}
@keyframes fade-up{
    0%{ opacity:0; transform:translateY(10px); }
    100%{ opacity:1; transform:translateY(0); }
}

/*end*/
/*sách hot tuần này*/
.hot-ticker {
    display:flex;
    align-items:center;
    gap:20px;
    padding:12px 18px;
    background:#fff;
    border-radius:12px;
    box-shadow:0 8px 20px rgba(0,0,0,0.08);
    margin:20px 0;
    overflow:hidden;
}

.ticker-title {
    font-weight:700;
    color:#e53935;
    font-size:16px;
    white-space:nowrap;
}

.ticker-list {
    display:flex;
    gap:40px;
    white-space:nowrap;
    animation:scroll-left 16s linear infinite;
    font-size:15px;
}

@keyframes scroll-left {
    0% { transform:translateX(0); }
    100% { transform:translateX(-60%); }
}
/*end*/
/*thanh truy cập nhanh*/
.quick-access {
    display:flex;
    justify-content:space-between;
    padding:15px 10px;
    background:linear-gradient(90deg,#fff1f2,#e8f0ff);
    border-radius:14px;
    margin:20px 0;
    box-shadow:0 8px 20px rgba(0,0,0,0.07);
}

.qa-item {
    padding:12px 18px;
    background:white;
    border-radius:12px;
    font-weight:600;
    cursor:pointer;
    box-shadow:0 5px 12px rgba(0,0,0,0.08);
    transition:.25s;
}

.qa-item:hover {
    transform:translateY(-4px);
    background:#fef2f2;
}
.quick-access-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.quick-access-title {
    background: white;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow:0 3px 10px rgba(0,0,0,0.08);
}

.quick-access-row {
    display: flex;
    gap: 15px;
    overflow-x: auto;        /* CHỐNG TRÀN – cho kéo ngang */
    padding-bottom: 8px;
}

.quick-access-item {
    background:white;
    min-width:120px;         /* CHUẨN KHÔNG TRÀN */
    padding:15px 8px;
    border-radius:12px;
    text-align:center;
    box-shadow:0 4px 12px rgba(0,0,0,0.1);
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    transition:0.2s;
}

.quick-access-item:hover {
    transform:translateY(-4px);
    box-shadow:0 6px 16px rgba(0,0,0,0.15);
}

/*end*/
/*truyền cảm hứng*/
.quote-banner {
    margin:25px 0;
    padding:25px;
    background:linear-gradient(135deg,#ffdde1,#ee9ca7);
    border-radius:18px;
    color:white;
    font-size:18px;
    display:flex;
    align-items:center;
    gap:20px;
    box-shadow:0 10px 25px rgba(255,107,107,0.4);
}

.quote-icon {
    font-size:40px;
    transform:rotate(-6deg);
}

.quote-text small {
    font-size:14px;
    opacity:0.85;
}

/*end*/
/*css đang truy cập */
.online-counter {
    background: #e3f2ff;
    color: #0066cc;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

/*end*/
/*MENU LỚP*/
/* ==== MENU LỚP ==== */
.grade-menu {
    margin: 15px auto 25px;
    padding: 10px 5px;
    display: flex;
    gap: 15px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.grade-menu::-webkit-scrollbar {
    display: none;
}

.grade-item {
    padding: 10px 18px;
    background: white;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #ff4b72;
    border: 2px solid #ffc1d3;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
    text-decoration: none;
    transition: .25s;
}

.grade-item:hover {
    background: #ff4b72;
    color: white;
    border-color: #ff4b72;
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(255,75,114,0.3);
}

/*END*/
/*MENU SÁCH*/
/* ==== MENU LỚP ==== */
.grade-menu {
    margin: 15px auto 10px;
    padding: 10px 5px;
    display: flex;
    gap: 15px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.grade-menu::-webkit-scrollbar {
    display: none;
}

.grade-item {
    padding: 10px 18px;
    background: white;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #ff4b72;
    border: 2px solid #ffc1d3;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
    text-decoration: none;
    transition: .25s;
}
.grade-item:hover {
    background: #ff4b72;
    color: white;
    border-color: #ff4b72;
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(255,75,114,0.3);
}

/* ==== MENU LOẠI TÀI LIỆU ==== */
.type-menu {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    margin: 5px 0 25px;
    padding: 5px 5px;
    white-space: nowrap;
    scrollbar-width: none;
}

.type-menu::-webkit-scrollbar {
    display: none;
}

.type-item {
    padding: 10px 20px;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid #cce8ff;
    color: #0076d6;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.25s;
    box-shadow: 0 3px 6px rgba(0,123,255,0.15);
}

.type-item:hover {
    background: #0076d6;
    color: white;
    border-color: #0076d6;
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0,123,255,0.25);
}

.super-menu {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 15px 10px;
    white-space: nowrap;
    scrollbar-width: thin;
}

.super-item {
    padding: 8px 16px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border: 1px solid #ffd6d6;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #e60045;
    transition: 0.25s;
}

.super-item:hover {
    background: #ffe9e9;
    transform: translateY(-3px);
}

.super-item.grade {
    border-color: #ff9aa2;
    color: #ff4d6d;
}


/*END*/
/*css tiêu đề */
.site-title {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.site-title-main {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
}

.site-title-sub {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    color: #fff;
}

/*end*/
/*css đăng nhập đăng ký */
.btn-login, .btn-register {
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: .25s;
}

/* Đăng nhập */
.btn-login {
    background: white;
    color: #ff3b7b;
    border: 2px solid #ff3b7b;
}

.btn-login:hover {
    background: #ff3b7b;
    color: white;
}

/* Đăng ký */
.btn-register {
    background: #ff3b7b;
    color: white;
    border: 2px solid #ff3b7b;
}

.btn-register:hover {
    background: #d81a63;
    border-color: #d81a63;
}
/*css sáng tối */
/* ==== DARK MODE ==== */
body.dark-mode {
    background:#0f172a;      /* nền tối */
    color:#e5e7eb;
}

/* header tối hơn, đổ bóng mạnh hơn */
body.dark-mode header {
    box-shadow:0 4px 18px rgba(0,0,0,0.7);
}

/* card, sidebar, ô sách… tối màu */
body.dark-mode .card,
body.dark-mode .sidebar {
    background:#111827;
    box-shadow:0 3px 14px rgba(0,0,0,0.6);
}

body.dark-mode .book-item {
    background:#020617;
}

/* danh mục bên trái */
body.dark-mode .cat-item {
    background:#111827;
    color:#e5e7eb;
}
body.dark-mode .cat-item:hover {
    background:#1f2937;
}

/* thanh menu lớp & loại tài liệu (nếu có) */
body.dark-mode .grade-item,
body.dark-mode .type-item {
    background:#111827;
    color:#e5e7eb;
    border-color:#374151;
}
body.dark-mode .grade-item:hover,
body.dark-mode .type-item:hover {
    background:#1f2937;
}

/* các nút bấm vẫn giữ màu, chỉ chỉnh shadow nhẹ */
body.dark-mode .btn-read {
    box-shadow:0 3px 6px rgba(248,113,113,0.5);
}
body.dark-mode .btn-download {
    box-shadow:0 3px 6px rgba(59,130,246,0.5);
}

/* ==== NÚT ĐỔI GIAO DIỆN ==== */
.theme-toggle {
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:6px 12px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,0.6);
    background:rgba(255,255,255,0.08);
    color:#fff;
    cursor:pointer;
    font-size:13px;
    font-weight:500;
    backdrop-filter:blur(6px);
    transition:0.25s;
}
.theme-toggle:hover {
    background:rgba(255,255,255,0.18);
    transform:translateY(-1px);
}
.theme-toggle .icon {
    font-size:15px;
}
.theme-toggle .text {
    font-size:12px;
}
/*end*/
/* Dark mode: viền nút đổi sáng hơn tí */
body.dark-mode .theme-toggle {
    border-color:rgba(255,255,255,0.9);
}

/*end*/
/*css hiệu ứng */
.effect-dropdown {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
    margin-left: 15px;
}
#effectContainer div {
    position: fixed;
    top: -20px;
    font-size: 22px;
    pointer-events: none;
    animation: fall 5s linear forwards;
    z-index: 9999;
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/*end*/
/* ===== HIỆU ỨNG NỀN CHUNG ===== */
#effectContainer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 5; /* dưới header/overlay tuỳ bạn */
}

/* ===== PHÁO HOA 360° ===== */
.fw-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffcc00;
    box-shadow: 0 0 8px rgba(255,255,255,0.9);
    animation: fw-burst 1.1s ease-out forwards;
}

@keyframes fw-burst {
    0% {
        transform: translate(0,0) scale(0.4);
        opacity: 1;
    }
    70% {
        transform: translate(var(--tx), var(--ty)) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0.5);
        opacity: 0;
    }
}

/* ===== TUYẾT 3D ===== */
.snowflake {
    position: absolute;
    top: -10%;
    font-size: 10px;
    color: #fff;
    text-shadow: 0 0 6px rgba(255,255,255,0.9);
    animation: snow-fall-3d linear forwards;
}

@keyframes snow-fall-3d {
    0% {
        transform: translate3d(var(--sx), -10%, 0) rotateZ(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--ex), 110%, 0) rotateZ(360deg);
        opacity: 0;
    }
}

/* ===== SAO GALAXY + TWINKLE ===== */
.star-twinkle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, #ccd6ff);
    box-shadow: 0 0 8px rgba(255,255,255,0.9);
    animation: star-twinkle 4s ease-in-out infinite alternate;
}

@keyframes star-twinkle {
    0% {
        transform: scale(0.6);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.4;
    }
}

/* Sao băng */
.shooting-star {
    position: absolute;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.9));
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.8));
    animation: shooting 1.2s ease-out forwards;
}

@keyframes shooting {
    0% {
        transform: translate3d(-20%, -20%, 0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate3d(140%, 40%, 0);
        opacity: 0;
    }
}

/* ===== HOA MÙA XUÂN (NHỎ, DÀY) ===== */
.spring-petal {
    position: absolute;
    top: -10%;
    font-size: 12px;
    animation: spring-fall linear forwards;
}

@keyframes spring-fall {
    0% {
        transform: translate3d(0,-10%,0) rotateZ(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--sx), 110%, 0) rotateZ(220deg);
        opacity: 0;
    }
}

/* ===== MÙA HÈ – BONG BÓNG / MẶT TRỜI NHỎ ===== */
.summer-bubble {
    position: absolute;
    bottom: -10%;
    font-size: 12px;
    animation: summer-rise linear forwards;
    opacity: 0.9;
}

@keyframes summer-rise {
    0% {
        transform: translate3d(0, 10%, 0) scale(0.6);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--sx), -110%, 0) scale(1.2);
        opacity: 0;
    }
}

/* ===== MÙA THU – LÁ RƠI ===== */
.fall-leaf {
    position: absolute;
    top: -10%;
    font-size: 12px;
    animation: fall-leaf linear forwards;
}

@keyframes fall-leaf {
    0% {
        transform: translate3d(0,-10%,0) rotateZ(0deg);
        opacity: 0;
    }
    20% { opacity: 1; }
    100% {
        transform: translate3d(var(--sx), 110%, 0) rotateZ(320deg);
        opacity: 0;
    }
}

/* ===== MÙA ĐÔNG – TUYẾT DÀY HƠN ===== */
.winter-snow {
    position: absolute;
    top: -10%;
    font-size: 9px;
    animation: winter-fall linear forwards;
}

@keyframes winter-fall {
    0% {
        transform: translate3d(0,-10%,0);
        opacity: 0;
    }
    100% {
        transform: translate3d(var(--sx), 110%, 0);
        opacity: 0.9;
    }
}

</style>
/* =======================================
   MOBILE RESPONSIVE FIX
   ======================================= */
@media (max-width: 768px) {

    /* Ẩn sidebar nếu cần */
    .layout {
        flex-direction: column;
        padding: 0 10px;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }

    /* Book grid - 2 cột trên mobile */
    .book-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Card sách */
    .book-item {
        padding: 10px !important;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.12);
        position: relative;
    }

    /* Ảnh sách */


    .book-title {
        font-size: 14px !important;
        font-weight: 600;
        margin: 6px 0 0 0;
        text-align: center;
    }

    .book-author {
        font-size: 12px !important;
        opacity: 0.7;
        text-align: center;
        margin-bottom: 4px;
    }

    /* Ribbon Tag (Nhãn sách) */
    .ribbon-tag {
        font-size: 11px !important;
        padding: 3px 8px !important;
        top: 6px !important;
        left: 6px !important;
        border-radius: 5px !important;
    }

    /* Nút bấm */
    .btn {
        width: 100% !important;
        font-size: 13px !important;
        padding: 10px !important;
        display: block !important;
        text-align: center !important;
        margin-top: 6px;
    }

    /* Điều chỉnh phần Tìm kiếm */
    .filter-row input,
    .filter-row select {
        flex: 100% !important;
        font-size: 14px;
    }

    /* Category icon */
    .category-icons {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }

    .category-box {
        padding: 10px !important;
        font-size: 13px !important;
    }

    /* Slider thu nhỏ */
    .slider-container {
        height: auto !important;
    }

    .slider-container img {
        width: 100% !important;
        height: auto !important;
    }
}

/* =======================================
   MOBILE SMALL (dưới 480px)
   ======================================= */
@media (max-width: 480px) {

    .book-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }

    .btn {
        font-size: 12px !important;
        padding: 8px !important;
    }

    .book-title {
        font-size: 13px !important;
    }
}

/* ===================== FIX MOBILE FULL WIDTH CHUẨN ===================== */

/* Bỏ mọi giới hạn chiều rộng */
header, footer, body, html {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* HEADER WRAP phải full width */
.header-wrap {
    max-width: 100% !important;
    width: 100% !important;
    padding: 10px 12px !important;
    margin: 0 !important;
}

/* Layout tổng */
.layout {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* SLIDER FULL WIDTH */
.slider-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

/* FOOTER FULL WIDTH */
footer {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 15px 0 !important;
}

/* Tránh container con đẩy lệch */
* {
    box-sizing: border-box;
}
/* ===== RESET CƠ BẢN ===== */
body {
    margin:0;
    font-family:"Segoe UI",Tahoma,Arial,sans-serif;
    background:#f3f6fa;
}

/* ===== WRAPPER ===== */
.layout {
    max-width:1400px;
    margin:25px auto;
    display:flex;
    gap:20px;
}

/* ===== SIDEBAR ===== */
.sidebar-box {
    width:260px;
}

/* ===== CARD ===== */
.card {
    background:white;
    padding:20px;
    border-radius:14px;
    margin-bottom:20px;
    box-shadow:0 5px 14px rgba(0,0,0,0.12);
}

.section-title {
    font-size:18px;
    font-weight:700;
    text-transform:uppercase;
    margin:0 0 12px 0;
}

/* ===== GRID SÁCH ===== */
.book-grid {
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
}

.book-item {
    position:relative;
    background:white;
    padding:10px;
    border-radius:14px;
    text-align:center;
    box-shadow:0 5px 12px rgba(0,0,0,0.1);
    transition:.25s;
}
.book-item:hover {
    transform:translateY(-6px);
    box-shadow:0 8px 20px rgba(0,0,0,0.2);
}



/* LABEL RIBBON */
.ribbon-tag {
    position:absolute;
    top:12px;
    left:12px;
    padding:6px 14px;
    font-size:13px;
    font-weight:600;
    color:white;
    border-radius:8px;
    box-shadow:0 3px 6px rgba(0,0,0,0.2);
}

/* BUTTON */
.btn {
    margin-top:6px;
    display:inline-block;
    padding:8px 14px;
    border-radius:6px;
    text-decoration:none;
    font-weight:600;
    transition:.2s;
    font-size:14px;
}

.btn-read { background:#ff6b6b; color:white; }
.btn-download { background:#4a90e2; color:white; }

.btn-read:hover { background:#ff5252; }
.btn-download:hover { background:#2f79d9; }

/* ===== CATEGORY ICONS ===== */
.category-icons {
    display:flex;
    gap:16px;
    margin-bottom:20px;
    overflow-x:auto;
}
.category-box {
    min-width:100px;
    padding:12px;
    background:white;
    border-radius:14px;
    text-align:center;
    box-shadow:0 3px 8px rgba(0,0,0,0.1);
    transition:.25s;
    cursor:pointer;
    border:2px solid #ffb3b3;
}
.category-box:hover {
    transform:translateY(-4px);
    border-color:#ff6b6b;
}
.category-icon { font-size:26px; }

/* ===== FILTER FORM ===== */
.filter-row {
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.filter-row input,
.filter-row select {
    padding:10px;
    border-radius:6px;
    border:1px solid #ccc;
    font-size:14px;
}

/* ===== VIEW ALL ===== */
.view-all {
    color:#ff6b6b;
    font-weight:700;
    text-decoration:none;
}

/* ===== SLIDER ===== */
.slider-container {
    width:100%;
    height:320px;
    border-radius:14px;
    overflow:hidden;
    box-shadow:0 6px 14px rgba(0,0,0,0.15);
    margin-bottom:25px;
    position:relative;
}

.slider-track {
    display:flex;
    height:100%;
    transition:transform .6s ease-in-out;
}

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

.slider-btn {
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    background:white;
    border:none;
    font-size:26px;
    padding:6px 12px;
    border-radius:50%;
    cursor:pointer;
}
.prev { left:15px; }
.next { right:15px; }
