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

:root {
    --bg: #f0ede6;
    --bg-card: #ffffff;
    --bg-soft: #f7f5f0;
    --bg-muted: #ece8e0;
    --ink: #111111;
    --ink2: #3a3a3a;
    --ink3: #888880;
    --yellow: #e8e44a;
    --yellow-dk: #ccc93a;
    --yellow-bg: #fafad0;
    --line: #dedad2;
    --line2: #ccc8be;
    --sh1: 0 1px 5px rgba(0,0,0,.06);
    --sh2: 0 3px 14px rgba(0,0,0,.09);
    --sh3: 0 6px 28px rgba(0,0,0,.13);
    --r: 10px;
    --r-sm: 6px;
    --r-lg: 16px;
    --r-pill: 24px;
}

html { font-size: 15px; }

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

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

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

/* ===== SITE HEADER ===== */
.top-bar {
    background: var(--bg-card);
    border-bottom: 1.5px solid var(--line);
    padding: 9px 0;
    box-shadow: var(--sh1);
}

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

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

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

.site-title-text {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--ink);
    letter-spacing: -.5px;
    font-style: normal;
    border-bottom: none;
    text-decoration: none;
}

.domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--yellow);
    border-radius: var(--r-pill);
    padding: 4px 14px;
}

.domain-tag .dtag-lbl {
    font-size: 0.67rem;
    color: rgba(0,0,0,.55);
    white-space: nowrap;
    font-weight: 600;
}

.domain-tag .dtag-url {
    font-size: 1.06rem;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
}

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

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

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

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

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

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

.nav-items-zone a {
    font-size: .82rem;
    color: var(--ink2);
    padding: 3px 6px;
    border-radius: var(--r-sm);
    transition: all .18s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid transparent;
    text-decoration: none;
    display: block;
}

.nav-items-zone a:hover {
    background: var(--yellow-bg);
    color: var(--ink);
    border-color: var(--yellow-dk);
}

.nav-items-zone a.active {
    background: var(--yellow);
    color: var(--ink);
    border-color: var(--yellow-dk);
    font-weight: 700;
}

/* ===== SEARCH ===== */
.search-panel {
    background: var(--bg-card);
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    padding: 8px 12px;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

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

.search-panel input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1.5px solid var(--line2);
    border-radius: var(--r-sm);
    padding: 0 12px;
    font-size: .88rem;
    color: var(--ink);
    background: var(--bg-soft);
    outline: none;
    transition: border-color .2s;
}

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

.search-panel button {
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid var(--ink);
    border-radius: var(--r-sm);
    background: var(--ink);
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all .18s;
    flex-shrink: 0;
}

.search-panel button:hover {
    background: var(--ink2);
    border-color: var(--ink2);
}

.search-panel button[value="1"] {
    background: var(--yellow);
    color: var(--ink);
    border-color: var(--yellow-dk);
}
.search-panel button[value="1"]:hover {
    background: var(--yellow-dk);
    border-color: var(--yellow-dk);
    color: var(--ink);
}

.search-panel button[value="2"] {
    background: var(--bg-card);
    color: var(--ink);
    border-color: var(--line2);
}
.search-panel button[value="2"]:hover {
    background: var(--bg-muted);
}

/* ===== HOT TAGS ===== */
.hot-terms {
    background: var(--bg-card);
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    padding: 7px 12px;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

.hot-terms h4 {
    font-size: .79rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 5px;
}

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

.terms-list .term-lnk {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--ink2);
    border: 1px solid var(--line2);
    border-radius: var(--r-pill);
    padding: 2px 10px;
    font-size: .76rem;
    text-decoration: none;
    transition: all .18s;
}

.terms-list .term-lnk:hover {
    background: var(--yellow);
    color: var(--ink);
    border-color: var(--yellow-dk);
}

/* ===== CONTENT SECTION ===== */
.content-section {
    background: var(--bg-card);
    border: 1.5px solid var(--line);
    border-radius: var(--r-lg);
    padding: 13px 13px 10px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

.sect-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg-muted);
    position: relative;
}

.sect-head::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 44px;
    height: 2px;
    background: var(--yellow);
    border-radius: 2px;
}

.sect-head h3 {
    font-size: .98rem;
    font-weight: 800;
    color: var(--ink);
}

.sect-head h3 a { color: var(--ink); }
.sect-head h3 a:hover { text-decoration: underline; }

.sect-head h4 {
    font-size: .95rem;
    font-weight: 800;
    color: var(--ink);
}

/* ===== 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(--r);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    transition: box-shadow .2s, transform .2s;
}

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

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

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

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

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

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

.media-caption h5 a { color: var(--ink); }
.media-caption h5 a:hover { text-decoration: underline; }

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

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

.pager-btns a.pb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--bg-card);
    border: 1.5px solid var(--line2);
    border-radius: var(--r-sm);
    font-size: .84rem;
    color: var(--ink2);
    text-decoration: none;
    transition: all .18s;
}

.pager-btns a.pb:hover {
    background: var(--yellow);
    border-color: var(--yellow-dk);
    color: var(--ink);
}

.pager-btns a.pb-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--ink);
    border: 1.5px solid var(--ink);
    border-radius: var(--r-sm);
    font-size: .84rem;
    font-weight: 700;
    color: #fff;
    cursor: default;
}

/* ===== FOOTER ===== */
.friends-bar {
    background: var(--bg-card);
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    padding: 9px 13px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

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

.flink-items dd { display: inline; }

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

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

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

/* ===== DETAIL PAGES ===== */
.dtl-heading {
    line-height: 1.8;
    text-align: center;
    padding: 13px 15px;
    font-size: .98rem;
    margin: 4px 0;
    word-break: break-all;
    background: var(--bg-card);
    border: 1.5px solid var(--line);
    border-left: 4px solid var(--yellow);
    border-radius: var(--r);
    box-shadow: var(--sh1);
}

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

.dtl-body {
    font-size: .9rem;
    line-height: 1.95;
    padding: 15px 18px;
    background: var(--bg-card);
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh1);
    margin: 4px 0;
}

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

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

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

.dl-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 22px;
    background: var(--ink);
    color: #fff;
    border: 2px solid var(--ink);
    border-radius: var(--r-sm);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.dl-item:hover {
    background: var(--yellow);
    color: var(--ink);
    border-color: var(--yellow-dk);
    transform: translateY(-1px);
}

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

.client-hint a { color: var(--ink); font-weight: 700; }
.client-hint a:hover { text-decoration: underline; }

/* ===== SHARE ===== */
.share-row {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--bg-soft);
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    padding: 8px 13px;
    margin: 4px 0;
    flex-wrap: wrap;
}

.share-row .sr-label { font-size: .77rem; color: var(--ink3); white-space: nowrap; }
.share-row .sr-url { font-size: .79rem; color: var(--ink2); 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(--ink);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
    flex-shrink: 0;
}

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

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

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

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

    .site-title-text { font-size: 1.06rem; }
    .domain-tag .dtag-url { font-size: .92rem; }

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

    .nav-zone-name {
        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;
        text-align: center;
    }

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

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

    /* Search: strictly no wrap */
    .search-panel form {
        flex-wrap: nowrap;
        gap: 4px;
    }

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

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

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

    .media-thumb { aspect-ratio: 600 / 350; }
    .media-caption h5 { font-size: .72rem; }
    .content-section { padding: 9px 9px 7px; }
    .dl-item { padding: 9px 14px; font-size: .84rem; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .nav-zone-name { font-size: 10px; }
    .nav-items-zone a { font-size: 13px; }
}

@media (max-width: 380px) {
    .nav-zone-name { font-size: 10px; }
    .nav-items-zone a { font-size: 12px; }
    .search-panel button { padding: 0 5px; font-size: .68rem; }
}
