/* ============================================================
   Film & Media Portal — Cloudflare Orange Tech Theme
   ============================================================ */

:root {
    --cf-orange:      #f6821f;
    --cf-orange-dk:   #d96a10;
    --cf-orange-lt:   #ffa04d;
    --cf-orange-pale: #fff4eb;
    --cf-orange-pale2:#ffe8d0;
    --page-bg:        #f7f8fa;
    --card-bg:        #ffffff;
    --nav-bg:         #ffffff;
    --border-clr:     #e8eaed;
    --border-dk:      #d0d3da;
    --txt-main:       #1d1d1f;
    --txt-sub:        #404040;
    --txt-muted:      #888899;
    --tag-bg:         #fff4eb;
    --tag-txt:        #d96a10;
    --btn-grad:       linear-gradient(135deg, #f6821f 0%, #ffa04d 100%);
    --btn-grad-hov:   linear-gradient(135deg, #d96a10 0%, #f6821f 100%);
    --card-shadow:    0 2px 12px rgba(246,130,31,0.09);
    --card-shadow-h:  0 8px 28px rgba(246,130,31,0.22);
    --radius:         10px;
    --radius-sm:      7px;
    --radius-xs:      5px;
    --tr:             all 0.22s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC',
                 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    background: var(--page-bg);
    color: var(--txt-main);
    font-size: 15px;
    line-height: 1.55;
    overflow-x: hidden;
}

/* ===== TOP HEADER ===== */
.cf-topbar {
    background: #ffffff;
    padding: 10px 0;
    border-bottom: 3px solid var(--cf-orange);
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.cf-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    flex-wrap: nowrap;
}

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

.cf-site-name {
    font-size: 27px;
    font-weight: 900;
    color: var(--txt-main);
    letter-spacing: 0.5px;
    font-style: normal;
    border-bottom: none;
}

.cf-domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cf-orange-pale);
    border: 1.5px solid var(--cf-orange);
    border-radius: var(--radius-xs);
    padding: 5px 14px;
}

.cf-domain-lbl {
    font-size: 11px;
    font-weight: 700;
    color: var(--cf-orange-dk);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.cf-domain-url {
    font-size: 18px;
    font-weight: 800;
    color: var(--cf-orange);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

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

.content {
    padding: 8px 0;
}

/* ===== CATEGORY NAV ===== */
.cf-nav-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
}

.cf-nav-line {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-clr);
}

.cf-nav-line:last-child { border-bottom: none; }

.cf-zone-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--cf-orange-dk);
    white-space: nowrap;
    width: 10%;
    text-align: center;
    border-right: 1px solid var(--border-clr);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 6px;
    flex-shrink: 0;
    background: var(--cf-orange-pale);
}

.cf-zone-items {
    width: 90%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    align-items: center;
}

.cf-zone-items a {
    display: inline-block;
    color: var(--txt-sub);
    text-decoration: none;
    padding: 5px 4px;
    border-radius: var(--radius-xs);
    transition: var(--tr);
    background: var(--page-bg);
    border: 1px solid var(--border-clr);
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
    width: calc((100% - 42px) / 8);
    flex-shrink: 0;
    flex-grow: 0;
}

.cf-zone-items a:hover {
    background: var(--cf-orange);
    color: #fff;
    border-color: var(--cf-orange);
    box-shadow: 0 2px 8px rgba(246,130,31,0.30);
}

.cf-zone-items a.active {
    background: var(--cf-orange);
    color: #fff;
    border-color: var(--cf-orange);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(246,130,31,0.30);
}

/* ===== SEARCH MODULE ===== */
.cf-search-bar {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 11px;
    margin-bottom: 8px;
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
}

.cf-search-bar form {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.cf-search-bar input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 9px 14px;
    border: 1.5px solid var(--border-dk);
    border-radius: 24px;
    background: var(--page-bg);
    color: var(--txt-main);
    font-size: 14px;
    outline: none;
    transition: var(--tr);
}

.cf-search-bar input[type="text"]:focus {
    border-color: var(--cf-orange);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(246,130,31,0.12);
}

.cf-search-bar input[type="text"]::placeholder {
    color: var(--txt-muted);
}

.cf-search-bar button {
    padding: 9px 15px;
    border: none;
    border-radius: 22px;
    background: var(--btn-grad);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--tr);
    white-space: nowrap;
    flex-shrink: 0;
}

.cf-search-bar button:hover {
    background: var(--btn-grad-hov);
    box-shadow: 0 4px 14px rgba(246,130,31,0.35);
}

/* ===== HOT TAG CLOUD ===== */
.cf-hotword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    list-style: none;
    padding: 9px 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
}

.cf-hotword-item {
    padding: 4px 13px;
    background: var(--cf-orange-pale);
    border-radius: 16px;
    color: var(--cf-orange-dk);
    text-decoration: none;
    font-size: 13px;
    transition: var(--tr);
    border: 1px solid var(--cf-orange-pale2);
    white-space: nowrap;
}

.cf-hotword-item:hover {
    background: var(--cf-orange);
    color: #fff;
    border-color: var(--cf-orange);
    box-shadow: 0 2px 8px rgba(246,130,31,0.25);
}

/* ===== SECTION BLOCK ===== */
.cf-section {
    margin-bottom: 14px;
}

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

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

.cf-sect-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--txt-main);
    margin: 0;
}

.cf-sect-title a {
    color: var(--txt-main);
    text-decoration: none;
    transition: var(--tr);
}

.cf-sect-title a:hover { color: var(--cf-orange); }

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

.cf-grid li { animation: cfIn 0.4s ease backwards; }
.cf-grid li:nth-child(1) { animation-delay: 0.03s; }
.cf-grid li:nth-child(2) { animation-delay: 0.06s; }
.cf-grid li:nth-child(3) { animation-delay: 0.09s; }
.cf-grid li:nth-child(4) { animation-delay: 0.12s; }
.cf-grid li:nth-child(5) { animation-delay: 0.15s; }
.cf-grid li:nth-child(6) { animation-delay: 0.18s; }
.cf-grid li:nth-child(7) { animation-delay: 0.21s; }
.cf-grid li:nth-child(8) { animation-delay: 0.24s; }

@keyframes cfIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cf-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    aspect-ratio: 600 / 350;
    background: var(--cf-orange-pale);
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
    transition: var(--tr);
}

.cf-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.cf-thumb:hover {
    box-shadow: var(--card-shadow-h);
    border-color: var(--cf-orange);
    transform: translateY(-2px);
}

.cf-thumb:hover img { transform: scale(1.07); }

.cf-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(217,106,16,0.60) 0%, transparent 58%);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.cf-thumb:hover::after { opacity: 1; }

.cf-item-info { padding: 7px 0 2px; }

.cf-item-info h5 {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--txt-sub);
}

.cf-item-info h5 a {
    color: var(--txt-sub);
    text-decoration: none;
    transition: var(--tr);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cf-item-info h5 a:hover { color: var(--cf-orange); }

/* ===== VIDEO PLAYER ===== */
.video-container {
    width: 100%;
    height: 640px;
    max-height: 640px;
    margin-bottom: 14px;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(246,130,31,0.20);
    position: relative;
}

.video-container iframe,
.video-container video,
.video-container #video-container {
    width: 100%;
    height: 100%;
    border: none;
}

.MacPlayer {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ===== TORRENT PREVIEW ===== */
.torrent-capture-grid { width: 100%; margin-top: 10px; }

.torrent-capture-grid picture {
    display: block;
    width: 100%;
}

.torrent-capture-grid img,
.torrent-capture-grid .img_item img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-clr);
    display: block;
}

.torrent-capture-grid .img_item { width: 100%; }

/* ===== DOWNLOAD BUTTONS ===== */
.cf-dl-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 14px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin: 12px 0;
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
}

.cf-dl-btn {
    display: inline-block;
    padding: 10px 22px;
    background: var(--btn-grad);
    color: #fff;
    text-decoration: none;
    border-radius: 22px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--tr);
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}

.cf-dl-btn:hover {
    background: var(--btn-grad-hov);
    box-shadow: 0 5px 16px rgba(246,130,31,0.40);
    transform: translateY(-1px);
}

/* ===== SHARE PANEL ===== */
.share-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 12px 0;
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-url-display {
    background: var(--page-bg);
    border: 1px solid var(--border-dk);
    border-radius: 22px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.share-label {
    font-weight: 700;
    font-size: 12px;
    color: var(--cf-orange-dk);
    white-space: nowrap;
    flex-shrink: 0;
}

.share-url {
    font-size: 12px;
    color: var(--txt-muted);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    flex: 1;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-copy-btn {
    padding: 9px 18px;
    background: var(--btn-grad);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--tr);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.share-copy-btn:hover {
    background: var(--btn-grad-hov);
    box-shadow: 0 4px 12px rgba(246,130,31,0.35);
}

.share-icon { font-size: 15px; }

/* ===== PAGINATION ===== */
.page_info_div {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    padding: 14px 0;
}

.a_page_info,
.page_info_focus {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: var(--tr);
    min-width: 36px;
    text-align: center;
}

.a_page_info {
    background: var(--card-bg);
    color: var(--txt-sub);
    border: 1px solid var(--border-dk);
}

.a_page_info:hover {
    background: var(--cf-orange);
    border-color: var(--cf-orange);
    color: #fff;
}

.page_info_focus {
    background: var(--btn-grad);
    color: #fff;
    border: 1px solid var(--cf-orange);
    cursor: default;
}

/* ===== FOOTER ===== */
.cf-footer {
    padding: 18px 0;
    text-align: center;
    border-top: 2px solid var(--border-clr);
    margin-top: 16px;
    background: var(--card-bg);
}

.cf-footer p {
    margin: 6px 0;
    color: var(--txt-muted);
    font-size: 13px;
}

.cf-footer a {
    color: var(--txt-muted);
    text-decoration: none;
    transition: var(--tr);
}

.cf-footer a:hover { color: var(--cf-orange); }

/* ===== FRIENDLY LINKS ===== */
.cf-flinks {
    padding: 10px 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
}

.cf-flinks dl { margin: 0; }

.cf-flinks dd {
    display: inline-block;
    margin: 3px 4px;
}

.cf-flinks a {
    color: var(--cf-orange-dk);
    text-decoration: none;
    font-size: 13px;
    transition: var(--tr);
}

.cf-flinks a:hover { color: var(--cf-orange); }

.pd5 { padding: 2px 0; display: inline-block; }

/* ===== UTILITIES ===== */
.clearfix::after { content: ""; display: table; clear: both; }
img[data-original] { background: var(--cf-orange-pale); }

.hide_mobile { display: block; }
.hide_pc     { display: block; }

@media (max-width: 768px)  { .hide_mobile { display: none !important; } }
@media (min-width: 769px)  { .hide_pc     { display: none !important; } }

/* ===== RESPONSIVE — TABLET / LARGE PHONE (<=768px) ===== */
@media (max-width: 768px) {

    .container { padding: 0 8px; }
    .content   { padding: 6px 0; }
    .cf-topbar { padding: 7px 0; }

    .cf-site-name  { font-size: 20px; }
    .cf-domain-lbl { font-size: 10px; }
    .cf-domain-url { font-size: 15px; }

    /* Nav: label 15%, links 85%, 4 per row x 2 rows */
    .cf-zone-name {
        width: 15%;
        font-size: 10px;
        padding: 7px 3px;
    }

    .cf-zone-items {
        width: 85%;
        gap: 4px;
        padding: 6px 5px;
    }

    .cf-zone-items a {
        font-size: 13px;
        padding: 5px 2px;
        width: calc((100% - 12px) / 4);
        flex-shrink: 0;
        flex-grow: 0;
    }

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

    .cf-item-info h5 { font-size: 12px; }

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

    .cf-search-bar input[type="text"] {
        min-width: 0;
        padding: 8px 10px;
        font-size: 13px;
    }

    .cf-search-bar button {
        padding: 8px 10px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .cf-sect-title { font-size: 16px; }

    .cf-hotword-list { gap: 5px; padding: 7px 10px; }
    .cf-hotword-item { padding: 4px 10px; font-size: 12px; }

    .cf-dl-row  { padding: 10px 8px; gap: 7px; }
    .cf-dl-btn  { padding: 9px 14px; font-size: 13px; }

    .share-section      { padding: 9px 10px; margin: 10px 0; flex-wrap: nowrap; }
    .share-url-display  { padding: 7px 10px; flex: 1; min-width: 0; }
    .share-label        { font-size: 11px; }
    .share-url          { font-size: 10px; }
    .share-copy-btn     { padding: 8px 11px; font-size: 12px; flex-shrink: 0; }
    .share-icon         { font-size: 14px; }

    .video-container { height: 56.25vw; max-height: 400px; margin-bottom: 10px; }

    .page_info_div { padding: 10px 0; gap: 4px; }
    .a_page_info,
    .page_info_focus { padding: 6px 11px; font-size: 12px; min-width: 32px; }
}

/* ===== RESPONSIVE — SMALL PHONE (<=480px) ===== */
@media (max-width: 480px) {

    .cf-site-name  { font-size: 17px; }
    .cf-domain-lbl { font-size: 9px; }
    .cf-domain-url { font-size: 13px; }

    .cf-zone-name {
        width: 15%;
        font-size: 10px;
        padding: 6px 2px;
    }

    .cf-zone-items {
        width: 85%;
        gap: 3px;
        padding: 5px 3px;
    }

    .cf-zone-items a {
        font-size: 12px;
        padding: 4px 1px;
        width: calc((100% - 9px) / 4);
    }

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

    .cf-item-info h5 { font-size: 12px; }

    .cf-search-bar input[type="text"] { padding: 7px 8px; font-size: 12px; }
    .cf-search-bar button             { padding: 7px 8px; font-size: 11px; }

    .cf-sect-title { font-size: 15px; }

    .video-container { height: 56.25vw; max-height: 280px; }

    .cf-dl-btn      { padding: 8px 12px; font-size: 12px; }
    .share-copy-btn { padding: 7px 9px; font-size: 11px; }
    .page_info_div  { padding: 8px 0; }
}

/* ===== PC — enforce 4-column grid ===== */
@media (min-width: 769px) {
    .cf-grid { grid-template-columns: repeat(4, 1fr); }
}
