/* Loaded only while Appearance > Interface refinements is enabled. */
body.ydg-ui-refined {
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
	--duration-press: 160ms;
	--duration-panel: 220ms;
}

.ydg-ui-refined :is(button, .button) { touch-action: manipulation; }
.ydg-ui-refined :is(button, .button):focus-visible { outline: 2px solid #ff91a2; outline-offset: 4px; }
.ydg-ui-refined :is(.button, .gv-vip-buy, .auth-submit, .favorite-button) {
	transition: transform var(--duration-press) var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.ydg-ui-refined :is(.button, .gv-vip-buy, .auth-submit, .favorite-button):active { transform: scale(.97); }
.ydg-ui-refined .ydg-drawer-close, .ydg-ui-refined .site-search__close { display: none; }

/* Frequent browsing keeps the grid and neighboring recommendations still. */
.ydg-ui-refined .video-card, .ydg-ui-refined .video-card:hover { transform: none; transition: none; }
.ydg-ui-refined .video-card__link:hover img { transform: none; opacity: 1; }
.ydg-ui-refined .video-card__link:hover .video-card__media { box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.ydg-ui-refined .video-card__media img { transition: transform 160ms var(--ease-out); }
.ydg-ui-refined .video-hover-overlay { background: rgba(0,0,0,.15); }
.ydg-ui-refined :is(.video-hover-overlay, .video-hover-play) { transition-duration: 160ms; }
.ydg-ui-refined .video-card__link:focus-visible { outline: 2px solid #ff91a2; outline-offset: 4px; border-radius: 16px; }

@media (hover: hover) and (pointer: fine) {
	.ydg-ui-refined .video-card__link:hover img { transform: scale(1.025); }
	.ydg-ui-refined .video-card__link:focus-visible :is(.video-hover-overlay, .video-hover-play) { opacity: 1; transition: none; }
	.ydg-ui-refined .video-card__link:focus-visible .video-hover-play { transform: translate(-50%,-50%) scale(1); }
	.ydg-ui-refined.home .right-hot-list--recent .right-hot-item,
	.ydg-ui-refined.home .right-hot-list--recent .right-hot-item:hover,
	.ydg-ui-refined.home .right-hot-list--recent .right-hot-item:focus-visible {
		flex: 1 1 0;
		grid-template-columns: 86px minmax(0,1fr);
		box-shadow: none;
		transition: background-color 160ms ease;
	}
	.ydg-ui-refined.home .right-hot-list--recent .right-hot-item__thumb img,
	.ydg-ui-refined.home .right-hot-list--recent .right-hot-item:hover .right-hot-item__thumb img,
	.ydg-ui-refined.home .right-hot-list--recent .right-hot-item:focus-visible .right-hot-item__thumb img { transform: none; filter: none; transition: none; }
	.ydg-ui-refined.home .right-hot-list--recent .right-hot-item::before { transition: opacity 160ms ease; }
}
@media (min-width: 1024px) and (max-width: 1199px) and (hover: hover) and (pointer: fine) {
	.ydg-ui-refined.home .right-hot-list--recent .right-hot-item,
	.ydg-ui-refined.home .right-hot-list--recent .right-hot-item:hover,
	.ydg-ui-refined.home .right-hot-list--recent .right-hot-item:focus-visible { grid-template-columns: 68px minmax(0,1fr); }
}

.ydg-ui-refined .cnh-hero-thumb {
	left: 0;
	scale: 1;
	translate: none;
	transform: translate3d(var(--hero-thumb-x,0px),0,0);
	transition: transform 250ms var(--ease-out), opacity 180ms ease, border-color 160ms ease, visibility 0s 250ms;
}
.ydg-ui-refined .cnh-hero-thumb.is-visible { transition-delay: 0s; }
.ydg-ui-refined .cnh-hero-thumb.is-active { transform: translate3d(var(--hero-thumb-x,0px),-8px,0) scale(var(--hero-active-scale,1.25)); }
.ydg-ui-refined .cnh-hero-slider.is-keyboard-switch * { transition: none !important; }
.ydg-ui-refined .cnh-hero-slider--cinema .cnh-hero-button {
 display: inline-flex;
 align-items: center;
 gap: 10px;
 min-height: 40px;
 padding: 10px 16px;
 border: 1px solid rgba(255,255,255,.8);
 border-radius: 10px;
 background: #f4f4f5;
 color: #14161b;
 font-size: 14px;
 font-weight: 650;
 line-height: 1.2;
 box-shadow: none;
}
.ydg-ui-refined .cnh-hero-button > span[aria-hidden] {
 display: block;
 width: 0;
 height: 0;
 overflow: hidden;
 border-top: 6px solid transparent;
 border-bottom: 6px solid transparent;
 border-left: 9px solid currentColor;
 font-size: 0;
 line-height: 0;
}

.ydg-ui-refined .favorite-button {
	padding: 10px 18px;
	border: 1px solid rgba(241,61,85,.5);
	border-radius: 10px;
	color: #ff8496;
	font-size: 14px;
	font-weight: 650;
	letter-spacing: 0;
	box-shadow: none;
}
.ydg-ui-refined .favorite-button::before { content: none; }
.ydg-ui-refined .favorite-button:is(:hover,:focus-visible,.is-active) { background: rgba(241,61,85,.16); color: #fff; box-shadow: none; }

/* Titles carry the card; statistics and descriptions stay secondary. */
.ydg-ui-refined .ydg-author-collection-title { font-weight: 650; line-height: 1.45; min-height: 2.9em; }
.ydg-ui-refined .ydg-author-collection-desc { height: 2.9em; -webkit-line-clamp: 2; line-height: 1.45; }
.ydg-ui-refined .ydg-author-collection-desc.is-expanded { height: auto; -webkit-line-clamp: unset; }
.ydg-ui-refined :is(.ydg-author-collection-meta, .video-card__meta) { font-weight: 500; }
.ydg-ui-refined .ydg-collections-filter { gap: 8px; }
.ydg-ui-refined .ydg-collections-filter__item { min-height: 44px; font-weight: 550; }
.ydg-ui-refined .gv-vip-plans { scroll-margin-top: 110px; }
/* Preserve the established blue / pink / orange / black-gold membership tiers. */
.ydg-ui-refined .gv-vip-plan:is(:hover,.is-featured) { transform: none; }
.ydg-ui-refined .gv-vip-status[class*="gv-vip-status--"] strong { color: var(--status-accent,#ffd98a); }
body.ydg-ui-refined:is(.page-template-page-login,.page-template-page-register) .auth-submit { background: #c82c45; border: 1px solid #c82c45; color: #fff; font-size: 17px; font-weight: 650; border-radius: 12px; }
body.ydg-ui-refined:is(.page-template-page-login,.page-template-page-register) .auth-switch .button { min-height: 44px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 15px; font-weight: 550; border-radius: 12px; }

@media (max-width: 767px), (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 700px) {
	.ydg-ui-refined .site-search {
		position: absolute;
		left: 68px;
		right: 12px;
		top: 20px;
		z-index: 30;
		display: grid;
		grid-template-columns: minmax(0,1fr) 40px 40px;
		width: auto;
		min-height: 48px;
		padding: 0 4px 0 14px;
		border: 1px solid rgba(255,255,255,.12);
		border-radius: 14px;
		background: #171b23;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translateY(-4px);
		transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 0s 180ms;
	}
	.ydg-ui-refined.mobile-search-open .site-search { visibility: visible; opacity: 1; pointer-events: auto; transform: none; transition-delay: 0s; }
	.ydg-ui-refined.mobile-search-open .site-brand { visibility: hidden; }
	.ydg-ui-refined .site-search input[type="search"] { width: 100%; min-width: 0; min-height: 46px; padding: 0; font-size: 16px; background: transparent; }
	.ydg-ui-refined.mobile-search-open .site-search button {
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		min-height: 46px;
		padding: 0;
		border: 0;
		border-radius: 10px;
		background: transparent;
		color: #e5e7ed;
		font-size: 0;
		box-shadow: none;
	}
	.ydg-ui-refined.mobile-search-open .site-search button::before { content: none; }
	.ydg-ui-refined.mobile-search-open .site-search button[type="submit"]::before {
		content: "";
		width: 15px;
		height: 15px;
		border: 2px solid currentColor;
		border-radius: 50%;
		background: transparent;
	}
	.ydg-ui-refined.mobile-search-open .site-search button[type="submit"]::after { content: ""; position: absolute; width: 8px; height: 2px; right: 8px; bottom: 11px; background: currentColor; transform: rotate(45deg); }
	.ydg-ui-refined.mobile-search-open .site-search .site-search__close { font-size: 28px; font-weight: 400; line-height: 1; }
	.ydg-ui-refined .site-search__submit-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.ydg-ui-refined .mobile-search-popular { left: 0; right: 0; top: 56px; background: #171b23; border: 1px solid var(--line); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
	.ydg-ui-refined .left-sidebars {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 40;
		display: block;
		width: min(84vw,320px);
		height: 100dvh;
		padding: 18px 20px max(24px,env(safe-area-inset-bottom,0px));
		overflow-y: auto;
		overscroll-behavior: contain;
		background: #0b0d11;
		border-right: 1px solid var(--line);
		box-shadow: 18px 0 45px rgba(0,0,0,.45);
		visibility: hidden;
		transform: translateX(-104%);
		transition: transform 250ms var(--ease-drawer), visibility 0s 250ms;
	}
	.ydg-ui-refined.mobile-drawer-open .left-sidebars { visibility: visible; transform: none; transition-delay: 0s; }
	.ydg-ui-refined.admin-bar .left-sidebars { top: 46px; height: calc(100dvh - 46px); }
	.ydg-ui-refined .ydg-drawer-close { position: absolute; right: 12px; top: 12px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: #171b23; color: #fff; font-size: 28px; cursor: pointer; }
	.ydg-ui-refined .mobile-drawer-brand { padding-right: 48px; }
	.ydg-ui-refined .mobile-drawer-auth { display: grid; gap: 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
	.ydg-ui-refined .mobile-drawer-brand { display: inline-flex; align-items: center; margin-bottom: 8px; }
	.ydg-ui-refined .mobile-drawer-brand__logo { display: block; width: auto; max-width: 150px; height: 42px; object-fit: contain; }
	.ydg-ui-refined .mobile-drawer-auth > a:not(.mobile-drawer-brand) { display: flex; align-items: center; min-height: 46px; padding: 10px 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 12px; background: rgba(255,255,255,.035); color: var(--text); font-size: 16px; }
	.ydg-ui-refined .left-sidebars .video-sidebar { position: relative; top: auto; overflow: visible; padding: 0 0 14px; margin: 0 0 14px; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: transparent; box-shadow: none; }
	.ydg-ui-refined .left-sidebars .video-sidebar--vip-entry { display: block; }
	.ydg-ui-refined .mobile-drawer-backdrop { position: fixed; inset: 0; z-index: 39; display: block; border: 0; background: rgba(0,0,0,.58); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
	.ydg-ui-refined.mobile-drawer-open .mobile-drawer-backdrop { opacity: 1; pointer-events: auto; }
	.ydg-ui-refined.mobile-drawer-open { overflow: hidden; }
	.ydg-ui-refined .left-sidebars .video-sidebar__section-toggle { min-height: 44px; }
	.ydg-ui-refined .left-sidebars .video-category-drawer[hidden] { display: none !important; }
	.ydg-ui-refined .left-sidebars .video-sidebar.is-section-open .video-category-drawer { display: grid; max-height: none; opacity: 1; margin-top: 10px; }
	.ydg-ui-refined .category-children { transition: opacity 160ms ease; }
	.ydg-ui-refined .category-drawer-item.is-open > .category-children { max-height: none; }
	.ydg-ui-refined .ydg-author-collection-title { font-size: 14px; }
	.ydg-ui-refined .ydg-author-collection-meta { font-size: 11px; line-height: 1.5; }
	.ydg-ui-refined .ydg-author-collection-desc { font-size: 12px; }
	.ydg-ui-refined .video-card__footer .video-card__meta { font-size: 11px; }
	.ydg-ui-refined .home-app-download { min-height: 48px; margin-top: 24px; margin-bottom: 12px; padding: 8px 12px; border-color: var(--line-soft); border-radius: 10px; background: #0d1015; }
	.ydg-ui-refined .home-app-download strong { font-size: 12px; font-weight: 600; }
	.ydg-ui-refined .home-app-download span { margin-top: 2px; font-size: 10px; }
	.ydg-ui-refined .home-app-download .button { min-height: 36px; padding: 8px 12px; font-size: 12px; }
	/* Mobile artwork fills the banner; copy sits over its shaded lower edge. */
	.ydg-ui-refined .cnh-hero-slider--cinema { display: block; height: clamp(360px,62svh,480px); min-height: 0; aspect-ratio: auto; }
	.ydg-ui-refined .cnh-hero-slider--cinema .cnh-hero-slide { position: absolute; inset: 0; }
	.ydg-ui-refined .cnh-hero-slider--cinema .cnh-hero-link { position: absolute; inset: 0; height: 100%; padding-top: 0; }
	.ydg-ui-refined .cnh-hero-slider--cinema :is(.cnh-hero-mobile-art,.cnh-hero-desktop-art,.cnh-hero-desktop-mask) { display: none; }
	.ydg-ui-refined .cnh-hero-slider--cinema .cnh-hero-mobile-poster { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
	.ydg-ui-refined .cnh-hero-slider--cinema .cnh-hero-link::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg,rgba(3,5,8,.03) 0%,rgba(3,5,8,.08) 30%,rgba(3,5,8,.5) 56%,rgba(3,5,8,.94) 100%); }
	.ydg-ui-refined .cnh-hero-slider--cinema .cnh-hero-content { position: absolute; left: 18px; right: 18px; top: auto; bottom: 42px; z-index: 3; width: auto; padding: 0; transform: none; }
	.ydg-ui-refined .cnh-hero-slider--cinema .cnh-hero-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 20px; line-height: 1.35; }
	.ydg-ui-refined .cnh-hero-slider--cinema .cnh-hero-desc { margin-bottom: 8px; }
	.ydg-ui-refined .cnh-hero-controls { bottom: 8px; }
	.ydg-ui-refined .cnh-hero-pagination { gap: 2px; }
	.ydg-ui-refined .cnh-hero-page { height: 28px; }
	.ydg-ui-refined .gv-vip-hero { margin-top: 12px; padding: 24px; gap: 20px; }
	.ydg-ui-refined .gv-vip-hero h1 { font-size: 28px; line-height: 1.3; }
	.ydg-ui-refined .gv-vip-hero p { font-size: 14px; line-height: 1.7; }
	.ydg-ui-refined .gv-vip-status { min-height: 0; padding: 16px; }
	.ydg-ui-refined .gv-vip-status strong { font-size: 22px; }
	.ydg-ui-refined .gv-vip-status p { margin: 8px 0 0; font-size: 13px; }
	.ydg-ui-refined :is(.clips-page,.clips-feed,.clip-slide,.clips-empty) { min-height: 100dvh; }
	.ydg-ui-refined .clips-feed { height: 100dvh; }
	body.ydg-ui-refined:is(.page-template-page-login,.page-template-page-register) .auth-submit { background: #c82c45; border-color: #c82c45; color: #fff; font-size: 17px; font-weight: 650; border-radius: 12px; }
	body.ydg-ui-refined:is(.page-template-page-login,.page-template-page-register) .auth-switch .button { min-height: 44px; border-color: var(--line); font-size: 15px; font-weight: 550; border-radius: 12px; }
	body.ydg-ui-refined:is(.page-template-page-login,.page-template-page-register) .auth-panel { max-height: calc(100dvh - 120px); padding: 26px; }
	body.ydg-ui-refined:is(.page-template-page-login,.page-template-page-register) .auth-form label { display: block; position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 700px) {
	.ydg-ui-refined .site-search { top: 12px; }
	.ydg-ui-refined .left-sidebars .video-sidebar__section-toggle { display: flex; }
	.ydg-ui-refined .cnh-hero-slider--cinema { height: clamp(280px,72svh,400px); }
}
@media (hover: none), (pointer: coarse) {
	.ydg-ui-refined :is(.ydg-author-collection-card,.author-card,.account-action,.gv-vip-plan):hover { transform: none; }
	.ydg-ui-refined .ydg-author-collection-card:hover .ydg-author-collection-cover--1 { transform: rotate(-3deg); }
	.ydg-ui-refined .ydg-author-collection-card:hover .ydg-author-collection-cover--2 { transform: rotate(3deg); }
	.ydg-ui-refined .ydg-author-collection-card:hover .ydg-author-collection-cover--3 { transform: translate(10px,8px) rotate(8deg) scale(.94); }
	.ydg-ui-refined .video-card__link:active .video-card__media { opacity: .86; }
}
@media (prefers-reduced-motion: reduce) {
	.ydg-ui-refined *, .ydg-ui-refined *::before, .ydg-ui-refined *::after { animation: none !important; scroll-behavior: auto !important; transition-property: opacity,color,background-color,border-color !important; transition-duration: 120ms !important; transition-delay: 0s !important; }
	.ydg-ui-refined .video-card__link:hover img, .ydg-ui-refined .button:active, .ydg-ui-refined .favorite-button:active { transform: none; }
}
