/* ====== CAFE TRUYỆN - CSS CHÍNH ====== */

/* === RESET & BASE === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --purple: #8B5CF6;
    --purple-light: #a78bfa;
    --purple-dark: #7c3aed;
    --emerald: #10B981;
    --rose: #f43f5e;
    --amber: #f59e0b;
    --border: rgba(255, 255, 255, 0.08);
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--purple-light);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--purple);
}

img {
    max-width: 100%;
    height: auto;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple);
}

/* === HEADER / NAVBAR === */
.navbar {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--purple), var(--emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.navbar-brand span {
    font-size: 1.5rem;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-nav a {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.navbar-nav .btn-login {
    background: var(--purple);
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
}

.navbar-nav .btn-login:hover {
    background: var(--purple-dark);
}

/* Mobile menu */
.pc-hide {
    display: none;
}

.mobile-nav-tools {
    display: none;
    align-items: center;
    gap: 6px;
}

.menu-toggle {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 8px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.menu-toggle:hover {
    background: var(--purple);
    border-color: var(--purple-light);
}

/* Cultivation System UI */
.cul-marquee-container {
    background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
    color: #FDE047;
    height: 30px;
    display: flex;
    align-items: center;
    overflow: hidden;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(253, 224, 71, 0.2);
    position: relative;
    z-index: 80;
}

.cul-marquee-text {
    white-space: nowrap;
    display: inline-block;
    padding-left: 100%;
    animation: marquee 25s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

.cul-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 6px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cul-level-name {
    font-weight: 600;
    margin-right: 4px;
}

/* Breakthrough Modal */
.breakthrough-modal {
    text-align: center;
    padding: 40px !important;
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bt-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.bt-level-name {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    padding: 10px 30px;
    border-radius: 50px;
    display: inline-block;
    margin-top: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px var(--amber));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px var(--amber));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px var(--amber));
    }
}

/* Mega Menu */
.cat-mega-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(25px);
    border-bottom: 2px solid var(--purple);
    z-index: 1010;
    display: none;
    /* Sử dụng display:none để ẩn chắc chắn */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.cat-mega-menu.active {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-menu-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    max-height: 85vh;
    overflow-y: auto;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.mega-item {
    color: var(--text-secondary);
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    display: block;
    /* Đảm bảo link nhận đúng kích thước */
}

.mega-item:hover {
    color: #fff;
    background: var(--purple-dark);
    border-color: var(--purple-light);
    transform: scale(1.02);
}

.mega-item.active {
    background: var(--purple);
    color: white;
    border-color: var(--purple-light);
}

.nav-btn-pc,
.nav-btn-mobile {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn-pc:hover,
.nav-btn-pc.active,
.nav-btn-mobile:hover,
.nav-btn-mobile.active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-btn-mobile {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0;
}

/* === CONTAINER === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* === HERO SECTION === */
.hero {
    text-align: center;
    padding: 60px 24px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(16, 185, 129, 0.05));
    border-bottom: 1px solid var(--border);
}

.hero-icon {
    width: 80px;
    height: 80px;
    background: rgba(139, 92, 246, 0.15);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.5rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--purple-light), var(--emerald));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Hero Updates List */
.hero-updates {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    margin: 20px auto 0;
    text-align: left;
}

.update-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.update-item:hover {
    background: var(--bg-hover);
    border-color: var(--purple-light);
    transform: translateX(5px);
    color: var(--text-primary);
}

.update-tag {
    background: var(--purple);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.update-title {
    font-weight: 600;
    color: var(--purple-light);
}

.update-chapter {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.update-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .update-item {
        font-size: 0.85rem;
        padding: 6px 12px;
        flex-wrap: wrap;
    }

    .update-chapter {
        width: 100%;
        flex: none;
    }
}

/* === STORY GRID === */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.section-title a {
    font-size: 0.9rem;
    color: var(--purple-light);
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.story-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--purple);
}

.story-card-cover {
    aspect-ratio: 3/4;
    background: var(--bg-hover);
    position: relative;
    overflow: hidden;
}

.story-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-card-cover .play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.story-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay .play-btn {
    width: 48px;
    height: 48px;
    background: var(--purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.story-card-body {
    padding: 12px;
}

.story-card-body h3 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.story-card-body .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.btn-primary {
    background: var(--purple);
    color: white;
}

.btn-primary:hover {
    background: var(--purple-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.btn-danger {
    background: var(--rose);
    color: white;
}

.btn-danger:hover {
    background: #e11d48;
}

.btn-success {
    background: var(--emerald);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* === FORMS === */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* === AUTH PAGES === */
.auth-container {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.auth-box .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.auth-box .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

/* === ALERT / MESSAGE === */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--rose);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--emerald);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--amber);
}

/* === AUDIO PLAYER BAR (FIXED BOTTOM) === */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    padding: 12px 24px;
    z-index: 200;
    display: none;
    /* Ẩn khi chưa phát */
}

.player-bar.active {
    display: block;
}

.player-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-info {
    flex: 0 0 200px;
    overflow: hidden;
}

.player-info h4 {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.player-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.player-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-buttons button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.player-buttons button:hover {
    color: var(--text-primary);
}

.player-buttons .btn-play-main {
    width: 44px;
    height: 44px;
    background: white;
    color: var(--bg-primary);
    border-radius: 50%;
    font-size: 1.3rem;
}

.player-buttons .btn-play-main:hover {
    transform: scale(1.05);
}

.player-progress {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-progress span {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-hover);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.progress-bar:hover {
    height: 6px;
}

.progress-bar .progress-fill {
    height: 100%;
    background: var(--purple);
    border-radius: 4px;
    width: 0%;
    position: relative;
}

.progress-bar .progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

.player-options {
    flex: 0 0 200px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.speed-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.speed-control select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.speed-control select option {
    background: var(--bg-secondary);
}

.btn-bgmusic {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-bgmusic.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    color: var(--purple-light);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-hover);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
}

/* === STORY DETAIL PAGE === */
.story-detail {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
}

.story-detail-cover {
    flex: 0 0 240px;
}

.story-detail-cover img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: var(--radius);
}

.story-detail-info {
    flex: 1;
}

.story-detail-info h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.story-detail-info .author {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.story-detail-info .description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.8;
}

.story-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

/* Chapter list */
.chapter-list {
    margin-top: 32px;
}

.chapter-list h2 {
    margin-bottom: 16px;
}

.chapter-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.chapter-item:hover {
    border-color: var(--purple);
    background: var(--bg-hover);
}

.chapter-item.playing {
    border-color: var(--purple);
    background: rgba(139, 92, 246, 0.1);
}

.chapter-item .ch-number {
    width: 36px;
    height: 36px;
    background: var(--bg-hover);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.chapter-item.playing .ch-number {
    background: var(--purple);
    color: white;
}

.chapter-item .ch-title {
    flex: 1;
    font-size: 0.95rem;
}

.chapter-item .ch-duration {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chapter-item .ch-resume {
    font-size: 0.75rem;
    color: var(--emerald);
}

/* === ADMIN === */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.admin-sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    flex-shrink: 0;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-right: 3px solid var(--purple);
}

.admin-content {
    flex: 1;
    padding: 24px;
}

.admin-content h1 {
    margin-bottom: 24px;
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px;
    background: var(--bg-hover);
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber);
}

.badge-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--rose);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 300;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.modal-overlay.active,
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
    display: flex;
    pointer-events: auto;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal h2 {
    margin-bottom: 24px;
}

/* === FAVORITES === */
.favorite-btn {
    background: none;
    border: 2px solid var(--border);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.favorite-btn:hover {
    border-color: var(--rose);
    color: var(--rose);
}

.favorite-btn.active {
    background: rgba(244, 63, 94, 0.15);
    border-color: var(--rose);
    color: var(--rose);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .pc-hide {
        display: none !important;
    }

    .mobile-nav-tools {
        display: flex !important;
    }

    .navbar {
        padding: 0 12px;
    }

    .navbar-brand {
        font-size: 1.15rem;
    }

    .navbar-brand span {
        font-size: 1.2rem;
    }

    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        gap: 0;
        z-index: 1002;
    }

    .navbar-nav.open {
        display: flex;
    }

    .navbar-nav li {
        width: 100%;
    }

    .navbar-nav a {
        padding: 12px 16px;
        width: 100%;
    }

    .mega-menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .mega-menu-content {
        padding: 20px 16px;
    }

    .mega-item {
        font-size: 0.85rem;
        padding: 8px;
    }

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .story-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }

    .story-detail {
        flex-direction: column;
    }

    .story-detail-cover {
        flex: none;
        max-width: 200px;
        margin: 0 auto;
    }

    .player-bar {
        padding: 8px 12px;
    }

    .player-inner {
        flex-wrap: wrap;
        gap: 8px;
    }

    .player-info {
        flex: 1;
        min-width: 0;
    }

    .player-controls {
        flex: 1 0 100%;
        order: 3;
    }

    .player-progress {
        max-width: 100%;
        width: 100%;
    }

    .progress-bar {
        height: 6px;
    }

    .progress-bar .progress-fill::after {
        width: 14px;
        height: 14px;
        opacity: 1;
    }

    .player-options {
        flex: 1 0 100%;
        justify-content: center;
    }

    .volume-control {
        position: relative;
    }

    .volume-control .volume-slider {
        display: none;
        position: absolute;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%) rotate(-90deg);
        transform-origin: center;
        width: 80px;
        background: var(--bg-secondary);
        padding: 4px;
        border-radius: 4px;
        z-index: 300;
    }

    .volume-control.open .volume-slider {
        display: block;
    }

    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 8px;
        gap: 4px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
    }

    .admin-sidebar a {
        padding: 8px 14px;
        font-size: 0.8rem;
        border-radius: 8px;
        border-right: none !important;
    }

    .admin-sidebar a:hover,
    .admin-sidebar a.active {
        border-right: none !important;
        background: var(--purple);
        color: white;
        border-radius: 8px;
    }

    .container {
        padding: 16px;
    }
}

/* === BODY PADDING for player bar === */
body.has-player {
    padding-bottom: 100px;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state p {
    margin-top: 8px;
}

/* === CULTIVATION POPUP SYSTEM === */
.cul-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 100003;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.cul-popup-overlay.active {
    display: flex;
    pointer-events: auto;
}
.cul-popup-box {
    background: var(--bg-secondary, #0f172a);
    padding: 35px 30px;
    border-radius: 20px;
    border: 2px solid var(--purple, #8B5CF6);
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.4);
    animation: popupIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}
.cul-popup-close {
    position: absolute;
    top: 12px; right: 16px;
    cursor: pointer;
    font-size: 1.5rem;
    color: #94a3b8;
    background: none;
    border: none;
    z-index: 2;
    line-height: 1;
}
.cul-popup-close:hover { color: #fff; }
.cul-popup-msg {
    color: #cbd5e1;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 10px 0 25px;
    text-align: center;
    max-height: 50vh;
    overflow-y: auto;
    white-space: pre-line;
}
.cul-popup-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.cul-popup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    border-radius: 12px;
    padding: 14px 20px;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    color: #fff;
    text-align: center;
    position: relative;
    z-index: 1;
}
.cul-popup-btn-primary {
    background: var(--purple, #8B5CF6);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.cul-popup-btn-primary:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}
.cul-popup-btn-cancel {
    background: #334155;
    color: #94a3b8;
}
.cul-popup-btn-cancel:hover {
    background: #475569;
}
.cul-popup-btn-success {
    background: var(--emerald, #10B981);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.cul-popup-btn-success:hover {
    background: #059669;
}
@keyframes popupIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}