/* z0006 - Bilibili Compact Interactive Style */
/* Primary: #FB7299 (B站粉) | Secondary: #FF6633 (橙色) | White BG */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 13px; color: #333; background: #f4f5f7; line-height: 1.5; }
a { color: #333; text-decoration: none; }
a:hover { color: #FB7299; }
img { max-width: 100%; display: block; }

/* Header */
header { background: #fff; border-bottom: 2px solid #FB7299; position: sticky; top: 0; z-index: 100; }
.hd-wrap { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; height: 46px; padding: 0 10px; gap: 10px; }
.logo { font-size: 18px; font-weight: 700; color: #FB7299; white-space: nowrap; flex-shrink: 0; }
.logo:hover { color: #FF6633; }
header nav[aria-label="主导航"] { display: flex; gap: 2px; flex-wrap: nowrap; overflow: hidden; flex: 1; }
header nav[aria-label="主导航"] a { padding: 4px 10px; font-size: 13px; border-radius: 4px; white-space: nowrap; }
header nav[aria-label="主导航"] a:hover,
header nav[aria-label="主导航"] a.cur { background: #FB7299; color: #fff; }
header nav[aria-label="主导航"] a.sub { font-size: 12px; color: #888; }
header nav[aria-label="主导航"] a.sub:hover,
header nav[aria-label="主导航"] a.sub.cur { background: #FF6633; color: #fff; }
.hd-search { display: flex; flex-shrink: 0; }
.hd-search input { width: 160px; height: 28px; border: 1px solid #ddd; border-radius: 4px 0 0 4px; padding: 0 8px; font-size: 12px; outline: none; }
.hd-search input:focus { border-color: #FB7299; }
.hd-search button { height: 28px; padding: 0 12px; background: #FB7299; color: #fff; border: none; border-radius: 0 4px 4px 0; cursor: pointer; font-size: 12px; }
.hd-search button:hover { background: #FF6633; }
.m-btns { display: none; gap: 6px; flex-shrink: 0; }
.m-btns button { background: none; border: none; cursor: pointer; color: #FB7299; padding: 4px; }

/* Search Panel (Mobile) */
.search-panel { display: none; padding: 8px 10px; background: #fff; border-bottom: 1px solid #eee; }
.search-panel.show { display: flex; gap: 6px; }
.search-panel input { flex: 1; height: 32px; border: 1px solid #ddd; border-radius: 4px; padding: 0 10px; font-size: 13px; outline: none; }
.search-panel input:focus { border-color: #FB7299; }
.search-panel button { height: 32px; padding: 0 14px; background: #FB7299; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }

/* Mobile Nav */
.m-nav { display: none; background: #fff; border-bottom: 1px solid #eee; padding: 8px 10px; flex-wrap: wrap; gap: 4px; }
.m-nav.show { display: flex; }
.m-nav a { padding: 4px 10px; font-size: 13px; border-radius: 4px; background: #f4f5f7; }
.m-nav a:hover { background: #FB7299; color: #fff; }
.m-nav a.sub { font-size: 12px; color: #888; background: #fafafa; }

/* Main */
main { max-width: 1200px; margin: 0 auto; padding: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
main > h1 { font-size: 16px; font-weight: 700; padding: 6px 0; margin: 0 0 6px; border-bottom: 2px solid #FB7299; color: #333; }

/* Section Headers */
.sec-hd { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 8px; padding-bottom: 6px; border-bottom: 2px solid #FB7299; }
.sec-hd span { font-size: 15px; font-weight: 700; color: #333; }
.sec-hd a { font-size: 12px; color: #FB7299; }
.sec-hd a:hover { color: #FF6633; }

/* Dense Video Grid - 方案F: a.item + span children */
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
a.item { display: block; background: #fff; border-radius: 4px; overflow: hidden; border: 1px solid transparent; transition: border-color .2s; }
a.item:hover { border-color: #FB7299; }
a.item .cover { display: block; position: relative; padding-bottom: 133.33%; overflow: hidden; background: #f0f0f0; }
a.item .cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
a.item .cover .mark { position: absolute; right: 0; bottom: 0; background: rgba(251,114,153,.85); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px 0 0 0; }
a.item .title { display: block; padding: 4px 6px; font-size: 12px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333; }
a.item:hover .title { color: #FB7299; }

/* Category Tabs */
.cat-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; padding: 8px 0; border-bottom: 1px solid #eee; }
.cat-tabs a { padding: 3px 10px; font-size: 12px; border-radius: 4px; background: #f4f5f7; color: #555; }
.cat-tabs a:hover,
.cat-tabs a.cur { background: #FB7299; color: #fff; }

/* Breadcrumb - 方案C: p.breadcrumb + / separator */
p.breadcrumb { font-size: 12px; color: #999; padding: 8px 0; }
p.breadcrumb a { color: #666; }
p.breadcrumb a:hover { color: #FB7299; }

/* Detail Page */
.detail { display: flex; gap: 14px; background: #fff; padding: 12px; border-radius: 6px; margin-bottom: 12px; }
.detail-cover { width: 180px; flex-shrink: 0; }
.detail-cover img { width: 100%; border-radius: 4px; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h1 { font-size: 18px; margin-bottom: 6px; line-height: 1.4; }
.score { display: inline-block; background: #FF6633; color: #fff; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-bottom: 8px; }
.meta { margin-bottom: 8px; }
.meta span { display: inline-block; font-size: 12px; color: #666; margin-right: 14px; margin-bottom: 4px; }
.tags { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-block; padding: 1px 8px; font-size: 11px; background: #f4f5f7; color: #666; border-radius: 3px; }
.play-action { margin-top: 8px; }
.btn-play { display: inline-block; padding: 6px 24px; background: #FB7299; color: #fff; border-radius: 4px; font-size: 13px; font-weight: 700; }
.btn-play:hover { background: #FF6633; color: #fff; }
.btn-play.disabled { background: #ccc; cursor: not-allowed; color: #fff; }

/* Vod / Episode */
.vod-group { margin-bottom: 10px; }
.vod-name { display: inline-block; font-size: 13px; font-weight: 700; color: #333; margin-bottom: 4px; }
.ep-list { display: flex; flex-wrap: wrap; gap: 4px; }
.ep-btn { display: inline-block; padding: 3px 10px; font-size: 12px; background: #f4f5f7; border-radius: 3px; color: #555; border: 1px solid transparent; }
.ep-btn:hover { border-color: #FB7299; color: #FB7299; }
.ep-btn.cur { background: #FB7299; color: #fff; border-color: #FB7299; }

/* Description */
.desc { font-size: 13px; line-height: 1.7; color: #555; padding: 8px 0; }

/* Player */
.player-box { margin-bottom: 12px; }
.player-wrap { position: relative; background: #000; border-radius: 6px; overflow: hidden; aspect-ratio: 16/9; }
.player-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #000; color: #aaa; font-size: 13px; z-index: 5; gap: 8px; }
.ld-spinner { width: 30px; height: 30px; border: 3px solid #555; border-top-color: #FB7299; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.video-player { width: 100%; height: 100%; }
.video-player iframe { width: 100%; height: 100%; border: none; }

/* Paging */
.paging { padding: 12px 0; text-align: center; }
.paging ul { list-style: none; padding: 0; margin: 0; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.paging a, .paging span { display: inline-block; padding: 4px 12px; font-size: 13px; border-radius: 3px; background: #fff; border: 1px solid #ddd; color: #333; text-decoration: none; }
.paging a:hover { border-color: #FB7299; color: #FB7299; }
.paging .active a, .paging span.cur { background: #FB7299; color: #fff; border-color: #FB7299; }
.paging .disabled a { color: #ccc; cursor: default; }

/* Search */
main > h1 + .grid { margin-top: 10px; }
.empty { text-align: center; padding: 30px 0; font-size: 14px; color: #999; }

/* Footer - 方案C: pipe separator */
footer { max-width: 1200px; margin: 16px auto 0; padding: 14px 10px; text-align: center; font-size: 12px; color: #999; border-top: 1px solid #eee; background: #fff; }
footer a { color: #666; margin: 0 4px; }
footer a:hover { color: #FB7299; }
footer p { margin-top: 6px; }

/* Detail page h1 */
.detail-info h1 { font-size: 18px; margin-bottom: 6px; line-height: 1.4; border: none; padding: 0; }

/* Responsive */
@media (max-width: 1024px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
    .hd-wrap { padding: 0 8px; }
    header nav[aria-label="主导航"] a.sub { display: none; }
}

@media (max-width: 768px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
    header nav[aria-label="主导航"] { display: none; }
    .hd-search { display: none; }
    .m-btns { display: flex; }
    .detail { flex-direction: column; }
    .detail-cover { width: 140px; margin: 0 auto; }
    .hd-wrap { height: 42px; }
}

@media (max-width: 480px) {
    .grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    main { padding: 6px; }
    .detail { padding: 8px; gap: 10px; }
    .detail-cover { width: 120px; }
    .detail-info h1 { font-size: 15px; }
    .sec-hd { margin: 8px 0 6px; }
    .ep-btn { padding: 2px 8px; font-size: 11px; }
    footer { padding: 10px 8px; }
}
