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

:root {
    --bg: #141414;
    --bg-soft: #1a1a1a;
    --bg-card: #202020;
    --bg-hover: #282828;
    --bg-muted: #2a2a2a;
    --red: #e8130c;
    --red-dk: #c41009;
    --red-glow: rgba(232,19,12,0.18);
    --gold: #f0a030;
    --gold-dk: #c87a10;
    --teal: #18b8a0;
    --txt: #f0f0f0;
    --txt2: #b8b8c8;
    --txt3: #686880;
    --line: #2e2e3a;
    --line2: #3a3a4a;
    --s1: 0 1px 6px rgba(0,0,0,.4);
    --s2: 0 3px 14px rgba(0,0,0,.5);
    --s3: 0 6px 28px rgba(0,0,0,.6);
    --r: 6px;
    --r2: 4px;
    --r3: 10px;
}

html { font-size: 15px; }

body {
    background: var(--bg);
    color: var(--txt);
    font-family: 'PingFang SC','Hiragino Sans GB','Microsoft YaHei','Helvetica Neue',Arial,sans-serif;
    line-height: 1.6;
}

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

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

/* ===== SITE HEADER ===== */
.site-topbar {
    background: #0d0d0d;
    border-bottom: 1px solid #2a0a08;
    padding: 8px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.5);
}

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

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

.brand-anchor {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--red);
    letter-spacing: -.3px;
    font-style: normal;
    text-decoration: none;
    border-bottom: none;
}

.domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1e0a08 0%, #2e1008 100%);
    border: 1px solid #4a1a10;
    border-radius: 20px;
    padding: 4px 14px;
}

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

.domain-tag .dt-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--gold);
    white-space: nowrap;
    letter-spacing: .3px;
}

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

/* ===== CATEGORY NAV ===== */
.cat-nav-wrap {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    margin: 3px 0;
    box-shadow: var(--s1);
}

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

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

.zone-badge {
    background: linear-gradient(180deg, #1e0e0c 0%, #160a08 100%);
    color: rgba(255,255,255,.65);
    font-size: .67rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    width: 60px;
    min-width: 60px;
    border-right: 1px solid #2a1210;
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

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

.cat-links-row a {
    font-size: .82rem;
    color: var(--txt2);
    padding: 4px 5px;
    border-radius: var(--r2);
    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-row a:hover {
    background: var(--red-glow);
    color: var(--red);
    border-color: rgba(232,19,12,.3);
}

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

/* ===== SEARCH ===== */
.search-strip {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 7px 11px;
    margin: 3px 0;
    box-shadow: var(--s1);
}

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

.search-strip input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 35px;
    border: 1px solid var(--line2);
    border-radius: var(--r2);
    padding: 0 11px;
    font-size: .87rem;
    color: var(--txt);
    background: var(--bg-muted);
    outline: none;
    transition: border-color .2s;
}

.search-strip input[type="text"]:focus {
    border-color: var(--red);
    background: var(--bg-soft);
}

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

.search-strip button {
    height: 35px;
    padding: 0 11px;
    border: none;
    border-radius: var(--r2);
    background: #2a2a3a;
    color: var(--txt2);
    font-size: .81rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s, color .18s;
    flex-shrink: 0;
}

.search-strip button:hover { background: #3a3a4a; color: #fff; }

.search-strip button[value="1"] { background: var(--red); color: #fff; }
.search-strip button[value="1"]:hover { background: var(--red-dk); }

.search-strip button[value="2"] { background: var(--gold); color: #111; }
.search-strip button[value="2"]:hover { background: var(--gold-dk); color: #fff; }

/* ===== HOT TAGS ===== */
.hotkey-block {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 6px 11px;
    margin: 3px 0;
    box-shadow: var(--s1);
}

.hotkey-block h4 {
    font-size: .77rem;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 5px;
}

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

.tag-row .kw-tag {
    display: inline-block;
    background: var(--bg-muted);
    color: var(--txt2);
    border: 1px solid var(--line2);
    border-radius: 16px;
    padding: 2px 10px;
    font-size: .75rem;
    text-decoration: none;
    transition: all .16s;
}

.tag-row .kw-tag:hover {
    background: var(--red-glow);
    color: var(--red);
    border-color: rgba(232,19,12,.3);
}

/* ===== CONTENT SECTION ===== */
.content-block {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r3);
    padding: 12px 12px 9px;
    margin: 4px 0;
    box-shadow: var(--s1);
}

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

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

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

.block-header h3 a { color: var(--txt); }
.block-header h3 a:hover { color: var(--red); }

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

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

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

.media-grid li:hover {
    box-shadow: var(--s3);
    transform: translateY(-2px);
}

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

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

.media-cover:hover img { transform: scale(1.06); }

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

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

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

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

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

.page-btn-row a.pb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 33px;
    height: 32px;
    padding: 0 9px;
    background: var(--bg-card);
    border: 1px solid var(--line2);
    border-radius: var(--r2);
    font-size: .83rem;
    color: var(--txt2);
    text-decoration: none;
    transition: all .16s;
}

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

.page-btn-row a.pb-cur {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 33px;
    height: 32px;
    padding: 0 9px;
    background: var(--red);
    border: 1px solid var(--red);
    border-radius: var(--r2);
    font-size: .83rem;
    font-weight: 700;
    color: #fff;
    cursor: default;
}

/* ===== FOOTER ===== */
.friendlinks-box {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 8px 12px;
    margin: 4px 0;
    box-shadow: var(--s1);
}

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

.fl-list dd { display: inline; }

.fl-list a {
    display: inline-block;
    font-size: .76rem;
    color: var(--txt3);
    padding: 2px 9px;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--bg-muted);
    text-decoration: none;
    transition: all .16s;
}

.fl-list a:hover { color: var(--red); border-color: rgba(232,19,12,.4); }

.copyright-bar {
    text-align: center;
    padding: 7px 0 13px;
    color: var(--txt3);
    font-size: .75rem;
}

/* ===== DETAIL PAGES ===== */
.detail-heading {
    line-height: 1.8;
    text-align: center;
    padding: 12px 14px;
    font-size: .96rem;
    margin: 4px 0;
    word-break: break-all;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--red);
    border-radius: var(--r);
    box-shadow: var(--s1);
    color: var(--txt);
}

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

.detail-meta {
    font-size: .89rem;
    line-height: 1.95;
    padding: 14px 17px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--s1);
    margin: 4px 0;
    color: var(--txt2);
}

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

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

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

.act-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 20px;
    background: var(--bg-muted);
    color: var(--txt);
    border: 1px solid var(--line2);
    border-radius: var(--r2);
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, transform .15s;
    text-decoration: none;
}

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

.dl-hint {
    text-align: center;
    padding: 6px;
    font-size: .81rem;
}

.dl-hint a { color: var(--gold); font-weight: 600; }
.dl-hint a:hover { color: var(--red); }

/* ===== SHARE BAR ===== */
.share-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-muted);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 7px 12px;
    margin: 4px 0;
    flex-wrap: wrap;
}

.share-row .sr-lbl { font-size: .76rem; color: var(--txt3); white-space: nowrap; }
.share-row .sr-url { font-size: .78rem; 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: 5px 13px;
    background: var(--bg-hover);
    color: var(--txt2);
    border: 1px solid var(--line2);
    border-radius: var(--r2);
    font-size: .79rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s, color .16s;
    flex-shrink: 0;
}

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

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

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

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

    .brand-title { font-size: 1.04rem; }
    .domain-tag .dt-val { font-size: .9rem; }

    /* Nav mobile: zone label 15%, links 85% */
    .cat-row { align-items: stretch; }

    .zone-badge {
        width: 15%;
        min-width: 15%;
        max-width: 15%;
        font-size: 10px;
        padding: 3px 1px;
        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: 2px;
        padding: 3px 4px;
        align-items: center;
    }

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

    /* Search: same row, no wrap */
    .search-strip form {
        flex-wrap: nowrap;
        gap: 3px;
    }

    .search-strip input[type="text"] {
        height: 33px;
        font-size: .78rem;
        padding: 0 6px;
    }

    .search-strip button {
        height: 33px;
        padding: 0 6px;
        font-size: .73rem;
    }

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

    .media-cover { aspect-ratio: 600 / 350; }
    .media-info h5 { font-size: .71rem; }
    .content-block { padding: 8px 8px 6px; }
    .act-btn { padding: 8px 13px; font-size: .83rem; }
}

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

@media (max-width: 380px) {
    .zone-badge { font-size: 10px; }
    .cat-links-row a { font-size: 12px; }
    .search-strip button { padding: 0 4px; font-size: .67rem; }
}
