
/* CleanStream 2.1.0
 * Single stylesheet by design: the template is small enough that splitting
 * navigation/content/polish files only created cascade and maintenance cost.
 */

:root {
  --bg: #f4f5f7;
  --card: #fff;
  --ink: #181a1f;
  --muted: #747780;
  --line: #e2e4e8;
  --lime: #e8f31c;
  --dark: #101114;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #cbd518; outline-offset: 3px; }

.shell { width: min(1180px, calc(100% - 32px)); margin: auto; }

/* Header */
.site-header { border-top: 4px solid var(--lime); background: var(--dark); color: #fff; }
.header-row { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--lime); color: #111; font-style: normal; }
.brand b { display: block; max-width: 500px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; }
.brand small { display: block; color: #92959d; font-size: 9px; letter-spacing: 2.5px; }
.header-row nav { display: flex; gap: 24px; }
.header-row nav a:hover { color: var(--lime); }

/* Category navigation and search */
.category-panel { margin-top: 18px; padding: 0 22px 22px; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px #12141812; }
.category-groups { padding: 8px 0; }
.category-row { display: grid; grid-template-columns: 108px 1fr; align-items: stretch; padding: 0; border-bottom: 1px dashed #e6e7e9; }
.category-row:last-child { border-bottom: 0; }
.category-row > b { position: relative; display: grid; place-items: center; align-self: center; margin: 9px 16px 9px 0; min-height: 34px; padding: 6px 10px; border-radius: 5px; background: var(--dark); color: var(--lime); line-height: 1.2; text-align: center; white-space: nowrap; }
.category-row > b a { display: block; width: 100%; white-space: nowrap; }
.category-row > b::after { content: ""; position: absolute; right: -6px; top: 50%; margin-top: -5px; border-width: 5px 0 5px 6px; border-style: solid; border-color: transparent transparent transparent var(--dark); }
.category-row > span { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); align-items: center; padding: 7px 0; }
.category-row > span a { position: relative; min-width: 0; padding: 7px 8px; color: #4d5057; text-align: center; white-space: nowrap; }
.category-row > span a:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 50%; width: 1px; height: 12px; background: #ddd; transform: translateY(-50%); }
.category-row > span a:hover { color: #111; background: #f4f5d7; }
.search-form { display: flex; max-width: 650px; height: 44px; margin: 9px auto 0; overflow: hidden; border: 2px solid var(--dark); border-radius: 6px; }
.search-label { display: grid; place-items: center; width: 62px; flex: 0 0 62px; background: var(--lime); color: var(--dark); font-weight: 900; }
.search-form input { flex: 1; min-width: 0; padding: 0 14px; border: 0; border-left: 1px solid #d6d8dc; background: #fafafa; outline: 0; }
.search-form button { width: 110px; border: 0; background: var(--dark); color: var(--lime); font-weight: 800; cursor: pointer; }

/* Main layout */
.page-main { padding: 28px 0 48px; }
.page-main section { margin-bottom: 34px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; border-bottom: 1px solid #dfe1e5; }
.section-head > div { padding-bottom: 10px; border-bottom: 3px solid var(--lime); }
.section-head small, .detail small { display: block; color: #999; font-weight: 800; letter-spacing: 2px; }
.section-head h1, .section-head h2 { margin: 2px 0 0; font-size: 22px; }
.section-head > a { padding-bottom: 12px; color: var(--muted); }
.crumb { margin-bottom: 18px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 28px 20px; border: 1px dashed #d5d8dd; border-radius: 8px; background: #fff; color: var(--muted); text-align: center; }

/* Advertising slots (markup lives in html/ads/) */
.ad-slot { width: min(1180px, calc(100% - 32px)); margin: 18px auto; overflow: hidden; }
.ad-slot a { display: block; overflow: hidden; border-radius: 8px; background: #e5e7ea; }
.ad-slot img { width: 100%; height: auto; }
.ad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.page-main .ad-slot, .player-panel .ad-slot { width: 100%; }
.player-panel .ad-slot { margin: 16px 0; }
.ad-placeholder { min-height: 92px; padding: 16px 22px; border: 1px dashed #c9cdd3; background: linear-gradient(135deg, #fff, #eef0f3) !important; text-align: center; }
.ad-placeholder small, .ad-placeholder strong, .ad-placeholder span { display: block; }
.ad-placeholder small { color: #a0a3aa; font-size: 9px; letter-spacing: 2px; }
.ad-placeholder strong { margin-top: 3px; color: #33363c; font-size: 18px; }
.ad-placeholder span { margin-top: 3px; color: #858890; font-size: 12px; }
.text-ad-slot { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.text-ad-slot a { overflow: hidden; padding: 10px 8px; border: 1px solid #c83d61; border-radius: 6px; background: #d94f73; color: #fff; font-weight: 700; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.text-ad-slot a:hover { border-color: #aa294d; background: #bf365c; color: #fff; }

/* Video cards */
.video-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px 14px; }
.recommendation-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.video-grid article { min-width: 0; }
.poster { position: relative; display: block; aspect-ratio: 3/4; overflow: hidden; border-radius: 7px; background: #dfe1e5; }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: .25s; }
.poster::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, #0009); }
.poster i { position: absolute; z-index: 2; left: 50%; top: 50%; display: grid; place-items: center; width: 42px; height: 42px; border: 2px solid #fffd; border-radius: 50%; background: #1118; color: #fff; font-style: normal; transform: translate(-50%, -50%); opacity: 0; }
.poster time { position: absolute; z-index: 2; right: 8px; bottom: 7px; color: #fff; }
.video-grid article:hover img { transform: scale(1.04); }
.video-grid article:hover .poster i { opacity: 1; }
.video-grid h2, .video-grid h3 { margin: 9px 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.poster.is-broken { display: grid; place-items: center; background: linear-gradient(145deg, #dfe1e4, #cdd0d5); }
.poster.is-broken::before { content: "暂无封面"; color: #858890; font-size: 12px; }
.poster.is-broken img { display: none; }
.poster.is-broken i { opacity: .8; }

/* Pagination and filters */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 30px; }
.pagination a, .pagination span { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.pagination span, .pagination a:hover { background: var(--dark); color: var(--lime); }
.filter-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 12px 14px; border: 1px solid #e4e6e9; border-radius: 8px; background: #fff; overflow-x: auto; white-space: nowrap; }
.filter-bar b { margin-right: 5px; }
.filter-bar a { padding: 7px 15px; border-radius: 5px; background: #f0f1f3; }
.filter-bar a:hover, .filter-bar a.active { background: var(--dark); color: var(--lime); }

/* Video detail */
.detail, .player-panel { padding: 24px; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px #12141812; }
.detail { display: grid; grid-template-columns: 220px 1fr; gap: 30px; }
.detail > img { width: 220px; aspect-ratio: 3/4; object-fit: cover; border-radius: 7px; }
.detail-copy { min-width: 0; }
.detail-copy h1, .player-panel h1 { overflow-wrap: anywhere; }
.detail h1 { margin: 5px 0 18px; font-size: 30px; }
.detail p { color: #656870; }
.button { display: inline-block; margin-top: 12px; padding: 12px 24px; border-radius: 5px; background: var(--dark); color: var(--lime); font-weight: 800; }
.detail-description { padding-top: 4px; }
.detail-content { padding: 22px 24px; border-radius: 8px; background: #fff; color: #363940; font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }
.detail-content img, .detail-content video, .detail-content iframe { max-width: 100%; height: auto; }

/* Native MacCMS player area */
.player { position: relative; aspect-ratio: 16/9; min-height: 180px; overflow: hidden; background: #050505; }
.player iframe, .player video, .player embed, .player object { width: 100% !important; height: 100% !important; }
.play-section { margin-top: 18px; }
.play-section-title { display: block; margin-bottom: 9px; }
.sources, .episodes { display: flex; flex-wrap: wrap; gap: 7px; }
.sources a, .episodes a { display: grid; place-items: center; min-width: 38px; min-height: 38px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.sources a:hover, .sources a.active, .episodes a:hover, .episodes a.active { background: var(--dark); color: var(--lime); }
.source-note { margin: 12px 0 0; color: #858890; font-size: 12px; }
.page-main .player-panel { margin-bottom: 22px; }

/* Articles */
.article-list { display: grid; gap: 12px; }
.article-list article > a { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 22px; border: 1px solid #e5e7ea; border-radius: 8px; background: #fff; transition: .2s; }
.article-list article > a:hover { border-color: #d2d71a; box-shadow: 0 8px 24px #15171910; transform: translateY(-1px); }
.article-list article div { min-width: 0; }
.article-list small { color: #94979e; letter-spacing: 1px; }
.article-list h2 { margin: 3px 0 5px; font-size: 18px; }
.article-list p { margin: 0; overflow: hidden; color: #6b6e76; text-overflow: ellipsis; white-space: nowrap; }
.article-list time { flex: 0 0 auto; color: #999; }
.article-detail { max-width: 900px; margin: auto; padding: 38px 42px; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px #12141812; }
.article-detail header { padding-bottom: 20px; border-bottom: 1px solid #e5e7e9; text-align: center; }
.article-detail header > small { color: #999; letter-spacing: 2px; }
.article-detail h1 { margin: 6px 0 14px; font-size: 30px; }
.article-detail header p { display: flex; justify-content: center; gap: 18px; margin: 0; color: #8a8d94; }
.article-body { padding-top: 26px; color: #363940; font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
.article-body img, .article-body video, .article-body iframe { max-width: 100%; height: auto; }

/* Footer */
footer { padding: 35px 0; background: var(--dark); color: #8d9098; text-align: center; }
footer b { color: var(--lime); }
footer p { margin: 5px; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin: 10px 0 14px; }
.footer-links a { color: #c6c8cd; }
.footer-links a:hover { color: var(--lime); }
.back-top { position: fixed; right: 20px; bottom: 20px; z-index: 9; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--lime); font-size: 20px; cursor: pointer; }
.back-top[hidden] { display: none; }

/* System pages */
.system-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #f1f2f4; }
.system-card { width: min(480px, 100%); padding: 42px 32px; border-top: 5px solid var(--lime); border-radius: 10px; background: #fff; text-align: center; box-shadow: 0 18px 50px #1112; }
.system-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 15px; border-radius: 50%; background: var(--dark); color: var(--lime); font-size: 28px; font-weight: 900; }
.system-card > small { color: #8a8d94; letter-spacing: 2px; }
.system-card h1 { margin: 5px 0 12px; }
.system-card p { margin: 0 0 24px; color: #62656c; }
.system-actions { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.ghost-button { display: inline-block; padding: 11px 20px; border: 1px solid #dcdfe3; border-radius: 5px; background: #fff; color: #333; cursor: pointer; }

@media (max-width: 980px) {
  .video-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .shell { width: calc(100% - 20px); }
  .header-row { min-height: 62px; }
  .brand i { width: 36px; height: 36px; }
  .brand b { max-width: 190px; font-size: 16px; }
  .header-row nav { gap: 12px; }
  .category-panel { margin: 10px -10px 0; padding: 0 4px 10px; border-radius: 0; }
  .category-groups { padding: 4px 0; }
  .category-row { grid-template-columns: 70px minmax(0, 1fr); align-items: stretch; overflow: visible; padding: 3px 0; }
  .category-row > b { align-self: stretch; display: grid; place-items: center; margin: 0 4px 0 0; min-height: 72px; padding: 0 4px; border-radius: 4px; font-size: 13px; font-weight: 800; }
  .category-row > b::after { display: none; }
  .category-row > span { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; overflow: visible; padding: 0; white-space: normal; }
  .category-row > span a { display: grid; place-items: center; min-width: 0; min-height: 34px; padding: 5px 1px; border-radius: 3px; background: #f3f4f6; color: #303239; font-size: 12.5px; font-weight: 700; line-height: 1.2; letter-spacing: -.2px; white-space: nowrap; }
  .category-row > span a::after { display: none !important; }
  .search-form { height: 40px; }
  .search-label { display: none; }
  .search-form input { border-left: 0; }
  .search-form button { width: 86px; }
  .page-main { padding: 20px 0 36px; }
  .ad-slot { width: calc(100% - 20px); margin: 10px auto; }
  .page-main .ad-slot, .player-panel .ad-slot { width: 100%; }
  .ad-grid { grid-template-columns: 1fr; gap: 8px; }
  .text-ad-slot.shell { width: 100vw; margin: 10px 0 0 calc(50% - 50vw); padding: 0 4px; }
  .text-ad-slot { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .text-ad-slot a { padding: 8px 2px; font-size: 10px; }
  .video-grid { grid-template-columns: repeat(3, 1fr); gap: 16px 9px; }
  .recommendation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .poster i { width: 34px; height: 34px; opacity: .8; }
  .section-head h1, .section-head h2 { font-size: 19px; }
  .detail { grid-template-columns: 105px 1fr; gap: 16px; padding: 16px; }
  .detail > img { width: 105px; }
  .detail h1 { font-size: 21px; }
  .player-panel { padding: 12px; }
  .player-panel, .play-recommendations { margin-right: -5px; margin-left: -5px; }
  .player-panel .section-head h1 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.3; }
  .page-main .player-panel { margin-bottom: 18px; }
  .episodes { max-height: 220px; overflow-y: auto; }
  .article-list article > a { align-items: flex-start; padding: 15px; gap: 12px; }
  .article-list h2 { font-size: 16px; }
  .article-list p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
  .article-list time { font-size: 11px; }
  .article-detail { padding: 25px 18px; }
  .article-detail h1 { font-size: 23px; }
  .article-body { font-size: 15px; }
  .article-detail header p { flex-wrap: wrap; gap: 7px 14px; }
  footer { padding: 28px 14px; font-size: 12px; }
  .footer-links { gap: 14px; }
  .footer-links a { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
