/* ============================================
   影视站模板 — 青绿科技风格
   ============================================ */

:root {
    --tc-primary: #00b38a;
    --tc-primary-dark: #009474;
    --tc-primary-light: #00d4a0;
    --tc-header-bg: #1d2d3c;
    --tc-page-bg: #edf7f4;
    --tc-white: #ffffff;
    --tc-card-bg: #ffffff;
    --tc-text: #333333;
    --tc-text-sub: #666666;
    --tc-text-light: #999999;
    --tc-border: #d8ede7;
    --tc-section-bg: #f0faf6;
    --tc-tag-bg: #e0f5ee;
    --tc-tag-text: #00956e;
    --tc-footer-bg: #1d2d3c;
    --tc-footer-text: #8aa8a0;
    --rd-sm: 4px;
    --rd-md: 8px;
    --sh-sm: 0 1px 4px rgba(0,0,0,0.07);
    --fn: 'PingFang SC','Microsoft YaHei','Hiragino Sans GB',sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--fn);
    background: var(--tc-page-bg);
    color: var(--tc-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--tc-primary); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ============================================
   布局容器
   ============================================ */

.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 14px;
}

.clearfix::after { content: ''; display: table; clear: both; }

/* ============================================
   顶部品牌栏
   ============================================ */

.g-header {
    background: var(--tc-header-bg);
    color: #fff;
    padding: 9px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.g-header .page-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

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

.g-site-name {
    font-size: 24px;
    font-weight: 900;
    color: var(--tc-primary-light);
    font-style: normal;
    text-decoration: none;
    border-bottom: none;
    line-height: 1;
    white-space: nowrap;
}

.g-site-name:hover { color: var(--tc-primary-light); }

.g-domain-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,179,138,0.18);
    border: 1px solid rgba(0,179,138,0.35);
    border-radius: 20px;
    padding: 3px 13px;
    white-space: nowrap;
}

.g-domain-box .d-lbl {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
}

.g-domain-box .d-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--tc-primary-light);
}

/* ============================================
   横幅（不设 margin/padding）
   ============================================ */

.g-banner-row { background: var(--tc-page-bg); margin-bottom: 4px; }

/* ============================================
   栏目导航
   ============================================ */

.g-nav-panel {
    background: var(--tc-white);
    border-bottom: 2px solid var(--tc-border);
    box-shadow: var(--sh-sm);
    margin-bottom: 5px;
}

.nav-cat-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #ecf7f2;
    min-height: 38px;
}

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

.nav-zone-tag {
    background: var(--tc-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    min-width: 46px;
    flex-shrink: 0;
    text-align: center;
    line-height: 1.3;
    word-break: break-all;
}

.nav-cat-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    flex: 1;
}

.nav-cat-list a {
    font-size: 13px;
    color: var(--tc-text);
    padding: 7px 11px;
    display: inline-block;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}

.nav-cat-list a:hover,
.nav-cat-list a.active {
    background: var(--tc-primary);
    color: #fff;
}

/* ============================================
   搜索区
   ============================================ */

.g-search-bar {
    background: var(--tc-white);
    padding: 8px 0;
    margin-bottom: 5px;
    box-shadow: var(--sh-sm);
}

.search-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
}

.search-row form {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    flex-wrap: nowrap;
    min-width: 0;
}

.search-row input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 2px solid var(--tc-primary);
    border-radius: var(--rd-sm);
    padding: 0 12px;
    font-size: 13px;
    font-family: var(--fn);
    color: var(--tc-text);
    background: #f8fffe;
    outline: none;
    transition: border-color 0.2s;
}

.search-row input[type="text"]:focus {
    border-color: var(--tc-primary-dark);
    background: #fff;
}

.search-row button {
    height: 36px;
    padding: 0 11px;
    background: var(--tc-primary);
    color: #fff;
    border: none;
    border-radius: var(--rd-sm);
    font-size: 12px;
    font-family: var(--fn);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}

.search-row button:hover { background: var(--tc-primary-dark); }

/* ============================================
   热搜标签
   ============================================ */

.g-hot-row {
    background: var(--tc-white);
    padding: 7px 0;
    margin-bottom: 5px;
    box-shadow: var(--sh-sm);
}

.hot-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.hot-inner strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--tc-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.hot-kws {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.hot-kws a {
    font-size: 12px;
    color: var(--tc-tag-text);
    background: var(--tc-tag-bg);
    border: 1px solid #c5e9de;
    border-radius: 2px;
    padding: 2px 8px;
    transition: all 0.15s;
}

.hot-kws a:hover {
    background: var(--tc-primary);
    color: #fff;
    border-color: var(--tc-primary);
}

/* ============================================
   内容区块
   ============================================ */

.g-content { padding: 4px 0; }

.film-blk {
    background: var(--tc-card-bg);
    margin-bottom: 6px;
    border-radius: var(--rd-md);
    overflow: hidden;
    box-shadow: var(--sh-sm);
}

.film-blk-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    background: var(--tc-section-bg);
    border-bottom: 2px solid var(--tc-primary);
}

.film-blk-hd h3.blk-title,
.film-blk-hd h4.blk-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--tc-text);
    padding-left: 10px;
    position: relative;
}

.film-blk-hd h3.blk-title::before,
.film-blk-hd h4.blk-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 15px;
    background: var(--tc-primary);
    border-radius: 2px;
}

.film-blk-hd h3.blk-title a,
.film-blk-hd h4.blk-title a { color: var(--tc-text); }
.film-blk-hd h3.blk-title a:hover,
.film-blk-hd h4.blk-title a:hover { color: var(--tc-primary); }

/* 影片网格 */
.film-list-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px 14px;
}

/* 关键修复：grid 子项必须有 min-width:0 才能正确收缩，防止图片撑破列宽 */
.film-card {
    position: relative;
    min-width: 0;
}

.film-cover {
    display: block;
    overflow: hidden;
    border-radius: var(--rd-sm);
    background: #c8e8e0;
    aspect-ratio: 600 / 350;
    /* 确保容器本身不超出格子宽度 */
    width: 100%;
}

.film-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 防止图片原始尺寸撑破容器 */
    max-width: 100%;
    display: block;
    transition: transform 0.3s;
}

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

.film-info { padding: 5px 2px 2px; }

.film-info h5 {
    font-size: 12px;
    font-weight: 500;
    color: var(--tc-text);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.film-info h5 a:hover { color: var(--tc-primary); }

/* ============================================
   详情页
   ============================================ */

.detail-hd {
    background: var(--tc-white);
    border-left: 4px solid var(--tc-primary);
    padding: 11px 15px;
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.7;
    word-break: break-all;
    box-shadow: var(--sh-sm);
    border-radius: 0 var(--rd-sm) var(--rd-sm) 0;
}

.detail-hd .cat-ref {
    color: var(--tc-primary);
    font-weight: 700;
    margin-right: 8px;
}

.detail-body {
    background: var(--tc-white);
    padding: 16px 18px;
    margin-bottom: 6px;
    border-radius: var(--rd-md);
    font-size: 14px;
    line-height: 2;
    box-shadow: var(--sh-sm);
}

.cap-img-box { margin-top: 12px; }
.cap-img-box picture { display: block; width: 100%; }
.cap-img-box picture img {
    width: 100%;
    height: auto;
    border-radius: var(--rd-sm);
}

/* 播放器 */
.player-container {
    background: #000;
    margin-bottom: 6px;
    border-radius: var(--rd-sm);
    overflow: hidden;
}

/* 下载按钮组 */
.btn-group-dl {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    flex-wrap: wrap;
}

.btn-dl {
    display: inline-block;
    padding: 9px 22px;
    background: var(--tc-primary);
    color: #fff;
    border: none;
    border-radius: var(--rd-sm);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--fn);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-align: center;
}

.btn-dl:hover { background: var(--tc-primary-dark); color: #fff; transform: translateY(-1px); }

.bt-client-pc, .bt-client-mobile {
    text-align: center;
    padding: 8px 14px;
    font-size: 13px;
}

.bt-client-pc a, .bt-client-mobile a {
    color: var(--tc-primary);
    font-weight: 600;
}

/* ============================================
   分享面板
   ============================================ */

.share-row {
    background: var(--tc-white);
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: var(--rd-sm);
    box-shadow: var(--sh-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-url-area {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.share-url-area .s-lbl {
    font-size: 12px;
    color: var(--tc-text-sub);
    white-space: nowrap;
    flex-shrink: 0;
}

.share-url-area .s-val {
    font-size: 12px;
    color: var(--tc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.btn-share-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--tc-primary);
    color: #fff;
    border: none;
    border-radius: var(--rd-sm);
    font-size: 12px;
    font-family: var(--fn);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}

.btn-share-copy:hover { background: var(--tc-primary-dark); }

/* ============================================
   分页
   ============================================ */

.g-pager-wrap {
    margin: 10px 0 5px;
    display: flex;
    justify-content: center;
}

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

.pg-row a, .pg-row .pg-cur {
    display: inline-block;
    min-width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: var(--rd-sm);
    font-size: 13px;
    padding: 0 6px;
}

.pg-row a {
    background: var(--tc-white);
    color: var(--tc-text);
    border: 1px solid var(--tc-border);
    transition: all 0.15s;
}

.pg-row a:hover {
    background: var(--tc-primary);
    color: #fff;
    border-color: var(--tc-primary);
}

.pg-row .pg-cur {
    background: var(--tc-primary);
    color: #fff;
    border: 1px solid var(--tc-primary);
    font-weight: 700;
}

/* ============================================
   友情链接
   ============================================ */

.g-flinks {
    background: var(--tc-white);
    padding: 8px 14px;
    margin-bottom: 5px;
    box-shadow: var(--sh-sm);
}

.g-flinks .flinks-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--tc-text-sub);
    margin-bottom: 7px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--tc-border);
}

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

.flinks-list dd { margin: 0; }

.flinks-list a.fl-item {
    display: inline-block;
    font-size: 12px;
    color: var(--tc-text-sub);
    background: var(--tc-tag-bg);
    border: 1px solid #c5e9de;
    padding: 2px 10px;
    border-radius: 2px;
    transition: all 0.15s;
}

.flinks-list a.fl-item:hover {
    background: var(--tc-primary);
    color: #fff;
    border-color: var(--tc-primary);
}

/* ============================================
   页脚
   ============================================ */

.g-footer {
    background: var(--tc-footer-bg);
    padding: 14px 0;
    margin-top: 6px;
}

.footer-txt {
    text-align: center;
    font-size: 12px;
    color: var(--tc-footer-text);
    line-height: 1.9;
}

/* ============================================
   显示切换
   ============================================ */

.only-pc { display: block; }
.only-mb { display: none; }

.cnt-badge {
    font-size: 12px;
    font-weight: 400;
    color: var(--tc-text-light);
    margin-left: 6px;
}

/* ============================================
   响应式 — ≤768px 大屏手机
   ============================================ */

@media (max-width: 768px) {
    .only-pc { display: none; }
    .only-mb { display: block; }

    .page-wrap { padding: 0 9px; }

    .g-site-name { font-size: 18px; }
    .g-domain-box .d-val { font-size: 13px; }

    /* 导航：分区标签15%，链接区85%，每行4列 */
    .nav-zone-tag {
        font-size: 10px;
        width: 15%;
        min-width: 36px;
        padding: 0 3px;
    }

    .nav-cat-list {
        width: 85%;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .nav-cat-list a {
        font-size: 13px;
        padding: 5px 3px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 搜索同行不换行 */
    .search-row { flex-wrap: nowrap; }
    .search-row form { flex-wrap: nowrap; }

    .search-row input[type="text"] { height: 32px; font-size: 12px; }
    .search-row button { height: 32px; font-size: 11px; padding: 0 7px; }

    /* 影片2列 — 核心修复 */
    .film-list-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 8px 9px;
    }

    /* 每个卡片不得超出列宽 */
    .film-card {
        min-width: 0;
        width: 100%;
        overflow: hidden;
    }

    /* 封面图容器固定在列宽内，图片不撑破 */
    .film-cover {
        width: 100%;
        max-width: 100%;
    }

    .film-cover img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        object-fit: cover;
    }

    .detail-hd { font-size: 13px; padding: 9px 11px; }
    .detail-body { font-size: 13px; padding: 11px; }

    .btn-dl { padding: 8px 15px; font-size: 13px; }

    .pg-row a, .pg-row .pg-cur {
        min-width: 28px; height: 28px; line-height: 28px; font-size: 12px;
    }
}

/* ============================================
   响应式 — ≤480px 小屏手机
   ============================================ */

@media (max-width: 480px) {
    .g-site-name { font-size: 16px; }
    .g-domain-box .d-val { font-size: 12px; }
    .g-domain-box { padding: 2px 8px; }

    .nav-zone-tag { font-size: 10px; width: 15%; min-width: 32px; }
    .nav-cat-list a { font-size: 12px; padding: 5px 2px; }

    .search-row input[type="text"] { height: 30px; font-size: 11px; }
    .search-row button { height: 30px; font-size: 11px; padding: 0 6px; }

    .film-info h5 { font-size: 11px; }
    .btn-dl { padding: 7px 11px; font-size: 12px; }
    .btn-group-dl { gap: 7px; }
}

/* ============================================
   响应式 — ≥769px PC端
   ============================================ */

@media (min-width: 769px) {
    .nav-cat-row { min-height: 40px; }

    .nav-zone-tag {
        font-size: 13px;
        min-width: 72px;
        padding: 0 10px;
    }

    .nav-cat-list {
        display: flex;
        flex-wrap: nowrap;
    }

    .nav-cat-list a {
        flex: 1;
        font-size: 14px;
        padding: 8px 6px;
        text-align: center;
    }
}
