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

:root {
    --primary: #1a2d6b;
    --primary-dk: #111e4a;
    --primary-mid: #243580;
    --primary-light: #e8ecf8;
    --accent: #c8102e;
    --accent-dk: #a00d25;
    --accent-bg: #fdf0f2;
    --gold: #d4a017;
    --surface: #ffffff;
    --surface-dim: #f4f6fb;
    --surface-muted: #eaecf5;
    --text-main: #111827;
    --text-sub: #374151;
    --text-muted: #8a94b0;
    --border: #dde2f0;
    --border-dk: #c5cce6;
    --shadow-sm: 0 1px 3px rgba(26,45,107,.08);
    --shadow-md: 0 3px 10px rgba(26,45,107,.12);
    --shadow-lg: 0 6px 22px rgba(26,45,107,.16);
    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 10px;
}

html { font-size: 15px; }

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

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

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

/* ===== SITE HEADER ===== */
.site-header {
    background: var(--primary);
    border-bottom: 3px solid var(--accent);
    padding: 10px 0;
}

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

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

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

.brand-name {
    font-size: 1.38rem;
    font-weight: 800;
    color: #ffffff;
    font-style: normal;
    letter-spacing: -.3px;
    text-decoration: none;
    border-bottom: none;
}

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

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

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

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

/* ===== CATEGORY NAV ===== */
.cat-nav-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 4px 0;
    box-shadow: var(--shadow-sm);
}

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

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

.cat-row-label {
    background: var(--primary);
    color: rgba(255,255,255,.85);
    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,.1);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

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

.cat-links-area a {
    font-size: .82rem;
    color: var(--text-sub);
    padding: 4px 5px;
    border-radius: var(--radius-sm);
    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-area a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #b8c3e8;
}

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

/* ===== SEARCH BAR ===== */
.search-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin: 4px 0;
    box-shadow: var(--shadow-sm);
}

.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: 36px;
    border: 1.5px solid var(--border-dk);
    border-radius: var(--radius-sm);
    padding: 0 11px;
    font-size: .88rem;
    color: var(--text-main);
    background: var(--surface-dim);
    outline: none;
    transition: border-color .2s;
}

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

.search-wrap button {
    height: 36px;
    padding: 0 13px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s;
    flex-shrink: 0;
}

.search-wrap button:hover { background: var(--primary-mid); }

.search-wrap button[value="1"] { background: var(--accent); }
.search-wrap button[value="1"]:hover { background: var(--accent-dk); }

.search-wrap button[value="2"] { background: var(--gold); }
.search-wrap button[value="2"]:hover { background: #a67c00; }

/* ===== HOT TAGS ===== */
.trending-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
    margin: 4px 0;
    box-shadow: var(--shadow-sm);
}

.trending-block h4 {
    font-size: .78rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

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

.tag-row .tag-item {
    display: inline-block;
    background: var(--surface-dim);
    color: var(--text-sub);
    border: 1px solid var(--border-dk);
    border-radius: 3px;
    padding: 2px 10px;
    font-size: .76rem;
    text-decoration: none;
    transition: all .16s;
}

.tag-row .tag-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #b0bce5;
}

/* ===== CONTENT SECTIONS ===== */
.content-module {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 12px 10px;
    margin: 4px 0;
    box-shadow: var(--shadow-sm);
}

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

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

.module-header h3 {
    font-size: .97rem;
    font-weight: 800;
    color: var(--primary);
}

.module-header h3 a { color: var(--primary); }
.module-header h3 a:hover { color: var(--accent); }

.module-header h4 {
    font-size: .95rem;
    font-weight: 800;
    color: var(--primary);
}

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

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

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

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

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

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

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

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

.movie-info h5 a { color: var(--text-main); }
.movie-info h5 a:hover { color: var(--accent); }

/* ===== PAGINATION ===== */
.pagination-wrap {
    margin: 13px 0 5px;
    display: flex;
    justify-content: center;
}

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

.page-controls a.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--surface);
    border: 1.5px solid var(--border-dk);
    border-radius: var(--radius-sm);
    font-size: .84rem;
    color: var(--text-sub);
    text-decoration: none;
    transition: all .16s;
}

.page-controls a.pg-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.page-controls a.pg-btn-active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: .84rem;
    font-weight: 700;
    color: #fff;
    cursor: default;
}

/* ===== FOOTER ===== */
.footer-links-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 13px;
    margin: 4px 0;
    box-shadow: var(--shadow-sm);
}

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

.friend-links dd { display: inline; }

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

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

.copyright-bar {
    text-align: center;
    padding: 8px 0 13px;
    color: var(--text-muted);
    font-size: .76rem;
}

/* ===== DETAIL PAGE ===== */
.detail-title {
    line-height: 1.8;
    text-align: center;
    padding: 12px 15px;
    font-size: .97rem;
    margin: 4px 0;
    word-break: break-all;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

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

.detail-meta {
    font-size: .9rem;
    line-height: 1.95;
    padding: 14px 17px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin: 4px 0;
}

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

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

/* ===== ACTION 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: 10px 22px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, transform .15s;
    text-decoration: none;
}

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

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

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

/* ===== SHARE BAR ===== */
.share-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--surface-dim);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 13px;
    margin: 4px 0;
    flex-wrap: wrap;
}

.share-bar .share-label { font-size: .77rem; color: var(--text-muted); white-space: nowrap; }
.share-bar .share-url { font-size: .79rem; color: var(--text-sub); flex: 1; min-width: 0; word-break: break-all; }

.share-bar .share-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 13px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s;
    flex-shrink: 0;
}

.share-bar .share-copy-btn:hover { background: var(--accent); }

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

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

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

    .brand-name { font-size: 1.05rem; }
    .domain-badge .badge-val { font-size: .88rem; }

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

    .cat-row-label {
        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;
    }

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

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

    .search-wrap form {
        flex-wrap: nowrap;
        gap: 4px;
    }

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

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

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

    .movie-cover { aspect-ratio: 600 / 350; }
    .movie-info h5 { font-size: .72rem; }
    .content-module { padding: 9px 9px 7px; }
    .act-btn { padding: 9px 14px; font-size: .84rem; }
}

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

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