/* z0005 - IMDb Magazine Portal Theme */
/* Colors: #F5C518 (IMDb Yellow), #1F1F1F (Dark), #6B3FA0 (Purple Accent) */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f4f4f4;
    color: #1F1F1F;
    line-height: 1.6;
    min-height: 100vh;
}
a { color: #1F1F1F; text-decoration: none; transition: color 0.2s; }
a:hover { color: #6B3FA0; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* === Header === */
.site-header {
    background: #1F1F1F;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 60px;
    gap: 20px;
}
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-badge {
    background: #F5C518;
    color: #1F1F1F;
    font-weight: 900;
    font-size: 1.1rem;
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.logo:hover .logo-badge { background: #e6b800; }

/* Main Nav */
.main-nav { flex: 1; }
.main-nav > ul { display: flex; gap: 4px; align-items: center; }
.main-nav > ul > li { position: relative; }
.main-nav a {
    color: #ccc;
    padding: 8px 14px;
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}
.main-nav a:hover,
.main-nav a.current {
    color: #F5C518;
    background: rgba(245,197,24,0.1);
}
.main-nav .has-sub:hover .sub-nav { display: block; }
.sub-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2a2a2a;
    border-radius: 0 0 6px 6px;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 100;
    padding: 6px 0;
}
.sub-nav li a {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 0;
}
.sub-nav li a:hover { background: rgba(245,197,24,0.15); }

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.header-search input {
    width: 220px;
    padding: 7px 14px;
    border: 2px solid #444;
    border-right: none;
    border-radius: 4px 0 0 4px;
    background: #333;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.header-search input:focus { border-color: #F5C518; }
.header-search input::placeholder { color: #888; }
.header-search button {
    padding: 7px 18px;
    background: #F5C518;
    color: #1F1F1F;
    border: 2px solid #F5C518;
    border-radius: 0 4px 4px 0;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.header-search button:hover { background: #e6b800; border-color: #e6b800; }

/* Mobile Buttons */
.mobile-btns { display: none; gap: 8px; align-items: center; margin-left: auto; }
.mobile-btns button {
    background: none;
    border: none;
    color: #F5C518;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s;
}
.mobile-btns button:hover { background: rgba(245,197,24,0.15); }

/* Search Panel (Mobile) */
.search-panel {
    display: none;
    background: #2a2a2a;
    padding: 12px 20px;
}
.search-panel.show { display: block; }
.search-panel-inner { display: flex; max-width: 600px; margin: 0 auto; }
.search-panel-inner input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #444;
    border-right: none;
    border-radius: 4px 0 0 4px;
    background: #333;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
}
.search-panel-inner input:focus { border-color: #F5C518; }
.search-panel-inner input::placeholder { color: #888; }
.search-panel-inner button {
    padding: 10px 20px;
    background: #F5C518;
    color: #1F1F1F;
    border: 2px solid #F5C518;
    border-radius: 0 4px 4px 0;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    background: #2a2a2a;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
}
.mobile-nav.show { display: block; max-height: 500px; overflow-y: auto; }
.mobile-nav ul { padding: 10px 0; }
.mobile-nav li a {
    display: block;
    padding: 10px 24px;
    color: #ccc;
    font-size: 0.95rem;
    border-bottom: 1px solid #333;
    transition: background 0.2s, color 0.2s;
}
.mobile-nav li a:hover { background: rgba(245,197,24,0.1); color: #F5C518; }
.mobile-nav li.sub-item a { padding-left: 44px; font-size: 0.9rem; color: #999; }

/* === Main Content === */
main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 200px);
}

/* === Welcome Section === */
.welcome-section {
    background: linear-gradient(135deg, #1F1F1F 0%, #2d2d2d 100%);
    color: #fff;
    padding: 40px 32px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 6px solid #F5C518;
}
.welcome-section h1 {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: #F5C518;
}
.welcome-desc {
    font-size: 1.05rem;
    color: #bbb;
    margin: 0;
}

/* === Featured Section === */
.featured-section { margin-bottom: 28px; }
.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.featured-item {
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}
.featured-item:hover { transform: translateY(-4px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.featured-item a { display: block; }
.featured-item .cover { display: block; position: relative; padding-bottom: 133.33%; overflow: hidden; background: #e0e0e0; }
.featured-item .cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.featured-item:hover .cover img { transform: scale(1.05); }
.featured-item .cover .mark { position: absolute; right: 0; bottom: 0; background: #F5C518; color: #1F1F1F; padding: 2px 8px; border-radius: 6px 0 0 0; font-size: 0.75rem; font-weight: 700; }
.featured-item .info { padding: 10px 12px 14px; }
.featured-item .info .title { font-size: 1rem; font-weight: 800; color: #1F1F1F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === Section Styles === */
.content-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 3px solid #F5C518;
}
.section-title {
    font-size: 1.3rem;
    font-weight: 900;
    color: #1F1F1F;
    position: relative;
    padding-left: 14px;
    margin-bottom: 16px;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 22px;
    background: #F5C518;
    border-radius: 3px;
}
.section-header .section-title { margin-bottom: 0; }
.more-link {
    color: #6B3FA0;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}
.more-link:hover { color: #F5C518; }

/* === Video Grid === */
.video-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    align-items: start;
}
.item {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.3s, box-shadow 0.3s;
}
.item:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.item a { display: block; }
.item .cover { display: block; position: relative; padding-bottom: 150%; overflow: hidden; background: #e0e0e0; }
.item .cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.item:hover .cover img { transform: scale(1.05); }
.item .cover .mark { position: absolute; right: 0; bottom: 0; background: #F5C518; color: #1F1F1F; padding: 1px 6px; border-radius: 6px 0 0 0; font-size: 0.75rem; font-weight: 700; }
.item .info { padding: 8px 10px 12px; }
.item .info .title { font-size: 0.88rem; font-weight: 700; color: #1F1F1F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.item:hover .info .title { color: #6B3FA0; }

/* === Breadcrumb === */
.breadcrumb {
    padding: 12px 0;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 16px;
}
.breadcrumb a { color: #6B3FA0; font-weight: 500; }
.breadcrumb a:hover { color: #F5C518; text-decoration: underline; }
.breadcrumb span { color: #999; }

/* === List Page === */
.list-page { padding-top: 10px; }
.list-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
}
.list-content h1 {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #F5C518;
    color: #1F1F1F;
}
.list-content h1 .subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    color: #888;
    margin-left: 8px;
}

/* Sidebar */
.sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    align-self: start;
    position: sticky;
    top: 80px;
}
.sidebar-section h3 {
    font-size: 1.05rem;
    font-weight: 800;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 3px solid #F5C518;
    color: #1F1F1F;
}
.sidebar ul li a {
    display: block;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #555;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}
.sidebar ul li a:hover,
.sidebar ul li a.current {
    background: #F5C518;
    color: #1F1F1F;
    font-weight: 600;
}
.sidebar ul li.sub-item a { padding-left: 28px; font-size: 0.85rem; }

/* === Archive / Detail Page === */
.archive-page { padding-top: 10px; }
.detail-section {
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.detail-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
}
.detail-poster img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.detail-header {
    margin-bottom: 16px;
}
.detail-header h1 {
    font-size: 1.8rem;
    font-weight: 900;
    color: #1F1F1F;
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Star Rating */
.star-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.star-rating .stars {
    color: #F5C518;
    font-size: 1.3rem;
    letter-spacing: 2px;
}
.score-value {
    background: #F5C518;
    color: #1F1F1F;
    font-weight: 900;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 1rem;
}

/* Description List (dl/dt/dd) */
.info-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.info-list dt {
    font-weight: 700;
    color: #666;
    white-space: nowrap;
}
.info-list dt::after { content: '：'; }
.info-list dd {
    color: #333;
    line-height: 1.5;
}

/* Play Action */
.play-action { margin-top: 16px; }
.btn-play {
    display: inline-block;
    background: #F5C518;
    color: #1F1F1F;
    padding: 12px 36px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 1.05rem;
    transition: background 0.2s, transform 0.2s;
    cursor: pointer;
}
.btn-play:hover { background: #e6b800; transform: translateY(-2px); color: #1F1F1F; }
.btn-play.disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
}
.btn-play.disabled:hover { transform: none; }

/* VOD Section */
.vod-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.vod-group { margin-bottom: 16px; }
.vod-group:last-child { margin-bottom: 0; }
.vod-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1F1F1F;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid #6B3FA0;
}
.episode-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.episode-btn {
    display: inline-block;
    padding: 6px 16px;
    background: #f5f5f5;
    color: #333;
    border-radius: 4px;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid #ddd;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    cursor: pointer;
}
.episode-btn:hover {
    background: #F5C518;
    color: #1F1F1F;
    border-color: #F5C518;
}
.episode-btn.current {
    background: #6B3FA0;
    color: #fff;
    border-color: #6B3FA0;
    font-weight: 700;
    cursor: default;
}

/* Description Section */
.desc-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.description {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #444;
}

/* Related Section */
.related-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* === Play Page === */
.play-page { padding-top: 10px; }
.play-header {
    margin-bottom: 16px;
}
.play-header h1 {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1F1F1F;
    padding-bottom: 10px;
    border-bottom: 3px solid #F5C518;
}

/* Video Player */
.video-player {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}
.video-player iframe,
.video-player video,
.video-player embed,
.video-player object {
    display: block;
    width: 100%;
    min-height: 200px;
}
.player-placeholder {
    width: 100%;
    padding: 80px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1F1F1F;
    transition: opacity 0.3s;
}
.video-player iframe ~ .player-placeholder,
.video-player video ~ .player-placeholder {
    display: none;
}
.player-placeholder.hide {
    display: none;
}
.player-placeholder p {
    color: #999;
    margin-top: 16px;
    font-size: 0.95rem;
}
.player-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(245,197,24,0.2);
    border-top-color: #F5C518;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Episodes Section */
.episodes-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* === Search Page === */
.search-page h1 {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid #F5C518;
    color: #1F1F1F;
}
.empty-result {
    text-align: center;
    padding: 50px 20px;
    font-size: 1.1rem;
    color: #888;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 28px;
}
.recommend-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* === Paging === */
.paging {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 24px 0;
}
.paging a, .paging span, .paging ul > li > a, .paging ul > li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}
.paging a, .paging ul > li > a {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}
.paging a:hover, .paging ul > li > a:hover {
    background: #F5C518;
    color: #1F1F1F;
    border-color: #F5C518;
}
.paging a.current, .paging span.current, .paging ul > li > a.current, .paging ul > li > span.current,
.paging .active a, .paging .active span, .paging span {
    background: #6B3FA0;
    color: #fff;
    border: 1px solid #6B3FA0;
}
.paging a.disabled, .paging span.disabled, .paging ul > li > a.disabled {
    color: #ccc;
    background: #f5f5f5;
    border-color: #e0e0e0;
    cursor: default;
    pointer-events: none;
}
.paging ul { display: flex; gap: 6px; list-style: none; flex-wrap: wrap; }
.paging select { height: 38px; padding: 0 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.9rem; color: #333; background: #fff; }

/* === Footer === */
.site-footer {
    background: #1F1F1F;
    color: #bbb;
    margin-top: 40px;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 20px 24px;
}
.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}
.footer-section h3 {
    color: #F5C518;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #333;
}
.footer-section ul li {
    margin-bottom: 8px;
}
.footer-section ul li a {
    color: #999;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-section ul li a:hover { color: #F5C518; }
.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
}
.footer-bottom p {
    font-size: 0.85rem;
    color: #777;
}

/* === Responsive === */

/* Tablet - 1024px */
@media (max-width: 1024px) {
    .video-grid { grid-template-columns: repeat(4, 1fr); }
    .featured-grid { grid-template-columns: repeat(4, 1fr); }
    .header-search input { width: 160px; }
    .list-layout { grid-template-columns: 180px 1fr; }
    .detail-layout { grid-template-columns: 220px 1fr; gap: 24px; }
}

/* Tablet small - 768px */
@media (max-width: 768px) {
    .header-inner { padding: 0 16px; }
    .main-nav { display: none; }
    .header-search { display: none; }
    .mobile-btns { display: flex; }

    main { padding: 16px; }

    .video-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .featured-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }

    .list-layout { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding: 12px 16px;
    }
    .sidebar-section { min-width: 100%; }
    .sidebar-section h3 { font-size: 0.95rem; }
    .sidebar ul { display: flex; flex-wrap: wrap; gap: 6px; }
    .sidebar ul li a { padding: 4px 10px; font-size: 0.85rem; white-space: nowrap; }
    .sidebar ul li.sub-item a { padding-left: 10px; }

    .detail-layout { grid-template-columns: 180px 1fr; gap: 20px; }
    .detail-header h1 { font-size: 1.4rem; }

    .welcome-section { padding: 28px 20px; }
    .welcome-section h1 { font-size: 1.4rem; }

    .footer-columns { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* Mobile - 480px */
@media (max-width: 480px) {
    .header-inner { height: 52px; }
    .logo-badge { font-size: 0.95rem; padding: 3px 10px; }

    main { padding: 12px; }

    .video-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .featured-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .item .info { padding: 6px 8px 10px; }
    .item .info .title { font-size: 0.8rem; }
    .item .cover .mark { font-size: 0.65rem; padding: 1px 5px; }

    .featured-item .info { padding: 8px 10px 12px; }
    .featured-item .info .title { font-size: 0.88rem; }

    .detail-layout { grid-template-columns: 1fr; }
    .detail-poster { max-width: 200px; margin: 0 auto; }
    .detail-header h1 { font-size: 1.2rem; text-align: center; }
    .star-rating { justify-content: center; }
    .info-list { font-size: 0.9rem; }
    .play-action { text-align: center; }

    .list-content h1 { font-size: 1.3rem; }
    .search-page h1 { font-size: 1.2rem; }
    .play-header h1 { font-size: 1.2rem; }

    .welcome-section { padding: 20px 16px; }
    .welcome-section h1 { font-size: 1.2rem; }
    .welcome-desc { font-size: 0.9rem; }

    .content-section { padding: 16px; }
    .section-title { font-size: 1.1rem; }

    .episode-list { gap: 6px; }
    .episode-btn { padding: 5px 12px; font-size: 0.82rem; }

    .footer-columns { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .footer-inner { padding: 28px 16px 20px; }
    .footer-section h3 { font-size: 0.85rem; margin-bottom: 8px; padding-bottom: 6px; }
    .footer-section ul li { margin-bottom: 4px; }
    .footer-section ul li a { font-size: 0.78rem; }

    .btn-play { padding: 10px 28px; font-size: 0.95rem; }
}
