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

:root {
    --bg: #ffffff;
    --bg-soft: #f5f5f5;
    --bg-muted: #ebebeb;
    --yellow: #ffe600;
    --yellow-dk: #e6cf00;
    --yellow-bg: #fffde0;
    --black: #111111;
    --black2: #222222;
    --green: #1a7a1a;
    --red: #cc0000;
    --txt: #111111;
    --txt2: #333333;
    --txt3: #888888;
    --bdr: #dddddd;
    --bdr2: #bbbbbb;
    --sh1: 0 1px 4px rgba(0,0,0,.08);
    --sh2: 0 3px 12px rgba(0,0,0,.13);
    --sh3: 0 6px 22px rgba(0,0,0,.18);
    --rad: 4px;
    --rad2: 3px;
    --rad3: 6px;
}

html { font-size: 15px; }

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

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

/* ===== WRAPPER ===== */
.outer-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

/* ===== SITE HEADER ===== */
.main-header {
    background: var(--yellow);
    border-bottom: 3px solid var(--black);
    padding: 8px 0;
}

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

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

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

.site-title-text {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--black);
    font-style: normal;
    letter-spacing: -1px;
    border-bottom: none;
    text-decoration: none;
    text-transform: uppercase;
}

.url-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--black);
    border-radius: 3px;
    padding: 4px 13px;
}

.url-tag .utag-lbl {
    font-size: 0.68rem;
    color: rgba(255,255,255,.65);
    white-space: nowrap;
}

.url-tag .utag-val {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--yellow);
    white-space: nowrap;
    letter-spacing: .2px;
}

/* ===== BANNER ===== */
.banner-strip {
    margin: 3px 0 2px;
}
.banner-strip img { width: 100%; border-radius: var(--rad); }

/* ===== CATEGORY NAV ===== */
.nav-box {
    background: var(--bg);
    border: 2px solid var(--black);
    border-radius: var(--rad);
    overflow: hidden;
    margin: 3px 0;
    box-shadow: 3px 3px 0 rgba(0,0,0,.15);
}

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

.nav-line:last-child { border-bottom: none; }

.zone-label {
    background: var(--black);
    color: var(--yellow);
    font-size: .68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 2px;
    width: 62px;
    min-width: 62px;
    border-right: 2px solid var(--black);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

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

.link-cells a {
    font-size: .82rem;
    color: var(--txt2);
    padding: 3px 6px;
    border-radius: var(--rad2);
    transition: all .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid transparent;
    text-decoration: none;
    display: block;
    font-weight: 500;
}

.link-cells a:hover {
    background: var(--yellow);
    color: var(--black);
    border-color: var(--yellow-dk);
    font-weight: 700;
}

.link-cells a.active {
    background: var(--yellow);
    color: var(--black);
    border-color: var(--black);
    font-weight: 800;
}

/* ===== SEARCH ===== */
.search-bar {
    background: var(--bg);
    border: 2px solid var(--black);
    border-radius: var(--rad);
    padding: 7px 11px;
    margin: 3px 0;
    box-shadow: 3px 3px 0 rgba(0,0,0,.15);
}

.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: 2px solid var(--bdr2);
    border-radius: var(--rad2);
    padding: 0 12px;
    font-size: .88rem;
    color: var(--txt);
    background: var(--bg-soft);
    outline: none;
    transition: border-color .15s;
}

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

.search-bar button {
    height: 36px;
    padding: 0 13px;
    border: 2px solid var(--black);
    border-radius: var(--rad2);
    background: var(--black);
    color: var(--yellow);
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
    flex-shrink: 0;
    letter-spacing: .2px;
}

.search-bar button:hover {
    background: var(--yellow);
    color: var(--black);
}

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

.search-bar button[value="2"] {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}
.search-bar button[value="2"]:hover { background: #a00000; border-color: #a00000; color: #fff; }

/* ===== HOT TAGS ===== */
.hot-tags-box {
    background: var(--bg);
    border: 2px solid var(--black);
    border-radius: var(--rad);
    padding: 7px 11px;
    margin: 3px 0;
    box-shadow: 3px 3px 0 rgba(0,0,0,.15);
}

.hot-tags-box h4 {
    font-size: .8rem;
    font-weight: 900;
    color: var(--black);
    margin-bottom: 5px;
    letter-spacing: .3px;
}

.tags-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tags-flow .tag-item {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--txt2);
    border: 1.5px solid var(--bdr2);
    border-radius: 3px;
    padding: 2px 10px;
    font-size: .76rem;
    text-decoration: none;
    transition: all .15s;
    font-weight: 500;
}

.tags-flow .tag-item:hover {
    background: var(--yellow);
    color: var(--black);
    border-color: var(--black);
    font-weight: 700;
}

/* ===== CONTENT SECTION ===== */
.content-block {
    background: var(--bg);
    border: 2px solid var(--black);
    border-radius: var(--rad3);
    padding: 12px 12px 10px;
    margin: 3px 0;
    box-shadow: 3px 3px 0 rgba(0,0,0,.12);
}

.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 3px solid var(--yellow);
}

.block-head h3 {
    font-size: 1rem;
    font-weight: 900;
    color: var(--black);
    letter-spacing: .3px;
}

.block-head h3 a { color: var(--black); }
.block-head h3 a:hover { color: var(--green); }

.block-head h4 {
    font-size: .96rem;
    font-weight: 900;
    color: var(--black);
}

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

.films-grid li {
    border-radius: var(--rad);
    overflow: hidden;
    border: 1.5px solid var(--bdr);
    background: var(--bg-soft);
    transition: box-shadow .18s, transform .18s;
}

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

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

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

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

.film-desc {
    padding: 5px 7px 6px;
    background: var(--bg);
}

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

.film-desc h5 a { color: var(--txt); }
.film-desc h5 a:hover { color: var(--green); }

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

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

.pg-row a.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--bg);
    border: 2px solid var(--black);
    border-radius: var(--rad2);
    font-size: .84rem;
    font-weight: 600;
    color: var(--black);
    text-decoration: none;
    transition: all .15s;
}

.pg-row a.pg-btn:hover {
    background: var(--yellow);
    color: var(--black);
}

.pg-row a.pg-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--black);
    border: 2px solid var(--black);
    border-radius: var(--rad2);
    font-size: .84rem;
    font-weight: 800;
    color: var(--yellow);
    cursor: default;
}

/* ===== FOOTER ===== */
.flink-section {
    background: var(--bg);
    border: 2px solid var(--black);
    border-radius: var(--rad);
    padding: 9px 12px;
    margin: 3px 0;
    box-shadow: 3px 3px 0 rgba(0,0,0,.12);
}

.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(--txt3);
    padding: 2px 9px;
    border-radius: 3px;
    border: 1px solid var(--bdr);
    background: var(--bg-soft);
    text-decoration: none;
    transition: all .15s;
}

.flink-list a:hover {
    color: var(--black);
    border-color: var(--black);
    background: var(--yellow);
}

.footer-cr {
    text-align: center;
    padding: 7px 0 13px;
    color: var(--txt3);
    font-size: .76rem;
}

/* ===== DETAIL PAGES ===== */
.item-title {
    line-height: 1.8;
    text-align: center;
    padding: 12px 15px;
    font-size: .98rem;
    margin: 3px 0;
    word-break: break-all;
    background: var(--yellow-bg);
    border: 2px solid var(--black);
    border-left: 5px solid var(--yellow);
    border-radius: var(--rad);
    box-shadow: 3px 3px 0 rgba(0,0,0,.12);
}

.item-title a {
    color: var(--black);
    font-weight: 800;
    margin-right: 6px;
}

.item-details {
    font-size: .9rem;
    line-height: 1.95;
    padding: 14px 17px;
    background: var(--bg);
    border: 2px solid var(--black);
    border-radius: var(--rad);
    box-shadow: 3px 3px 0 rgba(0,0,0,.12);
    margin: 3px 0;
}

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

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

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

.dl-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 22px;
    background: var(--black);
    color: var(--yellow);
    border: 2px solid var(--black);
    border-radius: var(--rad2);
    font-size: .9rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .18s, color .18s, transform .15s;
    text-decoration: none;
    letter-spacing: .3px;
}

.dl-action-btn:hover {
    background: var(--yellow);
    color: var(--black);
    transform: translateY(-1px);
}

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

.client-hint a { color: var(--black); font-weight: 700; }
.client-hint a:hover { color: var(--green); }

/* ===== SHARE ===== */
.share-row {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--yellow-bg);
    border: 2px solid var(--black);
    border-radius: var(--rad);
    padding: 7px 12px;
    margin: 3px 0;
    flex-wrap: wrap;
}

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

.share-row .row-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 13px;
    background: var(--black);
    color: var(--yellow);
    border: 2px solid var(--black);
    border-radius: var(--rad2);
    font-size: .8rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}

.share-row .row-btn:hover {
    background: var(--yellow);
    color: var(--black);
}

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

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

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

    .site-title-text { font-size: 1.08rem; }
    .url-tag .utag-val { font-size: .92rem; }

    .nav-line { align-items: stretch; }

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

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

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

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

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

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

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

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

@media (min-width: 481px) and (max-width: 768px) {
    .zone-label { font-size: 10px; }
    .link-cells a { font-size: 13px; }
}

@media (max-width: 380px) {
    .zone-label { font-size: 10px; }
    .link-cells a { font-size: 12px; }
    .search-bar button { padding: 0 5px; font-size: .68rem; }
}
