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

:root {
    --primary: #1565c0;
    --primary-dk: #0d47a1;
    --primary-lt: #1976d2;
    --accent: #ef5350;
    --accent-dk: #c62828;
    --accent-lt: #ffcdd2;
    --bg-main: #0f1923;
    --bg-card: #162032;
    --bg-panel: #1a2840;
    --bg-muted: #1e2e45;
    --surface: #243550;
    --surface2: #2c3e58;
    --txt-h: #e8f0fe;
    --txt-b: #b0bec5;
    --txt-m: #78909c;
    --txt-d: #455a64;
    --bdr: rgba(255,255,255,.08);
    --bdr2: rgba(255,255,255,.13);
    --glow: 0 0 0 1px rgba(21,101,192,.4);
    --shd1: 0 1px 4px rgba(0,0,0,.35);
    --shd2: 0 3px 12px rgba(0,0,0,.45);
    --shd3: 0 6px 24px rgba(0,0,0,.55);
    --rd: 7px;
    --rd2: 4px;
    --rd3: 10px;
    --gap: 4px;
}

html { font-size: 15px; scroll-behavior: smooth; }

body {
    background: var(--bg-main);
    color: var(--txt-b);
    font-family: 'PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .18s; }
a:hover { color: #ef9a9a; }
img { max-width: 100%; display: block; }
ul, dl { list-style: none; }
.clr::after { content: ''; display: table; clear: both; }

/* ===== WRAPPER ===== */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 14px;
}

/* ===== SITE HEADER ===== */
.site-topbar {
    background: linear-gradient(90deg, #0d2240 0%, #163562 50%, #0d2240 100%);
    border-bottom: 2px solid var(--primary);
    padding: 8px 0;
    box-shadow: 0 2px 16px rgba(21,101,192,.35);
}

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

.brand-wrap {
    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.38rem;
    font-weight: 900;
    color: #e3f2fd;
    letter-spacing: -.3px;
    font-style: normal;
    text-decoration: none;
    border-bottom: none;
    text-shadow: 0 0 18px rgba(100,181,246,.5);
}

.domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(100,181,246,.3);
    border-radius: 20px;
    padding: 4px 14px;
    backdrop-filter: blur(4px);
}

.domain-badge .db-tag {
    font-size: 0.68rem;
    color: rgba(179,229,252,.6);
    white-space: nowrap;
}

.domain-badge .db-addr {
    font-size: 1.05rem;
    font-weight: 800;
    color: #64b5f6;
    white-space: nowrap;
    letter-spacing: .3px;
}

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

/* ===== CATEGORY NAV ===== */
.cat-nav-box {
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    overflow: hidden;
    margin: var(--gap) 0;
    box-shadow: var(--shd1);
}

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

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

.zone-tag {
    background: var(--primary-dk);
    color: rgba(255,255,255,.75);
    font-size: .68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 2px;
    width: 64px;
    min-width: 64px;
    border-right: 1px solid rgba(255,255,255,.08);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .4px;
    flex-shrink: 0;
}

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

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

.cat-links-row a:hover {
    background: rgba(21,101,192,.25);
    color: #90caf9;
    border-color: rgba(21,101,192,.4);
}

.cat-links-row a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-lt);
    font-weight: 700;
}

/* ===== SEARCH BOX ===== */
.search-wrap {
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    padding: 8px 12px;
    margin: var(--gap) 0;
    box-shadow: var(--shd1);
}

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

.search-wrap input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1.5px solid var(--bdr2);
    border-radius: var(--rd2);
    padding: 0 12px;
    font-size: .88rem;
    color: var(--txt-h);
    background: var(--bg-muted);
    outline: none;
    transition: border-color .2s;
}

.search-wrap input[type="text"]::placeholder { color: var(--txt-d); }

.search-wrap input[type="text"]:focus {
    border-color: var(--primary-lt);
    background: var(--surface);
}

.search-wrap button {
    height: 36px;
    padding: 0 12px;
    border: none;
    border-radius: var(--rd2);
    background: var(--surface);
    color: var(--txt-h);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s;
    flex-shrink: 0;
}

.search-wrap button:hover { background: var(--surface2); }
.search-wrap button[value="1"] { background: var(--primary); color: #fff; }
.search-wrap button[value="1"]:hover { background: var(--primary-lt); }
.search-wrap button[value="2"] { background: #37474f; color: #b0bec5; }
.search-wrap button[value="2"]:hover { background: #455a64; }

/* ===== HOT TAGS ===== */
.hot-tags-box {
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    padding: 7px 12px;
    margin: var(--gap) 0;
    box-shadow: var(--shd1);
}

.hot-tags-box h4 {
    font-size: .79rem;
    font-weight: 700;
    color: var(--txt-h);
    margin-bottom: 5px;
}

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

.tag-cloud .tag-item {
    display: inline-block;
    background: var(--bg-muted);
    color: var(--txt-b);
    border: 1px solid var(--bdr2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .76rem;
    text-decoration: none;
    transition: all .18s;
}

.tag-cloud .tag-item:hover {
    background: rgba(21,101,192,.3);
    color: #90caf9;
    border-color: rgba(21,101,192,.5);
}

/* ===== CONTENT SECTIONS ===== */
.content-block {
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--rd3);
    padding: 13px 13px 10px;
    margin: var(--gap) 0;
    box-shadow: var(--shd1);
}

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

.block-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 40px;
    height: 2px;
    background: var(--primary-lt);
    border-radius: 2px;
}

.block-header h3 {
    font-size: .98rem;
    font-weight: 800;
    color: var(--txt-h);
}

.block-header h3 a { color: var(--txt-h); }
.block-header h3 a:hover { color: #64b5f6; }

.block-header h4 {
    font-size: .95rem;
    font-weight: 800;
    color: var(--txt-h);
}

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

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

.film-grid li:hover {
    box-shadow: var(--shd3);
    transform: translateY(-2px);
    border-color: rgba(21,101,192,.4);
}

.cover-link {
    display: block;
    width: 100%;
    aspect-ratio: 600 / 350;
    overflow: hidden;
    background: var(--surface);
}

.cover-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.cover-link:hover img { transform: scale(1.05); }

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

.film-info h5 {
    font-size: .78rem;
    font-weight: 500;
    color: var(--txt-b);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.film-info h5 a { color: var(--txt-b); }
.film-info h5 a:hover { color: #90caf9; }

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

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

.page-btns a.pbn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--bg-card);
    border: 1px solid var(--bdr2);
    border-radius: var(--rd2);
    font-size: .84rem;
    color: var(--txt-b);
    text-decoration: none;
    transition: all .18s;
}

.page-btns a.pbn:hover {
    background: rgba(21,101,192,.25);
    border-color: var(--primary-lt);
    color: #90caf9;
}

.page-btns a.pbn-cur {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--primary);
    border: 1px solid var(--primary-lt);
    border-radius: var(--rd2);
    font-size: .84rem;
    font-weight: 700;
    color: #fff;
    cursor: default;
}

/* ===== FOOTER ===== */
.footer-links-box {
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    padding: 9px 13px;
    margin: var(--gap) 0;
    box-shadow: var(--shd1);
}

.flink-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.flink-list dd { display: inline; }

.flink-list a {
    display: inline-block;
    font-size: .77rem;
    color: var(--txt-m);
    padding: 2px 9px;
    border-radius: 4px;
    border: 1px solid var(--bdr);
    background: var(--bg-muted);
    text-decoration: none;
    transition: all .18s;
}

.flink-list a:hover { color: #90caf9; border-color: rgba(21,101,192,.5); }

.cr-footer {
    text-align: center;
    padding: 8px 0 14px;
    color: var(--txt-d);
    font-size: .76rem;
}

/* ===== DETAIL PAGES ===== */
.detail-title {
    line-height: 1.8;
    text-align: center;
    padding: 13px 15px;
    font-size: .98rem;
    margin: var(--gap) 0;
    word-break: break-all;
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-left: 4px solid var(--primary-lt);
    border-radius: var(--rd);
    box-shadow: var(--shd1);
    color: var(--txt-h);
}

.detail-title a {
    color: #64b5f6;
    font-weight: 700;
    margin-right: 6px;
}

.detail-meta {
    font-size: .9rem;
    line-height: 1.95;
    padding: 15px 18px;
    background: var(--bg-card);
    border: 1px solid var(--bdr);
    border-radius: var(--rd);
    box-shadow: var(--shd1);
    margin: var(--gap) 0;
    color: var(--txt-b);
}

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

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

/* ===== ACTION BUTTONS ===== */
.action-btns {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.act-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 22px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--rd2);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s;
    text-decoration: none;
}

.act-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

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

.client-hint a { color: #64b5f6; font-weight: 600; }
.client-hint a:hover { color: #90caf9; }

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

.share-row .sr-label { font-size: .77rem; color: var(--txt-m); white-space: nowrap; }
.share-row .sr-url { font-size: .79rem; color: var(--txt-b); flex: 1; min-width: 0; word-break: break-all; }

.share-row .sr-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--rd2);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s;
    flex-shrink: 0;
}

.share-row .sr-btn:hover { background: var(--primary-lt); }

/* ===== VISIBILITY HELPERS ===== */
.pc-only { display: block; }
.mb-only { display: none; }

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

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

    .site-title { font-size: 1.06rem; }
    .domain-badge .db-addr { font-size: .9rem; }

    .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-row {
        width: 85%;
        flex: 1;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
        padding: 4px 5px;
        align-items: center;
    }

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

    .search-wrap form {
        flex-wrap: nowrap;
        gap: 4px;
    }

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

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

    .film-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }

    .cover-link { aspect-ratio: 600 / 350; }
    .film-info h5 { font-size: .72rem; }
    .content-block { padding: 9px 9px 7px; }
    .act-btn { padding: 9px 14px; font-size: .84rem; }
}

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

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