/* ========== Lumina 薰衣草设计系统（源自 DESIGN.md） ========== */
:root {
  --surface: #FAF9FE;
  --surface-low: #faf0ff;
  --surface-container: #f5eaff;
  --surface-high: #f1e3ff;
  --surface-highest: #ecdcff;
  --surface-lowest: #ffffff;
  --on-surface: #1F1135;
  --on-surface-variant: #4a454f;
  --primary: #7C5D9F;
  --primary-deep: #634585;
  --on-primary: #ffffff;
  --primary-fixed: #efdbff;
  --secondary: #F472B6;
  --outline: #cdc3d0;
  --outline-strong: #7c7580;
  --shadow-ambient: 0px 20px 40px rgba(31, 17, 53, 0.05);
  --radius-sm: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --font-display: 'Plus Jakarta Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Hanken Grotesk', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部导航：玻璃拟态浮动条 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 254, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--outline);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary-deep);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--secondary); }
.nav-links { display: none; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--on-surface-variant);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary-deep); }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--on-surface);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s;
  font-family: var(--font-body);
}
.lang-btn:hover { background: var(--surface-highest); }

@media (min-width: 768px) {
  .nav-inner { padding: 16px 64px; }
  .nav-links { display: flex; }
}

/* ---------- 顶部工具条（分类 + 统计，单行） ---------- */
.toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 20px 8px;
}
.toolbar::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto;
  height: 200px;
  background:
    radial-gradient(ellipse 50% 60% at 20% 40%, rgba(219, 184, 255, 0.45), transparent 70%),
    radial-gradient(ellipse 45% 55% at 80% 30%, rgba(252, 121, 189, 0.28), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 80%, rgba(239, 219, 255, 0.5), transparent 70%);
  pointer-events: none;
}
.toolbar > * { position: relative; }
@media (min-width: 768px) {
  .toolbar { padding: 14px 48px 10px; }
}

/* ---------- 统计（横排数字，靠右） ---------- */
.stats {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 18px;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}
.stat b {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--primary-deep);
}
.stat span { font-size: 11px; color: var(--on-surface-variant); }
@media (min-width: 768px) {
  .stats { gap: 24px; }
  .stat b { font-size: 20px; }
}

/* ---------- 主体容器 ---------- */
main { max-width: 1600px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { main { padding: 0 48px; } }

.section { margin-top: 16px; }

.works-main { padding-bottom: 24px; }

/* ---------- 筛选 chips ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.chip {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--outline);
  background: var(--surface-lowest);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 作品展示：3D 散落卡片（参考 Spotify-Visualiser） ---------- */
.stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  perspective: 1600px;
  perspective-origin: 50% 45%;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(219, 184, 255, .28), transparent 70%),
    radial-gradient(ellipse 40% 45% at 15% 75%, rgba(252, 121, 189, .14), transparent 65%),
    radial-gradient(ellipse 40% 45% at 85% 70%, rgba(124, 93, 159, .16), transparent 65%),
    var(--surface-lowest);
  border: 1px solid var(--outline);
  min-height: 320px;
}
.stage[data-stage="1"] {
  min-height: 620px;
}
.stage-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .05s linear;
  will-change: transform;
}

.tcard {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w, clamp(150px, 17vw, 210px));
  background: var(--surface-lowest);
  color: var(--on-surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(31, 17, 53, .14), 0 2px 8px rgba(31, 17, 53, .06);
  cursor: pointer;
  transform: translate(-50%, -50%) scale(var(--scale, 1)) translateZ(var(--z, 0px));
  animation: cardFloat var(--float-dur, 6s) ease-in-out var(--float-delay, 0s) infinite;
  will-change: transform;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.tcard:hover {
  transform: translate(-50%, -50%) scale(calc(var(--scale, 1) * 1.1)) translateZ(60px) !important;
  box-shadow: 0 36px 72px rgba(31, 17, 53, .22), 0 0 0 1px rgba(124, 93, 159, .35);
  z-index: 50;
  animation-play-state: paused;
}
/* 视频全屏/放大期间暂停浮动动画（transform 持续变化会导致全屏被浏览器强制退出） */
.tcard.fs-pause { animation-play-state: paused; }
@keyframes cardFloat {
  0%, 100% { transform: translate(-50%, -50%) scale(var(--scale, 1)) translateZ(var(--z, 0px)) translateY(0); }
  50%      { transform: translate(-50%, -50%) scale(var(--scale, 1)) translateZ(var(--z, 0px)) translateY(var(--float-amp, -10px)); }
}

.tcard-cover {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-high);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 10px;
}
.tcard-cover::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(31, 17, 53, .28));
  pointer-events: none;
}
.tcard-cover .badge {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary-deep);
  background: rgba(250, 249, 254, .85);
  backdrop-filter: blur(8px);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(205, 195, 208, .6);
}
.tcard-cover .ph-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  color: rgba(255,255,255,.85);
}
.tcard-star {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 249, 254, .92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(205, 195, 208, .6);
  color: #f5b301;
  box-shadow: 0 4px 12px rgba(31, 17, 53, .12);
}
/* 分享按钮：封面左上角（星标在右上角，不冲突） */
.tcard-share {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 249, 254, .92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(205, 195, 208, .6);
  color: var(--primary-deep);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 12px rgba(31, 17, 53, .12);
  transition: background .2s, color .2s;
}
.tcard-share:hover { background: var(--primary); color: #fff; }
/* 存桌面按钮：分享按钮右侧（粉色=保存动作），点击跳单曲页，封面即为桌面图标 */
.tcard-save {
  position: absolute;
  top: 10px;
  left: 46px;
  z-index: 4;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 249, 254, .92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(205, 195, 208, .6);
  color: var(--secondary);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 12px rgba(31, 17, 53, .12);
  transition: background .2s, color .2s;
}
.tcard-save:hover { background: var(--secondary); color: #fff; }
/* 直达链接高亮（?w= 定位到的卡片） */
.tcard.shared {
  z-index: 999;
  box-shadow: 0 0 0 3px var(--secondary), 0 36px 72px rgba(31, 17, 53, .25);
  animation-play-state: paused;
}
.tcard-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 249, 254, .92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(205, 195, 208, .6);
  color: var(--primary-deep);
  box-shadow: 0 6px 20px rgba(31, 17, 53, .18);
  cursor: pointer;
}
.tcard:hover .tcard-play {
  background: var(--primary);
  color: #fff;
  transform: translate(-50%, -50%) scale(1.08);
  transition: transform .3s cubic-bezier(.2,0,0,1), background .3s;
}
.tcard-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 3;
}
/* 全屏时完整显示画面（contain 不裁剪、留黑边），铺满视口 */
.tcard-video:fullscreen,
.tcard-video:-webkit-full-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain;
  background: #000;
}
.tcard-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 17, 53, .6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.tcard-close:hover { background: var(--primary); }
.tcard-embed-zone {
  padding: 0 10px 10px;
  background: var(--surface-lowest);
}
.tcard-embed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all .25s;
}
.tcard-embed-toggle:hover { background: var(--primary); color: #fff; }
.tcard-embed-toggle .ico { display: inline-flex; align-items: center; }
.tcard-embed-toggle .ico-close,
.tcard-embed-toggle .t-close { display: none; }
.tcard-embed-zone.open .tcard-embed-toggle .ico-close,
.tcard-embed-zone.open .tcard-embed-toggle .t-close { display: inline-flex; }
.tcard-embed-zone.open .tcard-embed-toggle .ico-open,
.tcard-embed-zone.open .tcard-embed-toggle .t-open { display: none; }
.tcard-embed {
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  display: none;
}
.tcard-embed-zone.open .tcard-embed { display: block; }
.tcard-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
/* 播放器展开时：卡片浮到最上层，舞台临时不裁剪（防止超出作品框被裁） */
.stage.unclip { overflow: visible; }
.tcard.zoomed {
  z-index: 999;
  box-shadow: 0 44px 90px rgba(31, 17, 53, .32), 0 0 0 1px rgba(124, 93, 159, .4);
}
.tcard-open {
  padding: 0 12px 10px;
  background: var(--surface-lowest);
}
.tcard-open a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-deep);
  text-decoration: none;
  border: 1px solid var(--outline);
  padding: 5px 12px;
  border-radius: 999px;
  transition: all .2s;
}
.tcard-open a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.ph-0 { background: linear-gradient(135deg, #7C5D9F, #dbb8ff); }
.ph-1 { background: linear-gradient(135deg, #a43073, #fc79bd); }
.ph-2 { background: linear-gradient(135deg, #4b5366, #bfc6dd); }
.ph-3 { background: linear-gradient(135deg, #634585, #F472B6); }

.tcard-meta {
  padding: 10px 12px 6px;
  background: var(--surface-lowest);
}
.tcard-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 3px;
}
.tcard-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--on-surface);
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tcard-sub {
  font-size: 11px;
  color: var(--on-surface-variant);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tcard-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 10px;
  border-top: 1px solid var(--surface-high);
}
.tcard-bar {
  flex: 1;
  height: 3px;
  background: var(--surface-high);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.tcard-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 30%;
  animation: tcard-progress 9s linear infinite;
}
@keyframes tcard-progress {
  0%   { width: 5%;  }
  100% { width: 95%; }
}
.tcard-btn {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.tcard-btn:hover { color: var(--secondary); }

@media (max-width: 768px) {
  .stage,
  .stage[data-stage="1"] {
    height: auto !important;
    min-height: 0;
    perspective: none;
    border-radius: var(--radius-lg);
    overflow: visible;
  }
  .stage-inner {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding: 18px;
    transform: none !important;
  }
  .tcard {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: 100%;
    transform: none;
    animation: cardFloatMobile var(--float-dur, 6s) ease-in-out var(--float-delay, 0s) infinite;
  }
  .tcard:hover { transform: scale(1.02) !important; }
}
/* 手机端轻量浮动（幅度小、不晕）：不能用带 translate(-50%,-50%) 的桌面动画 */
@keyframes cardFloatMobile {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@media (max-width: 480px) {
  .stage-inner { grid-template-columns: 1fr; }
}

.empty-tip {
  text-align: center;
  color: var(--on-surface-variant);
  padding: 60px 0;
}

/* ---------- 页脚 ---------- */
footer {
  margin-top: 8px;
  border-top: 1px solid var(--outline);
  padding: 40px 20px 32px;
  background: var(--surface-low);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  text-align: center;
}
@media (min-width: 768px) {
  footer { padding: 64px; }
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}
.footer-brand { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--on-surface); }
.footer-slogan { color: var(--on-surface-variant); font-size: 14px; margin-top: 6px; max-width: 300px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a {
  color: var(--on-surface-variant);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--outline);
  text-underline-offset: 4px;
  transition: color .2s;
}
.footer-links a:hover { color: var(--primary); }
.footer-copy { font-size: 12px; color: var(--on-surface-variant); opacity: .75; line-height: 1.8; }

/* ---------- 滚动显现动画 ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: all .8s cubic-bezier(.2,0,0,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- 语言切换 ---------- */
html[lang="en"] .lang-zh { display: none !important; }
html[lang="zh-CN"] .lang-en { display: none !important; }

/* ---------- 复制成功提示 ---------- */
#appToast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(31, 17, 53, .88);
  color: #fff;
  font-size: 13px;
  padding: 10px 22px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all .3s cubic-bezier(.2,0,0,1);
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(31, 17, 53, .25);
}
#appToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 分享直达：聚焦模式（?w= 打开时只突出目标卡片） ---------- */
.stage.focus .tcard { opacity: .08; }
.stage.focus .tcard.shared { opacity: 1; box-shadow: 0 0 0 3px var(--secondary), 0 40px 90px rgba(31, 17, 53, .3); }
#focusBack {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 9999;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--outline-strong);
  background: var(--surface-lowest);
  color: var(--primary-deep);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(31, 17, 53, .15);
  transition: all .2s;
}
#focusBack:hover { background: var(--primary); color: #fff; }
@media (max-width: 768px) {
  .stage.focus .tcard { opacity: .06; }
  #focusBack { top: 10px; right: 10px; padding: 7px 14px; font-size: 12px; }
}

/* ---------- 添加到桌面（右下角常驻） ---------- */
#installBtn {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 9998;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--outline-strong);
  background: var(--surface-lowest);
  color: var(--primary-deep);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(31, 17, 53, .15);
  transition: all .2s;
}
#installBtn:hover { background: var(--primary); color: #fff; }
#installGuide {
  position: fixed;
  inset: 0;
  background: rgba(31, 17, 53, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}
#installGuide.show { display: flex; }
.ig-card {
  background: #fff;
  border-radius: 18px;
  padding: 26px 24px;
  max-width: 330px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(31, 17, 53, .3);
}
.ig-card h3 { margin: 0 0 14px; font-size: 17px; color: var(--primary-deep); }
.ig-card p { margin: 0 0 18px; white-space: pre-line; font-size: 14px; color: #555; line-height: 1.8; }
.ig-close {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ig-close:hover { background: var(--primary-deep); }
.ig-card .ig-tip {
  margin: -8px 0 16px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}
@media (max-width: 768px) {
  #installBtn { bottom: 16px; right: 12px; padding: 8px 16px; font-size: 12px; }
}
