/* =========================================================
   水墨影院 · Pro 视觉与交互层
   依赖 ink.css（变量复用）
   ========================================================= */

/* ---------- 顶部滚动进度条 ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--seal), var(--gold), var(--jade));
  transform-origin: 0 50%; transform: scaleX(0);
  z-index: 100; pointer-events: none;
  transition: transform .12s linear, opacity .3s var(--ease);
}

/* ---------- 毛笔笔触分隔线 ---------- */
.brush-divider {
  display: block; margin: 32px auto; width: min(480px, 70%);
  height: 18px; opacity: .55;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 480 18'><path d='M4 10 C 60 2, 140 16, 220 9 S 380 2, 476 10' stroke='%231a1c1f' stroke-width='1.6' fill='none' stroke-linecap='round'/><path d='M60 9 C 120 7, 200 12, 300 9' stroke='%231a1c1f' stroke-width='.7' stroke-opacity='.6' fill='none' stroke-linecap='round'/></svg>") center / contain no-repeat;
}

/* ---------- 水墨山水 Hero ---------- */
.hero-pro {
  position: relative; overflow: hidden;
  padding: 110px 0 90px;
  isolation: isolate;
}
.hero-pro .bg-art {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
}
.hero-pro .bg-art svg { width: 100%; height: 100%; display: block; }

/* 各 SVG 层的飘动动画 */
.hero-pro .layer-cloud { animation: drift 60s var(--ease) infinite alternate; transform-origin: center; }
.hero-pro .layer-cloud-2 { animation: drift2 90s var(--ease) infinite alternate; }
.hero-pro .layer-moon  { animation: moon 9s ease-in-out infinite alternate; transform-origin: center; }
.hero-pro .layer-near  { animation: sway 14s ease-in-out infinite alternate; transform-origin: bottom center; }

@keyframes drift  { from { transform: translateX(-40px); } to { transform: translateX(50px); } }
@keyframes drift2 { from { transform: translateX(60px);  } to { transform: translateX(-50px); } }
@keyframes moon   { from { transform: translateY(0) scale(1); filter: brightness(1); }
                    to   { transform: translateY(-6px) scale(1.02); filter: brightness(1.08); } }
@keyframes sway   { from { transform: translateY(0) rotate(-.3deg); } to { transform: translateY(-3px) rotate(.3deg); } }

.hero-pro .brand-big {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 6px 14px 6px 6px; border-radius: 999px;
  background: rgba(255,255,255,.55); backdrop-filter: blur(6px);
  border: 1px solid var(--line); margin-bottom: 26px;
  font-size: 13px; letter-spacing: 4px; color: var(--ink-600);
  animation: fadeUp .9s var(--ease) both;
}
.hero-pro .brand-big .dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--seal), var(--seal-2));
  box-shadow: 0 0 0 4px rgba(179,58,58,.08);
  animation: pulse 3s var(--ease) infinite;
}

.hero-pro h1 {
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.15; letter-spacing: 8px;
  margin: 0 0 22px; font-weight: 600;
  animation: fadeUp 1s var(--ease) .1s both;
}
.hero-pro h1 .ink-mark {
  display: inline-block; position: relative; color: var(--seal);
  padding: 0 4px;
}
.hero-pro h1 .ink-mark::after {
  content: ""; position: absolute; left: -6px; right: -6px; top: -8px; bottom: -8px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='50' cy='50' r='38' fill='%23b33a3a' fill-opacity='.12'/><circle cx='50' cy='50' r='30' fill='%23b33a3a' fill-opacity='.08'/></svg>") center / contain no-repeat;
  z-index: -1; pointer-events: none;
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.08); opacity: .8; } }
@keyframes pulse   { 50% { box-shadow: 0 0 0 10px rgba(179,58,58,0); } }

.hero-pro p.lead {
  max-width: 600px; color: var(--ink-600);
  font-size: 18px; line-height: 2; letter-spacing: 2px;
  animation: fadeUp 1s var(--ease) .2s both;
}

.hero-pro .hero-cta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 36px; animation: fadeUp 1s var(--ease) .3s both;
}

.hero-pro .poem-v {
  position: absolute; right: 40px; top: 90px; bottom: 70px;
  writing-mode: vertical-rl; text-orientation: upright;
  font-size: 15px; letter-spacing: 12px;
  color: var(--ink-400); opacity: .55;
  font-style: italic;
  animation: fadeIn 1.6s var(--ease) .4s both;
  pointer-events: none;
}
@media (max-width: 880px) { .hero-pro .poem-v { display: none; } }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 卷首大轮播 ---------- */
.feature-carousel {
  position: relative;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 20px 50px -15px rgba(30,20,10,.25);
  border: 1px solid var(--line);
  background: #0f1012;
  aspect-ratio: 21 / 9;
  min-height: 260px;
}
.feature-carousel .track {
  display: flex; height: 100%;
  transition: transform .8s var(--ease);
  will-change: transform;
}
.feature-carousel .slide {
  flex: 0 0 100%; position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: #1a1c1f;
}
@media (max-width: 768px) {
  .feature-carousel { aspect-ratio: 4/5; }
  .feature-carousel .slide { grid-template-columns: 1fr; grid-template-rows: 55% 45%; }
}
.feature-carousel .slide .poster {
  position: relative; overflow: hidden;
}
.feature-carousel .slide .poster img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.04); transition: transform 8s var(--ease);
}
.feature-carousel .slide.active .poster img { transform: scale(1.12); }
.feature-carousel .slide .poster::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(15,16,18,0) 30%, rgba(15,16,18,.6) 70%, rgba(15,16,18,.95) 100%);
}
@media (max-width: 768px) {
  .feature-carousel .slide .poster::after {
    background: linear-gradient(180deg, transparent 40%, rgba(15,16,18,.9) 100%);
  }
}
.feature-carousel .slide .info {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  padding: 48px 56px; color: #f5f1e6;
  background: linear-gradient(135deg, #1a1c1f, #0f1012);
}
@media (max-width: 768px) { .feature-carousel .slide .info { padding: 24px; } }
.feature-carousel .slide .info .tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(179,58,58,.18); color: #e8bcbc;
  font-size: 12px; letter-spacing: 3px; width: fit-content;
  margin-bottom: 14px;
}
.feature-carousel .slide .info .tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--seal);
  box-shadow: 0 0 8px var(--seal);
}
.feature-carousel .slide h2 {
  margin: 0 0 8px; font-size: clamp(24px, 3vw, 40px);
  letter-spacing: 4px; font-weight: 600;
}
.feature-carousel .slide .sub {
  color: #b8bec6; letter-spacing: 2px; margin-bottom: 14px; font-size: 13px;
}
.feature-carousel .slide .meta-row {
  display: flex; gap: 16px; color: #9aa0a6; font-size: 13px; letter-spacing: 1px;
  margin-bottom: 18px;
}
.feature-carousel .slide .meta-row .rating { color: var(--gold); }
.feature-carousel .slide .desc {
  color: #c2c7cd; line-height: 1.9; letter-spacing: 1px; font-size: 14px;
  margin-bottom: 24px;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.feature-carousel .slide .btn.seal { background: var(--seal); border-color: var(--seal); }
.feature-carousel .slide .btn.ghost { border-color: rgba(255,255,255,.3); color: #fff; }
.feature-carousel .slide .btn.ghost:hover { background: rgba(255,255,255,.1); }

/* 进度指示 */
.feature-carousel .dots {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 2;
}
.feature-carousel .dots button {
  width: 26px; height: 3px; border-radius: 2px; border: 0;
  background: rgba(255,255,255,.25); cursor: pointer; padding: 0;
  transition: background .3s var(--ease), width .3s var(--ease);
  overflow: hidden; position: relative;
}
.feature-carousel .dots button.active { width: 48px; background: rgba(255,255,255,.3); }
.feature-carousel .dots button.active::after {
  content: ""; position: absolute; inset: 0;
  background: var(--paper); transform-origin: 0 50%;
  animation: dotFill 6s linear forwards;
}
@keyframes dotFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.feature-carousel .arrows {
  position: absolute; inset: 0; display: flex; justify-content: space-between;
  align-items: center; pointer-events: none; padding: 0 12px;
}
.feature-carousel .arrows button {
  pointer-events: auto;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(15,16,18,.4); color: #fff;
  font-size: 18px; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all .3s var(--ease); opacity: 0;
}
.feature-carousel:hover .arrows button { opacity: 1; }
.feature-carousel .arrows button:hover { background: rgba(179,58,58,.9); border-color: var(--seal); transform: scale(1.08); }
@media (max-width: 768px) { .feature-carousel .arrows button { opacity: 1; width: 36px; height: 36px; } }

/* ---------- 筛选 / 排序工具栏 ---------- */
.filter-bar {
  position: sticky; top: 68px; z-index: 30;
  background: rgba(245, 241, 230, .82); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  box-shadow: 0 4px 20px -10px rgba(30,20,10,.15);
}
.filter-bar .label { color: var(--ink-400); letter-spacing: 2px; font-size: 13px; margin-right: 2px; }
.filter-bar select {
  padding: 8px 32px 8px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%233a3f45' stroke-width='1.5'><path d='M1 1 L6 6 L11 1'/></svg>") right 10px center / 10px no-repeat;
  font: inherit; font-size: 13px; letter-spacing: 1px; color: var(--ink-800);
  appearance: none; cursor: pointer;
  transition: border-color .2s var(--ease);
}
.filter-bar select:hover { border-color: var(--ink-600); }
.filter-bar .spacer { flex: 1; }
.filter-bar .total { color: var(--ink-400); font-size: 13px; letter-spacing: 2px; }
.filter-bar .total b { color: var(--ink-900); font-weight: 600; margin: 0 4px; }

@media (max-width: 768px) {
  .filter-bar { top: 0; border-radius: 10px; padding: 10px 12px; gap: 10px; }
  .filter-bar .label { display: none; }
}

/* ---------- 卡片增强 ---------- */
.card {
  /* override：更精致的阴影与过渡 */
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 36px -14px rgba(30,20,10,.28); }
.card .poster img { transition: transform .9s var(--ease), filter .9s var(--ease); }
.card .hover-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .3s var(--ease);
  background: radial-gradient(circle at center, rgba(15,16,18,.3), rgba(15,16,18,.6));
  z-index: 1;
}
.card:hover .hover-play { opacity: 1; }
.card .hover-play .play-icon {
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,.95); color: var(--ink-900);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
  transform: scale(.7); transition: transform .35s var(--ease);
}
.card:hover .hover-play .play-icon { transform: scale(1); }
.card .hover-play .play-icon::before {
  content: ""; width: 0; height: 0;
  border-left: 14px solid currentColor;
  border-top: 9px solid transparent; border-bottom: 9px solid transparent;
  margin-left: 4px;
}

/* 卡片图片模糊占位 → 加载完成渐显 */
.card .poster img {
  background: linear-gradient(135deg, #ece6d4, #dcd2b8);
}
.card .poster img.is-loading { filter: blur(12px) saturate(.6); opacity: .7; }
.card .poster img.is-loaded  { filter: none; opacity: 1; transition: filter .6s var(--ease), opacity .6s var(--ease); }

/* ---------- 骨架屏 ---------- */
.skeleton {
  position: relative; overflow: hidden; background: rgba(20,20,20,.06); border-radius: 10px;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: shimmer 1.6s var(--ease) infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.card-skel {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: rgba(255,255,255,.4);
}
.card-skel .poster-skel { aspect-ratio: 2/3; }
.card-skel .line { height: 10px; border-radius: 4px; margin: 10px 16px; }
.card-skel .line.w70 { width: 70%; }
.card-skel .line.w40 { width: 40%; margin-bottom: 16px; }

/* ---------- 交错淡入 ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 章节标题增强 ---------- */
.section-title-pro {
  display: flex; align-items: baseline; gap: 14px;
  font-size: 28px; letter-spacing: 6px; font-weight: 600;
  position: relative; padding-left: 18px;
}
.section-title-pro::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 10px; width: 6px;
  background: linear-gradient(var(--ink-900), var(--seal));
  border-radius: 3px;
}
.section-title-pro small {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink-400); font-size: 14px; letter-spacing: 4px; font-weight: 400;
}
.section-title-pro .brush {
  position: absolute; left: 18px; bottom: -8px; height: 6px; width: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 6' preserveAspectRatio='none'><path d='M2 3 Q 60 0 110 3 T 198 3' stroke='%231a1c1f' stroke-opacity='.6' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") center/100% 100% no-repeat;
  transition: width 1s var(--ease);
}
.section-title-pro.in .brush { width: 120px; }

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 80;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.8); backdrop-filter: blur(8px);
  color: var(--ink-800); cursor: pointer;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: all .3s var(--ease);
  font-size: 18px;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--ink-900); color: var(--paper); border-color: var(--ink-900); transform: translateY(-2px); }

/* ---------- 抽屉遮罩 ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(15,16,18,.45);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; z-index: 55;
  transition: opacity .3s var(--ease);
}
.drawer-mask.show { opacity: 1; pointer-events: auto; }

/* ---------- Toast 堆栈 ---------- */
.toast-stack {
  position: fixed; top: 24px; right: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast-stack .toast-item {
  background: rgba(15,16,18,.92); color: var(--paper);
  padding: 12px 18px 12px 14px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.35);
  letter-spacing: 2px; font-size: 14px;
  transform: translateX(120%); opacity: 0;
  transition: all .35s var(--ease);
  backdrop-filter: blur(8px);
  min-width: 180px; max-width: 360px;
  pointer-events: auto;
  border-left: 3px solid var(--jade);
}
.toast-stack .toast-item.show { transform: none; opacity: 1; }
.toast-stack .toast-item.error   { border-left-color: var(--seal); }
.toast-stack .toast-item.warning { border-left-color: var(--gold); }
.toast-stack .toast-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--jade); flex: none; }
.toast-stack .toast-item.error   .dot { background: var(--seal); }
.toast-stack .toast-item.warning .dot { background: var(--gold); }

/* 隐藏旧的单一 toast 节点视觉（由 ux.js 接管） */
.toast { display: none !important; }

/* ---------- 面包屑 ---------- */
.crumb {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-400); letter-spacing: 2px; font-size: 13px;
  margin: 20px 0 8px;
}
.crumb a { transition: color .2s var(--ease); }
.crumb a:hover { color: var(--ink-900); }
.crumb .sep { opacity: .5; }

/* ---------- View Transitions（跨文档） ---------- */
@view-transition { navigation: auto; }

@supports (view-transition-name: a) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: .55s;
    animation-timing-function: cubic-bezier(.22,.61,.36,1);
  }
  ::view-transition-old(root) { animation-name: vt-out; }
  ::view-transition-new(root) { animation-name: vt-in; }
}
@keyframes vt-out { to { opacity: 0; transform: scale(.985); } }
@keyframes vt-in  { from { opacity: 0; transform: scale(1.01); } }

/* 海报作为 view transition 元素，实现连续感 */
.card .poster img.vt-active { view-transition-name: poster; }
.player-wrap.vt-active { view-transition-name: poster; }

/* ---------- 空态插图 ---------- */
.empty-pro {
  text-align: center; padding: 70px 20px; color: var(--ink-400);
}
.empty-pro svg { width: 120px; height: 120px; opacity: .55; margin-bottom: 14px; }
.empty-pro .msg { letter-spacing: 4px; }

/* ---------- 播放页增强 ---------- */
.watch-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 22px;
}
.watch-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.5);
  color: var(--ink-600); font-size: 13px; letter-spacing: 2px;
  transition: all .25s var(--ease);
}
.watch-back:hover { background: var(--ink-900); color: var(--paper); border-color: var(--ink-900); }

.player-wrap {
  /* 增加柔和周边发光 */
  position: relative;
}
.player-wrap::before {
  content: ""; position: absolute; inset: -20px; z-index: -1; border-radius: 28px;
  background: radial-gradient(closest-side, rgba(15,16,18,.3), transparent 70%);
  opacity: .8; pointer-events: none;
}

/* ---------- 水波纹点击反馈 ---------- */
.btn, .chip { position: relative; overflow: hidden; }
.ripple {
  position: absolute; border-radius: 50%;
  background: currentColor; opacity: .22;
  transform: scale(0); animation: ripple .55s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

/* ---------- 减少动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- 其他：印章悬停 ---------- */
.brand .seal {
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.brand:hover .seal { transform: rotate(2deg) scale(1.05); box-shadow: 0 6px 16px rgba(179,58,58,.45); }

/* ---------- 键盘焦点样式 ---------- */
:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 3px;
  border-radius: 6px;
}

/* 长列表性能 */
.grid { contain: layout style; }
.grid > * { content-visibility: auto; contain-intrinsic-size: 360px; }
