/* 8x8x 移动端影视模板样式 */

:root {
    --primary: #ff6b00;
    --bg-dark: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-input: #262626;
    --text-main: #ffffff;
    --text-sub: #999999;
    --text-dim: #666666;
    --border: #333333;
    --navbar-sticky-height: calc(50px + 42px + 1px);
    --filter-tag-row-static: calc(0.6875rem * 1.3 + 8px);
    --filter-tag-gap-static: 6px;
    --filter-section-collapsed-height: calc(1em + 0.2em + var(--filter-tag-row-static) * 4 + var(--filter-tag-gap-static) * 3);
    --filter-section-height: var(--filter-section-collapsed-height);
    --page-top-offset: var(--navbar-sticky-height);
    --layout-max-width: 750px;
    --layout-column-left: 0px;
    --layout-column-width: 100%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

html.input-focus-lock,
body.input-focus-lock {
    overflow-x: hidden !important;
    overscroll-behavior-x: none;
    max-width: 100vw;
    width: 100%;
    touch-action: pan-y;
}

html.input-focus-lock .pagination,
body.input-focus-lock .pagination {
    max-width: 100%;
    overflow-x: hidden;
}

main,
#8x8xSearchView,
.search-panel,
.search-panel-body {
    max-width: 100%;
    overflow-x: hidden;
}

main,
#8x8xSearchView {
    padding-top: var(--navbar-sticky-height);
}

/* 有筛选栏时：顶栏留白改由广告区统一承担，避免被 fixed 筛选栏遮挡 */
main:has(> .filter-bar-wrap),
#8x8xSearchView:has(> .filter-bar-wrap),
main.has-filter-bar,
#8x8xSearchView.has-filter-bar {
    padding-top: 0;
}

.filter-bar-wrap + .ad-blocks {
    padding-top: calc(var(--navbar-sticky-height) + var(--filter-section-height, var(--filter-section-collapsed-height)));
}

/* 播放页：筛选栏在 main 外（壳模式 #_0d 内或 body 直子） */
body > .filter-bar-wrap,
#_0d > .filter-bar-wrap {
    margin-top: var(--navbar-sticky-height);
    height: 0;
    overflow: visible;
    pointer-events: none;
}

body > .filter-bar-wrap .filter-section,
#_0d > .filter-bar-wrap .filter-section {
    pointer-events: auto;
}

.filter-bar-wrap + main {
    padding-top: 0;
}

.filter-bar-wrap + main > .ad-blocks {
    padding-top: var(--filter-section-height, var(--filter-section-collapsed-height));
}

a { color: inherit; text-decoration: none; }
ul, li { list-style: none; }
img { display: block; max-width: 100%; }

/* PC端：手机端居中，两边黑色背景 */
@media (min-width: 768px) {
    body {
        background: #000;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    body > * {
        width: 100%;
        max-width: 750px;
        background: var(--bg-dark);
    }
    body > .page-loading-overlay {
        width: 100vw !important;
        max-width: none !important;
        align-self: stretch;
        background: rgba(15, 15, 15, 0.78);
    }
    body > .notice-mod {
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        margin: 0 !important;
        transform: none !important;
        align-self: stretch !important;
        background: transparent !important;
    }
    .search-overlay {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 750px;
        max-width: 100vw;
        margin-left: 0;
    }
    html:not([data-layout-synced="1"]) .navbar,
    html:not([data-layout-synced="1"]) .filter-section {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(100vw, var(--layout-max-width));
    }
}

html[data-layout-synced="1"] .navbar,
html[data-layout-synced="1"] .filter-section {
    transform: none;
}

/* 容器 */
.container {
    max-width: 750px;
    margin: 0 auto;
    padding: 0 12px;
}

/* 顶部导航 */
.navbar {
    position: fixed;
    top: 0;
    left: var(--layout-column-left, 0);
    width: var(--layout-column-width, 100%);
    right: auto;
    max-width: 100%;
    z-index: 100;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.navbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    height: 50px;
}

.navbar-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
}

.navbar-search-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

.navbar-search-btn svg {
    width: 22px;
    height: 22px;
}

/* 搜索弹出层 */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--bg-dark);
    overflow: hidden;
}

.search-overlay.active {
    display: block;
}

body.search-open {
    overflow: hidden;
}

.search-panel {
    height: 100%;
    max-width: 750px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

.search-panel-head {
    flex-shrink: 0;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border-radius: 999px;
    padding: 0 6px 0 14px;
    min-height: 44px;
}

.search-field-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--text-sub);
}

.search-field input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 16px;
    line-height: 1.4;
}

.search-field input::placeholder {
    color: var(--text-dim);
}

.search-field input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.search-field-submit {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #ff9900;
    font-size: 15px;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
}

.search-panel-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 12px 24px;
}

.search-panel-foot {
    flex-shrink: 0;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
}

.search-cancel-btn {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.search-cancel-btn:active {
    opacity: 0.85;
}

.search-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.search-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.search-section-title--hot {
    color: #ff9900;
}

.search-history {
    margin-bottom: 24px;
}

.search-history-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.search-history-clear svg {
    width: 16px;
    height: 16px;
}

.search-history-tags {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    width: 100%;
}

.search-history-tag {
    border: none;
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.2;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    flex: 0 0 auto;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-history-more {
    flex: 0 0 auto;
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1;
    padding: 8px 4px;
    user-select: none;
}

.search-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(15, 15, 15, 0.78);
}

.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0;
    background: rgba(15, 15, 15, 0.78);
    pointer-events: all;
}

html.is-page-loading-active {
    overflow: hidden;
}

html.is-page-loading-active body {
    overflow: hidden;
}

.search-loading-spinner,
.page-loading-spinner {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-top-color: #ff9900;
    border-right-color: #ff9900;
    border-radius: 50%;
    animation: page-loading-spin 0.8s linear infinite;
    -webkit-animation: page-loading-spin 0.8s linear infinite;
    will-change: transform;
}

.search-loading-text,
.page-loading-text {
    color: #cccccc;
    font-size: 14px;
    line-height: 1.4;
    flex-shrink: 0;
}

#8x8xSearchView,
#8x8xSearchView.is-search-loading {
    position: relative;
}

#8x8xSearchView.is-search-loading {
    min-height: 240px;
}

@keyframes page-loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@-webkit-keyframes page-loading-spin {
    from { -webkit-transform: rotate(0deg); }
    to { -webkit-transform: rotate(360deg); }
}

@keyframes search-loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@-webkit-keyframes search-loading-spin {
    from { -webkit-transform: rotate(0deg); }
    to { -webkit-transform: rotate(360deg); }
}

.search-hot-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-hot-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    border: none;
    background: transparent;
    color: var(--text-main);
    text-align: left;
    padding: 10px 0;
    cursor: pointer;
}

.search-hot-rank {
    flex-shrink: 0;
    width: 22px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dim);
    text-align: center;
    line-height: 1;
}

.search-hot-rank--top {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    color: #fff;
}

.search-hot-rank--1 {
    background: linear-gradient(135deg, #ffb347, #ff7a00);
}

.search-hot-rank--2 {
    background: linear-gradient(135deg, #8ec5ff, #4a90e2);
}

.search-hot-rank--3 {
    background: linear-gradient(135deg, #ffb3c7, #e85d8f);
}

.search-hot-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgb(255 255 255 / 78%);
}

.search-hot-badge {
    flex-shrink: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 6px;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 20px;
    text-align: center
}

.search-close {
    margin-left: 8px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 22px;
    cursor: pointer;
}

/* 分类导航 */
.category-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 12px;
    height: 42px;
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-nav a {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-sub);
    white-space: nowrap;
    position: relative;
}

.category-nav a.active {
    color:#FF9900FF;
    font-weight: 600;
}

.category-nav a.active::after {
    content: "";
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #FF9900FF;
    border-radius: 1px;
}

/* 筛选区 */
.filter-section {
    --filter-tag-row: calc(0.6875rem * 1.3 + 8px);
    --filter-tag-gap: 6px;
    --filter-col: calc((100% - var(--filter-tag-gap) * 4) / 5);
    position: fixed;
    top: var(--navbar-sticky-height);
    left: var(--layout-column-left, 0);
    width: var(--layout-column-width, 100%);
    right: auto;
    max-width: 100%;
    z-index: 99;
    padding: 1em 1em 0.2em 1em;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.filter-options {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.filter-tags {
    display: flex;
    flex-direction: column;
    gap: var(--filter-tag-gap);
    width: 100%;
    min-width: 0;
}

.filter-tags-row {
    display: grid;
    gap: var(--filter-tag-gap);
    width: 100%;
}

.filter-tags-row--full {
    grid-template-columns: repeat(5, minmax(0, var(--filter-col)));
}

.filter-tags-row--btn {
    grid-template-columns: repeat(4, minmax(0, var(--filter-col)));
}

.filter-section.is-collapsed .filter-tags-row:nth-child(n+4) {
    display: none;
}

.filter-toggle {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: var(--filter-col);
    min-width: 0;
    height: var(--filter-tag-row);
    padding: 0 .25rem;
    background: #ff9900;
    color: #000;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.filter-section.is-collapsed .filter-toggle {
    margin-top: 0;
}

.filter-toggle-label {
    font-size: 12px;
    color: #000;
}

.filter-toggle .arrow {
    font-size: 10px;
    line-height: 1;
    transition: transform 0.2s;
}

.filter-toggle .arrow.up {
    transform: rotate(180deg);
}

.filter-options a,
.filter-options button.filter-tag-btn {
    display: block;
    min-width: 0;
    width: 100%;
    padding: 4px 6px;
    background: var(--bg-input);
    border-radius: 4px;
    color: rgb(255 255 255 / 78%);
    font-size: .6985rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.filter-options a.active,
.filter-options button.filter-tag-btn.active {
    color: #000;
    background: #ff9900;
    font-weight: 600;
}

/* 面包屑 */
.breadcrumb {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--bg-card);
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}

.breadcrumb .bc-item {
    color: var(--text-sub);
    text-decoration: none;
}

.breadcrumb .bc-item:hover {
    color: var(--text-main);
}

.breadcrumb .bc-sep {
    color: var(--text-dim);
    font-size: 12px;
    margin: 0 2px;
}

.breadcrumb .bc-tag {
    color: #ff9900;
    background: rgba(255,153,0,0.1);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
}

/* 广告位 */
.ad-blocks {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.ad-banner-list {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.6vw, 10px);
    padding: clamp(8px, 2.4vw, 12px);
    width: 100%;
}

.ad-banner-item {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 728 / 90;
    min-height: 48px;
    background: var(--bg-input);
    border-radius: 6px;
    overflow: hidden;
}

.ad-banner-item img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center;
    display: block;
    background: var(--bg-input);
}

.ad-box-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(4px, 1.6vw, 12px);
    padding: 0 clamp(8px, 2.4vw, 12px) clamp(8px, 2.4vw, 12px);
    width: 100%;
    justify-items: center;
    align-items: start;
}

.ad-box-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ad-box-item {
    display: block;
    width: 4em;
    height: 4em;
    min-width: 0;
    aspect-ratio: 1 / 1;
    background: var(--bg-input);
    border-radius: clamp(3px, 0.8vw, 6px);
    overflow: hidden;
}

.ad-box-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    background: var(--bg-input);
}

.ad-cap {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    padding: 0 2px;
    font-size: clamp(10px, 2.6vw, 12px);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ad-text-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(4px, 1.6vw, 12px);
    padding: 0 clamp(8px, 2.4vw, 12px) clamp(8px, 2.4vw, 12px);
    width: 100%;
}

.ad-text-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    height: 36px;
    aspect-ratio: 1 / 1;
    padding: 6px 4px;
    background: var(--bg-input);
    border-radius: clamp(3px, 0.8vw, 6px);
    color: #FF9900FF;
    font-size: clamp(11px, 2.8vw, 14px);
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
}

.ad-text-item span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    word-break: break-all;
}

.ad-site-promo {
    margin: 0 1rem 0 .9rem;
    padding: .5rem .625rem;
    background: #ffffff0d;
    border-radius: .375rem;
    font-size: .6875rem;
    line-height: 1.5;
}

.ad-site-promo-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    margin-bottom: 8px;
}

.ad-site-promo-links a {
    color: #ff7e00;
    font-size: clamp(13px, 3.2vw, 15px);
    font-weight: 600;
    line-height: 1.4;
}

.ad-site-promo-text {
    margin: 0 0 6px;
    color: var(--text-main);
    font-size: clamp(12px, 4vw, 14px);
    line-height: 1.6;
    word-break: break-all;
}

.ad-stroke-banner {
    display: inline-block;
    margin-top: 10px;
    color: #fff;
    font-size: clamp(22px, 6.5vw, 34px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-decoration: none;
    -webkit-text-stroke: 2px #000;
    paint-order: stroke fill;
    text-shadow:
        0 0 1px #000,
        2px 0 0 #000,
        -2px 0 0 #000,
        0 2px 0 #000,
        0 -2px 0 #000,
        2px 2px 0 #000,
        -2px 2px 0 #000,
        2px -2px 0 #000,
        -2px -2px 0 #000;
}

@media (max-width: 360px) {
    .ad-banner-item {
        min-height: 42px;
    }
}

/* 视频卡片网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px;
}

.video-grid > li {
    min-width: 0;
}

.video-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
}

.video-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(180deg, #222 0%, #141414 100%);
}

.video-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0;
    transition: opacity 0.25s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    image-rendering: auto;
}

.video-poster.is-portrait img {
    object-position: top center;
}

.video-poster.is-square img {
    object-position: top center;
}

.video-poster img.loaded {
    opacity: 1;
}

.video-remarks {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 11px;
    border-radius: 3px;
}

.video-title {
    padding: 8px 8px 10px;
    min-width: 0;
}

.video-title-text {
    display: block;
    display: -webkit-box;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1.4;
    max-height: 2.8em;
    color: var(--text-main);
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 12px;
}

.pagination.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

main.is-page-loading {
    pointer-events: none;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: 36px;
    padding: 0 14px;
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 14px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
}

.pagination-btn:hover {
    background: var(--bg-input);
}

.pagination-btn.is-disabled {
    color: var(--text-dim);
    background: var(--bg-card);
    cursor: default;
}

.pagination-info {
    color: var(--text-main);
    font-size: 14px;
    white-space: nowrap;
    padding: 0 4px;
}

.pagination-input {
    width: 52px;
    height: 36px;
    padding: 0 8px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 16px;
    text-align: center;
    box-sizing: border-box;
    -moz-appearance: textfield;
    touch-action: manipulation;
}

.pagination-input::-webkit-outer-spin-button,
.pagination-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pagination-jump {
    min-width: 56px;
    height: 36px;
    padding: 0 14px;
    background: #ff9900;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.pagination-jump:active {
    opacity: 0.88;
}

/* 页脚 */
.footer {
    padding: 20px 12px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    border-top: 1px solid var(--border);
}

.footer p {
    margin-bottom: 6px;
}

/* 返回顶部 */
.back-top {
    display: none;
    position: fixed;
    left: 16px;
    bottom: 15px;
    width: 44px;
    height: 44px;
    background: #FF9900FF;
    color: #000;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    z-index: 90;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.back-top.show {
    display: flex;
}

.back-top svg {
    width: 22px;
    height: 22px;
}

/* 区块标题 */
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 8px;
}

.section-title h2 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-main);
}

.section-title .more {
    color: rgb(255 255 255 / 78%);
    font-size: .8rem;
}

/* 详情页 */
.detail-card {
    padding: 12px;
}

.detail-main {
    display: flex;
    gap: 12px;
}

.detail-poster {
    flex-shrink: 0;
    width: 148px;
    aspect-ratio: 16 / 9;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(180deg, #222 0%, #141414 100%);
}

.detail-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.detail-poster.is-portrait img,
.detail-poster.is-square img {
    object-position: top center;
}

.detail-info {
    flex: 1;
    min-width: 0;
}

.detail-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.detail-meta {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.8;
}

.detail-meta span {
    margin-right: 12px;
}

.detail-desc {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.7;
}

/* 播放页 */
html.player-fs-active,
html.player-fs-active body {
    overflow: hidden;
    height: 100%;
}

.player-wrap {
    background: #000;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    overflow: hidden;
}

.player-wrap.is-pseudo-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    padding-bottom: 0 !important;
    z-index: 2147483645;
    background: #000;
}

.player-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #000;
    z-index: 1;
    isolation: isolate;
}

.player-wrap.is-pseudo-fullscreen .player-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.player-stage.is-pseudo-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    z-index: 2147483645;
    background: #000;
}

.player-stage video,
.player-stage iframe,
.player-wrap iframe,
.player-embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    object-fit: contain;
    background: #000;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.player-watermark-layer {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    overflow: visible;
}

.player-watermark-layer--viewport {
    position: fixed !important;
    inset: auto !important;
    z-index: 2147483647 !important;
    pointer-events: none;
    overflow: visible;
    -webkit-transform: translate3d(0, 0, 999px);
    transform: translate3d(0, 0, 999px);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.player-watermark-layer--viewport .player-watermark {
    -webkit-transform: translate3d(0, 0, 1px);
    transform: translate3d(0, 0, 1px);
}

.player-watermark--bg {
    background-repeat: no-repeat;
    background-position: top right;
    background-size: contain;
    min-height: 22px;
}

.player-watermark {
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
    bottom: auto;
    z-index: 1;
    display: block;
    visibility: visible;
    max-width: clamp(64px, 24vw, 140px);
    max-height: clamp(32px, 12vw, 56px);
    min-width: 56px;
    min-height: 22px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: top right;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 0.88;
}

.player-wrap.is-pseudo-fullscreen .player-watermark,
.player-wrap:fullscreen .player-watermark,
.player-wrap:-webkit-full-screen .player-watermark,
.player-wrap:-moz-full-screen .player-watermark,
.player-wrap:-ms-fullscreen .player-watermark,
.player-stage.is-pseudo-fullscreen .player-watermark,
.player-stage:fullscreen .player-watermark,
.player-stage:-webkit-full-screen .player-watermark,
.player-stage:-moz-full-screen .player-watermark,
.player-stage:-ms-fullscreen .player-watermark {
    opacity: 0.9;
    max-width: clamp(72px, 18vw, 180px);
    max-height: clamp(36px, 8vw, 72px);
}

.player-wrap:fullscreen,
.player-wrap:-webkit-full-screen,
.player-wrap:-moz-full-screen,
.player-wrap:-ms-fullscreen,
.player-stage:fullscreen,
.player-stage:-webkit-full-screen,
.player-stage:-moz-full-screen,
.player-stage:-ms-fullscreen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    padding: 0;
    background: #000;
}

.player-wrap:fullscreen video,
.player-wrap:-webkit-full-screen video,
.player-wrap:-moz-full-screen video,
.player-wrap:-ms-fullscreen video,
.player-wrap.is-pseudo-fullscreen video,
.player-stage:fullscreen video,
.player-stage:-webkit-full-screen video,
.player-stage:-moz-full-screen video,
.player-stage:-ms-fullscreen video,
.player-stage.is-pseudo-fullscreen video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (orientation: landscape) {
    .player-wrap.is-pseudo-fullscreen,
    .player-wrap:fullscreen,
    .player-wrap:-webkit-full-screen,
    .player-stage.is-pseudo-fullscreen,
    .player-stage:fullscreen,
    .player-stage:-webkit-full-screen {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }
}

.play-sources {
    display: flex;
    gap: 8px;
    padding: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.play-sources::-webkit-scrollbar { display: none; }

.play-source-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    background: var(--bg-card);
    color: var(--text-sub);
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.play-source-btn.active {
    background: #FF9900FF;
    color: #000;
    font-weight: 600;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
}

.episode-grid a {
    padding: 8px 4px;
    text-align: center;
    background: var(--bg-card);
    color: var(--text-sub);
    font-size: 12px;
    border-radius: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-grid a.active {
    background: #FF9900FF;
    color: #000;
    font-weight: 600;
}

/* 影片tag（片名下方，可点击形成站内链接） */
.movie-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 12px;
}

.movie-tag {
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-sub);
    background: var(--bg-card);
    border-radius: 4px;
    line-height: 1.5;
}

.movie-tag:hover {
    color: #000;
    background: #FF9900FF;
    font-weight: 600;
}

/* 加载动画 */
.loading-more {
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-size: 13px;
}

.search-empty-tip {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px 56px;
    color: var(--text-sub);
    font-size: 15px;
    line-height: 1.6;
    list-style: none;
}

/* 图片懒加载占位 */
.lazy-placeholder {
    background: linear-gradient(110deg, #1a1a1a 8%, #262626 18%, #1a1a1a 33%);
    background-size: 200% 100%;
    animation: shine 1.5s linear infinite;
}

@keyframes shine {
    to { background-position-x: -200%; }
}

/* 访问公告弹窗（主题色跟随 --primary） */
html.notice-mod-open,
body.notice-mod-open {
    overflow: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html.notice-mod-open::-webkit-scrollbar,
body.notice-mod-open::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.notice-mod {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    transform: none !important;
    align-self: stretch !important;
    box-sizing: border-box;
    background: transparent !important;
}

.notice-mod[hidden] {
    display: none !important;
}

.notice-mod__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.notice-mod__panel {
    position: relative;
    z-index: 1;
    width: min(90%, 420px);
    max-height: min(90vh, 720px);
    overflow: auto;
    background: #fff;
    color: #1a1a1a;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.notice-mod__panel::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.notice-mod__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: 14px 14px 0 0;
}

.notice-mod__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.notice-mod__title-icon {
    font-size: 15px;
    line-height: 1;
}

.notice-mod__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.notice-mod__body {
    padding: 14px 14px 6px;
}

.notice-mod__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.notice-mod__row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 8px 10px;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 8px;
}

.notice-mod__row-label {
    flex: 0 0 auto;
    color: #222;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.notice-mod__row-value {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-mod__copy-btn {
    flex: 0 0 auto;
    border: 0;
    border-radius: 6px;
    padding: 5px 10px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.notice-mod__copy-btn.is-copied {
    background: #2f9b4f;
}

.notice-mod__copy-btn--lg {
    padding: 7px 12px;
    font-size: 13px;
}

.notice-mod__block {
    margin-top: 12px;
}

.notice-mod__block--hl {
    padding: 12px;
    background: color-mix(in srgb, var(--primary) 8%, #fff);
    border: 1px dashed var(--primary);
    border-radius: 10px;
}

.notice-mod__block-label {
    margin-bottom: 8px;
    color: #777;
    font-size: 12px;
}

.notice-mod__block-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notice-mod__permanent {
    color: var(--primary);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    word-break: break-all;
}

.notice-mod__email {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.notice-mod__email-icon {
    flex: 0 0 auto;
    font-size: 14px;
}

.notice-mod__email-text {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-mod__email-tip {
    flex: 0 0 auto;
    color: #999;
    font-size: 11px;
    white-space: nowrap;
}

.notice-mod__hint {
    margin: 10px 0 0;
    color: #999;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.notice-mod__hint--strong {
    margin-top: 6px;
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
}

.notice-mod__foot {
    padding: 8px 14px 16px;
}

.notice-mod__got-it {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.notice-mod__got-it-arrow {
    font-size: 16px;
    line-height: 1;
}

@supports not (background: color-mix(in srgb, red 50%, white)) {
    .notice-mod__block--hl {
        background: #fff7f0;
    }
}
