/*
 * Open Poem 公开页面样式：「影院」风格（作者在 2026-11-21 选定的样稿二）。
 * 依据 ui-ux-pro-max 的检索结果：个人作品集 × 视频平台 → 深色影院 + 动效优先 + 毛玻璃，配色"Cinema dark + play red"。
 * 设计说明：docs/specs/2026-11-21-ui-redesign-design.md；样稿：docs/design/mockups/v2/v2-ying.html
 * 规则：正文对比度 ≥ 4.5:1，点击区域 ≥ 44px，交互动画 300–400ms，所有动画只在没开"减少动态效果"时运行。
 */

:root {
  --bg: #000000;
  --primary: #0F0F23;
  --secondary: #1E1B4B;
  --accent: #E11D48;      /* 播放红：唯一的强调色 */
  --fg: #F8FAFC;
  --card: #0C0C0D;
  --muted: #181818;
  --muted-fg: #94A3B8;
  --glass: rgba(255, 255, 255, .08);
  --glass-strong: rgba(255, 255, 255, .14);
  --glass-border: rgba(255, 255, 255, .16);
  --blur: 16px;
  --dur: 350ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --radius: 14px;
  --font-ui: system-ui, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-ui); font-size: 16px; line-height: 1.6; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 6px; }
img { display: block; max-width: 100%; }

/* 只给读屏软件和搜索引擎看的文字 */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---------- 页头：毛玻璃导航，滚动时停在顶部 ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(0, 0, 0, .4); border-bottom: 1px solid rgba(255, 255, 255, .06); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font-weight: 700; letter-spacing: .02em; }
.logo i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); font-style: normal; font-family: var(--font-kai); }
.nav-links { display: flex; gap: 4px; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none; color: var(--muted-fg); transition: color var(--dur), background var(--dur); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); background: var(--glass); }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform var(--dur) var(--ease), background var(--dur), box-shadow var(--dur); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-play { background: var(--accent); color: #fff; box-shadow: 0 10px 30px rgba(225, 29, 72, .35); }
.btn-play:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(225, 29, 72, .5); }
.btn-glass { background: var(--glass); border-color: var(--glass-border); color: var(--fg); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }
.btn-glass:hover { background: var(--glass-strong); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- 毛玻璃面板 ---------- */
.glass-panel { background: rgba(15, 15, 35, .6); border: 1px solid var(--glass-border); border-radius: 22px; padding: clamp(20px, 3vw, 36px); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur)); }

/* 诗句用楷体 */
.verse { font-family: var(--font-kai); font-size: clamp(1.3rem, 1rem + 1vw, 1.75rem); line-height: 1.8; color: #E7E9EF; }
/* 手机上一句放不下时，在中间（逗号处）折行，不留一两个字单独成行 */
.verse span { display: block; text-wrap: balance; }
.meta { color: var(--muted-fg); }

/* 后台预览时的提示条 */
.preview-banner { position: relative; z-index: 5; margin: 0; padding: 10px 24px; text-align: center; font-weight: 600; background: var(--accent); color: #fff; }

/* ---------- 关于页 ---------- */
.about { padding: clamp(40px, 8vh, 96px) 24px 80px; max-width: 880px; }
.about h1 { margin: 0 0 20px; font-size: clamp(2.6rem, 1.8rem + 4vw, 4.6rem); line-height: 1.05; font-weight: 800; }
.about-intro p { margin: 0 0 14px; font-size: 1.1rem; color: #D7DCE5; max-width: 36em; }
.profiles { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 40px; }
.about .glass-panel h2 { margin: 0 0 10px; font-size: 1.35rem; }
.about .glass-panel p { margin: 0 0 14px; color: #D7DCE5; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.stack li { padding: 6px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border); font-size: .9rem; }
.about .glass-panel .privacy { font-size: .85rem; color: var(--muted-fg); }

/* ---------- 错误页（404、403、413 等） ---------- */
.not-found { padding: clamp(60px, 14vh, 140px) 24px 100px; max-width: 760px; }
.not-found h1 { margin: 0 0 16px; font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4rem); line-height: 1.1; font-weight: 800; }
.not-found p { margin: 0 0 24px; color: #D7DCE5; font-size: 1.05rem; max-width: 34em; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid rgba(255, 255, 255, .08); padding: 22px 0 36px; color: var(--muted-fg); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.site-footer a:hover { color: var(--fg); }

/* ---------- 首页：空状态 ---------- */
.empty-state { padding: clamp(80px, 18vh, 180px) 24px; }
.empty { margin: 0; font-size: 1.3rem; color: var(--muted-fg); }

/* ---------- 首页：首屏 ---------- */
/* 往上收进导航栏下面，让毛玻璃导航压在画面上 */
.hero { position: relative; overflow: hidden; margin-top: -65px; padding-top: 65px; min-height: min(100svh, 920px); display: flex; align-items: center; }
.hero-bg { position: absolute; inset: 0; }
/* 背景：同一张封面，放大、模糊、压暗，只用来铺氛围 */
.hero-ambient { width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); filter: blur(42px) saturate(1.3) brightness(.65); }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .9) 0%, rgba(0, 0, 0, .55) 50%, rgba(0, 0, 0, .25) 100%), linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0) 35%); }
.aurora { position: absolute; z-index: 1; width: 60vw; height: 60vw; left: -12vw; bottom: -32vw; background: radial-gradient(circle, rgba(225, 29, 72, .28), rgba(225, 29, 72, 0) 60%); filter: blur(20px); }
.hero-inner { position: relative; z-index: 2; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: clamp(32px, 6vw, 96px); align-items: center; padding-top: 48px; padding-bottom: 72px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border); font-size: .85rem; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.hero h1 { margin: 18px 0 6px; font-size: clamp(3rem, 2rem + 5vw, 6rem); line-height: 1.05; font-weight: 800; letter-spacing: .02em; }
.hero .verse { margin: 18px 0 28px; }
/* 前景：完整的竖屏海报 */
.hero-poster { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; border: 1px solid var(--glass-border); background: var(--primary); box-shadow: 0 40px 100px rgba(0, 0, 0, .7); text-decoration: none; }
.hero-poster img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 35%; }

/* 没有封面时：深色渐变加诗名大字 */
.poster-fallback { display: grid; place-items: center; width: 100%; height: 100%; padding: 16px; background: radial-gradient(circle at 70% 20%, rgba(225, 29, 72, .35), rgba(225, 29, 72, 0) 55%), linear-gradient(160deg, var(--secondary), var(--primary)); font-family: var(--font-kai); font-size: clamp(1.4rem, 1rem + 1.6vw, 2.4rem); letter-spacing: .3em; writing-mode: vertical-rl; color: var(--fg); }

/* ---------- 首页：全部作品 ---------- */
.row { padding: 56px 0 24px; }
.row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.row-head h2 { margin: 0; font-size: 1.6rem; font-weight: 800; }
.arrows { display: flex; gap: 8px; }
.arrows[hidden] { display: none; }
.arrow { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass); color: var(--fg); cursor: pointer; transition: background var(--dur); }
.arrow:hover { background: var(--glass-strong); }
/* 左右留白和上面的 .wrap 对齐；吸附位置用同一个值，否则宽屏上一滚动整行就错位 */
.rail { --rail-pad: max(24px, calc((100% - 1240px) / 2 + 24px)); display: grid; grid-auto-flow: column; grid-auto-columns: clamp(160px, 17vw, 230px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--rail-pad); padding: 8px var(--rail-pad) 28px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.poster { position: relative; display: block; aspect-ratio: 9 / 16; scroll-snap-align: start; text-decoration: none; border-radius: var(--radius); overflow: hidden; background: var(--card); transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, 0) 45%); pointer-events: none; }
.poster .info { position: absolute; left: 14px; right: 14px; bottom: 16px; z-index: 1; }
.poster .info b { display: block; font-size: 1.15rem; }
.poster .info span { font-size: .85rem; color: #CBD5E1; }
.poster .play { position: absolute; z-index: 1; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; display: grid; place-items: center; background: rgba(225, 29, 72, .9); opacity: 0; transform: scale(.8); transition: opacity var(--dur), transform var(--dur) var(--ease); }
.poster:hover, .poster:focus-visible { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0, 0, 0, .6); }
.poster:hover img { transform: scale(1.06); }
.poster:hover .play, .poster:focus-visible .play { opacity: 1; transform: scale(1); }

/* ---------- 首页：介绍格子 ---------- */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; gap: 16px; padding: 40px 24px 80px; }
.tile { position: relative; border-radius: 20px; overflow: hidden; padding: 22px; background: var(--primary); border: 1px solid rgba(255, 255, 255, .07); }
.tile h3 { margin: 0 0 6px; font-size: 1.15rem; }
.tile p { margin: 0; color: var(--muted-fg); }
.t-big { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: flex-end; }
.t-big .collage { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; opacity: .55; }
.t-big .collage img { width: 100%; height: 100%; object-fit: cover; }
.t-big::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, #000 10%, rgba(0, 0, 0, .1) 70%); }
.t-big > :not(.collage) { position: relative; z-index: 2; }
.t-big h3 { font-size: clamp(1.6rem, 1rem + 2vw, 2.4rem); line-height: 1.2; font-weight: 800; }
.t-big p { color: #CBD5E1; }
.t-wide { grid-column: span 2; background: var(--secondary); }
.t-wide p { color: #CBD5E1; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags span { padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border); font-size: .85rem; }
.t-verse { display: flex; align-items: center; font-family: var(--font-kai); font-size: 1.35rem; line-height: 1.7; }
.t-follow { background: linear-gradient(135deg, #2A0A14, var(--primary)); }
.t-follow .actions { margin-top: 14px; }
.t-follow .btn { min-height: 44px; padding: 0 16px; }
/* 诗句格或关注格没有时，剩下的那一格占满第二行，不留空洞 */
.bento:not(:has(.t-verse)) .t-follow, .bento:not(:has(.t-follow)) .t-verse { grid-column: span 2; }
.bento:not(:has(.t-verse)):not(:has(.t-follow)) .t-wide { grid-row: span 2; }

@media (max-width: 860px) {
  .hero { min-height: auto; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 28px; }
  .hero-poster { order: -1; width: min(72%, 300px); justify-self: center; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .t-big, .t-wide, .t-verse, .t-follow { grid-column: auto !important; grid-row: auto !important; }
  .t-big { min-height: 300px; }
  .tile { min-height: 140px; }
  .arrows { display: none; }
}

/* ---------- 详情页 ---------- */
.detail { position: relative; overflow: hidden; margin-top: -65px; padding-top: 65px; }
/* 背景：封面放大、模糊、压暗，只用来铺氛围 */
.detail-bg { position: absolute; inset: 0; }
.detail-bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.2); filter: blur(48px) saturate(1.2); opacity: .5; }
.detail-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .35), #000 85%); }
.detail-grid { position: relative; display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; padding-top: 48px; padding-bottom: 80px; }
/* 播放器卡片：竖屏封面完整显示；能点时中间有播放按钮 */
.player { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; border: 1px solid var(--glass-border); background: var(--primary); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); text-decoration: none; }
.player img { width: 100%; height: 100%; object-fit: cover; }
.player .big-play { position: absolute; top: 50%; left: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; display: grid; place-items: center; background: rgba(225, 29, 72, .92); box-shadow: 0 0 0 10px rgba(225, 29, 72, .25); transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
/* 没有封面时中间是竖排标题，播放按钮挪到下方，免得挡住标题 */
.player:has(.poster-fallback) .big-play { top: auto; bottom: 12%; margin-top: 0; }
a.player:hover .big-play, a.player:focus-visible .big-play { transform: scale(1.08); box-shadow: 0 0 0 16px rgba(225, 29, 72, .2); }
.detail-panel h1 { margin: 0; font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem); line-height: 1.1; font-weight: 800; }
.detail-panel .meta { margin: 6px 0 0; }
.detail-panel .reads { margin: 4px 0 0; font-size: .85rem; color: var(--muted-fg); }
.detail-panel .original { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); margin: 20px 0 26px; }

/* 解读：没有脚本时各部分依次排开；有脚本时变成标签页（.is-tabbed） */
.readings { margin-top: 30px; }
.tab-panel { margin-bottom: 26px; }
.tab-panel h2 { margin: 0 0 10px; font-size: 1.1rem; color: var(--fg); }
.is-tabbed .tab-panel h2 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tab-panel p, .tab-panel li { color: #D7DCE5; line-height: 1.9; max-width: 38em; margin: 0 0 8px; }
.notes { margin: 0; padding: 0; list-style: none; }
.notes b { color: var(--fg); margin-right: .5em; }
.tabs { display: flex; gap: 6px; padding: 5px; margin-bottom: 18px; border-radius: 14px; background: rgba(0, 0, 0, .35); width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: transparent; color: var(--muted-fg); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background var(--dur), color var(--dur); }
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] { background: var(--glass); color: var(--fg); box-shadow: inset 0 0 0 1px var(--glass-border); }
.tab-panel:focus-visible { outline-offset: 6px; }

@media (max-width: 860px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .player { width: min(72%, 320px); justify-self: center; }
}
/* 手机上四个标签挤一挤，尽量一行放下，不用左右滑 */
@media (max-width: 520px) {
  .tabs { width: 100%; }
  .tabs button { flex: 1 0 auto; padding: 0 10px; }
}

/* ---------- 动画：只在没开"减少动态效果"时运行 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-poster img { animation: kenburns 24s ease-in-out infinite alternate; }
  .aurora { animation: drift 12s ease-in-out infinite alternate; }
  .is-tabbed .tab-panel:not([hidden]) { animation: panel-in var(--dur) var(--ease); }
}
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes drift { to { transform: translate(8vw, -4vw) scale(1.1); } }
/* 切换标签时新面板轻轻浮上来 */
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 进场：首屏内容依次出现（只在没开"减少动态效果"时） ---------- */
@media (prefers-reduced-motion: no-preference) {
  [data-enter] > * { opacity: 0; transform: translateY(16px); animation: rise .6s var(--ease) forwards; }
  [data-enter] > *:nth-child(2) { animation-delay: .1s; }
  [data-enter] > *:nth-child(3) { animation-delay: .2s; }
  [data-enter] > *:nth-child(4) { animation-delay: .3s; }
  [data-enter] > *:nth-child(5) { animation-delay: .4s; }
  [data-enter] > *:nth-child(6) { animation-delay: .5s; }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* 开了"减少动态效果"：悬停、按下这类过渡也关掉，状态直接切换 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
