/*
 * 首页（AI 漫剧创作平台）专属样式
 * ---------------------------------------------------------------
 * 全部规则都收在 body[data-page="home"] 作用域内，不改动 site.css，
 * 也不影响任何已有页面（历史教训：跨页共用的规则不要用「把 A 换成 A, B」
 * 这种文本替换，必须复制完整选择器）。
 *
 * 设计定位：Premium Cinematic AI Manga Creative Platform
 * —— 影院感、留白充足、作品即主体、动效克制（250~450ms ease-out）。
 *
 * 主题（本轮新增）：浅色为默认（--h-* 的浅色值直接写在 body[data-page="home"] 上），
 *   深色由 index.html 引入的 theme-boot.js 给 <html> 加 data-theme="dark" 后生效，
 *   覆盖的只是「页面表面」的 token；Hero / 创作卡 / 作品卡上的文字恒为亮色，
 *   因为它们衬的是照片 + 深色 scrim，这套取景在两套主题下都成立。
 */

/* 主题：**浅色为默认**（与全站一致），深色由 theme-boot.js 给 <html> 打 data-theme="dark"。
   这里只放「页面表面」的颜色（底色 / 文字 / 卡片 / 边框 / 顶栏 / 筛选 Tab）。
   压在图片上的文字（Hero 标题、创作卡、作品卡覆盖层）恒为亮色，故意不走主题变量 ——
   它们衬的是照片 + 深色 scrim，两套主题下都成立（这也正是影院感的来源）。 */
html:has(> body[data-page="home"]) { background: #ffffff; }
html[data-theme="dark"]:has(> body[data-page="home"]) { background: #080808; }

body[data-page="home"] {
  --h-bg: #ffffff;
  --h-bg-soft: #f6f7f9;
  --h-card: #ffffff;
  --h-ink: #14161a;
  --h-muted: rgba(20, 22, 26, .62);
  --h-faint: rgba(20, 22, 26, .42);
  --h-line: rgba(20, 22, 26, .10);
  --h-line-strong: rgba(20, 22, 26, .24);
  --h-header-bg: rgba(255, 255, 255, .86);
  --h-mark-bg: #1f2533;
  --h-chip: rgba(20, 22, 26, .05);
  --h-chip-strong: rgba(20, 22, 26, .09);
  --h-media-bg: #eceef1;
  --h-thumb-filter: none;
  --h-radius: 18px;
  --h-max: 1440px;
  --h-gutter: 32px;
  --h-ease: cubic-bezier(.22, .61, .36, 1);

  background: var(--h-bg);
  color: var(--h-ink);
}

/* 深色 = 原始设计（影院风） */
html[data-theme="dark"] body[data-page="home"] {
  --h-bg: #080808;
  --h-bg-soft: #0d0d0f;
  --h-card: #101013;
  --h-ink: #f5f5f5;
  --h-muted: rgba(255, 255, 255, .55);
  --h-faint: rgba(255, 255, 255, .38);
  --h-line: rgba(255, 255, 255, .08);
  --h-line-strong: rgba(255, 255, 255, .16);
  --h-header-bg: rgba(8, 8, 8, .74);
  --h-mark-bg: rgba(255, 255, 255, .1);
  --h-chip: rgba(255, 255, 255, .06);
  --h-chip-strong: rgba(255, 255, 255, .12);
  --h-media-bg: #131316;
  /* 深色页里亮底素材（白底角色设定）不压影调会像「白卡片」；浅色页反而要原色 */
  --h-thumb-filter: saturate(.96) brightness(.94);
}

/* ===== 外壳：让 Hero 可以全宽，内容区自管最大宽度 ===== */
body[data-page="home"] .site-shell { min-height: 100vh; background: var(--h-bg); }
body[data-page="home"] .main-content { padding: 0; background: transparent; }
body[data-page="home"] .content-wrap { width: 100%; max-width: none; }

/* 顶部导航结构完全不动，只换质感：浅色=白玻璃，深色=黑玻璃
   （浅色下 Hero 仍是深色照片，所以顶栏必须自带底色，不能透明穿透） */
body[data-page="home"] .site-header {
  border-color: var(--h-line);
  background: var(--h-header-bg);
  color: var(--h-ink);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
/* 注意：site.css 2611 行有 `body.is-public-page .brand > span:last-child strong { color:#1f2937 }`
   特异性 (0,3,1)，比下面的 .brand strong (0,2,1) 更高 —— 不显式匹配到 span:last-child
   的话，主题色压不过它（深色主题下曾实测品牌名对比度只有 1.36:1）。 */
body[data-page="home"] .brand,
body[data-page="home"] .brand strong,
body[data-page="home"] .brand > span:last-child strong { color: var(--h-ink); }
body[data-page="home"] .brand small,
body[data-page="home"] .brand > span:last-child small { color: var(--h-faint); }
body[data-page="home"] .brand-mark { background: var(--h-mark-bg); }
body[data-page="home"] .top-nav a { color: var(--h-muted); }
body[data-page="home"] .top-nav a:hover,
body[data-page="home"] .top-nav a.is-active { background: var(--h-chip-strong); color: var(--h-ink); }
body[data-page="home"] .header-icon,
body[data-page="home"] .balance-pill,
body[data-page="home"] .account-link {
  border-color: var(--h-line);
  background: var(--h-chip);
  color: var(--h-ink);
}
body[data-page="home"] .account-link:hover { border-color: var(--h-line-strong); }
body[data-page="home"] .balance-pill span,
body[data-page="home"] .account-text small { color: var(--h-muted); }
body[data-page="home"] .balance-pill strong,
body[data-page="home"] .account-text strong { color: var(--h-ink); }
body[data-page="home"] .account-avatar { background: var(--h-chip-strong); color: var(--h-ink); }

/* ===== 通用块 ===== */
.home-block { width: 100%; max-width: var(--h-max); margin: 0 auto; padding: 0 var(--h-gutter); }
.home-eyebrow { display: block; color: var(--h-faint); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.home-block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; margin-bottom: 26px; }
.home-block-head h2 { margin: 11px 0 0; color: var(--h-ink); font-size: clamp(26px, 2.6vw, 36px); font-weight: 750; letter-spacing: -.032em; line-height: 1.14; }
.home-block-head p { margin: 9px 0 0; color: var(--h-muted); font-size: 15px; }
.home-block-more { display: inline-flex; align-items: center; gap: 8px; padding-bottom: 4px; color: var(--h-muted); font-size: 14px; font-weight: 700; white-space: nowrap; transition: color .28s ease; }
.home-block-more b { transition: transform .32s var(--h-ease); }
.home-block-more:hover { color: var(--h-ink); }
.home-block-more:hover b { transform: translateX(6px); }

/* ===== 1. Hero Banner =====
   这里是**整张成品主视觉**，不是「照片 + 压字」。
   图里已经自带「造梦」书法标题、副标题和「开启你的造梦之旅」按钮，
   所以页面上不再叠任何文字 —— 以前那层 cinema-kicker / cinema-title / cinema-sub
   如果留着，就会和画面里的字重成一团。
   同理撤掉了暗遮罩与 cinemaDrift 位移：遮罩是给照片补层次的，
   成品图上再压一层会把画面压灰；位移动画会让图里的文字跟着慢慢飘。
   保留 .cinema 这个类名与 data-cinema，是为了不牵动其它引用它的地方。*/
.cinema {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: hidden;
  background: #08090c;
}
.cinema img { display: block; width: 100%; height: auto; }
/*
 * §395 主视觉「整张图完整可见」：以前是 width:100% + 高度跟着比例走，
 * 于是 1920×1080 下这块高 1072px，加上 64px 顶栏 = 1136 > 视口 —— 图最底下那行
 * 「一站式 AI 创作平台 · 开启…」永远被切在屏幕外；手机端更狠，原来按 1:1 取景
 * 用 object-fit:cover 硬裁，右侧整片内容直接没了。
 *
 * 现在改成「先按视口高度算出这张图最多能有多宽」，宽度在这条线以内取满：
 *   width = min(100%, (视口高 - 顶栏) × 图宽高比 1.7768)
 * 图片始终等比缩放 —— 不裁、不变形、也不超过一屏，宽屏多出来的两侧
 * 由 .cinema 的底色（取自画面本身的黑）补上，看不出接缝。
 * 用 svh 而不是 vh：手机浏览器地址栏收起/展开时 vh 会跳，svh 取「最短视口」最稳。
 */
.cinema-banner {
  display: block;
  width: min(100%, calc((100vh - 64px) * 1.7768));
  margin: 0 auto;
  line-height: 0;
}
@supports (height: 100svh) {
  .cinema-banner { width: min(100%, calc((100svh - 64px) * 1.7768)); }
}
.cinema-banner:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

/* 站内搜索：从 Hero 里挪出来，落在主视觉下方。
   功能够用、也不再需要「白玻璃」——那套是给深色照片打底的，
   现在衬的是页面底色，直接用首页自己的 --h-* 语义色，两套主题都自动成立。*/
.home-searchbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: var(--h-max);
  margin: 0 auto;
  padding: clamp(20px, 3vh, 32px) var(--h-gutter) 0;
}
.cinema-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(720px, 100%);
  height: 58px;
  padding: 0 8px 0 18px;
  border: 1px solid var(--h-line);
  border-radius: 16px;
  background: var(--h-card);
  box-shadow: 0 12px 30px rgba(16, 24, 40, .07);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.cinema-search:focus-within { border-color: var(--h-line-strong); box-shadow: 0 16px 38px rgba(16, 24, 40, .12); }
.cinema-search-glyph { flex: none; color: var(--h-faint); font-size: 19px; line-height: 1; }
.cinema-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--h-ink); font-size: 16px; outline: none; }
.cinema-search input::placeholder { color: var(--h-faint); }
.cinema-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.cinema-search-submit { flex: none; display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 22px; border-radius: 12px; background: var(--h-ink); color: var(--h-bg); font-size: 15px; font-weight: 750; transition: opacity .26s ease, transform .26s ease; }
.cinema-search-submit:hover { opacity: .84; transform: translateY(-1px); }
.cinema-hints { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 9px; margin-top: 14px; color: var(--h-faint); font-size: 13px; }
.cinema-hint { padding: 5px 13px; border: 1px solid var(--h-line); border-radius: 999px; background: var(--h-chip); color: var(--h-muted); font-size: 13px; transition: border-color .26s ease, background .26s ease, color .26s ease; }
.cinema-hint:hover { border-color: var(--h-line-strong); background: var(--h-chip-strong); color: var(--h-ink); }

/* ===== 2. 创作中心：8 个创作方向（一屏 4 张，超出左右滑动） =====
   卡片是「整张设计稿直出」，压到 4 张挤一屏就没了留白与可读性，所以宁可滑也不缩：
   一屏恒定 4 张（窄屏 2 张 / 手机 1 张），第 5 张起滑出来看。
   卡片仍是「照片 + 暗渐变 + 亮色文字」，与影院风一致；文字恒为亮色，
   衬的是照片 + 深色 scrim，两套主题下都成立（所以不走 --h-* 主题变量）。 */
.creation { margin-top: clamp(56px, 7.5vh, 88px); }
/* 轨道：原生横向滚动 + scroll-snap。滚动条隐藏 —— 卡片本身有 18px 圆角，
   一条系统滚动条压在下面会把整排的「悬浮感」破坏掉；可滑性由右上角的翻页按钮表达。 */
.creation-rail {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.creation-rail::-webkit-scrollbar { width: 0; height: 0; }
.creation-rail:focus-visible { outline: 2px solid var(--h-line-strong); outline-offset: 8px; border-radius: 22px; }
.creation-grid {
  --creation-per: 4;
  --creation-gap: 16px;
  display: flex;
  gap: var(--creation-gap);
}
/* 单张宽 = (可视宽 − 间隙) / 每屏张数。用 flex-basis 百分比而不是 grid，
   是为了让「一屏几张」只由一个变量控制，窄屏改一个值就够。 */
.creation-grid > .creation-card {
  flex: 0 0 calc((100% - (var(--creation-per) - 1) * var(--creation-gap)) / var(--creation-per));
  scroll-snap-align: start;
}
/* 翻页按钮：默认整块隐藏（data-creation-nav 带 hidden），只在真能滑时才出现 */
.creation-nav { display: inline-flex; flex: none; gap: 8px; padding-bottom: 4px; }
.creation-nav[hidden] { display: none; }
.creation-nav-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--h-line);
  border-radius: 50%;
  background: var(--h-card);
  color: var(--h-ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .26s ease, background .26s ease, transform .26s var(--h-ease), opacity .26s ease;
}
.creation-nav-btn:hover:not(:disabled) { border-color: var(--h-line-strong); transform: translateY(-2px); }
.creation-nav-btn:active:not(:disabled) { transform: translateY(0) scale(.94); }
/* 到头了就把那一侧的按钮变淡并锁死 —— 视觉上「没有更多了」比点了不动更清楚 */
.creation-nav-btn:disabled { opacity: .32; cursor: default; }
.creation-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 216px;
  overflow: hidden;
  border: 1px solid var(--h-line);
  border-radius: 18px;
  background: var(--h-card);
  transition: border-color .32s ease, transform .38s var(--h-ease);
}
.creation-card:hover { border-color: var(--h-line-strong); transform: translateY(-3px); }
.creation-card:focus-visible { outline: 2px solid var(--h-muted); outline-offset: 3px; }
.creation-media { position: absolute; inset: 0; overflow: hidden; }
.creation-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(.9) brightness(.82);
  transform: scale(1);
  transition: transform .44s var(--h-ease), filter .44s var(--h-ease);
}
.creation-card:hover .creation-media img { transform: scale(1.04); filter: saturate(1.02) brightness(.98); }
/* 暗渐变比原先更早开始压暗（50% 处就到 .72）：卡片矮，图片可露面积小，
   渐变晚起会让标题落在亮处、读不清。 */
.creation-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 8, 8, .16) 0%, rgba(8, 8, 8, .72) 48%, rgba(8, 8, 8, .95) 100%); opacity: 1; transition: opacity .34s ease; }
.creation-card:hover .creation-veil { opacity: .82; }
.creation-copy { position: relative; z-index: 2; padding: 20px 20px 22px; }
.creation-copy h3 { margin: 0; color: #fff; font-size: 18px; font-weight: 750; letter-spacing: -.028em; line-height: 1.25; transition: transform .34s var(--h-ease); }
/* 「让故事，从文字走进镜头。」这类一句话 slogan：比正文亮、比标题轻。
   选择器必须写成 `.creation-copy p.creation-lead`（(0,2,1)）—— 只写 `.creation-lead` 是 (0,1,0)，
   会被下面的 `.creation-copy p`（(0,1,1)）压过去，实测 computed color 变成 0.64、字号 12.8px。 */
.creation-copy p.creation-lead { margin: 7px 0 0; color: rgba(255, 255, 255, .92); font-size: 13.5px; font-weight: 650; line-height: 1.5; display: block; }
/* 说明文字最多 3 行：卡片高度必须可预期，否则一长就又把精选内容推下去了 */
.creation-copy p { margin: 6px 0 0; color: rgba(255, 255, 255, .64); font-size: 12.8px; line-height: 1.64; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.creation-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 13px; color: rgba(255, 255, 255, .88); font-size: 13.5px; font-weight: 700; transition: color .3s ease; }
.creation-cta b { transition: transform .34s var(--h-ease); }
.creation-card:hover .creation-copy h3 { transform: translateY(-3px); }
.creation-card:hover .creation-cta { color: #fff; }
.creation-card:hover .creation-cta b { transform: translateX(6px); }

/* --- 成品卡片图版（.creation-card--art）---
   上面那套「照片 + 渐变 + 叠文字」的样式留着给其它地方复用；创作中心的 4 张改成
   整张设计稿直出：文字已在图内，页面不再叠任何文字，避免重影。
   三处必须覆盖，否则会破坏设计稿：
   1) min-height → aspect-ratio：卡片高度由宽度按图比例算，不裁切设计稿；
   2) filter: none：原样式把照片压到 saturate(.9) brightness(.82)，套在设计稿上会把
      图内文字和蓝紫色调一起压暗、发灰；
   3) 不加 .creation-veil：设计稿自带暗色 scrim，再叠一层会让整张图糊掉。
   各图 419~423 高、宽 801~803，统一按 802/421 定比，单张最多裁 1.4px —— 肉眼不可见。 */
.creation-card--art { min-height: 0; aspect-ratio: 802 / 421; }
.creation-card--art .creation-media img { filter: none; }
.creation-card--art:hover .creation-media img { transform: scale(1.02); filter: none; }

/* ===== 3. 精选内容 ===== */
.showcase { margin-top: clamp(64px, 8.5vh, 104px); padding-bottom: clamp(84px, 10vh, 132px); }
.showcase-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--h-line); }
.showcase-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.showcase-tab { padding: 9px 16px; border-radius: 999px; background: transparent; color: var(--h-muted); font-size: 14px; font-weight: 650; transition: background .26s ease, color .26s ease; }
.showcase-tab b { margin-left: 7px; color: var(--h-faint); font-size: 12px; font-weight: 700; }
.showcase-tab:hover { background: var(--h-chip); color: var(--h-ink); }
.showcase-tab.is-active { background: var(--h-chip-strong); color: var(--h-ink); }
.showcase-tab.is-active b { color: var(--h-muted); }
.showcase-note { margin: 0; color: var(--h-faint); font-size: 13px; }

/* 瀑布流：CSS Grid + JS 抽行（零依赖，规格 §17 / §31）。
   用 columns 会按列均衡高度而留下竖向缝隙，阅读顺序还会变成竖排；改用 Grid 逐张
   放到最矮的列里。行高取 2px 的细分轨道（row-gap 设 0），间距由抽行时多算出来的
   余量补足 —— 这样卡片能严格保持素材原始比例，又不会出现量化误差留下的空洞。 */
.showcase-grid {
  --masonry-gap: 18px;
  --masonry-cols: 4;
  display: grid;
  grid-template-columns: repeat(var(--masonry-cols), minmax(0, 1fr));
  grid-auto-rows: 2px;
  column-gap: var(--masonry-gap);
  row-gap: 0;
}
.showcase-item {
  position: relative;
  display: block;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius);
  background: var(--h-card);
  transition: border-color .32s ease, transform .38s var(--h-ease);
}
.showcase-item:hover { border-color: var(--h-line-strong); transform: translateY(-3px); }
.showcase-item:focus-visible { outline: 2px solid var(--h-muted); outline-offset: 3px; }
.showcase-media { position: relative; display: block; aspect-ratio: var(--ratio, 16 / 9); overflow: hidden; background: var(--h-media-bg); }
.showcase-media img,
.showcase-media video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1); filter: var(--h-thumb-filter); transition: transform .52s var(--h-ease), filter .42s ease; }
/* 统一影调：覆盖层文字是亮的，所以无论哪套主题都在素材上压一层暗渐变，
   保证 hover 时 Title / Action 始终读得清（深色页另加 brightness 压曝光）。 */
.showcase-media::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg, rgba(8, 8, 8, .2) 0%, rgba(8, 8, 8, .13) 44%, rgba(8, 8, 8, .36) 100%); transition: opacity .42s ease; }
.showcase-item:hover .showcase-media::after { opacity: .5; }
.showcase-item:hover .showcase-media img,
.showcase-item:hover .showcase-media video { transform: scale(1.02); filter: saturate(1.02) brightness(1.02); }
.showcase-kind { position: absolute; z-index: 3; top: 12px; left: 12px; padding: 4px 11px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(8, 8, 8, .52); backdrop-filter: blur(10px); color: rgba(255, 255, 255, .84); font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
.showcase-play { position: absolute; z-index: 3; top: 50%; left: 50%; display: grid; place-items: center; width: 54px; height: 54px; margin: -27px 0 0 -27px; border: 1px solid rgba(255, 255, 255, .26); border-radius: 50%; background: rgba(8, 8, 8, .42); backdrop-filter: blur(10px); color: #fff; font-size: 17px; transition: opacity .3s ease, transform .34s var(--h-ease); }
.showcase-item:hover .showcase-play { transform: scale(1.06); }
/* §394 封面地址失效时的兜底：不要留一个破图图标，也不要把卡片高度塌成 0 */
.showcase-broken { position: absolute; inset: 0; display: grid; place-items: center; color: var(--h-faint); font-size: 12.5px; letter-spacing: .04em; }
/* 模板类作品没有媒体地址（它是一份画布，不是一张图）：给一块可读的占位，别留空白卡 */
.showcase-template-badge { position: absolute; inset: 0; display: grid; place-items: center; color: var(--h-ink-soft, rgba(255, 255, 255, .62)); font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.showcase-overlay {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 40px 16px 16px;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0) 0%, rgba(8, 8, 8, .74) 52%, rgba(8, 8, 8, .95) 100%);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .38s var(--h-ease);
}
.showcase-item:hover .showcase-overlay,
.showcase-item:focus-visible .showcase-overlay { opacity: 1; transform: translateY(0); }
.showcase-title { color: #fff; font-size: 15px; font-weight: 750; letter-spacing: -.012em; }
.showcase-meta { color: rgba(255, 255, 255, .6); font-size: 12.5px; }
.showcase-action { display: inline-flex; align-items: center; gap: 7px; margin-top: 9px; color: rgba(255, 255, 255, .92); font-size: 13px; font-weight: 700; }
.showcase-action b { transition: transform .32s var(--h-ease); }
.showcase-item:hover .showcase-action b { transform: translateX(5px); }

.showcase-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 68px 26px; min-height: 260px; border: 1px dashed var(--h-line-strong); border-radius: var(--h-radius); color: var(--h-muted); text-align: center; grid-column: 1 / -1; align-self: start; }
.showcase-empty strong { color: var(--h-ink); font-size: 16px; font-weight: 700; }
.showcase-empty p { margin: 0; max-width: 42ch; font-size: 13.5px; line-height: 1.75; }
.showcase-empty span { font-size: 26px; opacity: .5; }

/* ===== 3b. 「AI 内容」页签的卡片（用户分享） =====
   .showcase-item 的全套版式继续复用，这里只补三件事：
   1) 按钮重置 —— 它是 <button>（点击 = 放大观看，没有目标页面），
      必须抹掉 UA 自带的 padding / border-radius / 字体，否则卡片会比硬编码卡片大一圈；
   2) 底部信息常驻 —— 分享来的作品要「一眼看到作者」，
      不能像设计素材那样只在 hover 时才浮出标题；
   3) 长文案收口 —— 用户自己填的标题 / 作者名长度不可控，超长会把卡片撑变形。 */
body[data-page="home"] .showcase-item.is-shared {
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
body[data-page="home"] .showcase-item.is-shared .showcase-overlay { opacity: 1; transform: none; }
/* 底部统计栏是常驻的（z-index 4，贴在卡片最下沿），信息层也是贴着底边的 ——
   两者不互相让位时，「作者 · 项目名」会正好压在 👁/👍/☆/💬 那排数字上。
   这里把信息层抬到统计栏之上，两边各自有一行干净的基线。 */
body[data-page="home"] .showcase-item.is-shared .showcase-overlay { padding-bottom: 46px; }
body[data-page="home"] .showcase-item.is-shared .showcase-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body[data-page="home"] .showcase-item.is-shared .showcase-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 入场动效：慢、稳、不抢戏（规格 §32） =====
   注意 .reveal 默认必须是「可见」：只有 <html> 带上 has-reveal（由 index.html 头部
   一行内联脚本设置）才隐藏等入场。这样脚本没跑起来时内容不会凭空消失。 */
.reveal { opacity: 1; transform: none; }
html.has-reveal .reveal { opacity: 0; transform: translateY(20px); transition: opacity .78s var(--h-ease), transform .78s var(--h-ease); }
html.has-reveal .reveal.is-in { opacity: 1; transform: none; }
/* 首屏要素依次入场，错开一点更有电影感 */
html.has-reveal .cinema-inner > .reveal:nth-child(1) { transition-delay: .04s; }
html.has-reveal .cinema-inner > .reveal:nth-child(2) { transition-delay: .13s; }
html.has-reveal .cinema-inner > .reveal:nth-child(3) { transition-delay: .22s; }
html.has-reveal .cinema-inner > .reveal:nth-child(4) { transition-delay: .31s; }
html.has-reveal .cinema-inner > .reveal:nth-child(5) { transition-delay: .39s; }

@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .cinema-media img,
  body[data-page="home"] .cinema-media video { animation: none; }
  html.has-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .creation-card, .creation-card *, .showcase-item, .showcase-item * { transition: none !important; }
  .creation-rail { scroll-behavior: auto; }
}

/* ===== 响应式 ===== */
@media (max-width: 1199px) {
  body[data-page="home"] { --h-gutter: 26px; }
  .showcase-grid { --masonry-cols: 3; }
}

/* 4 张创作卡在中等屏保持一排的话每张会被挤到 200px 以下，改成「一屏 2 张 + 横滑」 */
@media (max-width: 1023px) {
  .creation-grid { --creation-per: 2; --creation-gap: 14px; }
}

@media (max-width: 900px) {
  .home-block-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .showcase-grid { --masonry-cols: 2; }
}

@media (max-width: 767px) {
  body[data-page="home"] { --h-gutter: 18px; }
  /* 主视觉是成品图，高度由图片自身比例决定 —— 不能再给 .cinema 设 min-height，
     那会把 390 宽下只有 ~220 高的图撑成 520~660，底下多出一大块纯黑空白。
     §395：手机端不做任何取景裁切了 —— 原先按 1:1 + cover 贴左取景，是为了让图里的字大一点，
     代价是右侧的「一站式 AI 创作平台 · 开启…」整段被切掉，用户第一眼就发现问题。
     现在统一按「整张图完整可见」处理（见 .cinema-banner 的宽度公式）：
     窄屏下宽度吃满 100%，高度自然收到 ~219px，16:9 的构图一个字都不缺。 */
  .cinema-search { height: 56px; padding: 0 6px 0 15px; border-radius: 14px; }
  .cinema-search-submit { height: 44px; padding: 0 17px; font-size: 14px; }
  .cinema-hints { display: none; }

  .creation-card { min-height: 200px; }
  /* 必须重写：媒体查询里的 .creation-card 与 .creation-card--art 同权重，
     写在后面就会把成品卡片图的 min-height 顶回 200px，把图拉变形。 */
  .creation-card--art { min-height: 0; }
  .creation-copy { padding: 18px 18px 20px; }
  .creation-copy h3 { font-size: 17px; }

  .showcase-grid { --masonry-cols: 2; --masonry-gap: 12px; }
  .showcase-item { border-radius: 15px; }
  .showcase-kind { top: 9px; left: 9px; padding: 3px 9px; font-size: 11px; }
}

/* 窄到 560 以下一屏只放得下一张完整卡（说明文字才不会被挤成两三个字一行） */
@media (max-width: 560px) {
  .creation-grid { --creation-per: 1; --creation-gap: 12px; }
  .creation-card { min-height: 178px; }
  .creation-card--art { min-height: 0; }
  .creation-copy p { -webkit-line-clamp: 2; }
}

/* 触屏没有 hover：标题/分类常驻可见，视频只显示 poster（规格 §18 / §21） */
@media (hover: none) {
  .showcase-overlay { opacity: 1; transform: none; }
  .showcase-play { display: none; }
}

/* ==========================================================================
 * §111 成就感体系：统计栏 / 最新热门横滑条 / 作品详情弹层
 * --------------------------------------------------------------------------
 * 统计栏用 --h-* token，随首页深浅主题自动切换；
 * 详情弹层挂到 <body> 末尾（首页无独立挂载点），用 .content-detail-* 类名，
 * 配色同样走 token，与全站双主题一致。
 * ========================================================================== */

/* ---- 卡片统计栏 ---- */
body[data-page="home"] .showcase-stats {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0) 0%, rgba(8, 8, 8, .62) 100%);
  pointer-events: none;
}
.content-stats { display: inline-flex; align-items: center; gap: 14px; }
.content-stat { display: inline-flex; align-items: center; gap: 5px; color: rgba(255, 255, 255, .82); font-size: 12px; font-variant-numeric: tabular-nums; }
.content-stat i { font-style: normal; font-size: 12px; opacity: .9; }
.content-stat b { font-weight: 650; }
.content-stat.is-action { color: rgba(255, 255, 255, .92); }
.content-stat.is-active i { color: #fbbf24; }
/* 详情弹层里的统计是可点的，卡片上的不可点（由 pointer-events 控制） */
.content-detail-actions .content-stats .content-stat { pointer-events: auto; cursor: pointer; transition: transform .16s ease; }
.content-detail-actions .content-stats .content-stat.is-action:hover { transform: scale(1.08); }

/* ---- 最新热门横滑条 ---- */
body[data-page="home"] .trending { margin-bottom: 26px; }
body[data-page="home"] .trending.is-hidden { display: none; }
body[data-page="home"] .trending-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
body[data-page="home"] .trending-title { color: var(--h-ink); font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
body[data-page="home"] .trending-sub { color: var(--h-faint); font-size: 12.5px; }
body[data-page="home"] .trending-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
body[data-page="home"] .trending-strip::-webkit-scrollbar { height: 6px; }
body[data-page="home"] .trending-strip::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--h-line-strong); }
.trending-item { flex: 0 0 210px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; padding: 0; border: 1px solid var(--h-line); border-radius: 14px; background: var(--h-card); overflow: hidden; text-align: left; cursor: pointer; color: inherit; font: inherit; transition: border-color .3s ease, transform .32s var(--h-ease); -webkit-appearance: none; appearance: none; }
.trending-item:hover { border-color: var(--h-line-strong); transform: translateY(-2px); }
.trending-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--h-media-bg); }
.trending-media img { display: block; width: 100%; height: 100%; object-fit: cover; filter: var(--h-thumb-filter); }
.trending-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(8, 8, 8, .24); font-size: 18px; }
.trending-info { display: flex; flex-direction: column; gap: 3px; padding: 0 12px 12px; }
.trending-info strong { color: var(--h-ink); font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trending-info small { color: var(--h-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ---- 作品详情弹层 ---- */
.content-detail-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(8, 8, 8, .66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: content-detail-fade .22s ease;
}
@keyframes content-detail-fade { from { opacity: 0; } to { opacity: 1; } }
body.has-content-detail { overflow: hidden; }

.content-detail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  width: min(1080px, 100%);
  max-height: min(88vh, 820px);
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .45);
  animation: content-detail-pop .3s var(--h-ease);
}
@keyframes content-detail-pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.content-detail-close {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(8, 8, 8, .5);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}
.content-detail-close:hover { background: rgba(8, 8, 8, .72); }
.content-detail-mediawrap { display: grid; place-items: center; background: #0a0a0a; min-height: 320px; }
.content-detail-media { display: block; width: 100%; max-height: min(88vh, 820px); object-fit: contain; }
/* 模板作品没有媒体地址时的占位（不能渲染 src="" 的破图） */
.content-detail-media.is-empty { display: grid; place-items: center; min-height: 320px; color: rgba(255, 255, 255, .62); font-size: 14.5px; text-align: center; padding: 0 24px; }
.content-detail-side { display: flex; flex-direction: column; min-height: 0; padding: 26px 24px; overflow-y: auto; }
.content-detail-head { margin-bottom: 18px; }
.content-detail-title { margin: 0 0 8px; font-size: 20px; font-weight: 750; letter-spacing: -.02em; color: #111827; }
.content-detail-meta { margin: 0 0 6px; font-size: 13px; color: #6b7280; }
.content-detail-desc { margin: 0; font-size: 14px; line-height: 1.7; color: #4b5563; }
.content-detail-actions { display: flex; align-items: center; gap: 10px; padding: 14px 0; border-top: 1px solid #eef0f3; border-bottom: 1px solid #eef0f3; }
.content-detail-actions .content-stats { gap: 18px; }
.content-detail-actions .content-stat { color: #374151; font-size: 13px; }
.content-detail-actions .content-stat.is-action { color: #1f2937; }
.content-detail-comments { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.content-comments-head { font-size: 14px; color: #111827; }
.content-comments-list { display: flex; flex-direction: column; gap: 14px; max-height: 320px; overflow-y: auto; }
.content-comments-loading { font-size: 13px; color: #9ca3af; padding: 16px 0; }
.content-comment { display: flex; flex-direction: column; gap: 4px; }
.content-comment-head { display: flex; align-items: baseline; gap: 10px; }
.content-comment-head b { font-size: 13px; color: #111827; }
.content-comment-head time { font-size: 11.5px; color: #9ca3af; }
.content-comment-body { margin: 0; font-size: 13.5px; line-height: 1.65; color: #374151; word-break: break-word; }
.content-comment-replies { margin-top: 8px; padding-left: 16px; border-left: 2px solid #eef0f3; display: flex; flex-direction: column; gap: 10px; }
.content-comment-form { display: flex; gap: 8px; margin-top: 14px; }
.content-comment-form input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 10px; font-size: 13.5px; color: #111827; background: #fafbfc; }
.content-comment-form input:focus { outline: none; border-color: #8b97ff; }
.content-comment-form button { flex-shrink: 0; padding: 10px 18px; border: none; border-radius: 10px; background: #5a66e8; color: #fff; font-size: 13.5px; font-weight: 650; cursor: pointer; transition: background .2s ease; }
.content-comment-form button:hover { background: #4a55d0; }

/* 深色主题下的详情弹层 */
html[data-theme="dark"] .content-detail { background: #14171c; color: #f2f4f7; }
html[data-theme="dark"] .content-detail-title { color: #f2f4f7; }
html[data-theme="dark"] .content-detail-meta { color: #a9b3c2; }
html[data-theme="dark"] .content-detail-desc { color: #c2cbd8; }
html[data-theme="dark"] .content-detail-actions { border-color: #272d37; }
html[data-theme="dark"] .content-detail-actions .content-stat { color: #c2cbd8; }
html[data-theme="dark"] .content-detail-actions .content-stat.is-action { color: #f2f4f7; }
html[data-theme="dark"] .content-comments-head { color: #f2f4f7; }
html[data-theme="dark"] .content-comment-head b { color: #f2f4f7; }
html[data-theme="dark"] .content-comment-body { color: #c2cbd8; }
html[data-theme="dark"] .content-comment-replies { border-color: #272d37; }
html[data-theme="dark"] .content-comment-form input { background: #1a1e25; border-color: #272d37; color: #f2f4f7; }
html[data-theme="dark"] .content-comment-form button { background: #8b97ff; color: #0b0d10; }
html[data-theme="dark"] .content-comment-form button:hover { background: #a3adff; }

/* 窄屏详情弹层单列堆叠 */
@media (max-width: 767px) {
  .content-detail { grid-template-columns: 1fr; max-height: 92vh; }
  .content-detail-mediawrap { min-height: 200px; }
  .content-detail-side { max-height: 50vh; }
}
