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

:root {
    --surface: #ffffff;
    --surface-warm: #faf8f5;
    --surface-muted: #f2ede6;
    --amber: #e8680a;
    --amber-deep: #c85507;
    --amber-pale: #fdf0e8;
    --amber-mid: #f07030;
    --jade: #2e7d5a;
    --jade-dk: #1f5c40;
    --jade-lt: #3a9470;
    --gold: #c8900a;
    --body-txt: #1e1a14;
    --sub-txt: #524a3c;
    --mute-txt: #9a9080;
    --border: #e8e0d4;
    --border2: #d8cfc0;
    --sh1: 0 1px 3px rgba(80,50,10,.06);
    --sh2: 0 2px 10px rgba(80,50,10,.10);
    --sh3: 0 5px 20px rgba(80,50,10,.14);
    --rad: 6px;
    --rad2: 4px;
    --rad3: 10px;
}

html { font-size: 15px; }

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

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

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

/* ===== SITE HEADER ===== */
.site-header {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    padding: 8px 0;
    box-shadow: var(--sh1);
}

.site-header .page-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

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

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

.site-title-text {
    font-size: 1.28rem;
    font-weight: 800;
    color: var(--amber);
    font-style: normal;
    text-decoration: none;
    border-bottom: none;
    letter-spacing: -.3px;
}

.domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--jade);
    border-radius: 20px;
    padding: 3px 12px;
}

.domain-badge .badge-hint {
    font-size: 0.68rem;
    color: rgba(255,255,255,.65);
    white-space: nowrap;
}

.domain-badge .badge-url {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

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

/* ===== CATEGORY NAV ===== */
.cat-nav-box {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--rad);
    overflow: hidden;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

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

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

.zone-label {
    background: var(--jade);
    color: rgba(255,255,255,.85);
    font-size: .68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    width: 60px;
    min-width: 60px;
    border-right: 1px solid rgba(255,255,255,.12);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

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

.cat-links-wrap a {
    font-size: .82rem;
    color: var(--sub-txt);
    padding: 3px 5px;
    border-radius: var(--rad2);
    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-wrap a:hover {
    background: var(--amber-pale);
    color: var(--amber);
    border-color: #f0b890;
}

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

/* ===== SEARCH BAR ===== */
.search-wrap {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--rad);
    padding: 7px 11px;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

.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: 34px;
    border: 1.5px solid var(--border2);
    border-radius: var(--rad2);
    padding: 0 11px;
    font-size: .87rem;
    color: var(--body-txt);
    background: var(--surface-warm);
    outline: none;
    transition: border-color .18s;
}

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

.search-wrap button {
    height: 34px;
    padding: 0 11px;
    border: none;
    border-radius: var(--rad2);
    background: var(--jade);
    color: #fff;
    font-size: .80rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s;
    flex-shrink: 0;
}

.search-wrap button:hover { background: var(--jade-lt); }
.search-wrap button[value="1"] { background: var(--amber); }
.search-wrap button[value="1"]:hover { background: var(--amber-deep); }
.search-wrap button[value="2"] { background: var(--gold); }
.search-wrap button[value="2"]:hover { background: #a07008; }

/* ===== HOT TAGS ===== */
.tags-panel {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--rad);
    padding: 7px 11px;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

.tags-panel h4 {
    font-size: .78rem;
    font-weight: 700;
    color: var(--jade);
    margin-bottom: 5px;
}

.tag-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-items .tag-item {
    display: inline-block;
    background: var(--surface-warm);
    color: var(--sub-txt);
    border: 1px solid var(--border2);
    border-radius: 18px;
    padding: 2px 10px;
    font-size: .75rem;
    text-decoration: none;
    transition: all .16s;
}

.tag-items .tag-item:hover {
    background: var(--amber-pale);
    color: var(--amber);
    border-color: #f0b890;
}

/* ===== CONTENT SECTION ===== */
.content-block {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--rad3);
    padding: 12px 12px 9px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

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

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

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

.block-header h3 a { color: var(--jade); }
.block-header h3 a:hover { color: var(--amber); }

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

/* ===== 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(--rad);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-warm);
    transition: box-shadow .18s, transform .18s;
}

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

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

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

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

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

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

.media-info h5 a { color: var(--body-txt); }
.media-info h5 a:hover { color: var(--amber); }

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

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

.pager-btns a.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    background: var(--surface);
    border: 1.5px solid var(--border2);
    border-radius: var(--rad2);
    font-size: .82rem;
    color: var(--sub-txt);
    text-decoration: none;
    transition: all .16s;
}

.pager-btns a.pg-btn:hover {
    background: var(--amber-pale);
    border-color: var(--amber);
    color: var(--amber);
}

.pager-btns a.pg-btn-cur {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    background: var(--amber);
    border: 1.5px solid var(--amber);
    border-radius: var(--rad2);
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    cursor: default;
}

/* ===== FOOTER ===== */
.footer-links-box {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--rad);
    padding: 8px 12px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

.friend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.friend-links dd { display: inline; }

.friend-links a {
    display: inline-block;
    font-size: .76rem;
    color: var(--mute-txt);
    padding: 2px 9px;
    border-radius: 3px;
    border: 1px solid var(--border);
    background: var(--surface-warm);
    text-decoration: none;
    transition: all .16s;
}

.friend-links a:hover { color: var(--amber); border-color: var(--amber); }

.copyright-row {
    text-align: center;
    padding: 7px 0 12px;
    color: var(--mute-txt);
    font-size: .75rem;
}

/* ===== DETAIL PAGES ===== */
.detail-title-bar {
    line-height: 1.8;
    text-align: center;
    padding: 12px 14px;
    font-size: .97rem;
    margin: 4px 0;
    word-break: break-all;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-left: 4px solid var(--amber);
    border-radius: var(--rad);
    box-shadow: var(--sh1);
}

.detail-title-bar a {
    color: var(--amber);
    font-weight: 700;
    margin-right: 5px;
}

.detail-meta-block {
    font-size: .89rem;
    line-height: 1.95;
    padding: 14px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--rad);
    box-shadow: var(--sh1);
    margin: 4px 0;
}

.preview-frame {
    display: block;
    width: 100%;
    margin-top: 9px;
}

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

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

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 9px 20px;
    background: var(--jade);
    color: #fff;
    border: none;
    border-radius: var(--rad2);
    font-size: .89rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, transform .14s;
    text-decoration: none;
}

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

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

.client-hint a { color: var(--jade); font-weight: 600; }
.client-hint a:hover { color: var(--amber); }

/* ===== SHARE BAR ===== */
.share-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-warm);
    border: 1.5px solid var(--border);
    border-radius: var(--rad);
    padding: 7px 12px;
    margin: 4px 0;
    flex-wrap: wrap;
}

.share-row .share-label { font-size: .76rem; color: var(--mute-txt); white-space: nowrap; }
.share-row .share-link-text { font-size: .78rem; color: var(--sub-txt); flex: 1; min-width: 0; word-break: break-all; }

.share-row .share-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: var(--jade);
    color: #fff;
    border: none;
    border-radius: var(--rad2);
    font-size: .79rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s;
    flex-shrink: 0;
}

.share-row .share-copy-btn:hover { background: var(--amber); }

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

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .media-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-text { font-size: 1.04rem; }
    .domain-badge .badge-url { font-size: .86rem; }

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

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

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

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

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

    .search-wrap button {
        height: 32px;
        padding: 0 6px;
        font-size: .72rem;
    }

    /* Film grid: exactly 2 columns, ratio locked */
    .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; }
    .action-btn { padding: 8px 13px; font-size: .83rem; }
}

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

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