/* ============================================================
   黄果AI — 覆盖层样式
   用法：放在模板目录，在 header.html 的 </head> 前引用。
   目的：把久草模板默认的「粉紫 + 大圆角 + 发光」换成
   「近黑 + 荧光黄绿 + 发丝线 + 密栅格」，且不动 PHP。
   先整站套，再按具体 class 收紧。所有颜色只从 :root 取。
   ============================================================ */

:root {
	--hg-bg: #0a0a0b;
	--hg-surface: #131316;
	--hg-surface-2: #1b1b1f;
	--hg-line: #26262b;
	--hg-line-strong: #3a3a41;
	--hg-ink: #f4f4ef;
	--hg-muted: #8c8c96;
	--hg-dim: #5c5c66;
	--hg-accent: #dfff3e;
	--hg-accent-ink: #0a0a0b;
	--hg-warn: #ff6a3d;
	--hg-radius: 2px;
	--hg-gap: 14px;
	--hg-max: 1440px;
	--hg-font: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
	--hg-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}

/* ---------------------------------------------------------------- base */
html { background: var(--hg-bg); color-scheme: dark; }
body {
	background: var(--hg-bg) !important;
	color: var(--hg-ink) !important;
	font-family: var(--hg-font) !important;
	font-size: 14px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	letter-spacing: .01em;
}
::selection { background: var(--hg-accent); color: var(--hg-accent-ink); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--hg-accent); }
img { background: var(--hg-surface-2); }
* { scrollbar-width: thin; scrollbar-color: var(--hg-line-strong) transparent; }

h1, h2, h3, h4 {
	font-weight: 700 !important;
	letter-spacing: -.02em;
	line-height: 1.25;
	color: var(--hg-ink);
}
h1 { font-size: clamp(24px, 3vw, 34px); }
h2 { font-size: clamp(18px, 2vw, 22px); }

.container, .wrap, .main, .content {
	max-width: var(--hg-max) !important;
	margin-inline: auto;
	padding-inline: 20px;
}

/* 干掉模板的发光与渐变底纹 */
body > .bg, .bg-img, .banner-bg { opacity: .35; filter: saturate(.7) brightness(.5); }

/* ---------------------------------------------------------------- header */
header, .header, .top, .nav-bar, .head {
	background: color-mix(in srgb, var(--hg-bg) 88%, transparent) !important;
	backdrop-filter: blur(14px) saturate(140%);
	border-bottom: 1px solid var(--hg-line) !important;
	box-shadow: none !important;
	position: sticky; top: 0; z-index: 60;
}
header .logo, .logo, .logo a {
	font-weight: 800 !important;
	letter-spacing: -.04em;
	font-size: 20px;
}
.logo::after {
	content: "";
	display: inline-block;
	width: .55em; height: .55em;
	margin-left: .28em;
	background: var(--hg-accent);
	vertical-align: .06em;
}
nav a, .nav a, .menu a, header .nav-list a {
	display: inline-flex; align-items: center;
	height: 34px; padding: 0 2px;
	font-size: 13px; color: var(--hg-muted) !important;
	border-bottom: 2px solid transparent;
	transition: color .15s, border-color .15s;
}
nav a:hover, nav a.active, .nav a.on, .menu a:hover {
	color: var(--hg-ink) !important;
	border-bottom-color: var(--hg-accent);
}
nav a + a, .nav a + a { margin-left: 18px; }

/* 手机：logo + 可横滑导航一行，搜索独占一行；头部不吸顶，省视口 */
@media (max-width: 720px) {
	header, .header, .top, .nav-bar, .head { position: static !important; }
	header > div, header .container, .header > div {
		height: auto !important;
		flex-wrap: wrap; gap: 8px !important;
		padding-block: 9px;
	}
	.logo { white-space: nowrap; flex: 0 0 auto; font-size: 17px !important; }
	header nav, .nav, .menu {
		order: 2; flex: 1 1 0; min-width: 0;
		overflow-x: auto; overflow-y: hidden;
		-ms-overflow-style: none; scrollbar-width: none;
	}
	header nav::-webkit-scrollbar { display: none; }
	nav a, .nav a, .menu a { white-space: nowrap; }
	nav a + a, .nav a + a { margin-left: 14px; }
	.search, .search-form, form[class*="search"] {
		order: 3; width: 100% !important; margin-left: 0 !important;
	}
}

/* ---------------------------------------------------------------- search */
.search, .search-box, .search-form, form[class*="search"] {
	background: var(--hg-surface) !important;
	border: 1px solid var(--hg-line) !important;
	border-radius: var(--hg-radius) !important;
	overflow: hidden;
}
.search input, .search-form input, form[class*="search"] input {
	background: transparent !important;
	color: var(--hg-ink) !important;
	border: 0 !important;
	height: 38px; flex: 1 1 auto; min-width: 0;
	padding-inline: 12px;
	font-family: var(--hg-mono);
	font-size: 13px;
}
.search input::placeholder, form[class*="search"] input::placeholder {
	color: var(--hg-dim); letter-spacing: .02em;
}
.search:focus-within, form[class*="search"]:focus-within {
	border-color: var(--hg-accent) !important;
	box-shadow: 0 0 0 1px var(--hg-accent);
}
.search button, .search-form button {
	background: var(--hg-accent) !important;
	color: var(--hg-accent-ink) !important;
	border: 0 !important;
	padding-inline: 16px !important;
	font-weight: 700;
	font-size: 13px;
}

/* ---------------------------------------------------------------- grid */
[class*="list"]:has(> [class*="item"]),
[class*="grid"], .video-list, .vod-list, .pic-list {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)) !important;
	gap: var(--hg-gap) !important;
}
@media (max-width: 720px) {
	[class*="list"]:has(> [class*="item"]),
	[class*="grid"], .video-list, .vod-list, .pic-list {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 10px !important;
	}
}

/* ---------------------------------------------------------------- card */
[class*="item"], [class*="card"], .vod-item, .pic-item {
	background: var(--hg-surface) !important;
	border: 1px solid var(--hg-line);
	border-radius: var(--hg-radius) !important;
	padding: 0 !important;
	transition: border-color .18s, background .18s;
	position: relative;
	overflow: hidden;
}
[class*="item"]:hover, [class*="card"]:hover {
	border-color: var(--hg-line-strong);
	background: var(--hg-surface-2) !important;
}
[class*="item"]:hover > a img, [class*="card"]:hover img {
	filter: brightness(1.08) contrast(1.02);
}

/* 封面统一 16:10，方角，发丝描边 */
[class*="thumb"], [class*="pic"], [class*="cover"], [class*="item"] > a > img, [class*="card"] img {
	aspect-ratio: 16 / 10;
	width: 100%;
	object-fit: cover;
	border-radius: var(--hg-radius) !important;
	border: 1px solid var(--hg-line);
	display: block;
	transition: filter .2s;
}

/* 标题压在图上，两行截断；底部 padding 给元信息行让位，渐变一直铺到卡底 */
[class*="item"] [class*="title"], [class*="card"] [class*="title"], [class*="item"] h3 {
	position: absolute; inset: auto 0 0 0;
	margin: 0 !important;
	padding: 30px 10px 26px;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.35;
	color: #fff !important;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	overflow: hidden;
	background: linear-gradient(to top, rgba(0,0,0,.92) 12%, rgba(0,0,0,.55) 55%, transparent);
	z-index: 2;
}
[class*="item"]:hover [class*="title"] { color: #fff !important; }

/* 角标：时长走等宽字，右上角 AI 标 */
[class*="duration"], [class*="time"], [class*="badge"] {
	position: absolute; top: 8px; left: 8px; z-index: 3;
	font-family: var(--hg-mono); font-size: 11px; line-height: 1;
	padding: 4px 5px; border-radius: 1px;
	background: rgba(10,10,11,.82); color: var(--hg-ink);
	letter-spacing: .04em;
}
[class*="item"]::after, [class*="card"]::after {
	content: "AI";
	position: absolute; top: 8px; right: 8px; z-index: 3;
	font-family: var(--hg-mono); font-size: 10px; font-weight: 700;
	padding: 3px 4px; border-radius: 1px;
	background: var(--hg-accent); color: var(--hg-accent-ink);
	opacity: 0; transform: translateY(-2px);
	transition: opacity .18s, transform .18s;
}
[class*="item"]:hover::after, [class*="card"]:hover::after { opacity: 1; transform: none; }

/* 元信息行：贴底，压在渐变上，必须在标题之上 */
[class*="item"] [class*="meta"], [class*="card"] [class*="meta"] {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
	display: flex; gap: 8px; align-items: center;
	padding: 0 10px 7px; font-size: 10.5px; line-height: 1.4;
	color: #b9b9c0; font-family: var(--hg-mono);
	font-variant-numeric: tabular-nums;
}

/* 强调色下划线，hover 从左长出 */
[class*="item"] > a, [class*="card"] > a { display: block; }
[class*="item"]::before {
	content: ""; position: absolute; left: 0; bottom: 0; z-index: 4;
	width: 0; height: 2px; background: var(--hg-accent);
	transition: width .25s cubic-bezier(.2,.8,.2,1);
}
[class*="item"]:hover::before { width: 100%; }

/* ---------------------------------------------------------------- tags */
[class*="tag"], .tags a, .tag-list a, [class*="category"] a {
	display: inline-flex; align-items: center;
	height: 22px; padding: 0 7px;
	font-size: 11px; font-family: var(--hg-mono);
	color: var(--hg-muted) !important;
	background: var(--hg-surface) !important;
	border: 1px solid var(--hg-line) !important;
	border-radius: 1px !important;
	letter-spacing: .02em;
}
[class*="tag"]:hover, .tags a:hover {
	color: var(--hg-accent-ink) !important;
	background: var(--hg-accent) !important;
	border-color: var(--hg-accent) !important;
}

/* ---------------------------------------------------------------- 详情页 */
.detail, .vod-info, .info-box, [class*="detail"] {
	background: var(--hg-surface) !important;
	border: 1px solid var(--hg-line) !important;
	border-radius: var(--hg-radius) !important;
	padding: 20px !important;
}
.detail h1, .vod-info h1 { margin-bottom: 10px; }
.detail .desc, .vod-info .desc, [class*="desc"] {
	color: var(--hg-muted) !important;
	font-size: 13.5px;
	line-height: 1.8;
	max-width: 74ch;
}
/* 播放按钮 */
.btn, .play-btn, [class*="btn-play"], .detail .btn {
	background: var(--hg-accent) !important;
	color: var(--hg-accent-ink) !important;
	border: 0 !important;
	border-radius: 1px !important;
	height: 40px; padding-inline: 26px;
	font-weight: 800; font-size: 14px;
	letter-spacing: .02em;
}
.btn:hover, .play-btn:hover {
	filter: brightness(1.06);
	color: var(--hg-accent-ink) !important;
}

/* 剧集/线路选择 */
[class*="play-list"] a, [class*="episode"] a, [class*="source"] a {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 46px; height: 32px; padding-inline: 8px;
	font-family: var(--hg-mono); font-size: 12px;
	color: var(--hg-muted) !important;
	background: var(--hg-surface) !important;
	border: 1px solid var(--hg-line) !important;
	border-radius: 1px !important;
}
[class*="play-list"] a:hover, [class*="play-list"] a.active,
[class*="source"] a.on {
	background: var(--hg-accent) !important;
	color: var(--hg-accent-ink) !important;
	border-color: var(--hg-accent) !important;
}

/* ---------------------------------------------------------------- 播放器 */
.player, .play-box, .video-box, #player, [class*="player"] {
	background: #000 !important;
	border: 1px solid var(--hg-line) !important;
	border-radius: var(--hg-radius) !important;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}
.player video, #player video { width: 100%; height: 100%; }
/* 播放器自带的圆角/阴影一律压平 */
.player *, .play-box * { border-radius: 1px !important; }

/* ---------------------------------------------------------------- 分页 */
.pagination a, .page a, [class*="page"] a {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 34px; height: 34px;
	font-family: var(--hg-mono); font-size: 12px;
	border: 1px solid var(--hg-line) !important;
	border-radius: 1px !important;
	color: var(--hg-muted) !important;
	background: transparent !important;
}
.pagination a:hover, .pagination a.active, .page a.on {
	background: var(--hg-accent) !important;
	color: var(--hg-accent-ink) !important;
	border-color: var(--hg-accent) !important;
}

/* ---------------------------------------------------------------- footer */
footer, .footer {
	border-top: 1px solid var(--hg-line);
	margin-top: 56px; padding: 28px 0 40px;
	color: var(--hg-dim) !important;
	font-size: 12px;
}
footer a { color: var(--hg-muted) !important; }
footer a:hover { color: var(--hg-accent) !important; }

/* ---------------------------------------------------------------- 合规页 */
.compliance, .page-content, [class*="article"] {
	max-width: 78ch; line-height: 1.9;
	color: var(--hg-muted);
}
.compliance h2 { color: var(--hg-ink); margin-top: 2em; }
.compliance code { font-family: var(--hg-mono); background: var(--hg-surface); padding: 1px 5px; }

/* ---------------------------------------------------------------- 工具类 */
.hg-accent { color: var(--hg-accent) !important; }
.hg-mono { font-family: var(--hg-mono); font-variant-numeric: tabular-nums; }
.hg-rule { height: 1px; background: var(--hg-line); border: 0; margin: 28px 0; }
.hg-label {
	font-family: var(--hg-mono); font-size: 11px; letter-spacing: .12em;
	text-transform: uppercase; color: var(--hg-dim);
}
/* 首屏大图位（AI 推荐位），模板里手动套 .hg-hero / .hg-side */
.hg-hero {
	display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--hg-gap);
	height: clamp(240px, 30vw, 400px);
	margin-bottom: 28px;
}
.hg-hero > * { position: relative; overflow: hidden; border: 1px solid var(--hg-line); }
/* 压暗底部，保证标题和角标可读；::before 在内容之下，不会挡住文字 */
.hg-hero > *::before {
	content: ""; position: absolute; inset: auto 0 0 0; height: 62%;
	background: linear-gradient(to top, rgba(6,6,7,.92) 8%, rgba(6,6,7,.45) 55%, transparent);
	pointer-events: none; z-index: 0;
}
.hg-hero img {
	width: 100%; height: 100%; object-fit: cover; display: block;
	aspect-ratio: auto; border: 0;
}
.hg-hero .hg-side {
	display: grid; grid-template-rows: 1fr 1fr; gap: 10px;
	border: 0;
}
.hg-hero .hg-side > * { position: relative; overflow: hidden; border: 1px solid var(--hg-line); }
@media (max-width: 720px) {
	.hg-hero { grid-template-columns: 1fr; height: auto; gap: 10px; }
	.hg-hero > :first-child { aspect-ratio: 16 / 9; }
	.hg-hero h1 { font-size: 20px !important; line-height: 1.3; }
	.hg-hero .hg-side {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 118px;
		gap: 10px; border: 0;
	}
	.hg-hero .hg-side .hg-label { font-size: 10px; letter-spacing: .06em; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
/* ============ 9CCMSPC 模板适配层（追加在 hgai.css 之后） ============ */
body { background: #0a0a0b !important; color: #f4f4ef !important; }
.uk-container, .main, .content, .uk-container-center, .uk-section { background: transparent !important; }
.left-nav { background: #0f0f11 !important; border-right: 1px solid #26262b; }
.left-nav a, .menu-tag a, .common-tab a { color: #b9b9c0 !important; }
.left-nav a:hover, .menu-tag a:hover { color: #dfff3e !important; }

/* 五列密度 */
.video-content > div { width: 20% !important; }
@media (max-width: 1100px) { .video-content > div { width: 25% !important; } }
@media (max-width: 820px)  { .video-content > div { width: 50% !important; } }

.video-head h3, .h3-color, .video-head { color: #dfff3e !important; }
.video-head { border-bottom: 1px solid #26262b; padding-bottom: 8px; margin-bottom: 12px; }
.video-head h3 { font-size: 17px; letter-spacing: .04em; font-weight: 700; }

/* 卡片：直角、发丝线、16:10、hover 强调 */
.video-pic {
	position: relative; display: block; overflow: hidden;
	border: 1px solid #26262b; border-radius: 2px; background: #131316;
	transition: border-color .18s;
}
.video-pic img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.video-pic::after {
	content: "AI"; position: absolute; top: 6px; right: 6px;
	background: #dfff3e; color: #0a0a0b;
	font: 700 10px/1 ui-monospace, monospace; padding: 3px 4px;
	opacity: 0; transition: opacity .18s;
}
.video-pic:hover { border-color: #dfff3e; }
.video-pic:hover::after { opacity: 1; }

.video-title a {
	color: #f4f4ef !important; font-size: 13px; line-height: 1.4;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	overflow: hidden; margin-top: 7px;
}
.video-title a:hover { color: #dfff3e !important; }
.video-play, .video-like, .video-title p { color: #8c8c96 !important; font-size: 11px; }
.live-tag { position: absolute; top: 6px; left: 6px; z-index: 2; }

/* 搜索框 */
.uk-form input, .search input { background: #131316 !important; color: #f4f4ef !important; border: 1px solid #26262b !important; }
.uk-button, .search button { background: #dfff3e !important; color: #0a0a0b !important; border: 0 !important; }

/* 分页 / 播放页 */
.uk-pagination > li > a { background: #131316 !important; border: 1px solid #26262b !important; color: #b9b9c0 !important; }
.uk-pagination > li.uk-active > a { background: #dfff3e !important; color: #0a0a0b !important; }
.video-player, .player, #player { border: 1px solid #26262b !important; }

/* 细节：把模板遗留的白色块压暗 */
.uk-panel, .uk-card, .detail, .uk-article { background: #131316 !important; color: #f4f4ef !important; }
hr, .line hr { border-color: #26262b !important; }
/* ============ 9CCMSPC 模板适配层（追加在 hgai.css 之后） ============ */
body { background: #0a0a0b !important; color: #f4f4ef !important; }
.uk-container, .main, .content, .uk-container-center, .uk-section { background: transparent !important; }
.left-nav { background: #0f0f11 !important; border-right: 1px solid #26262b; }
.left-nav a, .menu-tag a, .common-tab a { color: #b9b9c0 !important; }
.left-nav a:hover, .menu-tag a:hover { color: #dfff3e !important; }

/* 五列密度 */
.video-content > div { width: 20% !important; }
@media (max-width: 1100px) { .video-content > div { width: 25% !important; } }
@media (max-width: 820px)  { .video-content > div { width: 50% !important; } }

.video-head h3, .h3-color, .video-head { color: #dfff3e !important; }
.video-head { border-bottom: 1px solid #26262b; padding-bottom: 8px; margin-bottom: 12px; }
.video-head h3 { font-size: 17px; letter-spacing: .04em; font-weight: 700; }

/* 卡片：直角、发丝线、16:10、hover 强调 */
.video-pic {
	position: relative; display: block; overflow: hidden;
	border: 1px solid #26262b; border-radius: 2px; background: #131316;
	transition: border-color .18s;
}
.video-pic img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.video-pic::after {
	content: "AI"; position: absolute; top: 6px; right: 6px;
	background: #dfff3e; color: #0a0a0b;
	font: 700 10px/1 ui-monospace, monospace; padding: 3px 4px;
	opacity: 0; transition: opacity .18s;
}
.video-pic:hover { border-color: #dfff3e; }
.video-pic:hover::after { opacity: 1; }

.video-title a {
	color: #f4f4ef !important; font-size: 13px; line-height: 1.4;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	overflow: hidden; margin-top: 7px;
}
.video-title a:hover { color: #dfff3e !important; }
.video-play, .video-like, .video-title p { color: #8c8c96 !important; font-size: 11px; }
.live-tag { position: absolute; top: 6px; left: 6px; z-index: 2; }

/* 搜索框 */
.uk-form input, .search input { background: #131316 !important; color: #f4f4ef !important; border: 1px solid #26262b !important; }
.uk-button, .search button { background: #dfff3e !important; color: #0a0a0b !important; border: 0 !important; }

/* 分页 / 播放页 */
.uk-pagination > li > a { background: #131316 !important; border: 1px solid #26262b !important; color: #b9b9c0 !important; }
.uk-pagination > li.uk-active > a { background: #dfff3e !important; color: #0a0a0b !important; }
.video-player, .player, #player { border: 1px solid #26262b !important; }

/* 细节：把模板遗留的白色块压暗 */
.uk-panel, .uk-card, .detail, .uk-article { background: #131316 !important; color: #f4f4ef !important; }
hr, .line hr { border-color: #26262b !important; }

/* v3 修正 */
.right-content { background: transparent !important; }
.video-content > div { width: 20% !important; float: left; }
.video-content .video-pic { width: 100% !important; }
.video-content .video-pic img { width: 100% !important; height: auto !important; }
.video-content .uk-width-1-3 { box-sizing: border-box; padding-right: 12px; }

/* v4：容器已被 hgai.css 的 [class*="grid"] 变成 CSS Grid，
   子项不能再写百分比宽度，否则宽度会按轨道百分比缩小 */
.video-content > div { width: auto !important; float: none !important; padding-right: 0 !important; }
.video-content { grid-gap: 14px !important; }

/* v5：封面强制 16:10，栅格列数显式声明 */
.video-content { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important; grid-gap: 14px !important; }
.video-pic { aspect-ratio: 16 / 10 !important; position: relative !important; }
.video-pic img {
	position: absolute !important; inset: 0 !important;
	width: 100% !important; height: 100% !important;
	object-fit: cover !important;
}
.left-nav .menu-tag a, .left-nav .tab-a, .left-nav .nav-a { line-height: 32px; font-size: 13px; display: block; }

/* v6：封面底色压暗，坏图不留白块 */
.video-pic { background: #131316 !important; }
.video-pic img { background: #131316; color: #8c8c96; font-size: 11px; }
