/* ===== BASE RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --dk: #0f1117;
    --dk2: #161b26;
    --dk3: #1e2535;
    --dk4: #252d3d;
    --dk5: #2e3850;
    --accent: #0078f2;
    --accent2: #0063cc;
    --accent-glow: rgba(0,120,242,.18);
    --cyan: #00c8e0;
    --red: #e03030;
    --gold: #f0b429;
    --txt: #e8eaf0;
    --txt2: #9ba3b8;
    --txt3: #5a6278;
    --bdr: rgba(255,255,255,.07);
    --bdr2: rgba(255,255,255,.12);
    --card-bg: #1a2030;
    --sh1: 0 1px 4px rgba(0,0,0,.35);
    --sh2: 0 4px 16px rgba(0,0,0,.45);
    --sh3: 0 8px 32px rgba(0,0,0,.55);
    --rd: 6px;
    --rd2: 4px;
    --rd3: 10px;
}

html { font-size: 15px; }

body {
    background: var(--dk);
    color: var(--txt);
    font-family: 'Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .16s; }
a:hover { color: var(--cyan); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
.grp-clear::after { content: ''; display: table; clear: both; }

/* ===== LAYOUT WRAP ===== */
.main-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 14px;
}

/* ===== SITE HEADER ===== */
.site-head {
    background: var(--dk2);
    border-bottom: 1px solid var(--bdr2);
    padding: 10px 0;
    box-shadow: var(--sh2);
}

.site-head .main-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
    font-style: normal;
    letter-spacing: -.3px;
    text-decoration: none;
    border-bottom: none;
}

.domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, #005bb5 100%);
    border-radius: 20px;
    padding: 4px 14px;
    box-shadow: 0 0 12px var(--accent-glow);
}

.domain-tag .dt-label {
    font-size: 0.66rem;
    color: rgba(255,255,255,.65);
    white-space: nowrap;
}

.domain-tag .dt-addr {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    letter-spacing: .2px;
}

/* ===== BANNER ===== */
.promo-zone {
    margin: 4px 0 3px;
}
.promo-zone img { border-radius: var(--rd); width: 100%; }

/* ===== CATEGORY NAV ===== */
.cat-panel {
    background: var(--dk2);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    overflow: hidden;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

.cat-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--bdr);
    min-height: 36px;
}

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

.zone-tag {
    background: linear-gradient(180deg, var(--dk3) 0%, var(--dk4) 100%);
    color: var(--txt2);
    font-size: .66rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    width: 60px;
    min-width: 60px;
    border-right: 1px solid var(--bdr);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

.cat-links-box {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    align-items: center;
    padding: 3px 8px;
    gap: 3px;
    flex: 1;
}

.cat-links-box a {
    font-size: .81rem;
    color: var(--txt2);
    padding: 4px 4px;
    border-radius: var(--rd2);
    transition: all .16s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid transparent;
    text-decoration: none;
    display: block;
}

.cat-links-box a:hover {
    background: var(--accent-glow);
    color: var(--cyan);
    border-color: rgba(0,200,224,.2);
}

.cat-links-box a.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 700;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* ===== SEARCH BAR ===== */
.search-bar {
    background: var(--dk2);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    padding: 8px 12px;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

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

.search-bar input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1px solid var(--bdr2);
    border-radius: var(--rd2);
    padding: 0 12px;
    font-size: .86rem;
    color: var(--txt);
    background: var(--dk3);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.search-bar input[type="text"]::placeholder { color: var(--txt3); }

.search-bar input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: var(--dk4);
}

.search-bar button {
    height: 36px;
    padding: 0 11px;
    border: none;
    border-radius: var(--rd2);
    background: var(--dk4);
    color: var(--txt2);
    font-size: .80rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .16s;
    flex-shrink: 0;
    border: 1px solid var(--bdr2);
}

.search-bar button:hover { background: var(--dk5); color: var(--txt); }

.search-bar button[value="1"] {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.search-bar button[value="1"]:hover { background: var(--accent2); }

.search-bar button[value="2"] {
    background: var(--dk3);
    color: var(--gold);
    border-color: rgba(240,180,41,.25);
}
.search-bar button[value="2"]:hover { background: var(--dk4); }

/* ===== HOT TAGS ===== */
.tags-box {
    background: var(--dk2);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    padding: 7px 12px;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

.tags-box h4 {
    font-size: .77rem;
    font-weight: 700;
    color: var(--txt2);
    margin-bottom: 5px;
    letter-spacing: .3px;
}

.tag-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag-strip .tg {
    display: inline-block;
    background: var(--dk3);
    color: var(--txt2);
    border: 1px solid var(--bdr2);
    border-radius: 16px;
    padding: 2px 10px;
    font-size: .74rem;
    text-decoration: none;
    transition: all .16s;
}

.tag-strip .tg:hover {
    background: var(--accent-glow);
    color: var(--cyan);
    border-color: rgba(0,200,224,.3);
}

/* ===== CONTENT BLOCKS ===== */
.blk-sect {
    background: var(--dk2);
    border: 1px solid var(--bdr);
    border-radius: var(--rd3);
    padding: 12px 12px 10px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

.blk-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bdr);
    position: relative;
}

.blk-hd::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 36px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    border-radius: 2px;
}

.blk-hd h3 {
    font-size: .95rem;
    font-weight: 800;
    color: var(--txt);
    letter-spacing: .2px;
}

.blk-hd h3 a { color: var(--txt); }
.blk-hd h3 a:hover { color: var(--cyan); }

.blk-hd h4 {
    font-size: .93rem;
    font-weight: 800;
    color: var(--txt);
}

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

.media-grid li {
    border-radius: var(--rd);
    overflow: hidden;
    border: 1px solid var(--bdr);
    background: var(--card-bg);
    transition: box-shadow .2s, transform .2s, border-color .2s;
}

.media-grid li:hover {
    box-shadow: var(--sh3);
    transform: translateY(-2px);
    border-color: var(--bdr2);
}

.media-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 600 / 350;
    overflow: hidden;
    background: var(--dk3);
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s, opacity .2s;
    opacity: .92;
}

.media-thumb:hover img {
    transform: scale(1.05);
    opacity: 1;
}

.media-info {
    padding: 5px 7px 7px;
}

.media-info h5 {
    font-size: .76rem;
    font-weight: 500;
    color: var(--txt2);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color .16s;
}

.media-info h5 a { color: var(--txt2); }
.media-info h5 a:hover { color: var(--txt); }

.media-grid li:hover .media-info h5 a { color: var(--txt); }

/* ===== PAGINATION ===== */
.page-nav {
    margin: 12px 0 5px;
    display: flex;
    justify-content: center;
}

.page-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.page-row a.pb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--dk3);
    border: 1px solid var(--bdr2);
    border-radius: var(--rd2);
    font-size: .82rem;
    color: var(--txt2);
    text-decoration: none;
    transition: all .16s;
}

.page-row a.pb:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--cyan);
}

.page-row a.pb-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--rd2);
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    cursor: default;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ===== FOOTER ===== */
.foot-links {
    background: var(--dk2);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    padding: 9px 12px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

.fl-items {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.fl-items dd { display: inline; }

.fl-items a {
    display: inline-block;
    font-size: .75rem;
    color: var(--txt3);
    padding: 2px 9px;
    border-radius: 3px;
    border: 1px solid var(--bdr);
    background: var(--dk3);
    text-decoration: none;
    transition: all .16s;
}

.fl-items a:hover { color: var(--cyan); border-color: rgba(0,200,224,.3); }

.copy-bar {
    text-align: center;
    padding: 8px 0 14px;
    color: var(--txt3);
    font-size: .74rem;
}

/* ===== DETAIL PAGES ===== */
.dtl-heading {
    line-height: 1.8;
    text-align: center;
    padding: 12px 15px;
    font-size: .96rem;
    margin: 4px 0;
    word-break: break-all;
    background: var(--dk2);
    border: 1px solid var(--bdr);
    border-left: 3px solid var(--accent);
    border-radius: var(--rd);
    box-shadow: var(--sh1);
}

.dtl-heading a {
    color: var(--accent);
    font-weight: 700;
    margin-right: 6px;
}

.dtl-meta {
    font-size: .88rem;
    line-height: 1.95;
    padding: 14px 16px;
    background: var(--dk2);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    box-shadow: var(--sh1);
    margin: 4px 0;
    color: var(--txt2);
}

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

.preview-img picture,
.preview-img img {
    width: 100%;
    height: auto;
    border-radius: var(--rd2);
    display: block;
}

/* ===== DOWNLOAD BUTTONS ===== */
.dl-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.dl-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 22px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--rd2);
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, transform .15s, box-shadow .18s;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,120,242,.3);
}

.dl-action:hover {
    background: var(--accent2);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,120,242,.45);
}

.client-hint {
    text-align: center;
    padding: 7px;
    font-size: .80rem;
}

.client-hint a { color: var(--txt2); font-weight: 600; }
.client-hint a:hover { color: var(--cyan); }

/* ===== SHARE ROW ===== */
.share-row {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--dk3);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    padding: 8px 12px;
    margin: 4px 0;
    flex-wrap: wrap;
}

.share-row .sr-lbl { font-size: .75rem; color: var(--txt3); white-space: nowrap; }
.share-row .sr-url { font-size: .77rem; color: var(--txt2); flex: 1; min-width: 0; word-break: break-all; }

.share-row .sr-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 13px;
    background: var(--dk5);
    color: var(--txt);
    border: 1px solid var(--bdr2);
    border-radius: var(--rd2);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .16s;
    flex-shrink: 0;
}

.share-row .sr-btn:hover { background: var(--accent); border-color: var(--accent); }

/* ===== VIS HELPERS ===== */
.vis-pc { display: block; }
.vis-mb { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .media-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .vis-pc { display: none; }
    .vis-mb { display: block; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }

    .site-title { font-size: 1.04rem; }
    .domain-tag .dt-addr { font-size: .86rem; }

    .cat-row { align-items: stretch; }

    .zone-tag {
        width: 15%;
        min-width: 15%;
        max-width: 15%;
        font-size: 10px;
        padding: 4px 2px;
        letter-spacing: 0;
        line-height: 1.4;
        word-break: break-all;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .cat-links-box {
        width: 85%;
        flex: 1;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
        padding: 4px 4px;
        align-items: center;
    }

    .cat-links-box a {
        font-size: 12px;
        padding: 5px 2px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    /* Search stays on one row, no wrap */
    .search-bar form {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .search-bar input[type="text"] {
        height: 34px;
        font-size: .77rem;
        padding: 0 7px;
    }

    .search-bar button {
        height: 34px;
        padding: 0 7px;
        font-size: .72rem;
    }

    /* Film grid: 2 columns locked */
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }

    .media-thumb { aspect-ratio: 600 / 350; }
    .media-info h5 { font-size: .70rem; }
    .blk-sect { padding: 9px 9px 7px; }
    .dl-action { padding: 9px 13px; font-size: .82rem; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .zone-tag { font-size: 10px; }
    .cat-links-box a { font-size: 13px; }
}

@media (max-width: 380px) {
    .zone-tag { font-size: 10px; }
    .cat-links-box a { font-size: 12px; }
    .search-bar button { padding: 0 5px; font-size: .65rem; }
}
