/* ============================================
   a001 - KVideo Light Glass Theme
   Accent: #0056b3 (Blue)  Background: #f2f4f7
   ============================================ */

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif; font-size: 14px; color: #1d1d1f; background: #f2f4f7; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
a { text-decoration: none; color: inherit; transition: color .2s; }
a:hover { color: #0056b3; }
ul, ol { list-style: none; }
img { max-width: 100%; border: 0; vertical-align: middle; display: block; }
input, button { border: none; outline: none; font-family: inherit; -webkit-appearance: none; }
.hide { display: none !important; }

/* Layout */
.layout { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ============================================
   Header - Glass morphism rounded bar
   ============================================ */
.header { position: sticky; top: 0; z-index: 2000; padding: 16px 16px 8px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255,255,255,.95); backdrop-filter: blur(12px) saturate(120%); border: 1px solid rgba(0,0,0,.05); border-radius: 24px; padding: 14px 24px; box-shadow: 0 1px 2px rgba(0,0,0,.05); max-width: 1280px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: #1d1d1f; white-space: nowrap; flex-shrink: 0; }
.logo:hover { color: #1d1d1f; }
.logo .logo-icon { width: 32px; height: 32px; background: #0056b3; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.logo .logo-icon svg { width: 18px; height: 18px; fill: #fff; }
.logo .logo-sub { font-size: 12px; font-weight: 400; color: #6e6e73; }

/* Main nav - horizontal in header */
.nav-main { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: flex-end; overflow-x: auto; scrollbar-width: none; }
.nav-main::-webkit-scrollbar { display: none; }
.nav-main a { padding: 6px 14px; font-size: 14px; color: #6e6e73; border-radius: 20px; white-space: nowrap; transition: color .2s, background .2s; }
.nav-main a:hover { color: #1d1d1f; background: rgba(0,0,0,.04); }
.nav-main a.active { color: #fff; background: #0056b3; }
.nav-main a.sub-nav { font-size: 13px; color: #999; }

/* Header right */
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Search bar - large centered below header */
.search-section { max-width: 768px; margin: 24px auto 32px; padding: 0 16px; }
.search-bar { display: flex; align-items: center; background: rgba(255,255,255,.95); backdrop-filter: blur(12px); border: 1px solid rgba(0,0,0,.05); border-radius: 9999px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: border-color .2s, box-shadow .2s; }
.search-bar:focus-within { border-color: #0056b3; box-shadow: 0 0 0 3px rgba(0,86,179,.1); }
.search-bar input[type="text"] { flex: 1; height: 48px; padding: 0 20px; background: transparent; color: #1d1d1f; font-size: 15px; }
.search-bar input::placeholder { color: #999; }
.search-bar .btn-search { height: 40px; padding: 0 24px; margin: 4px 4px 4px 0; display: flex; align-items: center; gap: 6px; background: #0056b3; color: #fff; font-size: 14px; font-weight: 600; border-radius: 9999px; cursor: pointer; transition: background .2s; white-space: nowrap; }
.search-bar .btn-search:hover { background: #004494; }
.search-bar .btn-search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Search panel (mobile) */
.search-panel { display: none; padding: 12px 16px; }
.search-panel.show { display: flex; gap: 8px; max-width: 768px; margin: 0 auto; }
.search-panel input[type="text"] { flex: 1; height: 42px; padding: 0 16px; background: rgba(255,255,255,.95); border: 1px solid rgba(0,0,0,.05); border-radius: 9999px; color: #1d1d1f; font-size: 14px; }
.search-panel input::placeholder { color: #999; }
.search-panel .btn-search { padding: 0 20px; height: 42px; background: #0056b3; color: #fff; font-weight: 600; border-radius: 9999px; cursor: pointer; font-size: 14px; }

/* Mobile toggles */
.search-toggle, .menu-toggle { display: none; width: 36px; height: 36px; border-radius: 50%; background: transparent; cursor: pointer; align-items: center; justify-content: center; color: #6e6e73; transition: color .2s, background .2s; }
.search-toggle:hover, .menu-toggle:hover { color: #1d1d1f; background: rgba(0,0,0,.04); }
.search-toggle svg { pointer-events: none; }
.menu-toggle { position: relative; }
.menu-toggle span, .menu-toggle::before, .menu-toggle::after { content: ""; display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; position: absolute; left: 9px; transition: .25s; }
.menu-toggle::before { top: 11px; }
.menu-toggle span { top: 17px; }
.menu-toggle::after { top: 23px; }
.menu-toggle.active::before { top: 17px; transform: rotate(45deg); }
.menu-toggle.active span { opacity: 0; }
.menu-toggle.active::after { top: 17px; transform: rotate(-45deg); }

/* ============================================
   Nav tags (filter pills)
   ============================================ */
.nav-tags { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 4px 0 16px; scrollbar-width: none; }
.nav-tags::-webkit-scrollbar { display: none; }
.nav-tag { display: inline-block; padding: 6px 16px; font-size: 13px; color: #6e6e73; background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.05); border-radius: 9999px; white-space: nowrap; cursor: pointer; transition: all .2s; }
.nav-tag:hover { color: #0056b3; background: rgba(0,86,179,.06); border-color: rgba(0,86,179,.15); }
.nav-tag.active { color: #fff; background: #0056b3; border-color: #0056b3; }

/* ============================================
   Sections
   ============================================ */
.hero-section { padding: 0 0 8px; }
.category-section { padding: 8px 0; }
.page-section { padding: 8px 0 28px; }
.related-section { padding: 20px 0 8px; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 600; color: #1d1d1f; margin-bottom: 16px; }
.section-header .section-title { margin-bottom: 0; }
.view-all { font-size: 13px; color: #6e6e73; }
.view-all:hover { color: #0056b3; }

.page-title { font-size: 22px; font-weight: 600; color: #1d1d1f; margin-bottom: 20px; padding-top: 24px; }

/* ============================================
   Video Grid - 5 cols desktop (KVideo style)
   ============================================ */
.video-grid { display: grid; gap: 20px; margin-bottom: 24px; }
.cols-5 { grid-template-columns: repeat(5, 1fr); }

.video-grid .item { border-radius: 16px; overflow: hidden; background: #fff; transition: transform .2s ease-out, box-shadow .2s; }
.video-grid .item:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }

.video-grid .item .thumb { position: relative; display: block; padding-bottom: 140%; overflow: hidden; background: #f0f0f5; border-radius: 16px 16px 0 0; }
.video-grid .item .thumb img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.video-grid .item:hover .thumb img { transform: scale(1.03); }

.video-grid .item .thumb .overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.3) 0%, transparent 40%); opacity: 0; transition: opacity .3s; }
.video-grid .item:hover .thumb .overlay { opacity: 1; }

/* Score badge - star style like KVideo */
.video-grid .item .thumb .marks { position: absolute; top: 8px; left: 8px; display: flex; align-items: center; gap: 3px; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 8px; z-index: 1; }
.video-grid .item .thumb .marks::before { content: "★"; color: #fac800; font-size: 11px; }

.video-grid .item .info { padding: 10px 12px 14px; }
.video-grid .item .info .title { font-size: 14px; color: #1d1d1f; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.video-grid .item .info .title:hover { color: #0056b3; }

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb { padding: 20px 0 16px; font-size: 13px; color: #999; }
.breadcrumb a { color: #6e6e73; }
.breadcrumb a:hover { color: #0056b3; }
.breadcrumb .sep { margin: 0 6px; color: #ccc; }

/* ============================================
   Detail Page (Archive)
   ============================================ */
.detail-wrap { display: flex; gap: 28px; padding: 8px 0 24px; }
.detail-poster { width: 240px; flex-shrink: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.detail-poster img { width: 100%; display: block; }

.detail-info { flex: 1; }
.detail-info h1 { font-size: 24px; color: #1d1d1f; margin-bottom: 12px; line-height: 1.3; }
.score-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(0,0,0,.65); backdrop-filter: blur(4px); color: #fff; font-size: 14px; font-weight: 700; padding: 6px 14px; border-radius: 10px; margin-bottom: 16px; }
.score-badge::before { content: "★"; color: #fac800; }

.meta-list { margin-bottom: 20px; }
.meta-item { display: flex; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.meta-item dt { width: 60px; color: #999; flex-shrink: 0; }
.meta-item dd { color: #1d1d1f; flex: 1; }

.action-row { padding-top: 8px; }
.btn-play { display: inline-block; padding: 10px 32px; background: #0056b3; color: #fff; font-size: 15px; font-weight: 600; border-radius: 12px; transition: background .2s, transform .2s; }
.btn-play:hover { background: #004494; transform: scale(1.03); color: #fff; }
.btn-play.disabled { background: #e5e5ea; color: #999; cursor: not-allowed; }

/* Source & Episodes */
.source-section { padding: 16px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.source-title { font-size: 15px; color: #6e6e73; margin-bottom: 10px; }
.episode-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ep-btn { display: inline-block; padding: 6px 16px; background: rgba(0,0,0,.04); color: #1d1d1f; font-size: 13px; border-radius: 8px; transition: background .2s, color .2s; }
.ep-btn:hover { background: rgba(0,86,179,.08); color: #0056b3; }
.ep-btn.current { background: #0056b3; color: #fff; font-weight: 600; }

/* Description */
.desc-section { padding: 20px 0; }
.desc-section h3 { font-size: 16px; color: #1d1d1f; margin-bottom: 10px; }
.desc-section p { color: #6e6e73; line-height: 1.8; }

/* ============================================
   Player
   ============================================ */
.player-container { position: relative; width: 100%; max-width: 900px; aspect-ratio: 16/9; background: #000; border-radius: 16px; overflow: hidden; margin-bottom: 20px; }
.player-container iframe, .player-container video, .player-container embed, .player-container object { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.player-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #1d1d1f; z-index: 2; color: #999; gap: 12px; }
.loading-ring { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.15); border-top-color: #0056b3; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.play-title { font-size: 20px; color: #1d1d1f; padding-top: 20px; margin-bottom: 16px; }

/* ============================================
   Paging
   ============================================ */
.paging { text-align: center; padding: 24px 0; }
.paging ul { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.paging ul li a, .paging a { display: inline-block; padding: 8px 14px; background: rgba(255,255,255,.8); color: #6e6e73; font-size: 13px; border-radius: 8px; border: 1px solid rgba(0,0,0,.05); transition: background .2s, color .2s; }
.paging ul li a:hover, .paging a:hover { background: rgba(0,86,179,.06); color: #0056b3; border-color: rgba(0,86,179,.15); }
.paging ul li.active a, .paging .active a { background: #0056b3; color: #fff; font-weight: 600; border-color: #0056b3; }
.paging ul li.disabled a, .paging .disabled a { color: #ccc; background: rgba(255,255,255,.4); cursor: not-allowed; }

/* Empty tip */
.empty-tip { text-align: center; padding: 60px 0 20px; }
.empty-tip .empty-icon { width: 80px; height: 80px; margin: 0 auto 20px; background: rgba(0,0,0,.04); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.empty-tip .empty-icon svg { width: 36px; height: 36px; stroke: #999; fill: none; stroke-width: 1.5; }
.empty-tip h3 { font-size: 20px; font-weight: 600; color: #1d1d1f; margin-bottom: 8px; }
.empty-tip p { font-size: 14px; color: #6e6e73; margin-bottom: 24px; }
.empty-tip .btn-home { display: inline-block; padding: 10px 28px; background: #0056b3; color: #fff; font-size: 14px; font-weight: 600; border-radius: 12px; }
.empty-tip .btn-home:hover { background: #004494; color: #fff; }

/* ============================================
   Footer
   ============================================ */
.footer { margin-top: 32px; padding: 28px 0; border-top: 1px solid rgba(0,0,0,.06); }
.footer-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.footer-brand { font-size: 16px; font-weight: 600; color: #0056b3; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: #999; }
.footer-links a:hover { color: #0056b3; }
.footer-bottom { font-size: 12px; color: #ccc; text-align: center; }

/* ============================================
   Responsive
   ============================================ */

/* Tablet ≤1024px */
@media (max-width: 1024px) {
    .cols-5 { grid-template-columns: repeat(4, 1fr); }
    .detail-poster { width: 200px; }
    .nav-main { display: none; position: fixed; top: 80px; left: 16px; right: 16px; bottom: auto; max-height: 70vh; background: rgba(255,255,255,.98); backdrop-filter: blur(20px); flex-direction: column; padding: 16px 24px; gap: 0; z-index: 1999; overflow-y: auto; border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,.12); }
    .nav-main.show { display: flex; }
    .nav-main a { padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,.05); border-radius: 0; font-size: 16px; color: #1d1d1f; }
    .nav-main a.active { background: transparent; color: #0056b3; }
    .menu-toggle { display: flex; }
}

/* Mobile ≤768px */
@media (max-width: 768px) {
    .layout { padding: 0 12px; }
    .header { padding: 8px 12px 4px; }
    .header-inner { padding: 6px 12px; border-radius: 16px; gap: 8px; }
    .search-section { margin: 16px auto 20px; padding: 0 12px; }
    .search-bar input[type="text"] { height: 42px; font-size: 14px; }
    .search-bar .btn-search { height: 34px; padding: 0 16px; font-size: 13px; margin: 4px; }
    .cols-5 { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .video-grid .item { border-radius: 12px; }
    .video-grid .item .thumb { border-radius: 12px 12px 0 0; }
    .detail-wrap { flex-direction: column; gap: 16px; }
    .detail-poster { width: 160px; border-radius: 12px; }
    .detail-info h1 { font-size: 20px; }
    .section-title { font-size: 16px; }
    .page-title { font-size: 18px; padding-top: 16px; }
    .footer-top { flex-direction: column; gap: 12px; align-items: flex-start; }
    .player-container { border-radius: 0; margin-left: -12px; margin-right: -12px; width: calc(100% + 24px); }
}

/* Small phone ≤480px */
@media (max-width: 480px) {
    .cols-5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .video-grid .item .info { padding: 8px 10px 10px; }
    .video-grid .item .info .title { font-size: 13px; }
    .episode-list { gap: 6px; }
    .ep-btn { padding: 5px 12px; font-size: 12px; }
    .footer-links { gap: 10px; }
    .paging ul li a, .paging a { padding: 6px 10px; font-size: 12px; }
}
