/* 光影笔记 - 创意功能层样式
   15 个纯前端玩法：海报墙 / 情绪选片 / 动态主题 / 3D 翻转视差 / 图谱 / 金句弹幕 /
   对比 / 推荐链 / 看板 / 时间轴 / 词云 / 命运转盘 / 匿名弹幕 / 彩蛋 / 原声试听。
   全部本地实现，无远程资源。 */

/* ---------- 动态主题皮肤 ---------- */
:root {
  --theme-hue: 44;
  --theme-accent: #f5b942;
  --theme-grad: linear-gradient(120deg, #fbd368, #f5b942 45%, #e8923c);
}

body[data-theme="恐怖"] { --theme-hue: 356; --theme-accent: #e8645f; --theme-grad: linear-gradient(120deg, #f38f8b, #e8645f 45%, #c23b36); }
body[data-theme="科幻"] { --theme-hue: 205; --theme-accent: #63b3f5; --theme-grad: linear-gradient(120deg, #8fceff, #63b3f5 45%, #3d8fe0); }
body[data-theme="爱情"] { --theme-hue: 330; --theme-accent: #f56ba6; --theme-grad: linear-gradient(120deg, #ff9fc9, #f56ba6 45%, #e04585); }
body[data-theme="动画"] { --theme-hue: 160; --theme-accent: #5ad4a6; --theme-grad: linear-gradient(120deg, #8ff0c8, #5ad4a6 45%, #34b585); }
body[data-theme="剧情"] { --theme-hue: 28; --theme-accent: #f0a35a; --theme-grad: linear-gradient(120deg, #ffc994, #f0a35a 45%, #d97c33); }
body[data-theme="悬疑"] { --theme-hue: 268; --theme-accent: #b28bf0; --theme-grad: linear-gradient(120deg, #d3b8ff, #b28bf0 45%, #8a5cd9); }
body[data-theme="动作"] { --theme-hue: 8; --theme-accent: #f0624f; --theme-grad: linear-gradient(120deg, #ff9a84, #f0624f 45%, #d03f2c); }
body[data-theme="喜剧"] { --theme-hue: 46; --theme-accent: #f2c74a; --theme-grad: linear-gradient(120deg, #ffe38f, #f2c74a 45%, #d9a62a); }

body.theme-transition {
  transition: background 0.6s ease;
}
body.theme-transition .movie-card,
body.theme-transition .note-card,
body.theme-transition .btn-primary,
body.theme-transition .brand {
  transition: background 0.6s ease, border-color 0.6s ease, color 0.6s ease;
}

/* ---------- 沉浸式全屏海报墙 ---------- */
.poster-wall {
  position: relative;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 26px 6px 34px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.wall-card {
  flex: 0 0 78vw;
  max-width: 430px;
  scroll-snap-align: center;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.45s, border-color 0.45s;
}

@media (min-width: 760px) {
  .wall-card { flex-basis: 46vw; }
}

@media (min-width: 1080px) {
  .wall-card { flex-basis: 32vw; }
}

.wall-card:hover,
.wall-card.hover {
  transform: scale(1.06) translateY(-4px);
  z-index: 2;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 185, 66, 0.35);
  border-color: rgba(245, 185, 66, 0.55);
}

.wall-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 6s linear;
}

.wall-card.hover img,
.wall-card:hover img {
  transform: scale(1.12);
  animation: wallKenburns 7s ease-in-out infinite alternate;
}

@keyframes wallKenburns {
  from { transform: scale(1.08) translate(-0.6%, -0.4%); }
  to { transform: scale(1.16) translate(0.6%, 0.5%); }
}

.wall-card .wall-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 46px 18px 16px;
  background: linear-gradient(180deg, transparent, rgba(8, 10, 16, 0.92));
  color: var(--ink);
}

.wall-card .wall-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.wall-card .wall-sub { color: var(--ink-2); font-size: 0.86rem; }

.wall-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  background: rgba(8, 10, 16, 0.72);
  color: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.wall-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(8, 10, 16, 0.35);
  opacity: 0;
  transition: opacity 0.35s;
}

.wall-card.hover .wall-play,
.wall-card:hover .wall-play { opacity: 1; }

.wall-play .play-tri { width: 0; height: 0; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent var(--accent); }

.wall-tip { position: absolute; right: 14px; bottom: 12px; z-index: 3; font-size: 0.72rem; color: rgba(255, 255, 255, 0.7); pointer-events: none; }

/* ---------- 情绪/心情选片 ---------- */
.mood-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 26px;
}

.mood-label { font-weight: 600; color: var(--ink-2); margin-right: 4px; font-size: 0.9rem; }

.mood-btn {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
}

.mood-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

.mood-btn.active {
  background: var(--theme-grad);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(245, 185, 66, 0.28);
}

/* ---------- 3D 卡片翻转 ---------- */
.flip-card { perspective: 1200px; position: relative; }

.flip-inner {
  position: relative;
  width: 100%;
  display: grid;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.flip-card.flipped .flip-inner { transform: rotateY(180deg); }

.flip-front,
.flip-back {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}

.flip-front { display: flex; flex-direction: column; }

.flip-front .movie-poster { flex: 1; }

.flip-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 20px 18px;
  background:
    radial-gradient(280px 140px at 90% -10%, rgba(245, 185, 66, 0.1), transparent 60%),
    linear-gradient(160deg, var(--surface-2), var(--bg-soft));
  border: 1px solid var(--line);
}

.flip-back h4 { margin: 0; font-family: var(--font-serif); font-size: 1.1rem; }

.flip-back .flip-meta { color: var(--ink-2); font-size: 0.82rem; }

.flip-back .flip-summary { color: var(--ink); font-size: 0.9rem; line-height: 1.6; }

.flip-back .flip-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.flip-hint { font-size: 0.72rem; color: var(--ink-3); }

/* ---------- 收藏 / 试听 ---------- */
.fav-btn {
  position: absolute;
  top: 16px;
  right: 14px;
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 10, 16, 0.6);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.fav-btn:hover { transform: scale(1.12); }

.fav-btn.on { background: rgba(232, 100, 95, 0.85); color: #fff; }

.sound-btn {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 10, 16, 0.6);
  color: var(--accent);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.sound-btn:hover { transform: scale(1.12); }
.sound-btn.playing { box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.35); animation: soundPulse 1.4s ease infinite; }

@keyframes soundPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(245, 185, 66, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(245, 185, 66, 0.1); }
}

/* ---------- 对比 ---------- */
.compare-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 26px;
  padding: 14px 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.compare-bar .cmp-slot {
  font-size: 0.86rem;
  color: var(--ink-2);
  min-width: 120px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.compare-bar .cmp-slot.filled { color: var(--accent); border-color: rgba(245, 185, 66, 0.5); }

.compare-drawer {
  margin: 10px 0 30px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 22px;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cmp-col { display: grid; gap: 10px; align-content: start; }

.cmp-col h4 { margin: 0; font-family: var(--font-serif); }

.cmp-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--ink-2);
  border-bottom: 1px dashed var(--line-soft);
  padding-bottom: 8px;
}

.cmp-row strong { color: var(--ink); font-weight: 600; }

.cmp-chart { margin-top: 20px; }
.cmp-chart canvas { width: 100%; height: 180px; display: block; }

/* ---------- 词云 ---------- */
.wc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; align-items: center; }

.wc-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.wc-chip:hover { color: var(--accent); border-color: var(--accent); }
.wc-chip.active { background: var(--theme-grad); border-color: transparent; color: var(--accent-ink); font-weight: 600; }

.wc-canvas { width: 100%; height: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }

.wc-word { cursor: pointer; transition: transform 0.2s; }

/* ---------- 金句墙 / 弹幕 ---------- */
.quote-wall { columns: 1; column-gap: 16px; }
@media (min-width: 700px) { .quote-wall { columns: 2; } }
@media (min-width: 1000px) { .quote-wall { columns: 3; } }

.quote-card {
  break-inside: avoid;
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.quote-card:hover { transform: translateY(-3px); border-color: rgba(245, 185, 66, 0.5); }

.quote-card .q-text { font-family: var(--font-serif); font-style: italic; color: var(--ink); margin: 0 0 8px; }
.quote-card .q-src { font-size: 0.8rem; color: var(--accent); }

.barrage-stage {
  position: relative;
  height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(600px 260px at 50% -40%, rgba(245, 185, 66, 0.12), transparent 65%),
    var(--bg-soft);
}

.barrage-item {
  position: absolute;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(20, 24, 40, 0.85);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 0.85rem;
  animation: barrageFly linear forwards;
  cursor: pointer;
}

.barrage-item:hover { color: var(--accent); }

@keyframes barrageFly {
  from { transform: translateX(102vw); }
  to { transform: translateX(-120%); }
}

.danmaku-form { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.danmaku-form input { flex: 1 1 240px; min-width: 0; }
.danmaku-list { display: grid; gap: 10px; margin-top: 16px; max-height: 260px; overflow: auto; padding-right: 6px; }
.danmaku-item { display: flex; gap: 10px; font-size: 0.88rem; color: var(--ink-2); border-bottom: 1px dashed var(--line-soft); padding-bottom: 8px; }
.danmaku-item strong { color: var(--accent); }

/* ---------- 推荐链 ---------- */
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.chain-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s;
}

.chain-node:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }

.chain-node img { width: 44px; height: 62px; object-fit: cover; border-radius: 6px; }

.chain-node .cn-t { font-weight: 600; font-size: 0.92rem; }
.chain-node .cn-s { font-size: 0.76rem; color: var(--ink-3); }

.chain-arrow { color: var(--accent); font-size: 1.2rem; }

/* ---------- 命运转盘 ---------- */
.wheel-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 16, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 20px;
}

.wheel-modal.open { display: flex; }

.wheel-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.wheel-canvas { width: 300px; height: 300px; margin: 0 auto 18px; }

.wheel-result { min-height: 56px; font-size: 1rem; color: var(--ink); }

.wheel-result a { font-family: var(--font-serif); font-size: 1.3rem; }

.wheel-spin {
  margin-top: 14px;
  padding: 12px 30px;
  border-radius: 999px;
  border: none;
  background: var(--theme-grad);
  color: var(--accent-ink);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(245, 185, 66, 0.24);
}

.wheel-close {
  margin-top: 12px;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 20px;
  cursor: pointer;
}

/* ---------- 彩蛋 ---------- */
.egg-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}

.egg-panel {
  position: fixed;
  z-index: 96;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: min(92vw, 460px);
  background: linear-gradient(160deg, var(--surface-2), var(--bg));
  border: 1px solid var(--accent);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s, transform 0.4s;
}

.egg-panel.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.egg-panel h3 { font-family: var(--font-serif); color: var(--accent); margin: 0 0 10px; }
.egg-panel p { color: var(--ink-2); margin: 0 0 16px; }

/* ---------- 看板 ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 28px; }

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
}

.stat-tile .st-num { font-size: 2rem; font-weight: 700; font-family: var(--font-serif); color: var(--accent); }
.stat-tile .st-label { color: var(--ink-2); font-size: 0.86rem; }

.dash-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 22px;
}

.dash-panel h3 { margin: 0 0 16px; font-family: var(--font-serif); font-size: 1.15rem; }

.dash-panel canvas { width: 100%; height: 220px; display: block; }

.dash-list { display: grid; gap: 8px; }
.dash-list .dl-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; color: var(--ink-2); border-bottom: 1px dashed var(--line-soft); padding-bottom: 8px; }
.dash-list .dl-row strong { color: var(--ink); }

/* ---------- 时间轴 ---------- */
.timeline-wrap { position: relative; }

.timeline-scroll { overflow-x: auto; padding: 10px 0 24px; -webkit-overflow-scrolling: touch; }

.timeline-track {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  width: max-content;
  min-width: 100%;
}

.tl-node {
  display: grid;
  gap: 6px;
  justify-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.tl-node:hover { transform: translateY(-4px); border-color: var(--line); background: var(--surface); }

.tl-node img { width: 64px; height: 92px; object-fit: cover; border-radius: 8px; }

.tl-node .tl-y { font-size: 0.72rem; color: var(--ink-3); }
.tl-node .tl-t { font-size: 0.72rem; color: var(--ink-2); max-width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.decade-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

.decade-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 0.86rem;
  transition: all 0.2s;
}

.decade-btn.active { background: var(--theme-grad); border-color: transparent; color: var(--accent-ink); font-weight: 600; }

/* ---------- 图谱 ---------- */
.graph-wrap { position: relative; }
.graph-wrap canvas { width: 100%; height: 560px; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.graph-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 0.84rem; color: var(--ink-2); }
.graph-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.graph-legend .lg-main::before { background: var(--accent); }
.graph-legend .lg-link::before { background: var(--ink-3); }

/* ---------- 实验室 hub ---------- */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

.lab-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 22px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.lab-card:hover { transform: translateY(-5px); border-color: rgba(245, 185, 66, 0.5); box-shadow: var(--shadow); }

.lab-card .lab-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--theme-grad);
  color: var(--accent-ink);
  font-weight: 700;
  margin-bottom: 14px;
}

.lab-card h3 { margin: 0 0 8px; font-family: var(--font-serif); font-size: 1.1rem; }
.lab-card p { margin: 0; color: var(--ink-2); font-size: 0.88rem; }

/* ---------- 通用 ---------- */
.creative-section { padding: 56px 0; }

.creative-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid rgba(245, 185, 66, 0.35);
  background: rgba(245, 185, 66, 0.08);
  margin-bottom: 12px;
}

.parallax-panel { transform: translateZ(0); }
