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

:root {
    --bg: #ffffff;
    --bg-warm: #fffdf5;
    --bg-soft: #f8f6ee;
    --bg-muted: #f0ede0;
    --yellow: #ffd000;
    --yellow-dk: #e8bb00;
    --yellow-lt: #fffce8;
    --yellow2: #ffca28;
    --blue: #3a6cf4;
    --blue-dk: #2856d4;
    --blue-lt: #eef2ff;
    --sky: #1ea7e8;
    --sky-lt: #e8f6fd;
    --green: #22a85a;
    --green-lt: #e8f8ee;
    --orange: #ff6b00;
    --orange-lt: #fff3e8;
    --txt: #1a1a1a;
    --txt2: #444444;
    --txt3: #999999;
    --border: #e8e4d8;
    --border2: #d8d4c4;
    --shadow1: 0 1px 6px rgba(180,160,80,.10);
    --shadow2: 0 3px 14px rgba(180,160,80,.14);
    --shadow3: 0 6px 24px rgba(180,160,80,.20);
    --radius: 10px;
    --radius2: 6px;
    --radius3: 24px;
}

html { font-size: 15px; }

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

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

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

/* ===== SITE HEADER ===== */
.fg-header {
    background: var(--bg);
    border-bottom: 2px solid var(--yellow);
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(255,208,0,.15);
}

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

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

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

/* Fliggy-style: bold rounded friendly name */
.fg-site-name {
    font-size: 1.42rem;
    font-weight: 900;
    color: var(--txt);
    font-style: normal;
    letter-spacing: -.3px;
    text-decoration: none;
    border-bottom: none;
}

.fg-domain-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--yellow);
    border-radius: var(--radius3);
    padding: 5px 16px;
    box-shadow: 0 2px 10px rgba(255,208,0,.35);
}

.fg-domain-pill .fd-tip {
    font-size: 0.67rem;
    color: rgba(0,0,0,.5);
    white-space: nowrap;
    letter-spacing: .4px;
}

.fg-domain-pill .fd-url {
    font-size: 1.08rem;
    font-weight: 800;
    color: #111111;
    white-space: nowrap;
    letter-spacing: .2px;
}

/* ===== BANNER ===== */
.fg-hero {
    margin: 5px 0 3px;
    border-radius: var(--radius);
    overflow: hidden;
}
.fg-hero img { border-radius: var(--radius); width: 100%; }

/* ===== CATEGORY NAV ===== */
.fg-nav-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 4px 0;
    box-shadow: var(--shadow1);
}

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

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

.fg-zone-lbl {
    background: var(--yellow-lt);
    color: var(--txt3);
    font-size: .66rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    width: 62px;
    min-width: 62px;
    border-right: 1px solid var(--border);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

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

.fg-zone-links a {
    font-size: .8rem;
    color: var(--txt2);
    padding: 4px 4px;
    border-radius: var(--radius2);
    transition: all .16s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1.5px solid transparent;
    text-decoration: none;
    display: block;
    font-weight: 500;
}

.fg-zone-links a:hover {
    background: var(--yellow-lt);
    color: var(--txt);
    border-color: #f0d840;
}

.fg-zone-links a.active {
    background: var(--yellow);
    color: #111;
    border-color: var(--yellow);
    font-weight: 700;
}

/* ===== SEARCH ===== */
.fg-search-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 13px;
    margin: 4px 0;
    box-shadow: var(--shadow1);
}

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

.fg-search-card input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1.5px solid var(--border2);
    border-radius: var(--radius3);
    padding: 0 16px;
    font-size: .87rem;
    color: var(--txt);
    background: var(--bg-soft);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    font-family: inherit;
}

.fg-search-card input[type="text"]:focus {
    border-color: var(--yellow-dk);
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(255,208,0,.15);
}

.fg-search-card button {
    height: 38px;
    padding: 0 13px;
    border: none;
    border-radius: var(--radius3);
    background: var(--txt2);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s, transform .12s;
    flex-shrink: 0;
    font-family: inherit;
}

.fg-search-card button:hover { background: var(--txt); transform: translateY(-1px); }

.fg-search-card button[value="1"] {
    background: var(--yellow);
    color: #111;
    box-shadow: 0 2px 8px rgba(255,208,0,.4);
}
.fg-search-card button[value="1"]:hover {
    background: var(--yellow-dk);
    box-shadow: 0 3px 12px rgba(255,208,0,.5);
}

.fg-search-card button[value="2"] {
    background: var(--sky);
    color: #fff;
}
.fg-search-card button[value="2"]:hover { background: #158bc8; }

/* ===== HOT TAGS ===== */
.fg-hot-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 13px;
    margin: 4px 0;
    box-shadow: var(--shadow1);
}

.fg-hot-card h4 {
    font-size: .75rem;
    font-weight: 700;
    color: var(--txt2);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fg-hot-card h4::before {
    content: '🔥';
    font-size: .82rem;
}

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

.fg-tag-row .fg-tag {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--txt2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius3);
    padding: 3px 12px;
    font-size: .74rem;
    text-decoration: none;
    transition: all .16s;
    font-weight: 500;
}

.fg-tag-row .fg-tag:hover {
    background: var(--yellow-lt);
    color: var(--txt);
    border-color: #f0d840;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255,208,0,.2);
}

/* ===== CONTENT SECTION ===== */
.fg-section {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 13px 10px;
    margin: 5px 0;
    box-shadow: var(--shadow1);
}

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

.fg-sec-hd::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 40px;
    height: 2px;
    background: var(--yellow);
    border-radius: 2px;
}

.fg-sec-hd h3 {
    font-size: .97rem;
    font-weight: 800;
    color: var(--txt);
}

.fg-sec-hd h3 a { color: var(--txt); }
.fg-sec-hd h3 a:hover { color: var(--blue); }

.fg-sec-hd h4 {
    font-size: .95rem;
    font-weight: 800;
    color: var(--txt);
}

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

.fg-grid li {
    border-radius: var(--radius2);
    overflow: hidden;
    border: 1.5px solid var(--border);
    background: var(--bg-soft);
    transition: box-shadow .2s, transform .2s;
}

.fg-grid li:hover {
    box-shadow: var(--shadow3);
    transform: translateY(-3px);
}

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

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

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

.fg-caption {
    padding: 6px 8px 8px;
    border-top: 1px solid var(--border);
}

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

.fg-caption h5 a { color: var(--txt); }
.fg-caption h5 a:hover { color: var(--blue); }

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

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

.fg-pager-row a.fp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--bg);
    border: 1.5px solid var(--border2);
    border-radius: var(--radius2);
    font-size: .82rem;
    color: var(--txt2);
    text-decoration: none;
    transition: all .16s;
    font-weight: 500;
}

.fg-pager-row a.fp-btn:hover {
    background: var(--yellow-lt);
    border-color: var(--yellow-dk);
    color: var(--txt);
}

.fg-pager-row a.fp-btn-on {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--yellow);
    border: 1.5px solid var(--yellow);
    border-radius: var(--radius2);
    font-size: .82rem;
    font-weight: 800;
    color: #111;
    cursor: default;
    box-shadow: 0 2px 8px rgba(255,208,0,.4);
}

/* ===== FOOTER ===== */
.fg-flink-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 13px;
    margin: 5px 0;
    box-shadow: var(--shadow1);
}

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

.fg-flinks dd { display: inline; }

.fg-flinks a {
    display: inline-block;
    font-size: .73rem;
    color: var(--txt3);
    padding: 2px 10px;
    border-radius: var(--radius3);
    border: 1.5px solid var(--border);
    background: var(--bg-soft);
    text-decoration: none;
    transition: all .16s;
}

.fg-flinks a:hover {
    color: var(--blue);
    border-color: #aac4f8;
    background: var(--blue-lt);
}

.fg-cr {
    text-align: center;
    padding: 8px 0 14px;
    color: var(--txt3);
    font-size: .73rem;
}

/* ===== DETAIL PAGES ===== */
.fg-dtl-title {
    line-height: 1.8;
    text-align: center;
    padding: 13px 16px;
    font-size: .97rem;
    margin: 5px 0;
    word-break: break-all;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-top: 4px solid var(--yellow);
    border-radius: var(--radius);
    box-shadow: var(--shadow1);
}

.fg-dtl-title a {
    color: var(--blue);
    font-weight: 700;
    margin-right: 6px;
    font-size: .82rem;
    background: var(--blue-lt);
    padding: 1px 8px;
    border-radius: var(--radius2);
}

.fg-dtl-info {
    font-size: .9rem;
    line-height: 2;
    padding: 15px 18px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow1);
    margin: 5px 0;
    color: var(--txt2);
}

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

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

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

.fg-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: var(--yellow);
    color: #111;
    border: none;
    border-radius: var(--radius3);
    font-size: .9rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .18s, transform .14s, box-shadow .18s;
    text-decoration: none;
    font-family: inherit;
    box-shadow: 0 3px 12px rgba(255,208,0,.4);
}

.fg-dl-btn:hover {
    background: var(--yellow-dk);
    color: #111;
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(255,208,0,.55);
}

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

.fg-cli-hint a { color: var(--sky); font-weight: 600; }
.fg-cli-hint a:hover { color: var(--blue); }

/* ===== SHARE ===== */
.fg-share-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--yellow-lt);
    border: 1.5px solid #f0e060;
    border-radius: var(--radius);
    padding: 8px 13px;
    margin: 5px 0;
    flex-wrap: wrap;
}

.fg-share-bar .fs-lbl {
    font-size: .73rem;
    color: var(--txt3);
    white-space: nowrap;
}
.fg-share-bar .fs-url {
    font-size: .78rem;
    color: var(--txt2);
    flex: 1;
    min-width: 0;
    word-break: break-all;
}

.fg-share-bar .fs-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    background: var(--yellow);
    color: #111;
    border: none;
    border-radius: var(--radius3);
    font-size: .79rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .16s, transform .12s;
    flex-shrink: 0;
    font-family: inherit;
}

.fg-share-bar .fs-btn:hover {
    background: var(--yellow-dk);
    transform: translateY(-1px);
}

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

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

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

    .fg-site-name { font-size: 1.1rem; }
    .fg-domain-pill .fd-url { font-size: .9rem; }

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

    .fg-zone-lbl {
        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;
    }

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

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

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

    .fg-search-card input[type="text"] {
        height: 34px;
        font-size: .74rem;
        padding: 0 8px;
    }

    .fg-search-card button {
        height: 34px;
        padding: 0 7px;
        font-size: .69rem;
    }

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

    .fg-thumb { aspect-ratio: 600 / 350; }
    .fg-caption h5 { font-size: .71rem; }
    .fg-section { padding: 10px 10px 8px; }
    .fg-dl-btn { padding: 9px 16px; font-size: .84rem; }
}

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

@media (max-width: 380px) {
    .fg-zone-lbl { font-size: 10px; }
    .fg-zone-links a { font-size: 12px; }
    .fg-search-card button { padding: 0 5px; font-size: .63rem; }
}
