/* XJian Template - 麒御影视CMS风格 */
/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    font-size: 62.5%;
}

body {
    font: 400 14px/1.4 "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    min-height: 100%;
    background: #000000;
    color: #fff;
    -webkit-text-size-adjust: none;
}

a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s, background-color 0.3s;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 0;
}

/* Header */
.xj-header {
    background: #000;
    padding: 20px;
    border-bottom: 1px solid #1b1b1b;
}

.xj-header-inner {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.xj-logo a {
    display: block;
}

.xj-logo-text {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.xj-search {
    flex: 1;
    max-width: 500px;
    margin-left: 100px;
}

.xj-search-form {
    position: relative;
}

.xj-search-input {
    width: 100%;
    border: 0;
    border-radius: 20px;
    background: #fff;
    color: #000;
    font-size: 13px;
    padding: 12px 56px 12px 20px;
    outline: none;
}

.xj-search-input::placeholder {
    color: #666;
}

.xj-search-btn {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #276fdb;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.xj-search-btn-icon {
    display: block;
    flex-shrink: 0;
}

.xj-search-btn:hover {
    background: #1554b2;
}

/* Navigation */
.xj-nav {
    border: 1px solid #1b1b1b;
    border-left: 0;
    border-right: 0;
    background: #000;
    box-shadow: 0 1px 0 #2c2d32;
}

.xj-nav-inner {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 10px;
}

.xj-nav-primary {
    display: flex;
    align-items: center;
    list-style: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

.xj-nav-primary li {
    position: relative;
}

.xj-nav-primary a {
    display: block;
    padding: 17px 16px;
    color: #fff;
    transition: color 0.3s;
    position: relative;
    white-space: nowrap;
}

.xj-nav-primary a::before {
    position: absolute;
    content: "";
    left: 0;
    bottom: 0;
    background: #276fdb;
    height: 3px;
    width: 0;
    transition: width 0.3s;
}

.xj-nav-primary a:hover::before,
.xj-nav-primary a.is-active::before {
    width: 100%;
}

.xj-nav-primary a:hover,
.xj-nav-primary a.is-active {
    color: #276fdb;
}

.xj-nav-home a {
    width: 50px;
    text-align: center;
}

.xj-icon-home::before {
    content: "⌂";
    font-size: 20px;
}

/* Dropdown */
.xj-nav-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 17px 16px;
    padding-right: 28px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.xj-nav-dropdown-toggle::before {
    position: absolute;
    content: "";
    left: 0;
    bottom: 0;
    background-color: #276fdb;
    height: 3px;
    width: 0;
    transition: width 0.3s;
}

.xj-nav-dropdown-toggle:hover::before,
.xj-nav-dropdown.is-active > .xj-nav-dropdown-toggle::before,
.xj-nav-dropdown.is-open > .xj-nav-dropdown-toggle::before {
    width: 100%;
}

.xj-nav-dropdown-toggle:hover,
.xj-nav-dropdown.is-active > .xj-nav-dropdown-toggle,
.xj-nav-dropdown.is-open > .xj-nav-dropdown-toggle {
    color: #276fdb;
}

.xj-icon-arrow::before {
    content: "▼";
    font-size: 8px;
    margin-left: 8px;
}

.xj-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 180px;
    background: #1b1b1b;
    border: 1px solid #2c2d32;
    border-top: 3px solid #276fdb;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

@media (hover: hover) and (pointer: fine) {
    .xj-nav-dropdown:hover .xj-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.xj-dropdown-menu li a {
    padding: 12px 16px;
    font-size: 13px;
    text-transform: none;
}

.xj-dropdown-menu li a::before {
    display: none;
}

.xj-dropdown-menu li a:hover {
    background: #276fdb;
    color: #fff;
}

/* Main Content */
.xj-main {
    background: #151515;
    min-height: calc(100vh - 200px);
}

.xj-content {
    max-width: 1260px;
    margin: 0 auto;
    padding: 20px 10px 40px;
}

/* Page Header (List) */
.xj-page-header {
    padding: 30px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #1b1b1b;
}

.xj-page-title {
    font-size: 2.4rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.xj-page-desc {
    font-size: 14px;
    color: #888;
}

/* Section */
.xj-section {
    margin-bottom: 30px;
}

.xj-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #1b1b1b;
}

.xj-section-title {
    font-size: 1.8rem;
    font-weight: 500;
    color: #fff;
    text-transform: uppercase;
}

.xj-section-tabs {
    display: flex;
    align-items: center;
    gap: 15px;
}

.xj-section-tabs a,
.xj-section-tabs span {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.3s;
}

.xj-section-tabs a:hover,
.xj-section-tabs span.is-active {
    color: #276fdb;
}

.xj-section-more {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
}

.xj-section-more:hover {
    color: #276fdb;
}

/* Hero */
.xj-watching .xj-hero {
    display: flex;
    gap: 30px;
    background: #1b1b1b;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.xj-hero-poster {
    flex-shrink: 0;
    width: 240px;
    border-radius: 8px;
    overflow: hidden;
}

.xj-hero-poster img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.xj-hero-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.xj-hero-title {
    font-size: 2.4rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.xj-hero-desc {
    font-size: 1.4rem;
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 25px;
}

.xj-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s;
    border: none;
}

.xj-btn-primary {
    background: #276fdb;
    color: #fff;
}

.xj-btn-primary:hover {
    background: #1554b2;
}

.xj-btn-play {
    background: #e62117;
    color: #fff;
}

.xj-btn-play:hover {
    background: #c41a12;
}

/* Grid */
.xj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* Card */
.xj-card {
    background: #1b1b1b;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}

.xj-card:hover {
    transform: translateY(-5px);
}

.xj-card-pic {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.xj-card-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xj-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #276fdb;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.xj-card-title {
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pagination */
.xj-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #1b1b1b;
}

.xj-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #fff;
    background: #1b1b1b;
    transition: background 0.3s;
}

.xj-page-link:hover:not(.xj-disabled):not(.xj-active) {
    background: #276fdb;
    color: #fff;
}

.xj-page-link.xj-active {
    background: #276fdb;
    font-weight: 600;
}

.xj-page-link.xj-disabled {
    color: #666;
    cursor: not-allowed;
}

.xj-page-dots {
    color: #666;
    padding: 0 8px;
}

/* Empty */
.xj-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.xj-empty p {
    font-size: 16px;
}

/* Detail Page */
.xj-detail-header {
    display: flex;
    gap: 30px;
    background: #1b1b1b;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.xj-detail-poster {
    flex-shrink: 0;
    width: 200px;
    border-radius: 8px;
    overflow: hidden;
}

.xj-detail-poster img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.xj-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.xj-detail-title {
    font-size: 2.6rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.xj-detail-subtitle {
    font-size: 1.4rem;
    color: #888;
    margin-bottom: 15px;
}

.xj-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.xj-detail-meta span {
    font-size: 13px;
    color: #aaa;
    padding: 4px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}

.xj-detail-meta .xj-score {
    background: #276fdb;
    color: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.xj-detail-meta .xj-douban {
    background: #00b51d;
    color: #fff;
    font-weight: 600;
}

.xj-detail-hits {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
}

.xj-detail-section {
    background: #1b1b1b;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.xj-detail-section-title {
    font-size: 1.6rem;
    font-weight: 500;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2c2d32;
}

.xj-detail-plot {
    font-size: 1.4rem;
    line-height: 1.8;
    color: #ccc;
}

/* SEO Q&A */
.xj-desc-block {
    margin-bottom: 20px;
}

.xj-desc-block:last-child {
    margin-bottom: 0;
}

.xj-desc-question {
    font-size: 1.4rem;
    font-weight: 600;
    color: #276fdb;
    margin-bottom: 8px;
}

.xj-desc-answer {
    font-size: 1.3rem;
    color: #aaa;
    line-height: 1.7;
}

/* Episodes */
.xj-episodes {
    margin-bottom: 10px;
}

.xj-episode-group {
    margin-bottom: 25px;
}

.xj-episode-group:last-child {
    margin-bottom: 0;
}

.xj-episode-group-title {
    font-size: 1.3rem;
    font-weight: 500;
    color: #888;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.xj-episode-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.xj-episode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 10px 16px;
    background: #2c2d32;
    border-radius: 4px;
    font-size: 13px;
    color: #fff;
    transition: background 0.3s;
}

.xj-episode-btn:hover {
    background: #276fdb;
}

.xj-episode-btn.is-active {
    background: #e62117;
    font-weight: 600;
}

/* Breadcrumb */
.xj-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #888;
}

.xj-breadcrumb a {
    color: #888;
}

.xj-breadcrumb a:hover {
    color: #276fdb;
}

.xj-sep {
    color: #555;
}

/* Player Page */
.xj-player-section {
    background: #1b1b1b;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.xj-player-title {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.xj-player-wrapper {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.xj-player-container {
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 70vh;
    background: #000;
}

.xj-player-wrapper .artplayer-app {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 16/9 !important;
}

/* 确保播放器在加载前也有占位 */
.xj-player-wrapper:empty::before {
    content: '播放器加载中...';
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16/9;
    max-height: 70vh;
    color: #666;
    font-size: 14px;
}

.xj-player-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.xj-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #2c2d32;
    border-radius: 4px;
    font-size: 13px;
    color: #fff;
    transition: background 0.3s;
}

.xj-nav-btn:hover:not(.xj-disabled) {
    background: #276fdb;
}

.xj-nav-btn.xj-disabled {
    background: #1b1b1b;
    color: #555;
    cursor: not-allowed;
}

.xj-nav-btn.xj-detail {
    background: #276fdb;
}

.xj-player-episodes,
.xj-player-recommend {
    background: #1b1b1b;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

/* Player Title with Episode */
.xj-player-title {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.xj-player-episode {
    font-size: 1.4rem;
    color: #888;
    margin-left: 10px;
}

/* Source Tabs */
.xj-source-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #2c2d32;
}

.xj-source-title {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 15px;
    color: #aaa;
}

.xj-source-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.xj-source-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #2c2d32;
    border-radius: 4px;
    font-size: 13px;
    color: #fff;
    transition: all 0.3s;
}

.xj-source-tab:hover {
    background: #276fdb;
}

.xj-source-tab.is-active {
    background: #276fdb;
    font-weight: 600;
}

/* Episode Section */
.xj-episode-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #2c2d32;
}

.xj-episode-section-title {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 15px;
    color: #aaa;
}

/* Nav buttons with names */
.xj-nav-btn.xj-prev,
.xj-nav-btn.xj-next {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.xj-nav-btn.xj-next {
    align-items: flex-end;
}

.xj-nav-name {
    font-size: 12px;
    color: #888;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Recommend Section */
.xj-recommend-section {
    background: #1b1b1b;
    border-radius: 8px;
    padding: 25px;
    margin-top: 20px;
}

/* Footer */
.xj-footer {
    background: #000;
    border-top: 1px solid #1b1b1b;
    padding: 30px 20px;
}

.xj-footer-inner {
    max-width: 1260px;
    margin: 0 auto;
    text-align: center;
}

.xj-copyright {
    font-size: 13px;
    color: #666;
}

/* Responsive */
@media (max-width: 1024px) {
    .xj-search {
        margin-left: 30px;
    }
    
    .xj-nav-primary a,
    .xj-nav-dropdown-toggle {
        padding: 17px 12px;
        padding-right: 24px;
        font-size: 13px;
    }

    .xj-nav-home a {
        padding-right: 12px;
    }
}

@media (max-width: 768px) {
    .xj-header-inner {
        flex-direction: column;
        gap: 15px;
    }
    
    .xj-search {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .xj-nav-inner {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .xj-nav-inner::-webkit-scrollbar {
        height: 0;
    }

    .xj-nav-primary {
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: max-content;
        min-width: 100%;
    }

    .xj-nav-primary > li {
        flex-shrink: 0;
    }
    
    .xj-nav-primary a,
    .xj-nav-dropdown-toggle {
        padding: 12px 10px;
    }

    .xj-nav-dropdown-toggle {
        padding-right: 22px;
    }

    .xj-nav-home a {
        padding-right: 10px;
    }
    
    /* fixed：避免被 .xj-nav-inner overflow-x 裁剪；top 由 main.js 同步 */
    .xj-dropdown-menu {
        position: fixed;
        left: 12px;
        right: 12px;
        width: auto;
        top: 0;
        max-height: min(320px, 50vh);
        overflow-y: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        z-index: 200;
        -webkit-overflow-scrolling: touch;
    }
    
    .xj-nav-dropdown.is-open .xj-dropdown-menu {
        display: block;
    }
    
    .xj-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .xj-watching .xj-hero,
    .xj-detail-header {
        flex-direction: column;
    }
    
    .xj-hero-poster,
    .xj-detail-poster {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .xj-hero-title,
    .xj-detail-title {
        font-size: 1.8rem;
    }
    
    .xj-detail-info {
        text-align: center;
    }
    
    .xj-detail-meta {
        justify-content: center;
    }
    
    .xj-player-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .xj-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .xj-section-tabs {
        flex-wrap: wrap;
    }
    
    .xj-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .xj-card-title {
        font-size: 12px;
        padding: 8px;
    }
    
    .xj-episode-list {
        gap: 8px;
    }
    
    .xj-episode-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: auto;
    }

    .xj-filter-group {
        flex-direction: column;
        gap: 10px;
    }

    .xj-filter-label {
        width: auto;
        padding-top: 0;
    }

    .xj-filter-chips {
        width: 100%;
    }
}

/* 列表筛选栏 */
.xj-filter-bar {
    background: #1b1b1b;
    border: 1px solid #2c2d32;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.xj-filter-group {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #2c2d32;
}

.xj-filter-group:first-child {
    padding-top: 0;
}

.xj-filter-group:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.xj-filter-label {
    flex-shrink: 0;
    width: 52px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    padding-top: 7px;
    letter-spacing: 0.02em;
}

.xj-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.xj-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: #ccc;
    background: #2c2d32;
    border: 1px solid transparent;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.xj-filter-chip:hover {
    color: #fff;
    background: #3a3b40;
    border-color: rgba(39, 111, 219, 0.35);
}

.xj-filter-chip.is-active {
    color: #fff;
    background: #276fdb;
    border-color: #276fdb;
    font-weight: 600;
}

.xj-filter-cta {
    margin-bottom: 18px;
}

.xj-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #276fdb;
    background: rgba(39, 111, 219, 0.12);
    border: 1px solid rgba(39, 111, 219, 0.45);
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.xj-btn-outline:hover {
    color: #fff;
    background: #276fdb;
    border-color: #276fdb;
}
