/* ============================================================
   Short Drama Promotion Template - Dark Immersive Cinema Style
   Mobile-first: base styles target phones, media queries scale up
   Palette: bg #0F1014 / card #1A1C23 / accent #FF5722 / gold #F59E0B
   ============================================================ */

:root {
    --bg: #0F1014;
    --bg-elev: #14161C;
    --card: #1A1C23;
    --card-hover: #22252E;
    --accent: #FF5722;
    --accent-deep: #E64A19;
    --gold: #F59E0B;
    --text: #E8EAF0;
    --text-dim: #8B8FA3;
    --text-faint: #5A5E70;
    --line: rgba(255, 255, 255, 0.08);
    --grad-accent: linear-gradient(135deg, #FF5722, #F59E0B);
    --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.45);
    --radius: 10px;
    --radius-lg: 14px;
    --header-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Protect the HTML "hidden" attribute from being overridden by class-level
   display rules (e.g. .player-ended-overlay uses display:flex and would
   otherwise force the ended overlay visible before playback finishes) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, "PingFang SC", "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 14px;
}

/* ================= Header ================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 16, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--header-h);
}

.logo { flex: 0 0 auto; display: flex; align-items: center; }
.logo-img { height: 32px; width: auto; }

.header-search { margin-left: auto; }
.search-form {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 4px 4px 14px;
    transition: border-color 0.2s;
}
.search-form:focus-within { border-color: var(--accent); }
.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 13px;
    width: 140px;
    transition: width 0.25s;
}
.search-input::placeholder { color: var(--text-faint); }
.search-btn {
    flex: 0 0 auto;
    background: var(--grad-accent);
    border: none;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* Language switcher */
.language-switcher { display: flex; gap: 4px; }
.lang-link {
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 6px;
    opacity: 0.75;
    transition: opacity 0.2s, background 0.2s;
}
.lang-link:hover, .lang-link.active { opacity: 1; background: var(--card); }

/* Hamburger toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    align-items: center;
}
.mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

/* Quick category tags row */
.quick-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 8px;
    scrollbar-width: none;
}
.quick-tags::-webkit-scrollbar { display: none; }
.quick-tag {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--text-dim);
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    text-transform: uppercase;
}
.quick-tag:hover, .quick-tag.active {
    color: #fff;
    border-color: transparent;
    background: var(--grad-accent);
}

/* Mobile slide-down panel (hidden on phones, toggled by JS) */
.mobile-panel { display: none; }
.mobile-panel.open { display: block; padding-bottom: 12px; }
.mobile-nav-search { margin-bottom: 10px; }
.mobile-nav-search .search-input { width: 100%; flex: 1; }
.mobile-quick-tags {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.mobile-quick-tags::-webkit-scrollbar { display: none; }

/* ================= Main layout ================= */
.main-content { min-height: 60vh; padding: 14px 0 40px; }

/* ================= Hero carousel ================= */
.hero {
    position: relative;
    margin: 0 -14px 26px;
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: stretch;
}
.hero-bgs { position: absolute; inset: 0; z-index: 0; }
.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) brightness(0.45);
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.8s;
}
.hero-bg.is-on { opacity: 1; }

.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 22px;
    padding-bottom: 14px;
}

.hero-slide {
    display: none;
    align-items: center;
    gap: 18px;
}
.hero-slide.is-on { display: flex; flex-direction: column; text-align: center; }

.hero-kicker {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 3px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.hero-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: clamp(26px, 7vw, 34px);
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.15;
    text-transform: uppercase;
}
.hero-title a { color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6); }
.hero-desc {
    color: var(--text-dim);
    font-size: 13px;
    margin: 8px auto 0;
    max-width: 480px;
}
.hero-actions { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--grad-accent);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    padding: 11px 26px;
    border-radius: 999px;
    box-shadow: 0 6px 22px rgba(255, 87, 34, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 10px 30px rgba(255, 87, 34, 0.55); }
.hero-cta-play { font-size: 12px; }
.hero-ep-info {
    font-size: 12px;
    font-weight: 600;
    color: var(--gold);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 5px 12px;
    border-radius: 999px;
}

.hero-poster {
    display: block;
    margin: 16px auto 0;
    width: 130px;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.hero-poster img { width: 100%; height: 100%; object-fit: cover; }

.hero-thumbs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.hero-thumbs::-webkit-scrollbar { display: none; }
.hero-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 52px;
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--card);
    padding: 0;
    transition: border-color 0.25s;
}
.hero-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.65; transition: opacity 0.25s; }
.hero-thumb.is-on { border-color: var(--accent); }
.hero-thumb.is-on img { opacity: 1; }
.hero-thumb-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0%;
    background: var(--grad-accent);
}

/* ================= Section blocks ================= */
.section-block { margin-bottom: 30px; }
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}
.section-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-left: 12px;
    position: relative;
}
.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    border-radius: 2px;
    background: var(--grad-accent);
}
.section-more { font-size: 12px; font-weight: 600; color: var(--gold); white-space: nowrap; }

/* ================= Drama card grid ================= */
/* Mobile: 2 columns; PC: 5 columns (see media query) */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.drama-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s, box-shadow 0.25s;
}
.drama-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}
.drama-card-link { display: block; }
.drama-card-cover {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--bg-elev);
}
.drama-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}
.drama-card:hover .drama-cover-img { transform: scale(1.06); }
.drama-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #22252E, #14161C);
    color: var(--text-faint);
    font-family: "Barlow Condensed", sans-serif;
    font-size: 22px;
    font-weight: 700;
}

/* Top-right badge */
.card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 6px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.card-badge-eps { background: rgba(0, 0, 0, 0.75); border: 1px solid rgba(255, 255, 255, 0.25); }
.card-badge-free { background: var(--grad-accent); }
.card-badge-hot { background: var(--gold); color: #1a1a1a; }

/* Bottom gradient info */
.drama-card-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 26px 10px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 30%, rgba(0, 0, 0, 0.35) 70%, transparent);
}
.drama-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.drama-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.drama-card-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--gold);
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 1px 8px;
    border-radius: 999px;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.drama-card-tag-hot { color: var(--accent); background: rgba(255, 87, 34, 0.16); border-color: rgba(255, 87, 34, 0.4); }
.drama-card-views { font-size: 10px; color: rgba(255, 255, 255, 0.75); }

/* ================= Breadcrumb / list header / sort bar ================= */
.breadcrumb {
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.crumb-link { color: var(--text-dim); }
.crumb-link:hover { color: var(--accent); }
.crumb-current { color: var(--text-dim); }
.crumb-sep { color: var(--text-faint); }

.list-header { margin-bottom: 16px; }
.list-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 26px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tag-icon-large { margin-right: 4px; }
.list-desc { color: var(--text-dim); font-size: 13px; margin-top: 6px; max-width: 720px; }

.sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.sort-bar::-webkit-scrollbar { display: none; }
.sort-label { font-size: 12px; color: var(--text-faint); flex: 0 0 auto; }
.sort-option {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.sort-option:hover, .sort-option.active {
    color: #fff;
    border-color: transparent;
    background: var(--grad-accent);
}

/* ================= Empty state / pagination ================= */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--text-dim);
}
.empty-icon { font-size: 44px; margin-bottom: 10px; }
.btn-back {
    display: inline-block;
    margin-top: 14px;
    background: var(--grad-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 22px;
    border-radius: 999px;
}
.btn-back:hover { color: #fff; opacity: 0.9; }
.btn-back-outline { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-back-outline:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 26px; flex-wrap: wrap; }
.page-btn {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 13px;
    color: var(--text-dim);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.page-btn:hover { color: #fff; border-color: var(--accent); }
.page-btn.active { background: var(--grad-accent); border-color: transparent; color: #fff; font-weight: 700; }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ================= Drama detail page ================= */
/* Mobile: single centered column (player / CTA / info share the same width) */
.detail-main { display: flex; flex-direction: column; gap: 18px; }
.player-col { flex: 1 1 auto; min-width: 0; }
.info-col { flex: 1 1 auto; min-width: 0; max-width: 420px; margin: 0 auto; width: 100%; }

/* 9:16 vertical player shell: near full width on phones, capped on desktop */
.player-shell {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    aspect-ratio: 9 / 16;
    max-height: 78vh;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--line);
}
.player-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}
.drama-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    z-index: 2;
}

/* Big play button */
.player-play-btn {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #fff;
}
.play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    font-size: 24px;
    border-radius: 999px;
    background: var(--grad-accent);
    box-shadow: 0 0 0 12px rgba(255, 87, 34, 0.18), 0 8px 28px rgba(255, 87, 34, 0.55);
    animation: play-pulse 2.2s ease-in-out infinite;
    padding-left: 4px;
}
@keyframes play-pulse {
    0%, 100% { box-shadow: 0 0 0 10px rgba(255, 87, 34, 0.16), 0 8px 28px rgba(255, 87, 34, 0.5); }
    50% { box-shadow: 0 0 0 18px rgba(255, 87, 34, 0.08), 0 8px 34px rgba(255, 87, 34, 0.7); }
}
.play-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Playback-end conversion overlay */
.player-ended-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fade-in 0.4s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.ended-panel { text-align: center; padding: 24px; }
.ended-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}
.ended-sub { color: var(--gold); font-size: 14px; font-weight: 600; margin: 8px 0 18px; }
.ended-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--grad-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 13px 28px;
    border: none;
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(255, 87, 34, 0.6);
    animation: play-pulse 2.2s ease-in-out infinite;
}
.ended-cta:hover { color: #fff; transform: translateY(-2px); }

/* Primary CTA banner with breathing glow (centered to match the player width) */
.cta-banner { max-width: 420px; margin: 14px auto 0; text-align: center; }
.cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--grad-accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 18px;
    animation: cta-breathe 2.6s ease-in-out infinite;
    transition: transform 0.2s;
}
.cta-btn:hover { color: #fff; transform: translateY(-2px); }
@keyframes cta-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.55), 0 6px 24px rgba(255, 87, 34, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(255, 87, 34, 0), 0 6px 30px rgba(255, 87, 34, 0.6); }
}
.cta-play { font-size: 13px; }
.cta-steps { font-size: 11px; color: var(--text-faint); margin-top: 8px; }

/* Info column */
.drama-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.4px;
}
.drama-meta-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.heat-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 3px 12px;
    border-radius: 999px;
}
.drama-category-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--card);
    border: 1px solid var(--line);
    padding: 3px 12px;
    border-radius: 999px;
    transition: color 0.2s, border-color 0.2s;
}
.drama-category-link:hover { color: var(--accent); border-color: var(--accent); }

.drama-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.meta-item { font-size: 12px; color: var(--text-dim); }
.meta-label { color: var(--text-faint); }

/* Tag pills */
.drama-tag-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag-pill {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--card);
    border: 1px solid var(--line);
    padding: 3px 12px;
    border-radius: 999px;
    transition: color 0.2s, border-color 0.2s;
}
.tag-pill:hover { color: var(--gold); border-color: var(--gold); }

/* Episode selector grid */
.episode-section { margin-top: 18px; }
.episode-heading {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.episode-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ep-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid var(--line);
    background: var(--card);
    color: #fff;
    transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.ep-btn:active { transform: scale(0.94); }
/* Episode 1: playing state with accent border */
.ep-btn.ep-playing {
    border-color: var(--accent);
    background: rgba(255, 87, 34, 0.12);
    color: var(--accent);
}
.ep-btn .ep-state {
    position: absolute;
    top: -7px;
    right: -4px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--grad-accent);
    color: #fff;
    text-transform: uppercase;
}
/* Locked episodes: gray base + tiny gold lock */
.ep-btn.ep-locked .ep-lock {
    position: absolute;
    top: -7px;
    right: -4px;
    font-size: 9px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 5px;
    background: var(--gold);
    color: #1a1a1a;
}
.ep-btn.ep-locked { color: var(--text-dim); }
.ep-btn.ep-locked:hover { border-color: var(--gold); color: #fff; }
.episode-hint { font-size: 11px; color: var(--text-faint); margin-top: 10px; }

/* ================= SEO long-text sections ================= */
.seo-section { margin-top: 30px; }
.seo-heading {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.seo-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 60px;
    height: 3px;
    border-radius: 2px;
    background: var(--grad-accent);
}
.seo-body { color: var(--text-dim); font-size: 14px; line-height: 1.8; }
.seo-body p { margin-bottom: 12px; }
.seo-body h3 { color: var(--text); font-size: 16px; font-weight: 700; margin: 20px 0 8px; }
.seo-body ul, .seo-body ol { margin: 0 0 12px 18px; }
.seo-body ul { list-style: disc; }
.seo-body ol { list-style: decimal; }
.seo-body li { margin-bottom: 6px; }
.seo-body img { border-radius: var(--radius); margin: 10px 0; }
.seo-body a { color: var(--gold); }
.seo-body strong { color: var(--text); }

/* Same-genre text links */
.desc-related-links {
    margin-top: 30px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}
.desc-related-title { font-size: 14px; font-weight: 700; color: var(--gold); margin-bottom: 10px; }
.desc-related-list { display: flex; flex-direction: column; gap: 6px; }
.desc-related-list a {
    font-size: 13px;
    color: var(--text-dim);
    transition: color 0.2s, padding-left 0.2s;
}
.desc-related-list a:hover { color: var(--accent); padding-left: 4px; }

/* Related drama grid */
.related-section { margin-top: 30px; }

/* ================= Lock modal ================= */
.lock-modal { position: fixed; inset: 0; z-index: 1000; }
.lock-modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.lock-modal-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 40px);
    max-width: 380px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px 22px 22px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: modal-pop 0.25s ease;
}
@keyframes modal-pop { from { transform: translate(-50%, -46%) scale(0.92); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.lock-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-faint);
    font-size: 14px;
}
.lock-modal-close:hover { color: #fff; background: var(--card-hover); }
.lock-modal-icon { font-size: 34px; }
.lock-modal-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}
.lock-modal-desc { font-size: 12px; color: var(--text-dim); margin: 8px 0 16px; }
.lock-modal-btn {
    display: block;
    width: 100%;
    background: var(--grad-accent);
    border: none;
    border-radius: 999px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 13px;
    box-shadow: 0 8px 26px rgba(255, 87, 34, 0.5);
    transition: transform 0.2s;
}
.lock-modal-btn:hover { color: #fff; transform: translateY(-2px); }

/* ================= Sticky bottom conversion bar (mobile only) ================= */
.sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(20, 22, 28, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
}
.sticky-bar-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sticky-bar-thumb {
    width: 34px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    flex: 0 0 auto;
}
.sticky-bar-text { display: flex; flex-direction: column; min-width: 0; }
.sticky-bar-title {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sticky-bar-sub { font-size: 10px; color: var(--gold); }
.sticky-bar-btn {
    flex: 0 0 auto;
    background: var(--grad-accent);
    border: none;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 16px;
    box-shadow: 0 4px 18px rgba(255, 87, 34, 0.5);
    animation: cta-breathe 2.6s ease-in-out infinite;
}
.sticky-bar-btn:hover { color: #fff; }
/* Add bottom padding so the sticky bar never covers page content */
body.has-sticky-bar { padding-bottom: 74px; }

/* ================= Article list ================= */
.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s;
}
.article-item:hover { border-color: rgba(255, 87, 34, 0.5); }
.article-item-link { display: flex; gap: 12px; padding: 12px; }
.article-item-cover { flex: 0 0 auto; width: 96px; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; }
.article-item-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-item-body { min-width: 0; display: flex; flex-direction: column; }
.article-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-item-desc { font-size: 12px; color: var(--text-dim); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-item-meta { margin-top: auto; display: flex; gap: 12px; font-size: 11px; color: var(--text-faint); padding-top: 8px; }

/* ================= Generic page content (about / policy pages) ================= */
.page-content { max-width: 820px; margin: 0 auto; }
.page-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 30px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}
.page-updated { font-size: 12px; color: var(--text-faint); margin-bottom: 18px; }
.about-section { margin-bottom: 22px; }
.about-section h2 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    padding-left: 12px;
    position: relative;
}
.about-section h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    border-radius: 2px;
    background: var(--grad-accent);
}
.about-section p { color: var(--text-dim); font-size: 14px; margin-bottom: 10px; }
.about-section ul { list-style: disc; margin: 0 0 10px 18px; color: var(--text-dim); font-size: 14px; }
.about-section li { margin-bottom: 6px; }
.page-body { color: var(--text-dim); font-size: 14px; line-height: 1.8; }
.page-body p { margin-bottom: 12px; }
.page-body img { border-radius: var(--radius); }
.article-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-faint); margin-bottom: 16px; }

/* ================= Error pages ================= */
.error-page { text-align: center; padding: 70px 20px; }
.error-code {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 90px;
    font-weight: 800;
    line-height: 1;
    background: var(--grad-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.error-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 24px;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 12px;
}
.error-desc { color: var(--text-dim); font-size: 13px; margin-top: 8px; }
.error-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ================= Footer ================= */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-elev);
    margin-top: 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    padding: 28px 0 18px;
}
.footer-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
    margin-bottom: 10px;
}
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { font-size: 12px; color: var(--text-dim); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-contact p { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid var(--line); padding: 14px 0; text-align: center; }
.copyright { font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }
.footer-tips { font-size: 11px; color: var(--text-faint); max-width: 640px; margin: 0 auto; }

/* ================= Back to top ================= */
.back-to-top {
    position: fixed;
    right: 14px;
    bottom: 84px;
    z-index: 800;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--text-dim);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s, color 0.2s, border-color 0.2s;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }

/* ================= Utility ================= */
.drama-data { display: none; }

/* ============================================================
   Responsive: tablet and up
   ============================================================ */
@media (min-width: 768px) {
    .container { padding: 0 24px; }
    .main-content { padding: 20px 0 50px; }

    .search-input { width: 220px; }

    /* Grid: 3 columns on tablet */
    .drama-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }

    /* PC detail layout: player left 65%, info right 35% */
    .detail-main { flex-direction: row; align-items: flex-start; }
    .player-col { flex: 0 0 65%; }
    .info-col { flex: 0 0 35%; padding-left: 24px; max-width: none; margin: 0; }
    .player-shell { max-width: 480px; margin: 0 auto; max-height: 76vh; }
    .cta-banner { max-width: 480px; margin-left: auto; margin-right: auto; }

    .hero { margin: 0 -24px 30px; }
    .hero-inner { padding-top: 34px; }
    .hero-slide { flex-direction: row; text-align: left; }
    .hero-slide.is-on { flex-direction: row; }
    .hero-text { flex: 1 1 auto; }
    .hero-title { font-size: clamp(34px, 4.5vw, 52px); }
    .hero-desc { margin-left: 0; }
    .hero-actions { justify-content: flex-start; }
    .hero-poster { margin: 0; width: 210px; }
    .hero-thumbs { justify-content: flex-start; }

    .episode-grid { grid-template-columns: repeat(6, 1fr); }
    .footer-grid { grid-template-columns: repeat(4, 1fr); }

    .back-to-top { bottom: 24px; }

    /* Sticky bar is mobile-only */
    .sticky-bar { display: none; }
    body.has-sticky-bar { padding-bottom: 0; }
}

/* ============================================================
   Responsive: PC and up (grid goes to 5 columns per spec)
   ============================================================ */
@media (min-width: 1024px) {
    .drama-grid { grid-template-columns: repeat(5, 1fr); gap: 18px; }
    .episode-grid { grid-template-columns: repeat(7, 1fr); }

    /* Hide mobile hamburger helpers on desktop */
    .mobile-menu-toggle { display: none; }
    .mobile-panel { display: none !important; }

    .hero { min-height: 460px; }
    .hero-poster { width: 250px; }
    .hero-thumb { width: 64px; }
}

/* ================= Mobile & tablet: hamburger + dropdown panel ================= */
@media (max-width: 1023px) {
    /* margin-left:auto keeps the hamburger at the far right even when the
       language switcher is absent (no multi-language sites configured) */
    .mobile-menu-toggle { display: flex; margin-left: auto; }
    .header-search { display: none; }
    /* Category chips live inside the hamburger dropdown panel (.mobile-quick-tags)
       on small screens; hide the always-visible header row */
    .quick-tags { display: none; }
    .logo-img { height: 28px; }
}

/* ================= Reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
    .play-icon, .ended-cta, .cta-btn, .sticky-bar-btn { animation: none; }
    .hero-bg { transition: none; }
}

/* ============================================================
   AJAX browse page (drama/index.html): filter panel + toolbar
   ============================================================ */
.ajax-filter-bar { margin-bottom: 14px; }
.ajax-filter-bar .filter-loading { color: var(--text-faint); font-size: 13px; padding: 10px 0; }

.filter-group {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}
.filter-group:last-child { border-bottom: none; }
.filter-label { font-size: 12px; font-weight: 600; color: var(--text-faint); min-width: 92px; padding-top: 6px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 8px; }

/* button reset + pill style for filter options */
button.filter-option {
    cursor: pointer;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text-dim);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 999px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
button.filter-option:hover { color: #fff; border-color: var(--accent); }
button.filter-option.active { background: var(--grad-accent); border-color: transparent; color: #fff; }
.filter-count { font-style: normal; font-size: 10px; opacity: 0.75; margin-left: 2px; }

/* Toolbar: sort + result count + clear filters */
.browse-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.browse-toolbar .sort-bar { margin-bottom: 0; }
.browse-toolbar-right { display: flex; align-items: center; gap: 12px; }
.browse-result-count { color: var(--text-faint); font-size: 12px; }
button.sort-option { cursor: pointer; }
.filter-reset-btn {
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px dashed var(--line);
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.filter-reset-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Grid loading state */
.browser-grid-wrap { position: relative; min-height: 240px; }
.browser-grid-wrap.is-loading .drama-grid { opacity: 0.4; pointer-events: none; }
.browser-grid-wrap.is-loading::after {
    content: "";
    position: absolute;
    top: 60px;
    left: 50%;
    width: 32px;
    height: 32px;
    margin-left: -16px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: grid-spin 0.8s linear infinite;
}
@keyframes grid-spin { to { transform: rotate(360deg); } }

/* AJAX pagination buttons */
button.page-btn { cursor: pointer; font: inherit; }
.page-ellipsis { color: var(--text-faint); padding: 0 6px; }
/* button variant of the empty-state back button */
.empty-state button.btn-back { border: none; cursor: pointer; font: inherit; }

@media (max-width: 768px) {
    .browse-toolbar { flex-direction: column; align-items: flex-start; }
    .filter-group { flex-direction: column; gap: 8px; }
    .filter-label { min-width: 100%; padding-top: 0; }
}

/* ============================================================
   Contact page (page/contact.html): info cards + message form
   ============================================================ */
.contact-intro { color: var(--text-dim); font-size: 13px; margin-bottom: 20px; }
.contact-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.contact-info-card, .contact-form-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.contact-info-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}
.contact-info-list { display: flex; flex-direction: column; gap: 12px; }
.contact-info-item { display: flex; align-items: center; gap: 12px; }
.contact-info-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.contact-info-body { display: flex; flex-direction: column; min-width: 0; }
.contact-info-label { font-size: 11px; color: var(--text-faint); }
.contact-info-value { font-size: 14px; font-weight: 500; word-break: break-all; }
.contact-info-tips { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.contact-info-tips p { font-size: 12px; font-weight: 600; color: var(--gold); margin-bottom: 6px; }
.contact-info-tips ul { list-style: disc; margin-left: 18px; }
.contact-info-tips li { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }

/* Message form */
.contact-form-field { margin-bottom: 14px; }
.contact-form-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-dim); }
.required-mark { color: var(--accent); }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea {
    width: 100%;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.2s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--text-faint); }
.contact-form textarea { resize: vertical; min-height: 110px; }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-row img {
    height: 42px;
    width: 120px;
    border-radius: 8px;
    border: 1px solid var(--line);
    cursor: pointer;
    object-fit: cover;
}
.contact-form-actions { display: flex; gap: 10px; margin-top: 16px; }
.contact-submit-btn {
    flex: 1;
    background: var(--grad-accent);
    border: none;
    border-radius: 999px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 20px;
    transition: transform 0.2s, opacity 0.2s;
}
.contact-submit-btn:hover { color: #fff; transform: translateY(-2px); opacity: 0.95; }
.contact-submit-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.contact-reset-btn {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 14px;
    padding: 12px 22px;
    transition: color 0.2s, border-color 0.2s;
}
.contact-reset-btn:hover { color: #fff; border-color: var(--accent); }
.contact-form-msg { margin-top: 12px; font-size: 13px; padding: 10px 14px; border-radius: 8px; display: none; }
.contact-form-msg.success { display: block; color: #4ade80; background: rgba(74, 222, 128, 0.08); border: 1px solid rgba(74, 222, 128, 0.3); }
.contact-form-msg.error { display: block; color: #f87171; background: rgba(248, 113, 113, 0.08); border: 1px solid rgba(248, 113, 113, 0.3); }

@media (min-width: 900px) {
    .contact-layout { grid-template-columns: 1fr 1.2fr; align-items: start; }
}
