/* Film Portal — Bold Editorial Theme (Reddit-inspired) */

:root {
    --rd-orange:       #ff4500;
    --rd-orange-dim:   rgba(255,69,0,0.08);
    --rd-orange-mid:   rgba(255,69,0,0.15);
    --rd-orange-hover: #e03d00;
    --rd-blue:         #0079d3;
    --rd-blue-dim:     rgba(0,121,211,0.1);

    --bg-root:    #ffffff;
    --bg-section: #f6f7f8;
    --bg-card:    #ffffff;
    --bg-input:   #f6f7f8;
    --bg-muted:   #edeff1;

    --ink-dark:   #1c1c1c;
    --ink-mid:    #3c3c3c;
    --ink-soft:   #7c7c7c;
    --ink-faint:  #b0b0b0;

    --line:       #edeff1;
    --line-mid:   #dae0e6;

    --radius-xs:  4px;
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-pill:24px;

    --shadow-xs:  0 1px 3px rgba(0,0,0,0.06);
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg:  0 8px 28px rgba(0,0,0,0.12);

    --ease: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-root);
    color: var(--ink-dark);
    line-height: 1.55;
    font-size: 15px;
    overflow-x: hidden;
}

/* ===================== HEADER ===================== */
.rd-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
    padding: 0.65rem 0;
    box-shadow: var(--shadow-xs);
}

.rd-header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rd-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
}

.rd-logo-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--ease);
}

.rd-logo-link:hover { opacity: 0.82; }

.rd-site-name {
    font-size: 26px;
    font-weight: 900;
    color: var(--rd-orange);
    letter-spacing: -0.5px;
    font-style: normal;
    text-decoration: none;
    border-bottom: none;
}

.rd-domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    background: var(--rd-orange-dim);
    border: 1.5px solid rgba(255,69,0,0.25);
    border-radius: var(--radius-pill);
    transition: var(--ease);
}

.rd-domain-badge:hover {
    border-color: var(--rd-orange);
    background: var(--rd-orange-mid);
}

.rd-domain-tag {
    font-size: 11px;
    font-weight: 800;
    color: var(--rd-orange);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

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

/* ===================== LAYOUT ===================== */
.rd-wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 14px;
}

.rd-section {
    padding: 8px 0;
}

/* ===================== BANNER ===================== */
.rd-promo {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin: 2px 0;
    border: 1px solid var(--line);
}

.rd-promo a { display: block; line-height: 0; }
.rd-promo img { width: 100%; display: block; border-radius: var(--radius-md); }

/* ===================== NAV ===================== */
.rd-nav-panel {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--line-mid);
    box-shadow: var(--shadow-xs);
}

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

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

.rd-nav-zone {
    font-size: 14px;
    font-weight: 800;
    color: var(--bg-card);
    background: var(--rd-orange);
    width: 10%;
    min-width: 52px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    flex-shrink: 0;
    border-right: none;
    white-space: nowrap;
    overflow: hidden;
}

.rd-nav-links {
    width: 90%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px 10px;
    align-items: center;
    background: var(--bg-card);
}

.rd-nav-links a {
    display: inline-block;
    color: var(--ink-mid);
    text-decoration: none;
    padding: 5px 4px;
    border-radius: var(--radius-pill);
    transition: var(--ease);
    background: var(--bg-input);
    border: 1px solid var(--line-mid);
    white-space: nowrap;
    text-align: center;
    width: calc((100% - 42px) / 8);
    flex-shrink: 0;
    flex-grow: 0;
    font-size: 13px;
    font-weight: 600;
}

.rd-nav-links a:hover {
    background: var(--rd-orange);
    color: #fff;
    border-color: var(--rd-orange);
    box-shadow: 0 3px 10px rgba(255,69,0,0.22);
    transform: translateY(-1px);
}

.rd-nav-links a.active {
    background: var(--rd-orange);
    color: #fff;
    border-color: var(--rd-orange);
    box-shadow: 0 3px 10px rgba(255,69,0,0.22);
    font-weight: 700;
}

/* ===================== SEARCH ===================== */
.rd-searchbar {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--line-mid);
    box-shadow: var(--shadow-xs);
}

.rd-searchbar form {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}

.rd-searchbar input[type="text"] {
    flex: 1;
    min-width: 180px;
    padding: 10px 16px;
    border: 1.5px solid var(--line-mid);
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    color: var(--ink-dark);
    font-size: 14px;
    transition: var(--ease);
    outline: none;
    font-family: inherit;
}

.rd-searchbar input[type="text"]:focus {
    border-color: var(--rd-orange);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,69,0,0.1);
}

.rd-searchbar input[type="text"]::placeholder { color: var(--ink-faint); }

.rd-searchbar button {
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--rd-orange);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--ease);
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}

.rd-searchbar button:hover {
    background: var(--rd-orange-hover);
    box-shadow: 0 4px 14px rgba(255,69,0,0.28);
    transform: translateY(-1px);
}

/* ===================== TAG CLOUDS ===================== */
.rd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    list-style: none;
    padding: 11px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--line-mid);
    box-shadow: var(--shadow-xs);
}

.rd-tag {
    padding: 5px 14px;
    background: var(--bg-muted);
    border-radius: var(--radius-pill);
    color: var(--ink-mid);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--ease);
    border: 1.5px solid var(--line-mid);
}

.rd-tag:hover {
    background: var(--rd-orange);
    color: #fff;
    border-color: var(--rd-orange);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255,69,0,0.2);
}

/* ===================== SECTIONS ===================== */
.rd-block {
    margin-bottom: 14px;
}

.rd-block-hd {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--line);
    position: relative;
    display: flex;
    align-items: baseline;
}

.rd-block-hd::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--rd-orange);
    border-radius: 2px;
}

.rd-block-title {
    font-size: 19px;
    font-weight: 900;
    margin: 0;
    color: var(--ink-dark);
    letter-spacing: -0.3px;
}

.rd-block-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--ease);
}

.rd-block-title a:hover { color: var(--rd-orange); }

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

.rd-grid li {
    animation: rd-pop 0.42s ease backwards;
}

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

@keyframes rd-pop {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rd-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    aspect-ratio: 600 / 350;
    background: var(--bg-muted);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-xs);
    transition: var(--ease);
}

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

.rd-thumb:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--rd-orange);
}

.rd-thumb:hover img { transform: scale(1.06); }

.rd-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-md);
}

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

.rd-caption {
    padding: 8px 0 0;
}

.rd-caption h5 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--ink-mid);
}

.rd-caption h5 a {
    color: inherit;
    text-decoration: none;
    transition: var(--ease);
}

.rd-caption h5 a:hover { color: var(--rd-orange); }

/* ===================== DETAIL PANELS ===================== */
.rd-title-bar {
    line-height: 1.8;
    text-align: center;
    padding: 16px 20px;
    font-size: 16px;
    margin: 12px 0;
    word-break: break-all;
    background: var(--rd-orange-dim);
    border-radius: var(--radius-lg);
    border: 1.5px solid rgba(255,69,0,0.18);
}

.rd-title-bar a {
    color: var(--rd-orange);
    text-decoration: none;
    font-weight: 800;
    margin-right: 8px;
}

.rd-detail-panel {
    font-size: 15px;
    line-height: 1.9;
    padding: 20px 22px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin: 10px 0;
    border: 1px solid var(--line-mid);
    box-shadow: var(--shadow-xs);
    color: var(--ink-mid);
}

.rd-preview-wrap {
    margin-top: 12px;
}

.rd-preview-wrap picture {
    display: block;
    width: 100%;
}

.rd-preview-wrap picture img,
.rd-preview-wrap img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

/* ===================== ACTION BUTTONS ===================== */
.rd-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 12px;
    margin: 10px 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--line-mid);
    box-shadow: var(--shadow-xs);
}

.rd-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--rd-orange);
    color: #fff !important;
    text-decoration: none;
    border-radius: var(--radius-pill);
    font-weight: 800;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: var(--ease);
    box-shadow: 0 3px 12px rgba(255,69,0,0.25);
    letter-spacing: 0.1px;
    font-family: inherit;
}

.rd-btn:hover {
    background: var(--rd-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(255,69,0,0.32);
}

/* ===================== CLIENT LINKS ===================== */
.rd-client-pc,
.rd-client-mb {
    text-align: center;
    padding: 14px;
}

.rd-client-pc a,
.rd-client-mb a {
    color: var(--rd-blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: var(--ease);
}

.rd-client-pc a:hover,
.rd-client-mb a:hover { color: var(--rd-orange); }

/* ===================== SHARE ===================== */
.rd-share {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin: 10px 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--line-mid);
    box-shadow: var(--shadow-xs);
    flex-wrap: nowrap;
}

.share-url-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-mid);
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.share-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--rd-orange);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-url {
    font-size: 12px;
    color: var(--ink-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
    font-family: 'Courier New', monospace;
}

.share-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 16px;
    background: var(--rd-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--ease);
    white-space: nowrap;
    flex-shrink: 0;
    font-family: inherit;
}

.share-copy-btn:hover {
    background: #0060aa;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,121,211,0.28);
}

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

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

.rd-pager-a,
.rd-pager-cur {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    transition: var(--ease);
    min-width: 36px;
    text-align: center;
    text-decoration: none;
}

.rd-pager-a {
    background: var(--bg-card);
    color: var(--ink-mid);
    border: 1.5px solid var(--line-mid);
}

.rd-pager-a:hover {
    background: var(--rd-orange);
    border-color: var(--rd-orange);
    color: #fff;
    box-shadow: 0 3px 10px rgba(255,69,0,0.2);
}

.rd-pager-cur {
    background: var(--rd-orange);
    color: #fff;
    border: 1.5px solid var(--rd-orange);
    cursor: default;
}

/* ===================== FOOTER ===================== */
.rd-friendlinks {
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--line-mid);
    box-shadow: var(--shadow-xs);
}

.rd-friendlinks dl { margin: 0; }

.rd-friendlinks dd {
    display: inline-block;
    margin: 4px;
}

.rd-friendlinks a {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 13px;
    transition: var(--ease);
}

.rd-friendlinks a:hover { color: var(--rd-orange); }

.pd5 { padding: 3px 6px; }

.rd-footer {
    padding: 20px 0;
    text-align: center;
    border-top: 2px solid var(--line);
    margin-top: 16px;
    background: var(--bg-card);
}

.rd-footer p {
    margin: 5px 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.rd-footer a {
    color: var(--ink-soft);
    text-decoration: none;
    transition: var(--ease);
}

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

/* ===================== UTILS ===================== */
.clearfix::after { content: ""; display: table; clear: both; }

.nomobile  { display: block; }
.nodesktop { display: block; }

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

img[data-original] { background: var(--bg-muted); }

/* ===================== RESPONSIVE ===================== */

@media (max-width: 768px) {
    .rd-wrap { padding: 0 8px; }

    .rd-header { padding: 0.5rem 0; }
    .rd-brand  { gap: 10px; }

    .rd-site-name     { font-size: 20px; }
    .rd-domain-badge  { padding: 4px 12px; gap: 6px; }
    .rd-domain-tag    { font-size: 10px; }
    .rd-domain-url    { font-size: 16px; }

    .rd-section { padding: 6px 0; }

    /* Mobile nav: zone 15% / links 85% / 2×4 grid */
    .rd-nav-zone {
        width: 15%;
        font-size: 10px;
        padding: 8px 2px;
        white-space: normal;
        word-break: break-all;
        overflow: visible;
    }

    .rd-nav-links {
        width: 85%;
        gap: 4px;
        padding: 8px 5px;
    }

    .rd-nav-links a {
        font-size: 12px;
        padding: 4px 2px;
        width: calc((100% - 12px) / 4);
        flex-shrink: 0;
        flex-grow: 0;
    }

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

    .rd-block-title { font-size: 17px; }
    .rd-caption h5  { font-size: 12px; }

    .rd-searchbar { padding: 10px; }
    .rd-searchbar form { gap: 6px; }
    .rd-searchbar input[type="text"] { min-width: 90px; padding: 9px 12px; font-size: 13px; }
    .rd-searchbar button { padding: 9px 10px; font-size: 12px; }

    .rd-tags { padding: 9px 10px; gap: 6px; }
    .rd-tag  { padding: 4px 11px; font-size: 12px; }

    .rd-actions { padding: 12px 8px; gap: 8px; }
    .rd-btn     { padding: 9px 18px; font-size: 13px; }

    .rd-share          { padding: 10px; gap: 8px; margin: 8px 0; }
    .share-url-display { padding: 8px 10px; gap: 6px; }
    .share-label       { font-size: 10px; }
    .share-url         { font-size: 10px; }
    .share-copy-btn    { padding: 8px 11px; font-size: 12px; }
    .share-icon        { font-size: 14px; }

    .rd-pager-a,
    .rd-pager-cur { padding: 6px 11px; font-size: 12px; min-width: 30px; }

    .rd-block { margin-bottom: 10px; }

    .rd-title-bar    { padding: 13px 14px; font-size: 14px; margin: 10px 0; }
    .rd-detail-panel { padding: 14px 13px; font-size: 14px; margin: 8px 0; }
}

@media (max-width: 480px) {
    .rd-header { padding: 0.4rem 0; }

    .rd-site-name    { font-size: 18px; }
    .rd-domain-badge { padding: 4px 10px; }
    .rd-domain-tag   { font-size: 9px; }
    .rd-domain-url   { font-size: 15px; }

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

    .rd-nav-links {
        width: 85%;
        gap: 3px;
        padding: 6px 4px;
    }

    .rd-nav-links a {
        font-size: 12px;
        padding: 3px 1px;
        width: calc((100% - 9px) / 4);
    }

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

    .rd-searchbar input[type="text"] { min-width: 70px; padding: 8px 9px; font-size: 12px; }
    .rd-searchbar button { padding: 8px 8px; font-size: 11px; }

    .rd-block-title { font-size: 15px; }
    .rd-btn { padding: 8px 14px; font-size: 12px; }

    .rd-share       { padding: 8px; gap: 6px; }
    .share-copy-btn { padding: 7px 10px; font-size: 11px; }
}

@media (min-width: 769px) {
    .rd-grid { grid-template-columns: repeat(4, 1fr); }
    .rd-nav-zone  { font-size: 14px; }
    .rd-nav-links a { font-size: 13px; }
}
