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

:root {
    --surface: #ffffff;
    --surface-dim: #f4f3fa;
    --surface-mute: #ebe9f5;
    --purple: #3a1a7a;
    --purple-dk: #2a1058;
    --purple-mid: #5230a8;
    --purple-light: #6a48c8;
    --amber: #f0a500;
    --amber-dk: #c88000;
    --amber-bg: #fff8e6;
    --violet: #4b2095;
    --body-txt: #1c1830;
    --muted-txt: #5a5470;
    --faint-txt: #9890b8;
    --divider: #e0ddf0;
    --divider2: #ccc8e4;
    --shade1: 0 1px 4px rgba(58,26,122,.08);
    --shade2: 0 3px 14px rgba(58,26,122,.13);
    --shade3: 0 6px 26px rgba(58,26,122,.18);
    --rad: 8px;
    --rad-sm: 5px;
    --rad-lg: 14px;
}

html { font-size: 15px; }

body {
    background: var(--surface-dim);
    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 .18s; }
a:hover { color: var(--amber-dk); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
.cf::after { content: ''; display: table; clear: both; }

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

/* ===== SITE HEADER ===== */
.site-top {
    background: var(--purple);
    border-bottom: 3px solid var(--amber);
    padding: 10px 0;
    box-shadow: var(--shade2);
}

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

.brand-row {
    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.36rem;
    font-weight: 900;
    color: var(--amber);
    letter-spacing: -.3px;
    border-bottom: none;
    text-decoration: none;
    font-style: normal;
}

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

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

.domain-badge .badge-url {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--amber);
    white-space: nowrap;
}

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

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

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

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

.zone-tag {
    background: var(--purple);
    color: rgba(255,255,255,.85);
    font-size: .68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 2px;
    width: 64px;
    min-width: 64px;
    border-right: 2px solid var(--amber);
    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: 4px 8px;
    gap: 3px;
    flex: 1;
}

.cat-links a {
    font-size: .82rem;
    color: var(--muted-txt);
    padding: 3px 6px;
    border-radius: var(--rad-sm);
    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(--amber-bg);
    color: var(--amber-dk);
    border-color: #f5d080;
}

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

/* ===== SEARCH BLOCK ===== */
.search-panel {
    background: var(--surface);
    border: 1.5px solid var(--divider);
    border-radius: var(--rad);
    padding: 8px 12px;
    margin: 4px 0;
    box-shadow: var(--shade1);
}

.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(--divider2);
    border-radius: var(--rad-sm);
    padding: 0 12px;
    font-size: .88rem;
    color: var(--body-txt);
    background: var(--surface-dim);
    outline: none;
    transition: border-color .2s;
}

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

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

.search-panel button:hover { background: var(--purple-mid); }

.search-panel button[value="1"] { background: var(--amber); color: #1c1830; }
.search-panel button[value="1"]:hover { background: var(--amber-dk); color: #fff; }

.search-panel button[value="2"] { background: var(--purple-light); }
.search-panel button[value="2"]:hover { background: var(--purple-mid); }

/* ===== HOT TAGS ===== */
.tag-block {
    background: var(--surface);
    border: 1.5px solid var(--divider);
    border-radius: var(--rad);
    padding: 7px 12px;
    margin: 4px 0;
    box-shadow: var(--shade1);
}

.tag-block h4 {
    font-size: .79rem;
    font-weight: 700;
    color: var(--purple);
    margin-bottom: 5px;
}

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

.tag-cloud .tc-item {
    display: inline-block;
    background: var(--surface-dim);
    color: var(--muted-txt);
    border: 1px solid var(--divider2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .76rem;
    text-decoration: none;
    transition: all .18s;
}

.tag-cloud .tc-item:hover {
    background: var(--amber-bg);
    color: var(--amber-dk);
    border-color: #f5d080;
}

/* ===== CONTENT SECTION ===== */
.content-block {
    background: var(--surface);
    border: 1.5px solid var(--divider);
    border-radius: var(--rad-lg);
    padding: 13px 13px 10px;
    margin: 5px 0;
    box-shadow: var(--shade1);
}

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

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

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

.block-head h3 a { color: var(--purple); }
.block-head h3 a:hover { color: var(--amber); }

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

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

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

.thumb-link {
    display: block;
    width: 100%;
    aspect-ratio: 600 / 350;
    overflow: hidden;
    background: var(--surface-mute);
}

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

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

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

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

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

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

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

.page-btns a.pb {
    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(--divider2);
    border-radius: var(--rad-sm);
    font-size: .84rem;
    color: var(--muted-txt);
    text-decoration: none;
    transition: all .18s;
}

.page-btns a.pb:hover {
    background: var(--amber-bg);
    border-color: var(--amber);
    color: var(--amber-dk);
}

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

/* ===== FOOTER ===== */
.flink-section {
    background: var(--surface);
    border: 1.5px solid var(--divider);
    border-radius: var(--rad);
    padding: 9px 13px;
    margin: 5px 0;
    box-shadow: var(--shade1);
}

.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(--faint-txt);
    padding: 2px 9px;
    border-radius: 4px;
    border: 1px solid var(--divider);
    background: var(--surface-dim);
    text-decoration: none;
    transition: all .18s;
}

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

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

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

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

.detail-info {
    font-size: .9rem;
    line-height: 1.95;
    padding: 15px 18px;
    background: var(--surface);
    border: 1.5px solid var(--divider);
    border-radius: var(--rad);
    box-shadow: var(--shade1);
    margin: 5px 0;
}

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

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

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

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

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

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

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

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

.share-strip .ss-lbl { font-size: .77rem; color: var(--faint-txt); white-space: nowrap; }
.share-strip .ss-url { font-size: .79rem; color: var(--muted-txt); flex: 1; min-width: 0; word-break: break-all; }

.share-strip .ss-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: var(--rad-sm);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s;
    flex-shrink: 0;
}

.share-strip .ss-btn:hover { background: var(--amber); color: #1c1830; }

/* ===== 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; }

    .site-title { font-size: 1.06rem; }
    .domain-badge .badge-url { font-size: .9rem; }

    /* Nav zone label 15%, links 85% */
    .cat-row { align-items: stretch; }

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

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

    /* Search row: 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 */
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }

    .thumb-link { aspect-ratio: 600 / 350; }
    .item-caption h5 { font-size: .72rem; }
    .content-block { padding: 9px 9px 7px; }
    .act-btn { padding: 9px 14px; font-size: .84rem; }
}

@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; }
    .search-panel button { padding: 0 5px; font-size: .68rem; }
}
