/* z0003 - Douban Minimalist Theme */
/* Color: #00B51D (Douban Green), Background: #f6f6f1, Text: #494949 */

/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif; color: #494949; background: #f6f6f1; line-height: 1.7; }
a { color: #00B51D; text-decoration: none; transition: color .2s; }
a:hover { color: #009a18; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input { font: inherit; color: inherit; }

/* === Container === */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* === Header === */
.site-header { background: #fff; border-bottom: 1px solid #e8e8e3; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; height: 56px; }
.logo { font-size: 20px; font-weight: 700; color: #00B51D; white-space: nowrap; margin-right: 32px; letter-spacing: -0.5px; }
.logo:hover { color: #009a18; }

/* Main Nav */
.main-nav > ul { display: flex; gap: 4px; }
.main-nav > ul > li { position: relative; }
.main-nav a { display: block; padding: 6px 12px; color: #494949; font-size: 14px; border-radius: 4px; transition: background .2s, color .2s; }
.main-nav a:hover, .main-nav a.active { color: #00B51D; background: #f0f9f0; }
.has-sub:hover .sub-nav { display: block; }
.sub-nav { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid #e8e8e3; border-radius: 4px; min-width: 120px; padding: 4px 0; box-shadow: 0 4px 12px rgba(0,0,0,.08); z-index: 200; }
.sub-nav li { display: block; }
.sub-nav a { padding: 6px 16px; white-space: nowrap; border-radius: 0; }

/* Header Search */
.header-search { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.header-search input { width: 200px; height: 32px; padding: 0 10px; border: 1px solid #d9d9d4; border-radius: 4px; background: #fafafa; font-size: 13px; transition: border-color .2s; }
.header-search input:focus { outline: none; border-color: #00B51D; background: #fff; }
.header-search button { height: 32px; padding: 0 14px; background: #00B51D; color: #fff; border-radius: 4px; font-size: 13px; transition: background .2s; }
.header-search button:hover { background: #009a18; }

/* Mobile Controls */
.mobile-btns { display: none; margin-left: auto; gap: 8px; }
.mobile-btns button { padding: 6px; color: #494949; }

/* Search Panel (mobile) */
.search-panel { display: none; background: #fff; border-bottom: 1px solid #e8e8e3; padding: 10px 20px; }
.search-panel.show { display: block; }
.search-panel-inner { max-width: 1100px; margin: 0 auto; display: flex; gap: 8px; }
.search-panel-inner input { flex: 1; height: 36px; padding: 0 12px; border: 1px solid #d9d9d4; border-radius: 4px; font-size: 14px; }
.search-panel-inner input:focus { outline: none; border-color: #00B51D; }
.search-panel-inner button { height: 36px; padding: 0 16px; background: #00B51D; color: #fff; border-radius: 4px; font-size: 14px; }

/* Mobile Nav */
.mobile-nav { display: none; background: #fff; border-bottom: 1px solid #e8e8e3; }
.mobile-nav.show { display: block; }
.mobile-nav ul { max-width: 1100px; margin: 0 auto; padding: 8px 20px; }
.mobile-nav li { border-bottom: 1px solid #f0f0eb; }
.mobile-nav a { display: block; padding: 10px 0; color: #494949; font-size: 15px; }
.mobile-nav .sub-item a { padding-left: 16px; color: #787878; font-size: 14px; }

/* === Banner Section (Index h1) === */
.banner-section { padding: 40px 0 24px; }
.banner-section h1 { font-size: 28px; font-weight: 700; color: #333; letter-spacing: -0.5px; }
.banner-desc { margin-top: 6px; color: #9b9b9b; font-size: 14px; }

/* === Section === */
.section { margin-bottom: 36px; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 0 12px; border-bottom: 1px solid #e8e8e3; margin-bottom: 16px; }
.section-header h2 { font-size: 18px; font-weight: 600; color: #333; }
.section-header .more { font-size: 13px; color: #9b9b9b; }
.section-header .more:hover { color: #00B51D; }

/* === Video Grid (5 columns desktop) === */
.video-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px 16px; align-items: start; }

/* Card: figure.item */
.item { position: relative; overflow: hidden; }
.item a { display: block; color: #494949; }
.item .cover { display: block; position: relative; aspect-ratio: 2/3; overflow: hidden; border-radius: 3px; background: #e8e8e3; }
.item .cover img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.item .cover .mark { position: absolute; right: 0; bottom: 0; background: rgba(0,181,29,.85); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 3px 0 0 0; }
.item a:hover .cover img { opacity: .85; }
.item figcaption { padding: 8px 2px 0; font-size: 14px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === Filter Nav (List page) === */
.filter-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 20px 0 12px; border-bottom: 1px solid #e8e8e3; margin-bottom: 20px; }
.filter-nav a { padding: 4px 14px; font-size: 14px; color: #494949; border-radius: 4px; transition: background .2s, color .2s; }
.filter-nav a:hover, .filter-nav a.active { color: #00B51D; background: #f0f9f0; }

/* === Breadcrumb (ol/li with CSS ::before separator) === */
.breadcrumb { padding: 16px 0 8px; font-size: 13px; color: #9b9b9b; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before { content: "\203A"; margin: 0 8px; color: #c0c0b8; font-size: 15px; }
.breadcrumb a { color: #9b9b9b; }
.breadcrumb a:hover { color: #00B51D; }

/* === Detail Page === */
.detail-page { padding-bottom: 20px; }
.detail-layout { display: flex; gap: 30px; padding: 20px 0; }
.detail-cover { flex-shrink: 0; width: 220px; }
.detail-cover img { width: 100%; border-radius: 3px; background: #e8e8e3; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h1 { font-size: 24px; font-weight: 700; color: #333; margin-bottom: 8px; line-height: 1.3; }
.score { display: inline-block; font-size: 22px; font-weight: 700; color: #e09015; margin-bottom: 16px; letter-spacing: 1px; }
.score::before { content: "\2605 "; font-size: 18px; }
.info-list { font-size: 14px; line-height: 2; }
.info-list dt { float: left; color: #9b9b9b; width: 50px; }
.info-list dd { margin-left: 56px; color: #494949; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-action { margin-top: 20px; }
.btn-play { display: inline-block; padding: 10px 32px; background: #00B51D; color: #fff; border-radius: 4px; font-size: 15px; font-weight: 500; transition: background .2s; }
.btn-play:hover { background: #009a18; color: #fff; }
.btn-play.disabled { background: #c0c0b8; cursor: default; }

/* Source & Episodes */
.source-section { padding: 12px 0; border-bottom: 1px solid #f0f0eb; }
.source-label { font-size: 14px; font-weight: 600; color: #333; margin-right: 8px; }
.episode-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.episode-list a { display: inline-block; padding: 4px 12px; font-size: 13px; color: #494949; background: #f0f0eb; border-radius: 3px; transition: background .2s, color .2s; }
.episode-list a:hover { background: #e0f5e0; color: #00B51D; }
.episode-list a.current { background: #00B51D; color: #fff; }

/* Description */
.desc-section { padding: 24px 0 12px; }
.desc-section h2 { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 10px; }
.desc-section p { font-size: 14px; color: #666; line-height: 1.8; }

/* === Player === */
.video-player { position: relative; width: 100%; background: #000; border-radius: 3px; overflow: hidden; margin: 16px 0; }
.video-player iframe, .video-player video, .video-player embed, .video-player object { width: 100%; aspect-ratio: 16/9; display: block; }
.player-placeholder { position: absolute; top: 0; left: 0; width: 100%; aspect-ratio: 16/9; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #111; color: #888; z-index: 1; transition: opacity .3s; }
.player-placeholder.hide { opacity: 0; pointer-events: none; }
.player-placeholder p { margin-top: 12px; font-size: 14px; }
.player-spinner { width: 36px; height: 36px; border: 3px solid #333; border-top-color: #00B51D; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Search === */
.search-title { font-size: 20px; font-weight: 600; color: #333; padding: 24px 0 16px; border-bottom: 1px solid #e8e8e3; margin-bottom: 20px; }
.empty-result { text-align: center; padding: 48px 20px; font-size: 15px; color: #9b9b9b; }

/* === Paging === */
.paging { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px; padding: 28px 0; }
.paging a, .paging span, .paging ul > li > a, .paging ul > li > span { display: inline-block; min-width: 36px; height: 36px; line-height: 36px; text-align: center; padding: 0 10px; font-size: 14px; color: #494949; border: 1px solid #e8e8e3; border-radius: 3px; transition: border-color .2s, color .2s, background .2s; text-decoration: none; }
.paging a:hover, .paging ul > li > a:hover { border-color: #00B51D; color: #00B51D; }
.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: #00B51D; color: #fff; border-color: #00B51D; }
.paging a.disabled, .paging span.disabled, .paging ul > li > a.disabled { color: #c0c0b8; border-color: #e8e8e3; cursor: default; pointer-events: none; }
.paging ul { display: flex; gap: 4px; list-style: none; flex-wrap: wrap; }
.paging select { height: 36px; padding: 0 8px; border: 1px solid #e8e8e3; border-radius: 3px; font-size: 14px; color: #494949; background: #fff; }

/* === Footer === */
.site-footer { text-align: center; padding: 32px 20px; margin-top: 40px; border-top: 1px solid #e8e8e3; background: #fff; font-size: 13px; color: #9b9b9b; }
.footer-inner { margin-bottom: 8px; }
.footer-inner a { color: #9b9b9b; transition: color .2s; }
.footer-inner a:hover { color: #00B51D; }
.footer-inner .sep { margin: 0 10px; color: #d0d0c8; }
.copyright { font-size: 12px; color: #b8b8b0; }

/* === Responsive === */

/* Tablet: <= 1024px */
@media (max-width: 1024px) {
    .video-grid { grid-template-columns: repeat(4, 1fr); gap: 16px 12px; }
    .header-search input { width: 160px; }
    .detail-cover { width: 180px; }
    .detail-layout { gap: 20px; }
}

/* Small Tablet: <= 768px */
@media (max-width: 768px) {
    .video-grid { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
    .main-nav { display: none; }
    .header-search { display: none; }
    .mobile-btns { display: flex; }
    .header-inner { height: 48px; }
    .logo { font-size: 18px; margin-right: 0; }
    .detail-layout { flex-direction: column; gap: 16px; }
    .detail-cover { width: 160px; }
    .detail-info h1 { font-size: 20px; }
    .score { font-size: 18px; }
    .banner-section { padding: 24px 0 16px; }
    .banner-section h1 { font-size: 22px; }
    .container { padding: 0 16px; }
}

/* Mobile: <= 480px */
@media (max-width: 480px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); gap: 12px 8px; }
    .item figcaption { font-size: 13px; padding: 6px 1px 0; }
    .detail-cover { width: 120px; }
    .detail-info h1 { font-size: 18px; }
    .info-list { font-size: 13px; }
    .btn-play { padding: 8px 24px; font-size: 14px; }
    .episode-list a { padding: 3px 10px; font-size: 12px; }
    .section-header h2 { font-size: 16px; }
    .search-title { font-size: 17px; padding: 16px 0 12px; }
    .paging a, .paging span, .paging ul > li > a, .paging ul > li > span { min-width: 32px; height: 32px; line-height: 32px; font-size: 13px; }
    .site-footer { padding: 24px 16px; margin-top: 28px; }
}
