*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #e8e8e8;
	background: #131414;
}

a {
	color: inherit;
	text-decoration: none;
}

img {
	display: block;
	max-width: 100%;
}

.container {
	width: min(1920px, 100% - 48px);
	margin: 0 auto;
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(19, 20, 20, 0.95);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid #1e1f1f;
	transition: background 0.2s ease, border-color 0.2s ease, backdrop-filter 0.2s ease;
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 32px;
	height: 56px;
}

.site-brand {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	color: #fff;
}

.site-brand__logo {
	display: block;
	height: 24px;
	width: auto;
	max-height: 24px;
	max-width: 72px;
	object-fit: contain;
	flex-shrink: 0;
}

.site-brand__name {
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.site-nav {
	display: flex;
	gap: 24px;
	flex-shrink: 0;
}

.site-nav a {
	color: #999;
	font-size: 15px;
	transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.is-active {
	color: #fff;
}

.site-search {
	display: flex;
	align-items: center;
	margin-left: auto;
	background: #1a1a1a;
	border-radius: 20px;
	padding: 0 0 0 16px;
	border: 1px solid #2a2a2a;
	min-width: 200px;
	max-width: 280px;
	flex: 1;
}

.site-search input[type="search"] {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	color: #fff;
	font-size: 14px;
	padding: 8px 0;
	min-width: 0;
}

.site-search input[type="search"]::placeholder {
	color: #666;
}

.site-search button {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: #2a2a2a;
	color: #999;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.site-search button:hover {
	background: #333;
	color: #fff;
}

.site-search button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

.site-search button:disabled:hover {
	background: #2a2a2a;
	color: #999;
}

/* Section */
.hero-section {
	padding: 20px 0 12px;
}

.section-title {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	color: #fff;
	line-height: 1.2;
}

.section-subtitle {
	margin: 8px 0 0;
	color: #888;
	font-size: 14px;
}

.drama-grid-section {
	padding: 0 0 48px;
}

/* 列表网格 - 参考红果 PC：8 列 / row-gap 52 / column-gap 32 */
.drama-grid,
.drama-grid--related {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	row-gap: 52px;
	column-gap: 32px;
}

.drama-grid .drama-card__title,
.drama-grid--related .drama-card__title {
	margin: 8px 0 6px;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.3;
}

.drama-grid .drama-card__episodes,
.drama-grid--related .drama-card__episodes {
	right: 6px;
	bottom: 6px;
	padding: 2px 6px;
	font-size: 14px;
	background: rgba(0, 0, 0, 0.45);
	border-radius: 4px;
}

.drama-grid .drama-tags,
.drama-grid--related .drama-tags {
	gap: 4px;
}

.drama-grid .drama-tag,
.drama-grid--related .drama-tag {
	margin: 0;
	padding: 3px 6px;
	font-size: 12px;
	border-radius: 3px;
}

@media (max-width: 960px) {
	.drama-grid,
	.drama-grid--related {
		grid-template-columns: repeat(4, 1fr);
		row-gap: 32px;
		column-gap: 16px;
	}
}

@media (max-width: 640px) {
	.header-inner {
		flex-wrap: wrap;
		height: auto;
		padding: 12px 0;
		gap: 12px;
	}

	.site-search {
		order: 3;
		width: 100%;
		max-width: none;
	}

	.drama-grid,
	.drama-grid--related {
		grid-template-columns: repeat(3, 1fr);
		row-gap: 24px;
		column-gap: 12px;
	}

	.drama-grid .drama-card__title,
	.drama-grid--related .drama-card__title {
		margin: 6px 0 4px;
		font-size: 13px;
	}

	.drama-grid .drama-card__episodes,
	.drama-grid--related .drama-card__episodes {
		font-size: 11px;
		padding: 2px 5px;
	}

	.drama-grid .drama-tag,
	.drama-grid--related .drama-tag {
		font-size: 10px;
		padding: 2px 5px;
	}
}

@media (max-width: 400px) {
	.drama-grid,
	.drama-grid--related {
		grid-template-columns: repeat(2, 1fr);
	}

	.drama-grid .drama-card__title,
	.drama-grid--related .drama-card__title {
		font-size: 12px;
	}
}

/* Card */
.drama-card {
	min-width: 0;
}

.drama-card__link {
	display: block;
}

.drama-card__poster {
	position: relative;
	aspect-ratio: 187 / 256;
	border-radius: 8px;
	overflow: hidden;
	background: #1a1a1a;
}

.drama-card__poster::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 48px;
	background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.55) 100%);
	pointer-events: none;
}

.drama-card__poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	image-rendering: -webkit-optimize-contrast;
	transition: transform 0.3s ease;
}

.drama-card:hover .drama-card__poster img {
	transform: scale(1.08);
}

.drama-card__episodes {
	position: absolute;
	right: 8px;
	bottom: 8px;
	z-index: 1;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	color: #fff;
	line-height: 1;
	white-space: nowrap;
}

.drama-card__title {
	margin: 16px 0 12px;
	font-family: inherit;
	font-size: 18px;
	font-weight: 400;
	color: #ffffffe6;
	line-height: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.drama-card:hover .drama-card__title {
	color: #ffffffe6;
}

.drama-tags {
	display: flex;
	flex-wrap: wrap;
}

.drama-tag {
	display: inline-block;
	margin: 0 6px 0 0;
	padding: 4px 8px;
	font-family: inherit;
	font-size: 12px;
	line-height: 1;
	color: #ffffff80;
	background: #e0e0e00f;
	border-radius: 3px;
}

a.drama-tag {
	text-decoration: none;
	transition: color 0.2s, background 0.2s;
}

a.drama-tag:hover {
	color: #ffffffb3;
	background: #e0e0e01a;
}

body.home .site-header,
body.single-drama .site-header {
	background: transparent;
	backdrop-filter: none;
	border-bottom-color: transparent;
}

body.home .site-header.is-scrolled,
body.single-drama .site-header.is-scrolled {
	background: #131414;
	backdrop-filter: none;
	border-bottom-color: #1e1f1f;
}

body.single-drama .site-header.is-scrolled .site-search {
	background: #1a1a1a;
	border-color: #2a2a2a;
}

body.single-drama .site-header.is-scrolled .site-search input[type="search"]::placeholder {
	color: #666;
}

body.single-drama .site-main {
	margin-top: -56px;
}

body.single-drama .site-search {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.1);
}

body.single-drama .site-search input[type="search"]::placeholder {
	color: rgba(255, 255, 255, 0.45);
}

body.single-drama .site-search button {
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.65);
}

body.single-drama .site-search button:hover {
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
}

body.single-drama .site-search button:disabled:hover {
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.65);
}

/* Detail page */
.drama-detail {
	position: relative;
	padding: 24px 0 48px;
	overflow: hidden;
}

body.single-drama .drama-detail {
	padding-top: 80px;
}

.drama-detail__bg {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 100%;
	max-height: 520px;
	background-size: cover;
	background-position: center top;
	background-repeat: no-repeat;
	filter: blur(48px);
	transform: scale(1.15);
	opacity: 0.45;
	pointer-events: none;
}

body.single-drama .drama-detail__bg {
	max-height: 580px;
}

.drama-detail__gradient {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	height: 100%;
	background:
		linear-gradient(105deg, rgba(42, 36, 28, 0.55) 0%, rgba(19, 20, 20, 0.2) 45%, rgba(19, 20, 20, 0.85) 100%),
		linear-gradient(180deg, rgba(19, 20, 20, 0.05) 0%, rgba(19, 20, 20, 0.55) 55%, rgba(19, 20, 20, 0.92) 88%, #131414 100%);
	pointer-events: none;
}

.drama-detail__inner {
	position: relative;
	z-index: 1;
}

.drama-detail__hero {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 24px;
	align-items: stretch;
	margin-bottom: 40px;
}

.drama-detail__poster {
	grid-column: 1;
	align-self: start;
}

.drama-detail__head {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-width: 0;
	min-height: 100%;
}

.drama-detail__head-top {
	flex: 1;
}

.drama-detail__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	flex-shrink: 0;
	margin-top: 20px;
}

@media (max-width: 640px) {
	.drama-detail__hero {
		grid-template-columns: 1fr;
		gap: 16px;
		margin-bottom: 32px;
	}

	.drama-detail__poster {
		max-width: 180px;
		margin: 0 auto;
	}

	.drama-detail__head {
		min-height: 0;
	}

	.drama-detail__actions {
		margin-top: 16px;
	}

	.drama-detail__title {
		font-size: 22px;
		margin-bottom: 12px;
	}

	.drama-detail__head .drama-tag {
		font-size: 13px;
		padding: 4px 8px;
	}

	.drama-detail__episodes {
		font-size: 12px;
	}
}

.drama-detail__poster {
	position: relative;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	background: #1a1a1a;
}

.drama-detail__poster::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 48px;
	background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.55) 100%);
	pointer-events: none;
}

.drama-detail__poster img {
	width: 100%;
	aspect-ratio: 187 / 256;
	object-fit: cover;
}

.drama-detail__episodes {
	position: absolute;
	right: 8px;
	bottom: 8px;
	z-index: 1;
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	color: #fff;
	line-height: 1;
}

.drama-detail__title {
	margin: 0 0 16px;
	font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
	font-size: 28px;
	font-weight: 500;
	color: #fffffff2;
	line-height: 1.57;
}

.drama-detail__head .drama-tags {
	gap: 8px;
	margin-bottom: 0;
}

.drama-detail__head .drama-tag {
	margin: 0;
	padding: 6px 10px;
	font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
	font-size: 16px;
	line-height: 1;
	color: #fffffff2;
	background: rgba(224, 224, 224, 0.06);
	border-radius: 4px;
}

.drama-detail__head a.drama-tag:hover {
	color: #fffffff2;
	background: rgba(224, 224, 224, 0.12);
}

.drama-detail__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-top: 12px;
	color: rgba(255, 255, 255, 0.45);
	font-size: 13px;
	line-height: 1.5;
}

.drama-detail__meta-item {
	white-space: nowrap;
}

.drama-detail__section {
	position: relative;
	z-index: 1;
	margin-bottom: 40px;
}

.drama-detail__section-title {
	margin: 0 0 16px;
	font-family: inherit;
	font-size: 20px;
	font-weight: 500;
	color: #ffffffe6;
	line-height: 1.4;
}

.drama-detail__basic-text {
	color: rgba(255, 255, 255, 0.55);
	font-size: 16px;
	line-height: 1.8;
}

.drama-detail__basic-text p {
	margin: 0 0 12px;
}

.drama-detail__basic-text p:last-child {
	margin-bottom: 0;
}

.drama-detail__cast-scroll {
	margin-top: 24px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.drama-detail__cast-scroll::-webkit-scrollbar {
	display: none;
}

.drama-detail__cast {
	display: flex;
	flex-wrap: nowrap;
	gap: 20px;
	width: max-content;
	min-width: 100%;
	padding-bottom: 4px;
}

.drama-detail__cast-item {
	flex: 0 0 auto;
	width: 64px;
	text-align: center;
}

.drama-detail__cast-avatar {
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto 8px;
	border-radius: 50%;
	object-fit: cover;
	background: #2a2a2a;
}

.drama-detail__cast-avatar--placeholder {
	display: block;
}

.drama-detail__cast-name {
	font-size: 14px;
	font-weight: 500;
	color: #ffffffe6;
	line-height: 1.3;
	white-space: nowrap;
}

.drama-detail__cast-role {
	margin-top: 4px;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.45);
	line-height: 1.3;
	white-space: nowrap;
}

.drama-detail__download-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 162px;
	height: 45px;
	padding: 0;
	font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
	color: hsla(0, 0%, 100%, 0.95);
	background: linear-gradient(92.27deg, #ff7e0d 0.32%, #ff9233 100%);
	border-radius: 12px;
	text-decoration: none;
	cursor: pointer;
	position: relative;
	opacity: 1;
	z-index: 0;
	transition: opacity 0.2s ease, filter 0.2s ease;
}

.drama-detail__download-icon {
	display: block;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

.drama-detail__download-text {
	margin-left: 8px;
	font-family: inherit;
	font-size: 18px;
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1;
}

.drama-detail__download-btn:hover,
.drama-detail__download-btn:active,
.drama-detail__download-btn:focus {
	color: hsla(0, 0%, 100%, 0.95);
	background: linear-gradient(92.27deg, #eb8228 0.32%, #ff8f2e 100%);
	filter: brightness(0.96);
}

.drama-detail__download-btn--disabled,
.drama-detail__download-btn--disabled:hover,
.drama-detail__download-btn--disabled:active,
.drama-detail__download-btn--disabled:focus {
	color: rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.1);
	filter: none;
	cursor: not-allowed;
	pointer-events: none;
}

.drama-detail__download-btn--disabled .drama-detail__download-icon {
	opacity: 1;
}

.drama-detail__related {
	margin-bottom: 8px;
}

.drama-grid--related {
	margin-bottom: 0;
}

/* Pagination */
.pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 32px;
	flex-wrap: wrap;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 12px;
	color: #999;
	background: #1a1a1a;
	border-radius: 6px;
	transition: background 0.2s, color 0.2s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
	color: #fff;
	background: #333;
}

.pagination .page-numbers.current {
	background: #ff4d4f;
}

/* Empty state */
.empty-state {
	text-align: center;
	padding: 80px 20px;
	color: #666;
}

.empty-state__hint {
	margin-top: 8px;
	font-size: 13px;
	color: #555;
}

.empty-state a {
	color: #ff7875;
}

.empty-state a:hover {
	text-decoration: underline;
}

.empty-state--compact {
	padding: 24px 20px 8px;
}

/* 站外搜索 + 拉取资源 */
.drama-external-section {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid #1e1f1f;
}

.drama-external-section__title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 600;
	color: #fff;
}

.drama-external-section__status {
	margin: 0 0 20px;
	color: #888;
	font-size: 14px;
}

.drama-card--external .drama-card__title {
	margin: 8px 0 6px;
}

.drama-card--external .drama-tags {
	gap: 4px;
	margin-bottom: 10px;
}

.drama-card-external__actions {
	margin-top: 2px;
}

.drama-fetch-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	padding: 0 12px;
	border: none;
	border-radius: 6px;
	background: #ff7875;
	color: #fff;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.2s;
}

.drama-fetch-btn:hover:not(:disabled) {
	background: #ff9c99;
}

.drama-fetch-btn:disabled,
.drama-fetch-btn--done {
	background: #2a2a2a;
	color: #999;
	cursor: default;
}

.drama-card__link--static {
	cursor: default;
}

.hongguo-toast {
	position: fixed;
	left: 50%;
	bottom: 32px;
	z-index: 200;
	max-width: min(90vw, 480px);
	padding: 12px 20px;
	border-radius: 8px;
	background: rgba(30, 30, 30, 0.96);
	border: 1px solid #333;
	color: #fff;
	font-size: 14px;
	line-height: 1.5;
	transform: translateX(-50%);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Footer */
.site-footer {
	padding: 24px 0;
	border-top: 1px solid #1a1a1a;
	text-align: center;
	color: #555;
	font-size: 12px;
}

.site-footer p {
	margin: 0;
}
