/**
 * Film Index – mobile-first portal stylesheet
 * Layout inspired by classic Chinese movie index sites (narrow column, category cards, rank list).
 */

:root {
	--fi-bg: #e8eef5;
	--fi-surface: #ffffff;
	--fi-header: #1a5fb4;
	--fi-header-dark: #144a8c;
	--fi-link: #0645ad;
	--fi-link-hover: #c00;
	--fi-text: #222;
	--fi-muted: #666;
	--fi-border: #c8d4e4;
	--fi-rank1: #e53935;
	--fi-rank2: #fb8c00;
	--fi-rank3: #fdd835;
	--fi-max: 720px;
	--fi-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--fi-bg);
	color: var(--fi-text);
	font-family: var(--fi-font);
	font-size: 15px;
	line-height: 1.55;
}

a {
	color: var(--fi-link);
	text-decoration: none;
}

a:hover {
	color: var(--fi-link-hover);
	text-decoration: underline;
}

img {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.site {
	max-width: var(--fi-max);
	margin: 0 auto;
	min-height: 100vh;
	background: var(--fi-surface);
	box-shadow: 0 0 24px rgba(0, 40, 80, 0.08);
}

/* ---------- Header ---------- */
.site-header {
	background: linear-gradient(180deg, var(--fi-header) 0%, var(--fi-header-dark) 100%);
	color: #fff;
	padding: 12px 12px 0;
}

.header-brand {
	text-align: center;
	padding: 4px 0 8px;
}

.site-title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.site-title a {
	color: #fff;
	text-decoration: none;
}

.custom-logo-link {
	display: inline-block;
}

.custom-logo {
	max-height: 44px;
	width: auto;
}

.site-slogan {
	margin: 6px 0 0;
	font-size: 12px;
	opacity: 0.9;
	line-height: 1.4;
}

.header-search {
	padding: 0 0 10px;
}

.search-form {
	display: flex;
	gap: 6px;
}

.search-field {
	flex: 1;
	height: 36px;
	padding: 0 10px;
	border: 1px solid #fff;
	border-radius: 3px;
	font-size: 14px;
}

.search-submit,
.btn {
	height: 36px;
	padding: 0 14px;
	border: 0;
	border-radius: 3px;
	background: #ff9800;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.search-submit:hover,
.btn:hover {
	background: #f57c00;
	color: #fff;
	text-decoration: none;
}

.primary-navigation {
	background: #0f4a96;
	margin: 0 -12px;
	padding: 0 8px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.primary-menu {
	display: flex;
	flex-wrap: nowrap;
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: min-content;
}

.primary-menu li {
	flex: 0 0 auto;
}

.primary-menu a {
	display: block;
	padding: 10px 11px;
	color: #e8f1ff;
	font-size: 14px;
	white-space: nowrap;
	text-decoration: none;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current-cat > a {
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
	text-decoration: none;
}

.update-stats {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding: 8px 4px;
	font-size: 13px;
	background: #f0f5fb;
	color: var(--fi-muted);
	margin: 0 -12px;
	border-bottom: 1px solid var(--fi-border);
}

.update-stats em {
	font-style: normal;
	font-weight: 700;
	color: var(--fi-rank1);
	margin-left: 2px;
}

.stats-sep {
	color: #bbb;
}

/* ---------- Content ---------- */
.site-content {
	padding: 0 0 24px;
}

.site-main {
	padding: 12px;
}

.portal-home {
	padding-top: 8px;
}

.portal-section {
	margin-bottom: 18px;
}

.portal-heading {
	margin: 0 0 10px;
	padding: 8px 10px;
	font-size: 1.05rem;
	font-weight: 700;
	color: #123;
	background: linear-gradient(90deg, #d6e6f8 0%, #f5f9fc 100%);
	border-left: 4px solid var(--fi-header);
	border-radius: 0 3px 3px 0;
}

.portal-empty {
	margin: 0;
	padding: 12px;
	color: var(--fi-muted);
	font-size: 13px;
	background: #fafbfc;
	border: 1px dashed var(--fi-border);
	border-radius: 4px;
}

/* Category cards */
.cat-cards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.cat-card a {
	display: block;
	padding: 12px 14px;
	background: #f7fafc;
	border: 1px solid var(--fi-border);
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.cat-card a:hover {
	border-color: var(--fi-header);
	box-shadow: 0 2px 8px rgba(26, 95, 180, 0.12);
	text-decoration: none;
}

.cat-card-name {
	display: block;
	font-size: 16px;
	font-weight: 700;
	color: var(--fi-link);
	margin-bottom: 4px;
}

.cat-card-meta {
	display: block;
	font-size: 13px;
	color: var(--fi-muted);
}

.cat-card-meta em {
	font-style: normal;
	color: var(--fi-rank1);
	font-weight: 600;
}

.cat-card-date {
	display: block;
	font-size: 12px;
	color: #888;
	margin-top: 2px;
}

/* Rank list */
.rank-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--fi-border);
	border-radius: 4px;
	overflow: hidden;
	background: #fff;
}

.rank-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 9px 10px;
	border-bottom: 1px solid #eef2f7;
	font-size: 14px;
	line-height: 1.45;
}

.rank-item:last-child {
	border-bottom: 0;
}

.rank-item:nth-child(even) {
	background: #fafcfe;
}

.rank-num {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	line-height: 22px;
	text-align: center;
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	background: #90a4ae;
	border-radius: 3px;
}

.rank-item.rank-top:nth-child(1) .rank-num {
	background: var(--fi-rank1);
}

.rank-item.rank-top:nth-child(2) .rank-num {
	background: var(--fi-rank2);
}

.rank-item.rank-top:nth-child(3) .rank-num {
	background: #f9a825;
	color: #333;
}

.rank-item a {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Recent by category */
.recent-by-cat {
	display: grid;
	gap: 12px;
}

.recent-cat-block {
	border: 1px solid var(--fi-border);
	border-radius: 4px;
	overflow: hidden;
}

.recent-cat-title {
	margin: 0;
	padding: 8px 12px;
	font-size: 15px;
	background: #edf3fa;
	border-bottom: 1px solid var(--fi-border);
}

.recent-cat-title a {
	color: var(--fi-header-dark);
	font-weight: 700;
	text-decoration: none;
}

.recent-list {
	list-style: none;
	margin: 0;
	padding: 4px 0;
}

.recent-list li {
	padding: 7px 12px;
	border-bottom: 1px dashed #e8edf3;
	font-size: 13px;
	line-height: 1.4;
}

.recent-list li:last-child {
	border-bottom: 0;
}

.recent-list a {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Post list (archive) */
.page-header {
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--fi-header);
}

.page-title {
	margin: 0;
	font-size: 1.2rem;
}

.archive-description {
	margin-top: 6px;
	font-size: 13px;
	color: var(--fi-muted);
}

.post-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.post-list-item {
	border-bottom: 1px solid #eef2f7;
}

.post-list-link {
	display: flex;
	gap: 10px;
	padding: 12px 0;
	color: inherit;
	text-decoration: none;
}

.post-list-link:hover {
	text-decoration: none;
}

.post-list-link:hover .post-list-title {
	color: var(--fi-link-hover);
}

.post-thumb {
	flex: 0 0 64px;
	width: 64px;
	height: 86px;
	overflow: hidden;
	border-radius: 3px;
	background: #eef2f7;
}

.post-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.post-list-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
}

.post-list-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--fi-link);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.post-list-meta {
	font-size: 12px;
	color: var(--fi-muted);
}

/* Single */
.single-article {
	background: #fff;
}

.entry-title {
	margin: 0 0 8px;
	font-size: 1.25rem;
	line-height: 1.4;
	color: #111;
}

.entry-meta {
	font-size: 13px;
	color: var(--fi-muted);
	margin-bottom: 14px;
}

.entry-meta .sep {
	margin: 0 4px;
	color: #ccc;
}

.entry-featured {
	margin-bottom: 14px;
	border-radius: 4px;
	overflow: hidden;
}

.entry-content {
	font-size: 15px;
	line-height: 1.75;
	word-break: break-word;
}

.entry-content h2,
.entry-content h3 {
	margin: 1.2em 0 0.5em;
}

.entry-content p {
	margin: 0 0 1em;
}

.entry-content img {
	border-radius: 3px;
}

.post-navigation {
	margin-top: 20px;
	padding-top: 12px;
	border-top: 1px solid var(--fi-border);
}

.post-navigation .nav-links {
	display: grid;
	gap: 8px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
	padding: 10px 12px;
	background: #f5f8fb;
	border-radius: 4px;
	border: 1px solid var(--fi-border);
}

.post-navigation a {
	display: block;
	text-decoration: none;
	color: inherit;
}

.post-navigation .nav-label {
	display: block;
	font-size: 12px;
	color: var(--fi-muted);
	margin-bottom: 2px;
}

.post-navigation .nav-title {
	display: block;
	font-size: 14px;
	color: var(--fi-link);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Pagination */
.pagination {
	margin-top: 16px;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 8px;
	border: 1px solid var(--fi-border);
	border-radius: 3px;
	background: #fff;
	color: var(--fi-link);
	font-size: 13px;
	text-decoration: none;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
	background: var(--fi-header);
	border-color: var(--fi-header);
	color: #fff;
}

/* Footer */
.site-footer {
	padding: 20px 14px 28px;
	background: #f0f4f9;
	border-top: 1px solid var(--fi-border);
	text-align: center;
	font-size: 12px;
	color: var(--fi-muted);
}

.footer-wechat {
	margin-bottom: 14px;
}

.wechat-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 96px;
	margin: 0 auto 8px;
	background: #fff;
	border: 1px dashed #b0bec5;
	border-radius: 6px;
	color: #90a4ae;
	font-size: 13px;
}

.wechat-text {
	margin: 0;
	font-size: 13px;
	color: var(--fi-text);
}

.footer-note {
	margin: 0 0 12px;
	line-height: 1.6;
	padding: 0 8px;
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 10px;
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.footer-menu a {
	color: var(--fi-muted);
}

.site-info a {
	color: var(--fi-muted);
}

.site-info .sep {
	margin: 0 4px;
}

/* Breadcrumbs */
.breadcrumbs {
	margin: 0 0 12px;
	padding: 8px 10px;
	font-size: 12px;
	color: var(--fi-muted);
	background: #f5f8fb;
	border: 1px solid var(--fi-border);
	border-radius: 3px;
	line-height: 1.5;
}

.breadcrumbs-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.breadcrumbs-item {
	display: inline-flex;
	align-items: center;
}

.breadcrumbs-item a {
	color: var(--fi-muted);
}

.breadcrumbs-item a:hover {
	color: var(--fi-link);
}

.breadcrumbs-sep {
	margin: 0 6px;
	color: #c0c8d4;
}

.breadcrumbs-item [aria-current="page"] {
	color: var(--fi-text);
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Wider screens: still portal-narrow feel */
@media (min-width: 768px) {
	body {
		padding: 16px 0;
		background:
			radial-gradient(800px 300px at 20% 0%, rgba(26, 95, 180, 0.12), transparent 60%),
			var(--fi-bg);
	}

	.site {
		border-radius: 6px;
		overflow: hidden;
	}

	.cat-cards {
		grid-template-columns: repeat(3, 1fr);
	}

	.recent-by-cat {
		grid-template-columns: repeat(2, 1fr);
	}

	.site-main {
		padding: 16px 18px;
	}
}

@media (min-width: 900px) {
	:root {
		--fi-max: 760px;
	}
}
