/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #F8F9FA;
    --bg-surface: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --accent: #E11D48;
    --accent-hover: #C8192DBF;
    --accent-subtle: #FDF2F4;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* ---------- Font Import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-primary);
    padding-top: 64px;
    font-family: 'Inter', -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    text-decoration: none !important;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    border: 0;
    vertical-align: middle;
}

/* ---------- Container ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

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

/* ========================================
   Navigation Bar
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    align-items: center;
    height: 64px;
    max-width: 1200px;
    padding: 0 24px;
    position: relative;
}

/* ---------- Brand / Logo ---------- */
.navbar-brand {
    font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-right: 24px;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.brand-jav {
    color: var(--text-primary);
}

.brand-bus {
    color: var(--accent);
}

/* ---------- Hamburger Toggle (hidden on desktop) ---------- */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.nav-toggle-label:hover {
    background-color: var(--border-light);
}

.nav-toggle-label span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 2px 0;
    border-radius: 1px;
    transition: all 0.3s;
}

/* Hamburger animation when checked */
.nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 0);
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(2) {
    opacity: 0;
}

.nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, 0);
}

/* ---------- Nav Collapse ---------- */
.nav-collapse {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 12px;
    min-width: 0;
}

/* ---------- Search Form ---------- */
.navbar-form {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    max-width: 420px;
    min-width: 0;
    margin-left: auto;
}

.navbar-form .form-group {
    display: flex;
    width: 100%;
    align-items: center;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.navbar-form .form-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.08);
}

.form-control {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 16px;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.btn-search {
    height: 40px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
    color: #FFF;
    background-color: var(--accent);
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color var(--transition-fast);
}

.btn-search:hover {
    background-color: var(--accent-hover);
}

/* ---------- Nav Links ---------- */
.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Nav Buttons */
.btn-nav {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.btn-nav:hover {
    color: var(--text-primary);
    background-color: var(--border-light);
}

/* ========================================
   Waterfall Grid - CSS Grid Layout
   ======================================== */
#wrapper {
    padding: 28px 0;
    overflow: hidden;
}

#waterfall {
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    justify-content: center;
}

/* ---------- Item Wrapper ---------- */
.item {
    min-width: 0;
    width: 100%;
}

/* ---------- Movie Card ---------- */
.movie-box {
    width: 100%;
    min-width: 0;
    display: block;
    background-color: var(--bg-surface);
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal), border-color var(--transition-normal);
}

.movie-box:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: transparent;
}

.item-link {
    display: block;
    color: var(--text-primary);
}

/* Photo Frame */
.photo-frame {
    overflow: hidden;
    width: calc(100% - 16px);
    max-width: 100%;
    margin: 8px 8px 0 8px;
    border-radius: var(--radius-md);
    aspect-ratio: 2 / 3;
    background: var(--border-light);
}

.photo-frame img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    display: block;
    transition: transform 0.4s ease;
}

.movie-box:hover .photo-frame img {
    transform: scale(1.06);
}

/* Card Content */
.item-content {
    padding: 12px 12px 14px 12px;
}

.item-title {
    position: relative;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 40px;
}

/* Meta (Code + Date) */
.item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
}

.item-code {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background-color: var(--accent-subtle);
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.item-date {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Visited links */
.item a:visited .item-title {
    color: var(--text-tertiary);
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 32px 0;
    flex-wrap: wrap;
}

.pagination li {
    display: inline-block;
}

.pagination li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.pagination li a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-subtle);
}

.pagination li.active a {
    color: #FFF;
    background-color: var(--accent);
    border-color: var(--accent);
    cursor: default;
}

/* 以下为 JS 模板渲染的分页（.page-item / .page-link，active 与 disabled 为 span 元素） */
.pagination li .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.pagination li a.page-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-subtle);
}

.pagination li.active .page-link {
    color: #FFF;
    background-color: var(--accent);
    border-color: var(--accent);
    cursor: default;
}

.pagination li.disabled .page-link {
    color: var(--text-tertiary);
    background: var(--bg-surface);
    border-color: var(--border-light);
    cursor: default;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 32px 0;
    color: var(--text-secondary);
    background: #111827;
    text-align: center;
    margin-top: auto;
}

.footer a {
    color: #9CA3AF;
    margin: 0 12px;
    font-size: 13px;
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: #FFF;
}

.footer-links {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-copy {
    font-size: 12px;
    color: #4B5563;
}

/* ========================================
   Responsive — Tablet (≤ 991px)
   ======================================== */
@media screen and (max-width: 991px) {
    .navbar-form {
        max-width: 280px;
    }

    .btn-nav {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Grid: smaller minmax for tablet */
    #waterfall {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
        gap: 16px;
    }
}

/* ========================================
   Responsive — Small Tablet / Mobile (≤ 767px)
   ======================================== */
@media screen and (max-width: 767px) {
    .container {
        padding: 0 16px;
    }

    body {
        padding-top: 56px;
    }

    .navbar {
        height: 56px;
        background: rgba(255, 255, 255, 0.95);
    }

    .nav-container {
        flex-wrap: nowrap;
        height: 56px;
        padding: 0 16px;
    }

    /* Show hamburger */
    .nav-toggle-label {
        display: flex;
        order: 3;
        margin-left: auto;
    }

    .navbar-brand {
        font-size: 22px;
        margin-right: 0;
        order: 1;
    }

    /* Collapse nav into dropdown panel */
    .nav-collapse {
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--bg-surface);
        border-top: 2px solid var(--border);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        padding: 0;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 999;
    }

    .nav-toggle:checked ~ .nav-collapse {
        max-height: 500px;
        overflow-y: auto;
    }

    /* Search section */
    .navbar-form {
        max-width: none;
        padding: 16px;
        margin-left: 0;
        border-bottom: 8px solid var(--bg-primary);
    }

    .navbar-form .form-group {
        background: var(--bg-primary);
        border: none;
    }

    .form-control {
        height: 44px;
        font-size: 16px;
        padding: 0 16px;
    }

    .btn-search {
        height: 44px;
        padding: 0 24px;
        font-size: 16px;
    }

    /* Nav links section */
    .nav {
        padding: 8px 0;
        background: var(--bg-surface);
    }

    .navbar-nav {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .navbar-nav > li {
        border-bottom: 1px solid var(--border-light);
    }

    .navbar-nav > li:last-child {
        border-bottom: none;
    }

    .btn-nav {
        display: block;
        width: 100%;
        padding: 16px;
        font-size: 16px;
        font-weight: 500;
        color: var(--text-primary);
        text-align: left;
        border-radius: 0;
        border: none;
        background: transparent;
        transition: background-color var(--transition-fast), color var(--transition-fast);
    }

    .btn-nav:hover,
    .btn-nav:active {
        background-color: var(--bg-primary);
        color: var(--accent);
    }

    /* Icons for nav buttons */
    .navbar-nav > li:nth-child(1) .btn-nav::before {
        content: "👩";
        margin-right: 10px;
        font-size: 18px;
    }

    .navbar-nav > li:nth-child(2) .btn-nav::before {
        content: "🏷️";
        margin-right: 10px;
        font-size: 18px;
    }

    .navbar-nav > li:nth-child(3) .btn-nav::before {
        content: "📺";
        margin-right: 10px;
        font-size: 18px;
    }

    .navbar-nav > li:nth-child(4) .btn-nav::before {
        content: "🎬";
        margin-right: 10px;
        font-size: 18px;
    }

    /* Grid: 2 columns on mobile */
    #waterfall {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin: 0 auto;
        padding: 0 12px;
    }

    .photo-frame {
        width: calc(100% - 12px);
        margin: 6px 6px 0 6px;
        border-radius: var(--radius-sm);
    }

    .item-content {
        padding: 10px 8px 12px 8px;
    }

    .item-title {
        font-size: 12px;
        min-height: 36px;
        line-height: 1.4;
    }

    .item-meta {
        margin-top: 6px;
    }

    .item-code {
        padding: 1px 6px;
        font-size: 10px;
    }

    .item-date {
        font-size: 11px;
    }

    /* Pagination */
    .pagination {
        gap: 4px;
        padding: 24px 0;
    }

    .pagination li a {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }

    .pagination li .page-link {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }

    /* Footer */
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }

    .footer a {
        margin: 0;
    }
}

/* ========================================
   Responsive — Phone (≤ 480px)
   ======================================== */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    body {
        padding-top: 52px;
    }

    .navbar {
        height: 52px;
    }

    .nav-container {
        height: 52px;
        padding: 0 12px;
    }

    .nav-toggle-label {
        width: 36px;
        height: 36px;
    }

    .nav-toggle-label span {
        width: 18px;
    }

    .navbar-brand {
        font-size: 20px;
    }

    .nav-collapse {
        top: 52px;
    }

    .navbar-form {
        padding: 10px 12px;
    }

    .form-control {
        height: 38px;
        font-size: 14px;
    }

    .btn-search {
        height: 38px;
        padding: 0 18px;
        font-size: 14px;
    }

    /* Grid: 2 columns, tighter gap */
    #waterfall {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 10px;
    }

    .photo-frame {
        width: calc(100% - 8px);
        margin: 4px 4px 0 4px;
    }

    .item-content {
        padding: 8px 6px 10px 6px;
    }

    .item-title {
        font-size: 11px;
        min-height: 30px;
    }

    .item-meta {
        margin-top: 4px;
    }

    .item-code {
        font-size: 10px;
        padding: 1px 5px;
    }

    .item-date {
        font-size: 10px;
    }

    /* Pagination: compact */
    .pagination {
        gap: 3px;
        padding: 20px 0;
    }

    .pagination li a {
        min-width: 32px;
        height: 32px;
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 4px;
    }

    .pagination li .page-link {
        min-width: 32px;
        height: 32px;
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 4px;
    }

    /* Footer */
    .footer {
        padding: 24px 0;
    }

    .footer a {
        font-size: 12px;
    }

    .footer-copy {
        font-size: 11px;
    }
}

/* ========================================
   Responsive — Large Desktop (≥ 1400px)
   ======================================== */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1200px;
    }

    #waterfall {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }
}

/* ========================================
   Accessibility — Touch Targets
   ======================================== */
@media (pointer: coarse) {
    .btn-search,
    .btn-nav,
    .pagination li a,
    .pagination li .page-link {
        min-height: 44px;
    }
}

/* ========================================
   Accessibility — Reduced Motion
   ======================================== */
/* ========================================
    Movie Detail Page
    ======================================== */
.detail-wrapper {
    padding: 28px 0;
}

.detail-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.detail-cover {
    flex: 0 1 66%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
}

.detail-cover img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 800 / 538;
    object-fit: cover;
}

.detail-info {
    flex: 1;
    min-width: 0;
}

.detail-title {
    position: relative;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow: hidden;
}

.detail-code {
    display: inline-block;
    padding: 2px 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background-color: var(--accent-subtle);
    border-radius: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

.detail-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.meta-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.meta-label {
    flex: 0 0 80px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.meta-value {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-all;
}

.detail-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.meta-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.meta-series {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.genre-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.genre-tag:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-subtle);
}

.meta-actresses {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.actress-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.actress-chip:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-subtle);
}

.actress-chip img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border-light);
}

/* 强制混淆占位符不占据空间 */
.actress-chip span,
.genre-tag span {
    display: none !important;
}

/* Magnet Links Section */
.detail-magnet {
    margin-top: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
}

.magnet-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.magnet-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.magnet-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.magnet-item:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.magnet-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.magnet-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.magnet-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.magnet-size,
.magnet-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-magnet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-magnet:hover {
    background: var(--accent);
    color: #fff;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: #28a745;
    background: #e8f5e9;
    border: 1px solid #28a745;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-copy:hover {
    background: #28a745;
    color: #fff;
}

.btn-copy.copied {
    color: #fff;
    background: #28a745;
    border-color: #28a745;
    pointer-events: none;
}

.magnet-icon {
    font-size: 14px;
}

/* Gallery Preview Section */
.detail-gallery {
    margin-top: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
}

.gallery-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--border-light);
    aspect-ratio: 16 / 9;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Detail Page Responsive */
@media screen and (max-width: 767px) {
    .detail-layout {
        flex-direction: column;
        align-items: center;
    }

    .detail-cover {
        width: 100%;
        max-width: 400px;
    }

    .detail-info {
        width: 100%;
        padding: 0 16px;
    }

    .detail-title {
        font-size: 17px;
        text-align: center;
    }

    .actress-list {
        gap: 8px;
    }

    .actress-item {
        padding: 5px 10px 5px 5px;
    }

    .actress-item img {
        width: 34px;
        height: 34px;
    }

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

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

@media (prefers-reduced-motion: reduce) {
    .movie-box,
    .photo-frame img,
    a {
        transition: none;
    }
}

/* ========================================
   Related Movies Section
   ======================================== */
.detail-related {
    margin-top: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
}

.related-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

@media screen and (max-width: 767px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ========================================
    Genre Page
    ======================================== */
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.genre-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.genre-header .page-title {
    margin-bottom: 0;
}

.genre-back {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.genre-back:hover {
    color: var(--accent);
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.genre-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal), border-color var(--transition-normal);
    text-decoration: none;
}

.genre-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: transparent;
}

.genre-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.genre-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-nav-active {
    color: var(--accent) !important;
    background-color: var(--accent-subtle) !important;
}

@media screen and (max-width: 1023px) {
    .genre-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 767px) {
    .genre-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .genre-card {
        padding: 16px 8px;
    }

    .genre-name {
        font-size: 13px;
    }
}

@media screen and (max-width: 479px) {
    .genre-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
     Actress Page
     ======================================== */
.actress-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    overflow: hidden;
}

.actress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal), border-color var(--transition-normal);
    text-decoration: none;
    min-width: 0;
}

.actress-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: transparent;
}

.actress-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--border-light);
}

.actress-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.actress-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actress-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.actress-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.actress-header-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--border-light);
    flex-shrink: 0;
}

.actress-header-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.actress-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.actress-header-info .page-title {
    margin-bottom: 0;
}

.actress-total {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.actress-back {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.actress-back:hover {
    color: var(--accent);
}

@media screen and (max-width: 1023px) {
    .actress-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 767px) {
    .actress-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 0 16px;
    }

    .actress-card {
        padding: 12px 8px;
    }

    .actress-photo {
        width: 52px;
        height: 52px;
    }

    .actress-name {
        font-size: 13px;
    }

    .actress-header {
        flex-wrap: wrap;
    }

    .actress-back {
        margin-left: 0;
    }
}

@media screen and (max-width: 479px) {
    .actress-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 12px;
    }
}

/* ========================================
     Print Styles
     ======================================== */
@media print {
    .navbar,
    .footer,
    .pagination {
        display: none;
    }

    body {
        padding-top: 0;
        background: #FFF;
    }

    .movie-box {
        box-shadow: none;
        border: 1px solid #DDD;
        break-inside: avoid;
    }
}

/* ---------- 横幅广告 ---------- */
.ad-hengfu-wrapper {
    width: 100%;
    background: #f5f5f5;
    text-align: center;
    overflow: hidden;
    --hengfu-pc-base: 80px;
    --hengfu-mobile-base: 60px;
}
.ad-hengfu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.ad-hengfu-item {
    display: block;
    width: 100%;
    max-width: 1200px;
    overflow: hidden;
}
.ad-hengfu-item img {
    display: block;
    width: 100%;
    height: calc(var(--hengfu-pc-base, 80px) * var(--hengfu-scale, 100) / 100);
    object-fit: fill;
}
@media (max-width: 768px) {
    .ad-hengfu-item img {
        height: calc(var(--hengfu-mobile-base, 60px) * var(--hengfu-scale, 100) / 100);
    }
}

/* ---------- 图标广告 ---------- */
.ad-icon-wrapper {
    width: 100%;
    margin-top: 24px;
    --icon-pc-base: 120px;
    --icon-mobile-base: 80px;
}
.ad-icon-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
}
.ad-icon-item {
    display: inline-block;
    height: var(--icon-pc-base);
    overflow: hidden;
    border-radius: 20px;
}
.ad-icon-item img {
    display: block;
    height: 100%;
    width: auto;
    object-fit: contain;
}
@media (max-width: 767px) {
    .ad-icon-wrapper {
        margin-top: 16px;
    }
    .ad-icon-container {
        gap: 10px;
    }
    .ad-icon-item {
        height: var(--icon-mobile-base);
    }
}

/* ---------- 底飘广告（仅移动端，底部悬浮） ---------- */
.ad-bottom-wrapper {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: #fff;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}
.ad-bottom-container {
    width: 100%;
}
.ad-bottom-item {
    display: block;
    width: 100%;
    overflow: hidden;
}
@media (max-width: 767px) {
    .ad-bottom-wrapper {
        display: block;
    }
}


/* ========================================
   Friend Links (友情链接)
   ======================================== */
.friend-links {
    padding: 20px 0;
    margin-bottom: 40px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.friend-links-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.friend-links-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 8px;
    white-space: nowrap;
}

.friend-links-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.friend-links-list a {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.friend-links-list a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-subtle);
}

/* 移动端适配 */
@media screen and (max-width: 767px) {
    .friend-links {
        padding: 16px 0;
    }

    .friend-links-inner {
        justify-content: center;
    }

    .friend-links-title {
        width: 100%;
        text-align: center;
        margin-right: 0;
        margin-bottom: 4px;
    }
}

/* ---------- 移动端禁止页面缩放（增量追加） ---------- */
html, body {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

/* 解决 iOS 输入框字号 < 16px 聚焦自动放大视口 Bug */
input, select, textarea {
    font-size: 16px !important;
}

/* ---------- Copy Toast 提示 ---------- */
.copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 9999;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 500;
    color: #FFF;
    background: rgba(0, 0, 0, 0.72);
    border-radius: var(--radius-md);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.copy-toast.toast-show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
