:root {
    --c-bg: #ffffff;
    --c-surface: #f7f5fb;
    --c-purple: #4d148c;
    --c-purple-dark: #3a0f6b;
    --c-purple-light: #6a2db8;
    --c-orange: #ff6200;
    --c-blue-link: #2563a8;
    --c-text: #2c2c2c;
    --c-text-muted: #555555;
    --c-text-dim: #999999;
    --c-border: #d8d8d8;
    --c-border-light: #eeeeee;
    --c-hover-bg: #efe8f8;
    --r-xs: 3px;
    --r-sm: 5px;
    --r-md: 8px;
    --trans: 0.16s ease;
    --max-w: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--c-bg);
    color: var(--c-text);
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--c-blue-link); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--c-orange); }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
.cf::after { content: ''; display: table; clear: both; }

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrap {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================================
   MASTHEAD — deep purple bar
   ============================================================ */
.site-masthead {
    background: var(--c-purple);
    border-bottom: 3px solid var(--c-orange);
}

.masthead-row {
    display: flex;
    align-items: center;
    height: 50px;
    gap: 14px;
}

.brand-cluster {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.brand-home-link { text-decoration: none; }

.brand-name-text {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    font-style: normal;
    text-decoration: none;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.brand-name-text:hover { color: #ffe082; }

.latest-url-block {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 20px;
    padding: 3px 12px;
    white-space: nowrap;
}

.latest-url-label {
    font-size: 11px;
    color: rgba(255,255,255,0.72);
}

.latest-url-value {
    font-size: 15px;
    font-weight: 700;
    color: #ffe082;
    letter-spacing: 0.4px;
}

/* ============================================================
   PROMO / BANNER STRIP
   ============================================================ */
.banner-strip {
    margin: 4px 0 2px;
    overflow: hidden;
}

/* ============================================================
   CATEGORY NAV
   ============================================================ */
.nav-block {
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-border);
    padding: 5px 0 3px;
    margin-bottom: 3px;
}

.cat-row {
    display: flex;
    align-items: flex-start;
    padding: 3px 0;
    border-bottom: 1px solid var(--c-border-light);
    gap: 0;
}

.cat-row:last-child { border-bottom: none; padding-bottom: 0; }

.cat-zone-name {
    flex-shrink: 0;
    width: 60px;
    font-size: 10px;
    color: var(--c-purple);
    font-weight: 700;
    background: var(--c-hover-bg);
    border-radius: var(--r-xs);
    padding: 3px 3px;
    text-align: center;
    line-height: 1.4;
    margin-right: 8px;
    margin-top: 1px;
    letter-spacing: 0.2px;
}

.cat-link-group {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 5px;
    flex: 1;
    align-items: center;
}

.cat-link-group a {
    color: var(--c-text);
    font-size: 13px;
    padding: 2px 8px;
    border-radius: var(--r-xs);
    border-bottom: 2px solid transparent;
    transition: color var(--trans), border-color var(--trans), background var(--trans);
    white-space: nowrap;
}

.cat-link-group a:hover {
    color: var(--c-purple);
    background: var(--c-hover-bg);
    border-bottom-color: var(--c-purple-light);
}

.cat-link-group a.active {
    color: var(--c-purple);
    font-weight: 700;
    background: var(--c-hover-bg);
    border-bottom-color: var(--c-orange);
}

/* ============================================================
   SEARCH
   ============================================================ */
.search-strip {
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    padding: 6px 0;
    margin-bottom: 3px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    width: 100%;
}

.search-bar input[type="text"] {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    color: var(--c-text);
    font-size: 13px;
    padding: 6px 11px;
    outline: none;
    transition: border-color var(--trans), box-shadow var(--trans);
}

.search-bar input[type="text"]:focus {
    border-color: var(--c-purple);
    box-shadow: 0 0 0 2px rgba(77,20,140,0.1);
}

.search-bar input[type="text"]::placeholder { color: #bbb; }

.search-bar button {
    flex-shrink: 0;
    background: var(--c-purple);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    font-size: 12px;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: background var(--trans), transform var(--trans);
}

.search-bar button:hover {
    background: var(--c-purple-light);
    transform: translateY(-1px);
}

/* ============================================================
   HOT TAGS
   ============================================================ */
.hot-tags-block {
    padding: 5px 0 3px;
    border-bottom: 1px solid var(--c-border-light);
    margin-bottom: 3px;
}

.hot-tags-heading {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-purple);
    margin-bottom: 5px;
    letter-spacing: 0.4px;
}

.hot-tags-heading strong { font-weight: 800; }

.tags-line {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.tags-line .t-link {
    color: var(--c-blue-link);
    font-size: 12px;
    border-bottom: 1px solid rgba(37,99,168,0.4);
    transition: color var(--trans), border-color var(--trans);
    white-space: nowrap;
}

.tags-line .t-link:hover {
    color: var(--c-orange);
    border-bottom-color: var(--c-orange);
}

/* ============================================================
   CONTENT SECTION
   ============================================================ */
.media-section {
    padding: 7px 0 4px;
    border-bottom: 1px solid var(--c-border-light);
    margin-bottom: 3px;
}

.media-section:last-child { border-bottom: none; }

.media-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--c-purple);
}

.media-heading h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-purple);
}

.media-heading h3 a { color: var(--c-purple); font-weight: 700; }
.media-heading h3 a:hover { color: var(--c-orange); }

.item-count { font-size: 12px; font-weight: normal; color: var(--c-text-dim); }

/* ============================================================
   FILM GRID
   ============================================================ */
.media-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    list-style: none;
    padding: 0;
}

.media-grid li { display: flex; flex-direction: column; }

.media-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--r-xs);
    background: #e8e0f4;
    aspect-ratio: 600 / 350;
    border: 1px solid var(--c-border);
    transition: box-shadow var(--trans), border-color var(--trans);
}

.media-thumb:hover {
    box-shadow: 0 3px 14px rgba(77,20,140,0.18);
    border-color: var(--c-purple-light);
}

.media-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.28s ease;
}

.media-thumb:hover img { transform: scale(1.04); }

.media-caption { padding: 4px 2px 2px; }

.media-caption h5 {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.media-caption h5 a { color: var(--c-text-muted); }
.media-caption h5 a:hover { color: var(--c-purple); }

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.item-title-bar {
    text-align: center;
    padding: 14px 16px;
    font-size: 16px;
    line-height: 1.8;
    word-break: break-all;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 10px;
}

.item-title-bar a {
    color: var(--c-purple);
    font-weight: 700;
    margin-right: 6px;
}

.item-info-box {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-left: 3px solid var(--c-purple);
    border-radius: var(--r-sm);
    font-size: 14px;
    line-height: 1.9;
    padding: 14px 18px;
    margin-bottom: 10px;
}

.preview-img-wrap { margin-top: 10px; width: 100%; }

.preview-img-wrap picture { display: block; width: 100%; }

.preview-img-wrap picture img,
.preview-img-wrap img {
    width: 100%;
    height: auto;
    border-radius: var(--r-xs);
    display: block;
    border: 1px solid var(--c-border);
}

/* ============================================================
   DOWNLOAD BUTTONS
   ============================================================ */
.download-btns {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0;
}

.dl-action-btn {
    display: inline-flex;
    align-items: center;
    background: var(--c-purple);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 22px;
    border-radius: 24px;
    cursor: pointer;
    border: none;
    transition: background var(--trans), transform var(--trans);
    text-decoration: none;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.dl-action-btn:hover {
    background: var(--c-purple-light);
    color: #fff;
    transform: translateY(-1px);
}

.dl-hint { text-align: center; padding: 7px 0; font-size: 13px; }
.dl-hint a { color: var(--c-purple); font-weight: 600; border-bottom: 1px solid var(--c-purple); }
.dl-hint a:hover { color: var(--c-orange); border-bottom-color: var(--c-orange); }

/* ============================================================
   SHARE BOX
   ============================================================ */
.share-row {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    padding: 9px 13px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.share-lbl { font-size: 12px; color: var(--c-text-dim); white-space: nowrap; font-weight: 600; }

.share-val {
    flex: 1;
    font-size: 12px;
    color: var(--c-text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.share-btn {
    flex-shrink: 0;
    background: var(--c-purple);
    border: none;
    color: #fff;
    border-radius: var(--r-xs);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--trans);
    white-space: nowrap;
}

.share-btn:hover { background: var(--c-purple-light); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pager-wrap { margin-top: 14px; padding-bottom: 8px; }

.pager-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 0;
}

.pg-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xs);
    color: var(--c-blue-link);
    font-size: 13px;
    transition: background var(--trans), color var(--trans), border-color var(--trans);
}

.pg-item:hover {
    background: var(--c-hover-bg);
    color: var(--c-purple);
    border-color: var(--c-purple-light);
}

.pg-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    background: var(--c-purple);
    border: 1px solid var(--c-purple);
    border-radius: var(--r-xs);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

/* ============================================================
   FOOTER
   ============================================================ */
.flinks-section {
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    padding: 8px 0;
    margin-top: 6px;
}

.flinks-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-purple);
    margin-bottom: 6px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.flinks-ul {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
}

.flinks-ul dd { margin: 0; }

.flinks-ul a {
    color: var(--c-text-muted);
    font-size: 12px;
    border-bottom: 1px solid var(--c-border);
    transition: color var(--trans), border-color var(--trans);
}

.flinks-ul a:hover { color: var(--c-purple); border-bottom-color: var(--c-purple); }

.site-footer-bottom {
    background: var(--c-purple-dark);
    padding: 10px 0;
    margin-top: 4px;
}

.footer-txt {
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    line-height: 1.8;
}

/* ============================================================
   PLAYER
   ============================================================ */
.player-wrap {
    margin: 8px 0;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--c-border);
}

/* ============================================================
   HELPERS
   ============================================================ */
@media (max-width: 768px) { .hide-mobile { display: none !important; } }
@media (min-width: 769px) { .hide-pc { display: none !important; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Small phones ≤480px */
@media (max-width: 480px) {
    .cat-zone-name {
        width: 15%;
        font-size: 10px;
        padding: 2px 2px;
        margin-right: 4px;
    }
    .cat-link-group { width: 85%; }
    /* 8 nav items → 4 per row = 2 rows */
    .cat-link-group a {
        font-size: 12px;
        padding: 2px 4px;
        width: calc(25% - 4px);
        text-align: center;
    }
    /* Film: 2 cols */
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }
    .brand-name-text { font-size: 15px; }
    .latest-url-value { font-size: 13px; }
    /* Search single row */
    .search-bar { flex-wrap: nowrap; }
    .search-bar input[type="text"] { font-size: 12px; }
    .search-bar button { font-size: 11px; padding: 6px 7px; }
}

/* Medium phones 481–768px */
@media (min-width: 481px) and (max-width: 768px) {
    .cat-zone-name {
        width: 15%;
        font-size: 10px;
        padding: 2px 3px;
        margin-right: 5px;
    }
    .cat-link-group { width: 85%; }
    .cat-link-group a {
        font-size: 13px;
        padding: 2px 5px;
        width: calc(25% - 5px);
        text-align: center;
    }
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .search-bar { flex-wrap: nowrap; }
}

/* PC ≥769px */
@media (min-width: 769px) {
    .cat-link-group a { flex: 1; text-align: center; }
    .media-grid { grid-template-columns: repeat(4, 1fr); }
}
