/*
Theme Name: CineBox
Theme URI: https://example.com/cinebox
Author: CineBox
Author URI: https://example.com
Description: 一款致敬 Letterboxd 布局风格的电影评论 WordPress 主题：海报网格、半星评分、预告片弹窗、多配色主题。配套插件 CineBox Collector 支持 Letterboxd 内容采集（随机评论数、本地/R2/外链三种图片存储）。
Version: 1.2.62
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cinebox
*/

/* ============================================================
   1. 配色主题（CSS 变量，html[data-scheme] 切换）
   ============================================================ */

/* 午夜绿（默认，深色） */
html[data-scheme="midnight"], html {
	--bg: #14181c;
	--bg-soft: #10151a;
	--panel: #1b2127;
	--panel-2: #212930;
	--border: #2b353d;
	--text: #d8e0e6;
	--text-strong: #ffffff;
	--muted: #8d9aa6;
	--accent: #00e054;
	--accent-ink: #06230f;
	--accent-soft: rgba(0, 224, 84, 0.14);
	--link: #40bcf4;
	--star: #00e054;
	--header-bg: #11151a;
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	--hover: rgba(255, 255, 255, 0.05);
}

/* 日光（浅色） */
html[data-scheme="daylight"] {
	--bg: #f4f6f8;
	--bg-soft: #e9edf1;
	--panel: #ffffff;
	--panel-2: #eef2f5;
	--border: #d9e1e8;
	--text: #2b3742;
	--text-strong: #131b22;
	--muted: #67737e;
	--accent: #00a94f;
	--accent-ink: #ffffff;
	--accent-soft: rgba(0, 169, 79, 0.12);
	--link: #0077cc;
	--star: #00a94f;
	--header-bg: #ffffff;
	--shadow: 0 8px 24px rgba(20, 40, 60, 0.12);
	--hover: rgba(0, 0, 0, 0.04);
}

/* 深海蓝 */
html[data-scheme="ocean"] {
	--bg: #0d1520;
	--bg-soft: #0a101a;
	--panel: #15202f;
	--panel-2: #1b293b;
	--border: #26374c;
	--text: #d7e3ef;
	--text-strong: #ffffff;
	--muted: #87a0b6;
	--accent: #38bdf8;
	--accent-ink: #06202e;
	--accent-soft: rgba(56, 189, 248, 0.14);
	--link: #7dd3fc;
	--star: #38bdf8;
	--header-bg: #0a121c;
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	--hover: rgba(255, 255, 255, 0.05);
}

/* 咖啡橙 */
html[data-scheme="coffee"] {
	--bg: #1a1410;
	--bg-soft: #14100c;
	--panel: #241c16;
	--panel-2: #2d231b;
	--border: #3c2f24;
	--text: #ecdfd2;
	--text-strong: #ffffff;
	--muted: #a8968a;
	--accent: #ff9a3c;
	--accent-ink: #2a1602;
	--accent-soft: rgba(255, 154, 60, 0.15);
	--link: #ffb066;
	--star: #ff9a3c;
	--header-bg: #161009;
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	--hover: rgba(255, 255, 255, 0.05);
}

/* 绯红 */
html[data-scheme="crimson"] {
	--bg: #1b1316;
	--bg-soft: #150f11;
	--panel: #261a1f;
	--panel-2: #301f26;
	--border: #422d35;
	--text: #eddde2;
	--text-strong: #ffffff;
	--muted: #a9909b;
	--accent: #ff4d5e;
	--accent-ink: #33060c;
	--accent-soft: rgba(255, 77, 94, 0.15);
	--link: #ff8a95;
	--star: #ff4d5e;
	--header-bg: #170f12;
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	--hover: rgba(255, 255, 255, 0.05);
}

/* 紫罗兰 */
html[data-scheme="violet"] {
	--bg: #16131f;
	--bg-soft: #110e19;
	--panel: #201b2e;
	--panel-2: #29223c;
	--border: #372e50;
	--text: #e2ddf0;
	--text-strong: #ffffff;
	--muted: #9a92b5;
	--accent: #a78bfa;
	--accent-ink: #1d1040;
	--accent-soft: rgba(167, 139, 250, 0.16);
	--link: #c4b5fd;
	--star: #a78bfa;
	--header-bg: #120f1a;
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	--hover: rgba(255, 255, 255, 0.05);
}

/* ============================================================
   2. 基础
   ============================================================ */

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

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

body {
	margin: 0;
	overflow-x: clip; /* 防横向溢出（clip 不影响 sticky 头部） */
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	font-size: 15px;
	line-height: 1.65;
	transition: background 0.25s ease, color 0.25s ease;
}

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

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

h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.25; margin: 0 0 0.5em; }

button { font-family: inherit; }

.container { max-width: 990px; margin: 0 auto; padding: 0 20px; }

.screen-reader-text {
	position: absolute !important;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px; height: 1px;
}

/* 通用按钮 */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 10px 18px;
	border: 1px solid transparent;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	cursor: pointer;
	transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 15px; height: 15px; }

.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { opacity: 0.88; }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--hover); }

.btn-sm { padding: 7px 12px; font-size: 11px; }

/* ============================================================
   3. 页头
   ============================================================ */

.site-header {
	position: absolute; /* 悬浮于页面顶部，不占用单独的顶部空间 */
	top: 0;
	left: 0;
	right: 0;
	z-index: 50;
	/* 顶部渐变遮罩：保证悬浮文字在背景剧照/内容上清晰可读 */
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
	border-bottom: none;
}

.header-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
	height: 60px;
	display: flex;
	align-items: center;
	gap: 26px;
}

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text-strong); font-weight: 800; font-size: 19px; letter-spacing: 2.5px; }
.brand:hover { text-decoration: none; }
.brand { min-width: 0; }
.brand-name { min-width: 0; max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-logo { max-width: 40vw; }
.brand-logo { width: 28px; height: 28px; color: var(--accent); }
.custom-logo { max-height: 40px; width: auto; }

.main-nav { flex: 1; }
.nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-link {
	display: inline-block;
	padding: 8px 12px;
	border-radius: 4px;
	color: var(--text);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.5px;
}
.nav-link:hover { color: var(--text-strong); background: var(--hover); text-decoration: none; }

.header-tools { display: flex; align-items: center; gap: 12px; }

/* 移动端圆形图标工具组（默认隐藏，仅手机端显示） */
.m-tools { display: none; }
.m-tool { position: relative; }
.m-tool-btn {
	display: flex; align-items: center; justify-content: center;
	width: 36px; height: 36px;
	background: transparent; border: 1px solid var(--border); border-radius: 50%;
	color: var(--text); cursor: pointer;
}
.m-tool-btn:hover { color: var(--accent); border-color: var(--accent); }
.m-tool-btn svg { width: 18px; height: 18px; }
.m-tool-menu {
	position: absolute; right: 0; top: calc(100% + 8px);
	min-width: 190px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 6px;
	box-shadow: var(--shadow);
	padding: 6px;
	z-index: 60;
}
.m-menu-link {
	display: block; width: 100%;
	padding: 9px 12px;
	background: transparent; border: 0; border-radius: 4px;
	color: var(--text); font-size: 13px; text-align: left; cursor: pointer;
}
.m-menu-link:hover { background: var(--accent-soft); color: var(--text-strong); text-decoration: none; }
.m-menu-link.is-active { color: var(--accent); font-weight: 700; }
.m-tool-menu .search-input { width: 100%; }

/* 悬浮导航配色：文字统一白色，配合顶部渐变遮罩，任何背景（含背景剧照）下均可读 */
.site-header .brand { color: #fff; }
.site-header .nav-link { color: #fff; }
.site-header .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.16); }
.site-header .lang-switch { border-color: rgba(255, 255, 255, 0.35); }
.site-header .lang-opt { color: rgba(255, 255, 255, 0.8); }
.site-header .lang-opt:hover:not(.is-active) { color: #fff; background: rgba(255, 255, 255, 0.16); }
.site-header .scheme-toggle { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.site-header .search-input { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.site-header .search-input::placeholder { color: rgba(255, 255, 255, 0.65); }
.site-header .search-submit { color: rgba(255, 255, 255, 0.7); }
.site-header .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.site-header .btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }

.search-form { position: relative; }
.search-input {
	width: 190px;
	padding: 8px 32px 8px 12px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text);
	font-size: 13px;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-submit {
	position: absolute; right: 2px; top: 2px; bottom: 2px;
	width: 30px;
	display: flex; align-items: center; justify-content: center;
	background: transparent; border: 0; color: var(--muted); cursor: pointer;
}
.search-submit svg { width: 16px; height: 16px; }
.search-submit:hover { color: var(--accent); }

/* 配色切换 */
.scheme-switch { position: relative; }
.scheme-toggle {
	display: flex; align-items: center; justify-content: center;
	width: 36px; height: 36px;
	background: transparent; border: 1px solid var(--border); border-radius: 50%;
	color: var(--text); cursor: pointer;
}
.scheme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.scheme-toggle svg { width: 18px; height: 18px; }
.scheme-menu {
	position: absolute; right: 0; top: calc(100% + 8px);
	min-width: 210px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 6px;
	box-shadow: var(--shadow);
	padding: 6px;
	z-index: 60;
}
.scheme-menu button {
	display: block; width: 100%;
	padding: 9px 12px;
	background: transparent; border: 0; border-radius: 4px;
	color: var(--text); font-size: 13px; text-align: left; cursor: pointer;
}
.scheme-menu button:hover { background: var(--accent-soft); color: var(--text-strong); }

/* ============================================================
   4. 首页 Hero
   ============================================================ */

.hero {
	background:
		radial-gradient(1200px 400px at 70% -10%, var(--accent-soft), transparent 60%),
		linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
	border-bottom: 1px solid var(--border);
	padding: 72px 0 60px;
	text-align: center;
}

.hero-title {
	font-size: 40px;
	font-weight: 800;
	letter-spacing: 0.5px;
	max-width: 720px;
	margin: 0 auto 14px;
}

.hero-sub {
	color: var(--muted);
	font-size: 16px;
	max-width: 560px;
	margin: 0 auto 28px;
}

.hero-actions { display: none; }

.hero-stats { display: flex; gap: 44px; justify-content: center; margin-top: 28px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat strong { font-size: 24px; color: var(--text-strong); }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: 1px; }

/* ============================================================
   5. 区块与标题
   ============================================================ */

.section { padding: 36px 0 10px; }

.section-head {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 18px;
}

.section-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0;
	padding-bottom: 4px;
	border-bottom: 2px solid var(--accent);
}
.section-title em { font-style: normal; color: var(--accent); }

.section-tabs { display: flex; gap: 4px; }
.tab {
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	background: transparent;
}
.tab:hover { color: var(--text-strong); text-decoration: none; }
.tab.is-active { background: var(--accent-soft); color: var(--accent); }

.section-more { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.section-more:hover { color: var(--accent); }

/* ============================================================
   6. 影片网格
   ============================================================ */

.film-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 16px 14px;
}

.film-card { position: relative; }

.poster-wrap {
	display: block;
	position: relative;
	border-radius: 5px;
	overflow: hidden;
	aspect-ratio: 2 / 3;
	background: var(--panel-2);
}

.poster { display: block; width: 100%; height: 100%; object-fit: cover; }

.poster--ph {
	display: flex; align-items: center; justify-content: center;
	font-size: 34px; font-weight: 800; color: var(--muted);
	background: linear-gradient(160deg, var(--panel-2), var(--panel));
}
.poster--lg { font-size: 64px; width: 100%; height: 100%; border-radius: 5px; }

.card-hover {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; justify-content: flex-end;
	padding: 10px;
	background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.88) 100%);
	color: #fff;
	opacity: 0;
	transition: opacity 0.15s ease;
}
.poster-wrap:hover .card-hover, .poster-wrap:focus-visible .card-hover { opacity: 1; }

.ch-title { font-size: 13px; font-weight: 700; line-height: 1.3; }
.ch-meta { font-size: 11px; color: #c3cbd4; margin: 3px 0 5px; }
.ch-stars .stars-fg svg, .ch-stars .stars-bg svg { fill: #fff; }
.ch-stars .stars-bg { opacity: 0.45; }
.ch-views { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #c3cbd4; margin-top: 3px; }
.ch-views svg { width: 12px; height: 12px; fill: #c3cbd4; }
.film-views { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: inherit; }
.film-views svg { width: 14px; height: 14px; fill: var(--muted); }

.card-caption { margin-top: 7px; display: flex; flex-direction: column; gap: 1px; }
.cc-title {
	font-size: 12px; font-weight: 700; color: var(--text);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-year { font-size: 11px; color: var(--muted); }

/* ============================================================
   7. 星级组件
   ============================================================ */

.stars {
	position: relative;
	display: inline-flex;
	line-height: 0;
	vertical-align: middle;
}
.stars-bg, .stars-fg { display: inline-flex; }
.stars-bg svg, .stars-fg svg { width: 16px; height: 16px; }
.stars-bg svg { fill: var(--border); }
.stars-fg svg { fill: var(--star); }

.stars-fg {
	position: absolute;
	top: 0; left: 0;
	overflow: hidden;
	white-space: nowrap;
}

.stars--sm svg { width: 13px; height: 13px; }
.stars--xs svg { width: 11px; height: 11px; }

/* ============================================================
   8. 首页影评动态
   ============================================================ */

.feed { list-style: none; margin: 0; padding: 0; }
.feed-item {
	display: flex; gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--border);
}
.feed-avatar { flex-shrink: 0; }
.review-avatar {
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 4px;
	color: #fff;
	font-weight: 800;
	font-size: 16px;
	flex-shrink: 0;
}
.feed-meta { font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.feed-user { color: var(--text-strong); }
.feed-film { font-weight: 700; }
.feed-text { margin: 5px 0 0; color: var(--text); font-size: 13.5px; }
.via { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 1px 6px; }
.via:hover { color: var(--accent); text-decoration: none; border-color: var(--accent); }

/* ============================================================
   9. 归档页
   ============================================================ */

.archive-head { padding: 30px 20px 6px; }
.page-title { font-size: 24px; font-weight: 800; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 4px 11px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: var(--text);
}
.chip em { font-style: normal; color: var(--muted); font-size: 11px; }
a.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chip--label { color: var(--muted); background: transparent; border-style: dashed; }

/* 分页 */
.pagination, .nav-links { display: flex; gap: 6px; justify-content: center; margin: 30px 0; flex-wrap: wrap; }
.page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 34px; height: 34px; padding: 0 8px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text);
	font-size: 13px;
	font-weight: 600;
}
.page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
a.page-numbers:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.empty-state {
	padding: 48px 20px;
	text-align: center;
	color: var(--muted);
	background: var(--panel);
	border: 1px dashed var(--border);
	border-radius: 6px;
}
.empty-404 .code404 { font-size: 72px; font-weight: 800; color: var(--accent); margin: 0; }

/* ============================================================
   10. 影片详情页
   ============================================================ */

.film-backdrop {
	background-size: cover;
	background-position: center 18%;
	width: min(1200px, 100%);
	aspect-ratio: 12 / 5; /* 1200×500 横向电影横幅 */
	position: relative;
	margin: 0 auto;
	/* 左右边缘渐变羽化，让海报边缘柔和融入页面背景 */
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0%, #000 28%, #000 72%, transparent 100%);
}
.film-backdrop::after {
	content: "";
	position: absolute; inset: 0;
	background:
		linear-gradient(90deg, var(--bg) 0%, transparent 26%, transparent 74%, var(--bg) 100%),
		linear-gradient(180deg, transparent 48%, var(--bg) 96%);
}
.film-backdrop--plain {
	height: 200px;
	background: radial-gradient(900px 300px at 50% 0%, var(--accent-soft), transparent 70%), var(--bg-soft);
}

/* 影片页布局（Letterboxd 式，Grid 区域：桌面 海报| masthead / actions|main） */
.film-layout {
	display: grid;
	grid-template-columns: 230px minmax(0, 1fr);
	grid-template-areas:
		"rail masthead"
		"rail main";
	gap: 14px 28px;
	align-items: start;
	margin-top: -30px;
	position: relative;
	z-index: 5;
	padding-bottom: 60px;
}
.film-rail {
	grid-area: rail;
	align-self: start;
	position: sticky; /* PC 端：海报与操作按钮滚动到顶部后固定，正文继续滚动 */
	top: 16px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.film-masthead { grid-area: masthead; margin-bottom: 14px; }
.film-main { grid-area: main; min-width: 0; }
.film-head {
	display: flex;
	gap: 26px;
	margin-top: -130px;
	position: relative;
	z-index: 5;
}

.film-poster {
	flex-shrink: 0;
	width: 220px;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: var(--shadow);
	background: var(--panel-2);
}
.film-poster img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }

.rail-actions { min-width: 0; }
.rail-actions { display: flex; flex-direction: column; gap: 8px; }
.rail-btn {
	display: flex; align-items: center; gap: 9px;
	width: 100%; padding: 9px 12px;
	border: 1px solid var(--border); border-radius: 4px;
	background: var(--panel); color: var(--text);
	font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
	cursor: pointer; text-transform: none;
}
.rail-btn svg { width: 15px; height: 15px; fill: var(--muted); flex: none; }
.rail-btn:hover { border-color: var(--accent); color: var(--text-strong); text-decoration: none; }
.rail-btn--accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.rail-btn.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.rail-btn.is-on svg { fill: var(--accent); }
.rail-btn--accent svg { fill: var(--accent-ink); }
.film-masthead { padding-top: 4px; min-width: 0; }

/* 评分摘要：大数字 + 直方图（Letterboxd 式） */
.rating-summary {
	display: inline-flex; gap: 14px; flex-wrap: wrap;
	padding: 8px 10px;
	background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
	margin: 10px 0 6px;
	max-width: 100%;
}
.rating-overview { min-width: auto; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.rating-big { font-size: 19px; font-weight: 800; color: var(--text-strong); line-height: 1; letter-spacing: -0.25px; }
.rating-starline { display: inline-flex; align-items: center; }
.big-star { position: relative; display: inline-block; width: 14px; height: 14px; flex: none; }
.big-star-bg, .big-star-fg { position: absolute; inset: 0; display: inline-flex; }
.big-star svg { width: 14px; height: 14px; }
.big-star-bg svg { fill: var(--border); }
.big-star-fg { overflow: hidden; white-space: nowrap; }
.big-star-fg svg { fill: var(--accent); }
.rating-histogram { flex: 1; min-width: 130px; display: flex; flex-direction: column; gap: 1px; justify-content: center; }
.hist-row { display: flex; align-items: center; gap: 9px; line-height: 1; }
.hist-label { width: 40px; flex: none; display: inline-flex; }
.hist-label .stars { line-height: 0; }
.hist-bar { flex: 1; height: 4px; background: var(--panel-2); border-radius: 2px; overflow: hidden; }
.hist-fill { display: block; height: 100%; background: var(--accent); border-radius: 2px; min-width: 0; }
.hist-count { display: none; }
.rating-avatars { display: flex; align-items: center; gap: 4px; margin: 0 0 10px; flex-wrap: wrap; }
.ra-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-right: 6px; }

.ostars { display: inline-flex; gap: 1px; line-height: 0; vertical-align: middle; }
.ostar { display: inline-flex; width: 14px; height: 14px; }
.ostar svg { width: 14px; height: 14px; }
.ostar--empty svg { color: var(--muted); }
.ostar--full svg path { fill: var(--accent); }
.ostar--half svg path:first-child { color: var(--muted); }
.ostar--half svg path:last-child { fill: var(--accent); }
.rating-starline .ostar { width: 16px; height: 16px; }
.rating-starline .ostar svg { width: 16px; height: 16px; }

.film-info { padding-top: 34px; min-width: 0; }

.film-title {
	overflow-wrap: anywhere;
	font-size: 40px;
	font-weight: 800;
	letter-spacing: 0.3px;
	margin: 0 0 4px;
}
.film-year { font-size: 22px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.film-year:hover { color: var(--accent); }
.film-original { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.film-director { font-size: 15px; margin: 0 0 12px; }
.film-director strong { color: var(--text-strong); font-weight: 700; }
.dot { color: var(--muted); margin: 0 4px; }

.film-ratingbox {
	display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
	padding: 12px 16px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 6px;
	margin: 14px 0 18px;
}
.rating-avg { display: inline-flex; align-items: center; gap: 8px; }
.rating-avg strong { font-size: 19px; color: var(--text-strong); }
.rating-count { font-size: 12.5px; color: var(--muted); }
.rating-external { font-size: 12.5px; color: var(--muted); margin-left: auto; }

.film-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-trailer svg { width: 17px; height: 17px; }

.film-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 260px;
	gap: 30px;
	padding-top: 34px;
	padding-bottom: 60px;
}

.panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 20px 22px;
	margin-bottom: 26px;
}
.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.synopsis { color: var(--text); font-size: 14.5px; }

.section-block { margin-bottom: 30px; }
.section-block .section-title { display: inline-block; margin-bottom: 14px; }

/* 演职员 */
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.cast-card {
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	padding: 12px 6px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 6px;
	text-align: center;
	transition: border-color 0.12s ease;
}
.cast-card:hover { border-color: var(--accent); }
.cast-name { font-size: 12px; font-weight: 600; line-height: 1.35; }
/* 影片页标签栏（Letterboxd 式） */
.film-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.film-tabs::-webkit-scrollbar { display: none; }
.crew-names { overflow-wrap: anywhere; }
.film-tab {
	flex-shrink: 0;
	padding: 10px 14px 9px;
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	cursor: pointer;
	white-space: nowrap;
}
.film-tab:hover { color: var(--text-strong); }
.film-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.film-tab em { font-style: normal; font-weight: 600; opacity: 0.75; }
.film-tab-panel { display: none; }
.film-tab-panel.is-active { display: block; }
.info-row--block { flex-direction: column; gap: 4px; }
.info-row--block dt { width: auto; }
.info-row--block dd { line-height: 1.65; }

.cast-role { font-size: 11px; color: var(--muted); line-height: 1.3; margin-top: -2px; }
.crew-list { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 6px 18px; }
.crew-row { display: flex; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.crew-row:last-child { border-bottom: 0; }
.crew-role { flex-shrink: 0; width: 140px; color: var(--muted); font-weight: 600; }
.crew-names { color: var(--text); }
.release-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 6px 18px; }
.release-list li { display: flex; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.release-list li:last-child { border-bottom: 0; }
.rel-country { flex-shrink: 0; width: 140px; color: var(--muted); font-weight: 600; }
.rel-date { color: var(--text); }
.genre-index { margin-top: 16px; }
.genre-index .chip--lg { padding: 8px 16px; font-size: 13.5px; }

/* 预告片（呈现方式与 Letterboxd 一致：缩略图卡片 + 弹窗播放） */
.trailer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.trailer-card {
	display: flex; flex-direction: column;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	padding: 0;
	text-align: left;
	transition: transform 0.12s ease, border-color 0.12s ease;
}
.trailer-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.trailer-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--panel-2); }
.trailer-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-badge {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, 0.28);
	transition: background 0.12s ease;
}
.play-badge svg { width: 44px; height: 44px; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
.trailer-card:hover .play-badge { background: rgba(0, 0, 0, 0.45); }
.trailer-label {
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 700;
	color: var(--text);
}

/* 影评列表 */
.reviews { list-style: none; margin: 0; padding: 0; }
.reviews .review-item-wrap { border-bottom: 1px solid var(--border); }
.reviews .review-item-wrap:last-child { border-bottom: 0; }
.reviews .children { list-style: none; margin-left: 24px; }

.review { display: flex; gap: 14px; padding: 18px 0; }
.review-left { flex-shrink: 0; }
.review-body { min-width: 0; flex: 1; }
.review-head {
	display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
	margin-bottom: 6px;
}
.review-user { font-size: 13.5px; font-weight: 700; color: var(--accent); }
.review-user a { color: inherit; }
.review-date { font-size: 12px; color: var(--muted); }
.review-text { font-size: 14px; color: var(--text); }
.review-text p { margin: 0 0 8px; }
.review-text p:last-child { margin-bottom: 0; }
.review-stats { display: flex; gap: 16px; margin-top: 8px; }
.review-stat { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.review-stat svg { width: 14px; height: 14px; fill: var(--muted); }
.review-stat.is-like svg { fill: var(--accent); }

/* 评论表单 */
.comment-reply-title { font-size: 15px; font-weight: 700; margin: 22px 0 10px; }
.comment-form p { margin: 0 0 14px; }
.comment-form label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 12px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text);
	font-size: 14px;
	font-family: inherit;
}
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-form .submit, .comment-form .btn { border: 0; cursor: pointer; }
.comment-notes, .logged-in-as { font-size: 12.5px; color: var(--muted); }

/* 我的评分输入 */
.comment-form-rating {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 16px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 6px;
}
.cfr-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.rating-input { display: inline-flex; gap: 2px; }
.rate-star { position: relative; width: 28px; height: 28px; background: transparent; border: 0; padding: 0; cursor: pointer; }
.rate-star svg { position: absolute; inset: 2px; width: 24px; height: 24px; }
.rate-star .ic-full { fill: var(--border); }
.rate-star .ic-half { fill: var(--border); }
.rate-star.is-full .ic-full { fill: var(--star); }
.rate-star.is-full .ic-half { display: none; } /* 全星时隐藏半星，避免灰色半星覆盖绿色完整星 */
.rate-star.is-half .ic-half { fill: var(--star); }
.rate-star:hover .ic-full { fill: var(--star); opacity: 0.6; }
.rate-star:hover .ic-half { display: none; }

/* 回到顶部按钮（影片详情页右下角，透明悬浮） */
.back-to-top {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 90;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #fff;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: rgba(0, 0, 0, 0.6); }
.back-to-top svg { width: 20px; height: 20px; }

/* 侧栏 */
.aside-panel {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 16px 18px;
	margin-bottom: 18px;
}
.aside-title { font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.info-list { margin: 0; }
.info-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: 0; }
.info-row dt { flex-shrink: 0; width: 68px; color: var(--muted); }
.info-row dd { margin: 0; color: var(--text); min-width: 0; }
.aside-note { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ============================================================
   11. 预告片弹窗（Letterboxd 式）
   ============================================================ */

.cinebox-modal { position: fixed; inset: 0; z-index: 100; }
.cinebox-modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6, 8, 10, 0.9); }
.modal-box {
	position: absolute; top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	/* 自适应：桌面最宽 960px；窄屏按视口宽度；矮视口按高度反算宽度，保证播放器完整可见 */
	width: min(960px, 94vw, calc((100vh - 96px) * 1.7778));
	max-width: 100%;
}
.modal-close {
	position: absolute; top: -44px; right: 0;
	width: 36px; height: 36px;
	background: transparent; border: 0;
	color: #fff; font-size: 30px; line-height: 1; cursor: pointer;
}
.modal-close:hover { color: var(--accent); }
.modal-frame {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.modal-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 640px) {
	.modal-box { width: 96vw; }
	.modal-close { top: -38px; width: 32px; height: 32px; font-size: 26px; }
	.modal-frame { border-radius: 3px; }
	.modal-note { font-size: 12px; padding: 12px; }
}

/* ============================================================
   12. 页脚 / 通用文章 / 表单
   ============================================================ */

.site-footer {
	border-top: 1px solid var(--border);
	background: var(--bg-soft);
	padding-top: 44px;
	margin-top: 40px;
}
.footer-grid {
	display: grid;
	grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
	gap: 30px;
	padding-bottom: 34px;
}
.footer-logo { font-size: 18px; font-weight: 800; letter-spacing: 2.5px; color: var(--text-strong); }
.footer-logo:hover { text-decoration: none; color: var(--accent); }
.footer-tagline { color: var(--text); font-size: 13px; margin: 8px 0 10px; }
.footer-copy { color: var(--muted); font-size: 12.5px; margin: 0 0 4px; }
.footer-made { color: var(--muted); font-size: 12.5px; margin: 0; }
.footer-col h3 {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.8px;
	text-transform: uppercase;
	color: var(--muted);
	margin: 4px 0 12px;
}
.footer-col a { display: block; color: var(--text); font-size: 13px; padding: 3px 0; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-col--wide .footer-source { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; line-height: 1.7; }
.footer-col--wide .footer-source a { display: inline; color: var(--link); padding: 0; }
.footer-col--wide .footer-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-col--wide .footer-links a { display: inline; padding: 0; }


.post-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.post-title a { color: var(--text-strong); }
.post-meta { color: var(--muted); font-size: 12.5px; }
.prose { font-size: 15px; }

/* 合规/普通页面：页头横幅 + 文档卡片排版（配色跟随主题变量） */
.page-hero {
	background:
		radial-gradient(900px 300px at 30% -40%, var(--accent-soft), transparent 65%),
		linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
	border-bottom: 1px solid var(--border);
	padding: 44px 0 26px;
}
.page-hero .page-title { font-size: 30px; font-weight: 800; margin: 0; }
.cinebox-page { padding: 34px 20px 60px; }

.cinebox-legal { padding: 30px 36px 26px; }
.cinebox-legal h2 {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.6px;
	color: var(--text-strong);
	margin: 30px 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--accent);
}
.cinebox-legal h2:first-child { margin-top: 4px; }
.cinebox-legal p { font-size: 14px; line-height: 1.8; color: var(--text); margin: 0 0 12px; }
.cinebox-legal ul { margin: 0 0 14px; padding-left: 22px; }
.cinebox-legal li { font-size: 14px; line-height: 1.8; color: var(--text); margin-bottom: 6px; }
.cinebox-legal li::marker { color: var(--accent); }
.cinebox-legal a { color: var(--link); }
.cinebox-legal em { color: var(--muted); }
.cinebox-doc-note { display: none; }

input[type="text"], input[type="email"], input[type="search"], input[type="url"], textarea, select {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 4px;
	color: var(--text);
	padding: 9px 12px;
	font-family: inherit;
	font-size: 14px;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

/* 语言切换 EN / 中文 */
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.lang-opt {
	padding: 6px 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: var(--muted);
	background: transparent;
}
.lang-opt.is-active { background: var(--accent); color: var(--accent-ink); }
.lang-opt:hover:not(.is-active) { color: var(--text-strong); background: var(--hover); text-decoration: none; }

/* ============================================================
   13. 响应式（PC / 平板 / 手机，防挤压变形）
   ============================================================ */

/* 大平板：压缩搜索框 */
@media (max-width: 1080px) {
	.search-input { width: 150px; }
}

/* 平板：单栏内容、隐藏导航与搜索、页脚两栏 */
@media (max-width: 880px) {
	.header-tools { margin-left: auto; } /* pad 版：功能按钮靠右 */
	.film-body { grid-template-columns: 1fr; }
	/* Letterboxd 手机排列：海报+标题并排 → 全宽图标动作行 → 内容 */
	.film-layout {
		grid-template-columns: 104px minmax(0, 1fr);
		grid-template-areas:
			"poster masthead"
			"actions actions"
			"main main";
		margin-top: -90px;
		gap: 14px;
	}
	.film-rail { display: contents; } /* 移动端取消 sticky，海报/按钮直接参与 grid */
	.film-layout .film-poster { grid-area: poster; width: 100%; }
	.film-layout .rail-actions { grid-area: actions; }
	.film-masthead { margin-bottom: 0; }
	.film-title { font-size: 20px; }
	.film-year { font-size: 14px; }
	.film-original { font-size: 12px; margin: 0 0 4px; }
	.film-director { font-size: 12.5px; margin: 0 0 8px; }
	.chips { margin-top: 2px; }
	.rail-actions { flex-direction: row; gap: 8px; }
	.rail-btn { flex: 1 1 0; justify-content: center; height: 44px; padding: 8px 4px; }
	.rb-label { display: none; }
	.rating-summary { flex-direction: column; gap: 10px; padding: 12px; margin: 12px 0 8px; }
	.rating-overview { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 8px; min-width: 0; }
	.rating-histogram { min-width: 0; }
	.film-info { padding-top: 18px; width: 100%; }
	.film-title { font-size: 30px; }
	.film-grid { grid-template-columns: repeat(4, 1fr); }
	.header-search { display: none; }
	.main-nav { display: none; }
	.hero-title { font-size: 30px; }
	.rating-external { margin-left: 0; width: 100%; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.cinebox-legal { padding: 22px 20px; }
}

/* 手机：三列海报、区块纵排、长文本换行 */
@media (max-width: 560px) {
	/* 手机端顶部功能栏：恢复实心背景条（sticky 固定顶部） */
	.site-header {
		position: sticky;
		top: 0;
		background: var(--header-bg);
		border-bottom: 1px solid var(--border);
	}
	.header-inner { height: 52px; gap: 10px; }
	/* 手机端文字恢复主题色（覆盖悬浮导航的白色） */
	.site-header .brand { color: var(--text-strong); }
	.site-header .nav-link { color: var(--text); }
	.site-header .nav-link:hover { color: var(--text-strong); background: var(--hover); }
	.site-header .lang-switch { border-color: var(--border); }
	.site-header .lang-opt { color: var(--muted); }
	.site-header .lang-opt:hover:not(.is-active) { color: var(--text-strong); background: var(--hover); }
	.site-header .scheme-toggle { color: var(--text); border-color: var(--border); }
	.site-header .search-input { background: var(--panel); border-color: var(--border); color: var(--text); }
	.site-header .search-input::placeholder { color: var(--muted); }
	.site-header .search-submit { color: var(--muted); }
	.site-header .btn-ghost { color: var(--text); border-color: var(--border); }
	.site-header .btn-ghost:hover { background: var(--hover); }
	/* 手机端：隐藏 PC 元素，显示圆形图标工具组（含下拉） */
	.header-search, .lang-switch, .scheme-switch, .header-tools > .btn { display: none; }
	.m-tools { display: flex; align-items: center; gap: 8px; }
	/* 影片页背景剧照下方的模块整体下移 100px */
	.film-layout { margin-top: 10px; }

	.film-grid { grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
	.hero { padding: 40px 0 32px; }
	.hero-title { font-size: 25px; }
	.hero-sub { font-size: 14px; }
	.hero-actions { flex-wrap: wrap; }
	.hero-actions .btn { flex: 1 1 auto; justify-content: center; }
	.hero-stats { gap: 20px; flex-wrap: wrap; }
	.stat strong { font-size: 20px; }
	.card-caption { display: none; }
	.film-title { font-size: 18px; }
	.film-year { font-size: 13px; }
	.section-head { flex-wrap: wrap; }
	.section-more { margin-left: 0; }
	.footer-grid { grid-template-columns: 1fr; gap: 22px; }
	.crew-row, .release-list li { flex-direction: column; gap: 2px; }
	.crew-role, .rel-country { width: auto; }
	.info-row { flex-direction: column; gap: 2px; }
	.info-row dt { width: auto; }
	.film-ratingbox { padding: 10px 12px; }
	.rating-summary { padding: 12px; gap: 12px; }
	.rating-big { font-size: 17px; }
	.hist-label { width: 36px; }

	.rating-avatars { gap: 5px; }
	.page-hero { padding: 32px 0 20px; }
	.page-hero .page-title { font-size: 24px; }
	.cast-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
	.review { padding: 14px 0; }
	.review-head { gap: 7px; }
	.pagination, .nav-links { gap: 4px; }
}

/* 小屏手机：两列海报 + 更紧的头部 */
@media (max-width: 380px) {
	.film-grid { grid-template-columns: repeat(2, 1fr); }
	.brand-name { max-width: 40vw; }
	.lang-opt { padding: 5px 7px; }
	.scheme-toggle { width: 32px; height: 32px; }
	.header-tools { gap: 7px; }
}

/* ============================================================
   14. Letterboxd 风格首页 (front-page.php)
   ============================================================ */

.home-hero {
	min-height: 640px;
	display: flex;
	align-items: flex-end;
	text-align: center;
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(1400px 500px at 50% 0%, var(--accent-soft), transparent 65%),
		linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}
.home-hero .container { position: relative; z-index: 2; padding-bottom: 46px; }
.home-hero-title {
	font-size: clamp(26px, 4.2vw, 44px);
	font-weight: 800;
	letter-spacing: 0.3px;
	max-width: 760px;
	margin: 0 auto 14px;
	line-height: 1.2;
}
.home-hero-sub {
	color: var(--muted);
	font-size: 16px;
	margin: 0 auto 34px;
}

/* 随机剧照背景 + 采集站风格（固定宽度居中，不做全宽铺满；顶部/两侧/底部渐变羽化） */
.home-hero.has-backdrop::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: min(1200px, 100%);
	height: 100%;
	z-index: 0;
	background-image: var(--hero-bg);
	background-size: cover;
	background-position: center 22%;
	filter: brightness(0.8) saturate(1.02);
	/* 左右对称羽化：以背景图自身宽度为基准，左右边缘柔和渐变淡出到页面底色
	   （此前用 ::after 按 Hero 全宽算横向渐变会与居中背景图错位，导致左右羽化不对称） */
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
}
.home-hero.has-backdrop::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		linear-gradient(180deg, var(--bg) 0%, transparent 110px),
		linear-gradient(90deg, var(--bg) 0%, transparent 28%, transparent 72%, var(--bg) 100%),
		linear-gradient(180deg, transparent 70%, rgba(20,24,28,0.6) 88%, var(--bg) 100%);
}
.home-hero-stats { display: flex; gap: 40px; justify-content: center; margin-top: 0; }

/* Hero 背景剧照右侧电影名（采集站风格：最右竖排、小字号、hover 变亮） */
.hero-film {
	position: absolute;
	bottom: clamp(100px, 15vh, 150px);
	right: max(16px, calc((100% - 1200px) / 2 + 16px));
	z-index: 2;
	display: inline-flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 34%;
	text-decoration: none !important;
	text-decoration-line: none !important;
	color: rgba(255, 255, 255, 0.55);
	transition: color 0.22s ease;
}
.hero-film:hover,
.hero-film:focus,
.hero-film:active,
.hero-film:visited {
	text-decoration: none !important;
	text-decoration-line: none !important;
	box-shadow: none;
}
.hero-film-title {
	writing-mode: vertical-rl;
	direction: rtl;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.32em;
	line-height: 1.35;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
	max-height: 30%;
	overflow: hidden;
}
.hero-film:hover { color: rgba(255, 255, 255, 0.9); }

/* ============ /films/ 归档页（Letterboxd films 页克隆） ============ */
.films-hero { padding: 26px 0 8px; }
.films-hero .page-title { margin-bottom: 18px; }
.browse-by { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 2px; }
.browse-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--muted);
}
.browse-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.browse-tab {
	display: inline-block;
	padding: 5px 12px;
	font-size: 14px;
	font-weight: 700;
	color: var(--text-strong);
	opacity: 0.72;
	transition: opacity 0.18s, color 0.18s;
}
.browse-tab:hover { opacity: 1; color: var(--accent); }
.browse-tab.is-active { opacity: 1; color: var(--accent); }
.find-film { margin: 18px 0 4px; }
.find-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 6px;
}
.find-row { display: flex; gap: 8px; max-width: 460px; }
.find-row input[type='search'] {
	flex: 1;
	min-width: 0;
	padding: 9px 12px;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--panel);
	color: var(--text);
	font-size: 14px;
}
.find-row input[type='search']:focus { outline: none; border-color: var(--accent); }
.find-go {
	padding: 9px 18px;
	border: 0;
	border-radius: 6px;
	background: var(--accent);
	color: var(--accent-ink);
	font-weight: 700;
	cursor: pointer;
}
.find-go:hover { opacity: 0.88; }
.film-count { margin-left: auto; font-size: 12.5px; color: var(--muted); }

/* 侧栏海报网格（Crew picks） */
.side-poster-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.side-poster-grid .home-poster-link { aspect-ratio: 2 / 3; }

/* 侧栏评论者列表 */
.reviewer-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.reviewer { display: flex; align-items: center; gap: 12px; }
.reviewer .review-avatar { flex: 0 0 40px; }
.rev-info { min-width: 0; display: flex; flex-direction: column; }
.rev-name { font-size: 14px; font-weight: 700; color: var(--text-strong); }
.rev-meta { font-size: 12.5px; color: var(--muted); }
.side-note { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }

/* /films/ 归档页 + 搜索结果：主列电影网格防溢出
   基础 .film-grid 是 repeat(6,1fr)，轨道 auto 最小值会被长标题（中文/无空格片名）的
   min-content 撑破 610px 主列，导致列宽各异、海报溢出相叠。这里改为受控的
   自适应轨道 minmax(96px,1fr) + 卡片/标题溢出省略，恢复规整紧凑的竖版海报网格。 */
body.archive .home-main .film-grid,
body.search-results .home-main .film-grid {
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	grid-auto-rows: auto;
}
body.archive .home-main .film-grid .film-card,
body.search-results .home-main .film-grid .film-card {
	min-width: 0;
	overflow: hidden;
}
body.archive .home-main .film-grid .card-caption,
body.search-results .home-main .film-grid .card-caption {
	overflow: hidden;
}
body.archive .home-main .film-grid .cc-title,
body.search-results .home-main .film-grid .cc-title {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* 双列主体布局 */
.home { padding-bottom: 10px; }
.home-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 40px;
	align-items: start;
	padding-top: 40px;
}
.home-main { min-width: 0; }
.home-side { display: flex; flex-direction: column; gap: 34px; position: sticky; top: 84px; }

/* Popular this week 跨列占满整行 */
.home-full { grid-column: 1 / -1; }

.home-section { margin-bottom: 44px; }

.home-head {
	display: flex;
	align-items: baseline;
	gap: 16px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--border);
	padding-bottom: 10px;
}
.home-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0;
}
.home-title a { color: var(--muted); }
.home-title a:hover { color: var(--accent); }
.home-tabs { display: flex; gap: 4px; }
.home-tab { font-size: 12px; font-weight: 600; color: var(--muted); padding: 3px 10px; border-radius: 999px; }
.home-tab:hover { color: var(--text-strong); text-decoration: none; }
.home-tab.is-active { color: var(--accent); background: var(--accent-soft); }
.home-more { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.home-more:hover { color: var(--accent); }
.home-empty { color: var(--muted); font-size: 14px; }

/* 海报网格：Letterboxd 风格紧凑图上评分 */
.home-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 14px;
}
/* Popular this week 跨列网格 8 列拉满宽度（置于 .home-grid 之后以覆盖其列数） */
.home-grid--full { grid-template-columns: repeat(8, 1fr); }
.home-poster { position: relative; }
.home-poster-link {
	position: relative;
	display: block;
	aspect-ratio: 2 / 3;
	border-radius: 5px;
	overflow: hidden;
	background: var(--panel-2);
}
.home-poster-link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-poster-rating {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 6px 0 5px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
}
.home-poster-rating .big-star { width: 40px; height: 15px; }
.home-poster-rating .big-star svg { width: 40px; height: 15px; }
.home-poster-hover {
	position: absolute; inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 3px;
	padding: 10px;
	background: rgba(0, 0, 0, 0.78);
	opacity: 0;
	transition: opacity 0.22s;
	pointer-events: none;
}
.home-poster-link:hover .home-poster-hover { opacity: 1; }
.hph-title { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.25; }
.hph-meta { font-size: 11px; color: #c9d2da; }
.hph-synopsis {
	font-size: 11.5px;
	color: #e2e8ee;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* 影评时间线：文章式，海报 + 头像/评星/点赞 */
.home-reviews { list-style: none; margin: 0; padding: 0; }
.home-review {
	display: flex;
	gap: 16px;
	padding: 18px 0;
	border-bottom: 1px solid var(--border);
}
.home-review:last-child { border-bottom: 0; }
.hr-poster {
	flex: 0 0 64px;
	width: 64px;
	aspect-ratio: 2 / 3;
	border-radius: 4px;
	overflow: hidden;
	background: var(--panel-2);
}
.hr-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hr-main { min-width: 0; flex: 1; }
.hr-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hr-meta .review-avatar { flex: 0 0 30px; }
.hr-user { font-weight: 700; font-size: 13.5px; color: var(--text-strong); }
.hr-user:hover { color: var(--accent); }
.hr-film { font-size: 13px; color: var(--muted); }
.hr-film a { color: var(--text-strong); font-weight: 500; }
.hr-film a:hover { color: var(--accent); }
.hr-film .hr-year { font-style: normal; color: var(--muted); }
.hr-text { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--text); }
.hr-foot { display: flex; gap: 16px; margin-top: 8px; }
.hr-like, .hr-reply {
	display: inline-flex; align-items: center; gap: 5px;
	font-size: 12px; color: var(--muted);
}
.hr-like svg, .hr-reply svg { width: 14px; height: 14px; fill: currentColor; }

/* 侧栏 */
.side-section .home-title { margin-bottom: 14px; }
.side-poster {
	flex: 0 0 52px;
	width: 52px;
	aspect-ratio: 2 / 3;
	border-radius: 4px;
	overflow: hidden;
	background: var(--panel-2);
}
.side-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.side-item:last-child { border-bottom: 0; }
.side-info { min-width: 0; }
.side-title { display: block; font-size: 14px; font-weight: 700; color: var(--text-strong); line-height: 1.3; }
.side-title:hover { color: var(--accent); }
.side-meta { font-size: 12px; color: var(--muted); margin: 3px 0 6px; }
.side-info .big-star { width: 56px; height: 20px; }
.side-info .big-star svg { width: 56px; height: 20px; }

.home-cta-block {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--panel);
	transition: border-color 0.2s, background 0.2s;
}
.home-cta-block:hover { border-color: var(--accent); background: var(--panel-2); text-decoration: none; }
.home-cta-block strong { font-size: 22px; color: var(--accent); }
.home-cta-block span { font-size: 12px; color: var(--muted); }

/* 响应式 */
@media (max-width: 820px) {
	.home-layout { grid-template-columns: 1fr; gap: 20px; }
	.home-side { position: static; }
}
@media (max-width: 600px) {
	.home-grid, .home-grid--full { grid-template-columns: repeat(4, 1fr); gap: 10px; }
	.home-hero { min-height: 360px; }
	.home-hero-stats { gap: 28px; margin-top: 0; }
	.home-review { gap: 12px; }
	.hero-film { bottom: 90px; right: 12px; max-width: 60%; }
	.hero-film-title { font-size: 12px; letter-spacing: 0.24em; max-height: 34%; }
}
@media (max-width: 380px) {
	.home-grid, .home-grid--full { grid-template-columns: repeat(3, 1fr); }
}
