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

:root {
    --bg: #111318;
    --bg-card: #1a1d24;
    --bg-panel: #20232d;
    --bg-hover: #252933;
    --red: #e83030;
    --red-dk: #c01818;
    --red-glow: rgba(232,48,48,.18);
    --amber: #f5a623;
    --amber-dk: #d48a10;
    --txt: #f0f0f5;
    --txt2: #b0b0c0;
    --txt3: #6a6a80;
    --border: #2a2d38;
    --border2: #343744;
    --shadow1: 0 1px 5px rgba(0,0,0,.35);
    --shadow2: 0 3px 14px rgba(0,0,0,.5);
    --shadow3: 0 8px 28px rgba(0,0,0,.65);
    --radius: 6px;
    --radius2: 4px;
    --radius3: 10px;
}

html { font-size: 15px; }

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

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

/* ===== PAGE WRAPPER ===== */
.site-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 14px;
}

/* ===== SITE HEADER ===== */
.top-bar {
    background: #0d0f14;
    border-bottom: 2px solid var(--red);
    padding: 8px 0;
}

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

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

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

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

.domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 3px 13px;
}

.domain-badge .badge-label {
    font-size: 0.66rem;
    color: var(--txt3);
    white-space: nowrap;
}

.domain-badge .badge-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--amber);
    white-space: nowrap;
}

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

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

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

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

.zone-tag {
    background: var(--red);
    color: rgba(255,255,255,.9);
    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 rgba(0,0,0,.25);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

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

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

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

/* ===== SEARCH BAR ===== */
.qry-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
    margin: 3px 0;
    box-shadow: var(--shadow1);
}

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

.qry-bar input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 34px;
    border: 1px solid var(--border2);
    border-radius: var(--radius2);
    padding: 0 11px;
    font-size: .86rem;
    color: var(--txt);
    background: var(--bg);
    outline: none;
    transition: border-color .2s;
}

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

.qry-bar input[type="text"]:focus {
    border-color: var(--red);
    background: #0d0f14;
}

.qry-bar button {
    height: 34px;
    padding: 0 11px;
    border: none;
    border-radius: var(--radius2);
    background: var(--bg-panel);
    color: var(--txt2);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s, color .18s;
    flex-shrink: 0;
}

.qry-bar button:hover { background: var(--bg-hover); color: var(--txt); }

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

.qry-bar button[value="2"] { background: var(--amber); color: #111; }
.qry-bar button[value="2"]:hover { background: var(--amber-dk); color: #111; }

/* ===== HOT TAGS ===== */
.trending-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
    margin: 3px 0;
    box-shadow: var(--shadow1);
}

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

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

.tag-cloud .tc-item {
    display: inline-block;
    background: var(--bg-panel);
    color: var(--txt2);
    border: 1px solid var(--border2);
    border-radius: 16px;
    padding: 2px 10px;
    font-size: .74rem;
    text-decoration: none;
    transition: all .18s;
}

.tag-cloud .tc-item:hover {
    background: var(--red-glow);
    color: var(--red);
    border-color: rgba(232,48,48,.35);
}

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

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

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

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

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

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

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

.movie-grid li {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    transition: box-shadow .22s, transform .22s;
}

.movie-grid li:hover {
    box-shadow: var(--shadow3);
    transform: translateY(-2px);
    border-color: var(--border2);
}

.movie-cover {
    display: block;
    width: 100%;
    aspect-ratio: 600 / 350;
    overflow: hidden;
    background: #0d0f14;
}

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

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

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

.movie-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;
}

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

/* ===== 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.pn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    background: var(--bg-card);
    border: 1px solid var(--border2);
    border-radius: var(--radius2);
    font-size: .82rem;
    color: var(--txt2);
    text-decoration: none;
    transition: all .18s;
}

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

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

/* ===== FOOTER ===== */
.flink-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 13px;
    margin: 4px 0;
    box-shadow: var(--shadow1);
}

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

.flink-list dd { display: inline; }

.flink-list a {
    display: inline-block;
    font-size: .75rem;
    color: var(--txt3);
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    text-decoration: none;
    transition: all .18s;
}

.flink-list a:hover { color: var(--red); border-color: var(--red); }

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

/* ===== DETAIL TITLE ===== */
.entry-title {
    line-height: 1.75;
    text-align: center;
    padding: 12px 15px;
    font-size: .96rem;
    margin: 4px 0;
    word-break: break-all;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    border-radius: var(--radius);
    box-shadow: var(--shadow1);
}

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

/* ===== TORRENT INFO ===== */
.entry-meta {
    font-size: .88rem;
    line-height: 2;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow1);
    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(--radius2);
    display: block;
}

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

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

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

.client-tip {
    text-align: center;
    padding: 6px;
    font-size: .8rem;
}

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

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

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

.share-strip .s-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 13px;
    background: var(--bg-hover);
    color: var(--txt2);
    border: 1px solid var(--border2);
    border-radius: var(--radius2);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, color .18s;
    flex-shrink: 0;
}

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

/* ===== VISIBILITY HELPERS ===== */
.desktop-only { display: block; }
.mobile-only { display: none; }

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

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

    .site-title { font-size: 1.05rem; }
    .domain-badge .badge-val { font-size: .9rem; }

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

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

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

    /* Search: single row, no wrap */
    .qry-bar form {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .qry-bar input[type="text"] {
        height: 32px;
        font-size: .77rem;
        padding: 0 6px;
    }

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

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

    .movie-cover { aspect-ratio: 600 / 350; }
    .movie-info h5 { font-size: .70rem; }
    .content-block { padding: 8px 8px 6px; }
    .action-btn { padding: 9px 14px; font-size: .83rem; }
}

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

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