/* ============================================
   GY · 天空之隙 — 主样式表
   清晨天空 · 淡蓝色调
   ============================================ */

/* --- 键盘焦点可见性 — 主题化焦点环（按明暗背景取对比度足够的颜色） --- */
:focus-visible {
  outline: 2px solid #3E7FA5;
  outline-offset: 2px;
}
html.night-mode :focus-visible {
  outline-color: #9FD1F0;
}

/* --- 通用 hover 防抖 ---
   圆形元素 hover 时 scale 放大可能导致鼠标在边界处反复进出，
   触发快速闪烁。通过不可见伪元素扩大热区来解决。 */
.social-link::after,
.music-btn::after,
.music-btn--sm::after {
  content: '';
  position: absolute;
  /* 在元素周围扩展 6px 热区 */
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  pointer-events: auto;
  z-index: -1;
}

/* --- CSS 变量 --- */
:root {
  /* 天空渐变 */
  --sky-top: #DCEAF3;
  --sky-mid: #B0D2E7;
  --sky-bot: #8DBAD3;
  /* 文字层级 */
  --text-primary: #0F2A3D;
  --text-secondary: #3A6A80;
  --text-muted: #6E90A0;
  /* 强调色 */
  --accent: #89C4E1;
  --accent-hover: #6DB3D4;
  --warm-accent: #E8B860;
  /* 强调色层级 */
  --accent-soft: rgba(137, 196, 225, 0.25);
  --accent-glow: rgba(137, 196, 225, 0.45);
  /* 光晕 */
  --glow-color: rgba(168, 212, 232, 0.5);
  /* 星图粒子调色 — 白天偏浅蓝半透，叠在浅蓝纯色底上若隐若现 */
  --star-rgb: 120, 162, 192;          /* 自由粒子点 */
  --star-line-rgb: 140, 178, 204;     /* 星座连线 */
  --star-meteor-rgb: 190, 215, 230;   /* 流星拖尾 */
  --cloud-white: rgba(255, 255, 255, 0.75);
  /* 卡片 */
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.55);
  /* 字体 */
  --font-display: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', cursive, serif;
  --font-cn: "PingFang SC", "Microsoft YaHei", "微软雅黑", "Noto Sans SC", system-ui, sans-serif;
  --font-en: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  /* 过渡 */
  --transition-fast: 0.25s cubic-bezier(0.2, 0, 0, 1);

  /* 动效体系 — Playful 个性 + 梦幻天空 */
  --ease-playful: cubic-bezier(0.34, 1.56, 0.64, 1);       /* 弹跳入场（弹性回弹 ~12%） */
  --ease-playful-soft: cubic-bezier(0.4, 1.3, 0.6, 1);     /* 轻微弹跳（~8%） */
  --ease-premium: cubic-bezier(0.4, 0, 0.2, 1);            /* 优雅缓动（梦幻层用） */
  --ease-snappy: cubic-bezier(0.2, 0, 0, 1);               /* 快速响应（按钮按下） */
  --dur-instant: 0.08s;
  --dur-quick: 0.15s;
  --dur-standard: 0.3s;
  --dur-slow: 0.5s;
}

/* --- 全局重置 --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 全局：减少移动端双击缩放延迟 */
button,
a,
select {
  touch-action: manipulation;
}

body {
  font-family: var(--font-cn);
  color: var(--text-primary);
  background: var(--sky-mid); /* 整站纯色背景（白天浅蓝/夜间深蓝，变量驱动） */
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  cursor: default;
  line-height: 1.7;
  /* 禁止移动端下拉刷新导致的白边 */
  overscroll-behavior: none;
  /* 刘海屏 / 底部指示条安全区适配 */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* hidden 属性优先于任何布局规则。
   作者样式表里的 display 会盖掉浏览器默认的 [hidden] { display: none }，
   用 hidden 控制的元素（设置遮罩、清除选择按钮）会因此常显、白占合成层 */
[hidden] {
  display: none !important;
}

/* ============================================
   页面加载进度条
   ============================================ */
#load-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
}
#load-bar-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--warm-accent));
  transition: width 0.3s ease-out;
  /* 完成时快速消失 */
}
#load-bar-fill.done {
  width: 100%;
  opacity: 0;
  transition: width 0.15s ease-out, opacity 0.4s ease-out;
}

/* --- 粒子画布 --- */
#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* --- 云层（视差容器） --- */
.clouds-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/*
  云朵结构：
  - .cloud-drift：负责绝对定位 + CSS 漂移动画（translateX 从左到右无限循环）
  - .cloud：       纯 CSS 云朵造型（椭圆拼接），不参与 JS 交互
*/

/* 漂移容器 */
.cloud-drift {
  position: absolute;
  left: 0;
  animation: cloud-drift linear infinite;
  animation-duration: var(--drift-dur, 45s);
  animation-delay: var(--drift-delay, 0s);
  will-change: transform;
}

.cloud-drift--far  { --drift-dur: 58s; top: 10%; }
.cloud-drift--mid  { --drift-dur: 45s; top: 52%; }
.cloud-drift--near { --drift-dur: 35s; top: 30%; }

@keyframes cloud-drift {
  0%   { transform: translateX(-540px) translateY(0px); }
  25%  { transform: translateX(calc(25vw - 135px)) translateY(-14px); }
  50%  { transform: translateX(calc(50vw - 50px)) translateY(8px); }
  75%  { transform: translateX(calc(75vw + 40px)) translateY(-10px); }
  100% { transform: translateX(calc(100vw + 100px)) translateY(0px); }
}

/* 云朵本体 — 用多个椭圆拼成蓬松的形状 */
.cloud {
  position: relative;
}

.cloud span {
  position: absolute;
  background: var(--cloud-white);
  border-radius: 50%;
  filter: blur(6px);
}

/* --- 远层云（小而淡） --- */
.cloud--far {
  width: 220px;
  height: 90px;
}

.cloud--far span:nth-child(1) {
  width: 130px; height: 60px;
  top: 10px; left: 20px;
}

.cloud--far span:nth-child(2) {
  width: 100px; height: 50px;
  top: 0; left: 70px;
}

.cloud--far span:nth-child(3) {
  width: 80px; height: 40px;
  top: 20px; left: 110px;
}

/* --- 中层云 --- */
.cloud--mid {
  width: 340px;
  height: 130px;
}

.cloud--mid span:nth-child(1) {
  width: 180px; height: 80px;
  top: 20px; left: 30px;
}

.cloud--mid span:nth-child(2) {
  width: 150px; height: 90px;
  top: 0; left: 110px;
}

.cloud--mid span:nth-child(3) {
  width: 120px; height: 70px;
  top: 25px; left: 200px;
}

.cloud--mid span:nth-child(4) {
  width: 100px; height: 55px;
  top: 45px; left: 140px;
}

/* --- 近层云（大而淡） --- */
.cloud--near {
  width: 460px;
  height: 170px;
}

.cloud--near span:nth-child(1) {
  width: 240px; height: 110px;
  top: 20px; left: 40px;
}

.cloud--near span:nth-child(2) {
  width: 200px; height: 120px;
  top: 10px; left: 160px;
}

.cloud--near span:nth-child(3) {
  width: 160px; height: 80px;
  top: 40px; left: 280px;
}

/* --- 鼠标跟随飞鱼（宫崎骏风格） --- */
.cursor-fish {
  position: fixed;
  z-index: 0;
  /* 鱼贴在光标附近（最近 62px），自身对角半径约 73px —— 参与命中时会偶发盖住
     光标下方的按钮，表现为"点一次没反应"。指针事件穿透即可；
     点击涟漪与受惊逃跑走的是 document 上的全局监听，不受影响 */
  pointer-events: none;
  width: 104px;
  height: 84px;
  transform: translate(-42.1%, -51.6%);
  transform-origin: 42.1% 51.6%; /* 旋转轴 = 鱼身体心 */
  opacity: 0;
  transition: opacity 0.6s var(--ease-premium);
  filter:
    drop-shadow(0 0 10px rgba(137, 196, 225, 0.45))
    drop-shadow(0 0 3px  rgba(232, 244, 253, 0.5));
  will-change: transform;
}

.cursor-fish.visible {
  opacity: 0.9;
}

/* ---- 魔法光晕 ---- */
.cursor-fish .fish-aura {
  fill: var(--accent);
  opacity: 0.15;
  transform-origin: 32px 32px;
  animation: aura-pulse 2.5s ease-in-out infinite;
}

@keyframes aura-pulse {
  0%, 100% { opacity: 0.1; transform: scale(0.85); }
  50%      { opacity: 0.22; transform: scale(1.1); }
}

/* ---- 鱼身 ---- */
.cursor-fish .fish-body {
  fill: var(--accent);
}

/* ---- 尾鳍 — 如水袖般飘动 ---- */
.cursor-fish .fish-tail {
  fill: var(--accent);
  opacity: 0.82;
  transform-origin: 44px 32px;
  animation: fish-tail-flow 1.2s ease-in-out infinite;
}

@keyframes fish-tail-flow {
  0%, 100% { transform: rotate(0deg) scaleX(1); }
  30%      { transform: rotate(6deg) scaleX(0.94); }
  70%      { transform: rotate(-5deg) scaleX(1.04); }
}


/* ---- 翅膀 — 半透明梦幻翅（水平翻转） ---- */
.cursor-fish .fish-wing {
  fill: var(--sky-top);
  opacity: 0.52;
}

/* 振翅动画：模拟昆虫高速振翅 */
@keyframes wing-flutter {
  0%, 100% { transform: scaleY(1); }
  45%      { transform: scaleY(0.18); }
  55%      { transform: scaleY(0.18); }
}

.cursor-fish .fish-wing--upper {
  transform-origin: 46px 26px;
  animation: wing-flutter 0.16s ease-in-out infinite;
}

.cursor-fish .fish-wing--upper-small {
  transform-origin: 42px 26px;
  animation: wing-flutter 0.16s ease-in-out infinite 0.03s;
}

.cursor-fish .fish-wing--lower {
  transform-origin: 46px 38px;
  animation: wing-flutter 0.16s ease-in-out infinite 0.08s;
}

.cursor-fish .fish-wing--lower-small {
  transform-origin: 42px 38px;
  animation: wing-flutter 0.16s ease-in-out infinite 0.11s;
}

/* ---- 眼睛 — 宫崎骏式大眼萌 ---- */
.cursor-fish .fish-eye-white {
  fill: #fff;
}

.cursor-fish .fish-eye-pupil {
  fill: var(--text-primary);
}

.cursor-fish .fish-eye-shine {
  fill: #fff;
}

/* ---- 魔法星屑 — 闪烁飘散 ---- */
.cursor-fish .fish-sparkle {
  fill: #fff;
  opacity: 0;
}

@keyframes sparkle {
  0%, 100% { opacity: 0;   transform: scale(0.4); }
  40%      { opacity: 0.7; transform: scale(1.3); }
  60%      { opacity: 0.7; transform: scale(1.3); }
}

.cursor-fish .fish-sparkle--1 { animation: sparkle 1.6s ease-in-out infinite; }
.cursor-fish .fish-sparkle--2 { animation: sparkle 1.9s ease-in-out infinite 0.5s; }
.cursor-fish .fish-sparkle--3 { animation: sparkle 2.2s ease-in-out infinite 0.9s; }
.cursor-fish .fish-sparkle--4 { animation: sparkle 1.7s ease-in-out infinite 1.3s; }
.cursor-fish .fish-sparkle--5 { animation: sparkle 2.0s ease-in-out infinite 0.3s; }
.cursor-fish .fish-sparkle--6 { animation: sparkle 1.8s ease-in-out infinite 0.7s; }
.cursor-fish .fish-sparkle--7 { animation: sparkle 2.3s ease-in-out infinite 1.1s; }

/* ---- 点击涟漪（与星图画布涟漪光晕统一） ---- */
.click-ripple {
  position: fixed;
  z-index: 5;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: radial-gradient(circle, rgba(168, 212, 232, 0.2) 0%, rgba(168, 212, 232, 0.05) 60%, transparent 100%);
  box-shadow:
    0 0 40px rgba(168, 212, 232, 0.3),
    0 0 80px rgba(168, 212, 232, 0.15),
    inset 0 0 15px rgba(255, 255, 255, 0.25);
  pointer-events: none;
  animation: ripple-expand 1.2s ease-out forwards;
}

@keyframes ripple-expand {
  0%   { transform: scale(0.1); opacity: 0.9; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* --- 主内容区 --- */
.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem;
  text-align: center;
  /* 防止 hero 内容拦截下方区域的事件（飞鱼点击等） */
  pointer-events: none;
}

/* hero 内部可交互元素恢复事件 */
.hero > * {
  pointer-events: auto;
}

/* --- 头像 --- */
.avatar-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 1.8rem;
  transition: transform 0.4s var(--ease-playful-soft);
  opacity: 0;
  animation: fade-in 1.5s 0.15s var(--ease-premium) forwards;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.avatar-wrapper:hover {
  transform: scale(1.08);
}

/* 光晕环 — 基础光晕常驻，呼吸感由伪元素的 opacity 承担（只走合成，不必每帧重绘阴影） */
.avatar-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 0 30px var(--glow-color),
    0 0 80px rgba(168, 212, 232, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  animation: ring-breathe 4s ease-in-out infinite;
}

/* 呼吸时叠加的那层光晕 */
.avatar-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    0 0 45px rgba(168, 212, 232, 0.7),
    0 0 110px rgba(168, 212, 232, 0.45);
  opacity: 0;
  animation: ring-glow 4s ease-in-out infinite;
}

@keyframes ring-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

@keyframes ring-glow {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  /* 头像加载前的占位 */
  background: linear-gradient(135deg, var(--sky-mid), var(--accent));
}

/* 头像加载失败时隐藏 */
.avatar.is-error {
  opacity: 0;
  pointer-events: none;
}

/* 头像占位（没有图片时显示） */
.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-mid), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

.avatar-placeholder span {
  font-size: 2.4rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* --- 名字 --- */
.name {
  font-family: var(--font-cn);
  font-size: 2.8rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.6);
  animation: fade-up 0.6s 0.2s var(--ease-playful) both;
}

/* --- 一句话介绍 --- */
.intro {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 2;
  max-width: 380px;
  margin-bottom: 2.2rem;
  white-space: normal;
  animation: fade-up 0.6s 0.38s var(--ease-playful) both;
}

/* --- 社交链接 --- */
.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  gap: clamp(0.8rem, 3vw, 1.5rem);
  margin-bottom: 3rem;
  animation: fade-up 0.6s 0.55s var(--ease-playful) both;
}

.social-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(44px, 10vw, 48px);
  height: clamp(44px, 10vw, 48px);
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-primary);
  transition:
    transform 0.25s var(--ease-playful-soft),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
  text-decoration: none;
}

.social-link:hover {
  transform: translateY(-4px) scale(1.08);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 28px rgba(137, 196, 225, 0.4);
  color: var(--warm-accent);
}

.social-link:active {
  transform: translateY(-1px) scale(0.96);
  transition: transform var(--dur-instant) var(--ease-snappy);
}

.social-icon {
  width: clamp(18px, 5vw, 22px);
  height: clamp(18px, 5vw, 22px);
  fill: currentColor;
}

/* --- 上浮入场动画 --- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(36px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   音乐播放器 — iOS 控制中心卡片风格
   ┌──────────────────────────┐
   │  曲名                     │  第1行 .music-label-wrap
   ├──────────────────────────┤
   │     ⏮    ▶⏸    ⏭        │  第2行 .music-controls
   ├──────────────────────────┤
   │  ═══════进度══════        │  第3行 .progress-wrap
   │  0:00 ──────── 0:00      │
   ├──────────────────────────┤
   │  ☰   🔀    🔊 ═══  20%  │  第4行 .music-bottom
   └──────────────────────────┘
   设计个性：iOS 半透明毛玻璃 + 细圆角 + 统一间距
   ============================================ */

.music-player {
  position: relative;
  z-index: 2; /* 确保音乐播放器在飞鱼 (z-index:0) 上方，可正常交互 */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 0.65rem 0.8rem 0.6rem;
  box-shadow: 0 4px 24px rgba(30, 59, 77, 0.08);
  margin-top: 0.8rem;
  margin-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  width: min(300px, 92vw);
  transition:
    opacity 0.35s var(--ease-premium),
    box-shadow 0.4s var(--ease-premium),
    transform 0.35s var(--ease-playful-soft);
}

/* 桌面端空闲半透明 */
@media (hover: hover) and (pointer: fine) {
  .music-player {
    opacity: 0.58;
  }
  .music-player:hover {
    opacity: 1;
    box-shadow: 0 8px 36px rgba(30, 59, 77, 0.12);
    transform: translateY(-2px);
  }
}

/* ---- 曲名（第1行，按钮语义：可点击复制 + 键盘可达） ---- */
.music-label {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
  padding: 0.1rem 0;
  text-align: center;
  transition: color 0.2s ease;
  /* 原生 button 样式重置 */
  border: none;
  background: none;
  font-family: inherit;
  line-height: inherit;
}

/* 播放后曲名变深色突出 */
.music-label.playing {
  font-weight: 500;
  color: var(--text-primary);
}

.music-label:hover {
  color: var(--accent-hover);
}

.music-label.loading {
  cursor: default;
  animation: label-pulse 1.2s ease-in-out infinite;
}
.music-label.loading:hover {
  color: var(--text-primary);
}

@keyframes label-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* 列表按钮打开状态 */
#music-list-btn.open {
  color: var(--accent-hover);
}

/* ---- 播放列表下拉面板 ---- */
.music-playlist {
  max-height: 0;
  overflow: hidden;
  /* 与 .music-player 的左右内边距（0.8rem）对齐，列表满宽贴到卡片边缘 */
  margin: 0 -0.8rem;
  border-radius: 0;
  transition: max-height 0.25s cubic-bezier(0.2, 0, 0, 1);
}
.music-playlist.open {
  /* 64px 为滚动区之上的标签栏 + 提示条预留：标签栏约 38px、提示条约 22px。
     留够这段高度，降级环境下提示条出现时列表底部与下方分隔线才不会被裁掉 */
  max-height: calc(175px + 64px);
}

/* 列表分隔线 */
.playlist-divider {
  height: 1px;
  margin: 0 0.9rem;
  background: var(--card-border);
  flex-shrink: 0;
}

/* 底部分隔线 — 上下留间距，和按钮行拉开 */
.playlist-divider-bottom {
  height: 1px;
  margin: 0.45rem 0.9rem 0.25rem;
  background: var(--card-border);
  flex-shrink: 0;
}

.playlist-inner {
  max-height: 175px;
  overflow-y: auto;
  padding: 0.35rem 0 0.65rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(137, 196, 225, 0.3) transparent;
  /* 防止滚动到边界时触发页面橡皮筋效果 */
  overscroll-behavior-y: contain;
  /* 允许垂直方向触摸滚动 */
  touch-action: pan-y;
}
.playlist-inner::-webkit-scrollbar {
  width: 4px;
}
.playlist-inner::-webkit-scrollbar-track {
  background: transparent;
}
.playlist-inner::-webkit-scrollbar-thumb {
  background: rgba(137, 196, 225, 0.35);
  border-radius: 4px;
}

/* ---- 本地音乐提示条（位于标签栏与列表之间，仅本地标签下显示） ---- */
.playlist-local {
  position: relative;
  flex-shrink: 0;
}

/* 降级环境提示（仅本次浏览有效） */
.playlist-local-hint {
  margin: 0;
  padding: 0 0.9rem 0.4rem;
  font-size: 0.6rem;
  line-height: 1.35;
  color: var(--text-muted);
  opacity: 0.9;
}

/* ---- 列表切换标签页 ---- */
.playlist-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.4rem 0.7rem 0.15rem;
  flex-shrink: 0;
}
.playlist-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.32rem 0.4rem;
  border: 0;
  border-radius: 9px;
  background: none;
  font-family: inherit;
  font-size: 0.68rem;
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.playlist-tab:hover {
  background: var(--accent-soft);
  color: var(--text-primary);
}
.playlist-tab[aria-selected='true'] {
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 500;
}
.playlist-tab-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  fill: currentColor;
}
.playlist-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playlist-tab-count {
  flex-shrink: 0;
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.65;
}

/* 空列表引导按钮（本地列表为空时的主要入口） */
.playlist-cta {
  display: block;
  width: calc(100% - 1.4rem);
  margin: 0.3rem 0.7rem 0.5rem;
  padding: 0.5rem 0.7rem;
  border: 1px dashed var(--accent-hover);
  border-radius: 10px;
  background: none;
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--accent-hover);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}
.playlist-cta:hover {
  background: var(--accent-soft);
}
.playlist-cta-hint {
  display: block;
  margin: 0 0.7rem 0.5rem;
  font-size: 0.6rem;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
}

/* 列表项 */
.playlist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.playlist-item:hover {
  background: var(--accent-soft);
  color: var(--text-primary);
}

/* 空歌单提示 */
.playlist-empty {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.8rem 0.9rem;
  user-select: none;
}
/* 序号 */
.playlist-item .pl-index {
  flex-shrink: 0;
  width: 1.3em;
  text-align: right;
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}
/* 曲名（允许截断） */
.playlist-item .pl-name {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* 当前播放项指示 */
.playlist-item.current {
  color: var(--accent-hover);
  font-weight: 500;
  background: rgba(137, 196, 225, 0.08);
}
.playlist-item.current::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 0 2px 2px 0;
  background: var(--accent-hover);
}
.playlist-item.current .pl-index {
  color: var(--accent-hover);
  opacity: 0.8;
}

/* 仅供辅助技术/程序读取的隐藏元素 */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- 曲名行改为横向 flex 容纳按钮 ---- */
.music-label-wrap {
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==================== 第二行：上一首 · 播放 · 下一首 ==================== */

.music-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.15rem;
}

/* --- 播放/暂停主按钮 --- */
.music-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background var(--transition-fast),
    transform 0.22s var(--ease-playful-soft),
    box-shadow 0.22s var(--ease-playful-soft),
    color var(--transition-fast);
}

.music-btn:hover {
  background: rgba(255, 255, 255, 0.94);
  transform: scale(1.08);
  box-shadow: 0 4px 20px rgba(137, 196, 225, 0.4);
}

.music-btn:active {
  animation: btn-press 0.28s var(--ease-snappy);
}

@keyframes btn-press {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.92); }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.music-btn.playing {
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 3px 18px rgba(137, 196, 225, 0.35);
}

/* 小按钮 */
.music-btn--sm {
  position: relative;
  width: 36px;
  height: 36px;
  background: transparent;
  border-radius: 50%;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.2s ease,
    transform 0.2s var(--ease-playful-soft),
    color 0.2s ease;
}

.music-btn--sm:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-primary);
  transform: scale(1.12);
}

.music-btn--sm:active {
  transform: scale(0.85);
  transition: transform var(--dur-instant) var(--ease-snappy);
}

.music-btn--sm.mode-list,
.music-btn--sm.mode-single,
.music-btn--sm.mode-shuffle {
  color: var(--accent-hover);
  background: rgba(255, 255, 255, 0.4);
}

.music-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.music-icon-sm {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* 播放/暂停图标切换 */
#music-icon-pause { display: none; }
#music-icon-play  { display: block; }
.music-btn.playing #music-icon-play  { display: none; }
.music-btn.playing #music-icon-pause { display: block; }

/* ==================== 提示气泡 ==================== */

.tip-wrap,
.mode-wrap,
.music-label-wrap {
  position: relative;
  display: flex;
  flex-shrink: 0;
}

.social-tip,
.mode-tip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  font-size: 0.7rem;
  color: var(--text-primary);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(137, 196, 225, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-playful-soft);
}

.tip-wrap:hover .social-tip,
.mode-wrap:hover .mode-tip,
.music-label-wrap.show-tip:hover .social-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==================== 第三行：进度条 ==================== */

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}

/* 进度条容器 — 扩大热区，左右留空给滑块 */
.progress-bar {
  flex: 1;
  height: 14px;              /* 热区 14px */
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  margin: 0 5px;              /* 滑块不遮挡时间标签 */
}

/* 轨道 — 4px 细线 */
.progress-bar::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  height: 4px;
  background: var(--accent-soft);
  border-radius: 2px;
}

/* 已播放填充 */
.progress-fill {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
}

/* 拖拽滑块 — 始终可见 */
.progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(30, 59, 77, 0.25),
    0 0 0 2px var(--accent-hover);
}

.progress-bar:hover .progress-fill::after {
  transform: translateY(-50%) scale(1.2);
}

.progress-bar:active .progress-fill::after {
  transform: translateY(-50%) scale(0.85);
}

/* 时间标签 */
.time-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  user-select: none;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ==================== 第四行：模式 + 音量 ==================== */

.music-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* 音量范围条 — 和进度条同样的自定义 div 系统 */
.volume-bar-wrap {
  flex: 1;
  height: 14px;              /* 热区 14px */
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 60px;
}

/* 轨道 — 4px 细线 */
.volume-bar-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  height: 4px;
  background: var(--accent-soft);
  border-radius: 2px;
}

/* 已填充部分 */
.volume-fill {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  width: 20%;                /* 默认 20%，JS 动态更新 */
  pointer-events: none;
}

/* 拖拽滑块 — 始终可见，和进度条同款 */
.volume-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(30, 59, 77, 0.25),
    0 0 0 2px var(--accent-hover);
}

.volume-bar-wrap:hover .volume-fill::after {
  transform: translateY(-50%) scale(1.2);
}

.volume-bar-wrap:active .volume-fill::after {
  transform: translateY(-50%) scale(0.85);
}

.volume-pct {
  font-size: 0.6rem;
  color: var(--text-secondary);
  min-width: 30px;
  text-align: right;
  user-select: none;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* --- 复制提示气泡 --- */
.toast {
  position: fixed;
  bottom: 1.8rem;
  left: 50%;
  /* 必须高于设置遮罩（1000）：在设置面板里操作后的提示要看得见 */
  z-index: 1001;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 0.65rem 1.2rem;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(137, 196, 225, 0.3);
  max-width: 85vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.35s var(--ease-playful), transform 0.45s var(--ease-playful);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================
   页脚
   ============================================ */

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2rem max(2.5rem, env(safe-area-inset-bottom));
  margin-top: 5rem;
}

.footer-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 0 auto 1.5rem;
  border-radius: 1px;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--warm-accent);
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.footer-visitor {
  margin-top: 0.15rem;
  font-size: 0.65rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* --- 响应式适配 --- */
@media (max-width: 640px) {
  .hero {
    padding: 1.5rem;
  }

  .avatar-wrapper {
    width: 140px;
    height: 140px;
    margin-bottom: 1.4rem;
  }

  .name {
    font-size: 2.2rem;
  }

  .intro {
    font-size: 0.95rem;
    max-width: 280px;
  }

  .social-links {
    gap: 1rem;
  }

  /* 移动端 — 播放器与 intro 同宽 */
  .music-player {
    width: 280px;
    max-width: 100%;
    padding: 0.6rem 0.85rem;
    gap: 0.5rem;
    border-radius: 22px;
  }
  .music-playlist {
    border-radius: 0;
    margin: 0 -0.85rem -0.6rem;
  }
  .music-playlist.open {
    max-height: min(calc(175px + 64px), calc(40vh + 64px));
  }
  .playlist-inner {
    max-height: min(175px, 40vh);
  }
  .playlist-tab {
    font-size: 0.66rem;
    padding: 0.3rem 0.35rem;
  }
  .playlist-local-hint {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .music-btn {
    width: 36px;
    height: 36px;
  }

  .music-btn--sm {
    width: 30px;
    height: 30px;
  }

  .music-icon {
    width: 19px;
    height: 19px;
  }

  .music-icon-sm {
    width: 15px;
    height: 15px;
  }


  .time-label {
    font-size: 0.56rem;
  }

  .volume-pct {
    font-size: 0.56rem;
    min-width: 26px;
  }

  .music-label {
    font-size: 0.72rem;
  }

}

/* 云层降级 — 触屏设备模糊压制 + 高分屏透明度优化 */
@media (hover: none) and (pointer: coarse) {
  .cloud span { filter: blur(3px); }
}
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 3dppx) {
  .cloud span { filter: blur(2px); opacity: 0.6; }
}

/* 超小屏（≤400px）进一步缩小 */
@media (max-width: 400px) {
  .music-player {
    width: 280px;
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    gap: 0.4rem;
    border-radius: 20px;
  }
  .music-playlist {
    border-radius: 0;
    margin: 0 -0.75rem -0.5rem;
  }
  .music-playlist.open {
    max-height: calc(135px + 64px);
  }
  .playlist-inner {
    max-height: 135px;
  }
  .playlist-tab {
    font-size: 0.62rem;
    padding: 0.28rem 0.3rem;
    gap: 0.2rem;
  }
  .playlist-local-hint {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .music-btn {
    width: 34px;
    height: 34px;
  }

  .music-btn--sm {
    width: 28px;
    height: 28px;
  }

  .music-icon {
    width: 18px;
    height: 18px;
  }

  .music-icon-sm {
    width: 14px;
    height: 14px;
  }


  .music-label {
    font-size: 0.65rem;
  }

  /* 超小屏 — 音量条独占一行 */
  .music-bottom {
    flex-wrap: wrap;
    gap: 8px;
  }
  .volume-bar-wrap {
    order: 3;
    flex-basis: 100%;
    min-width: 80px;
  }

  .social-tip,
  .mode-tip {
    font-size: 0.62rem;
    padding: 0.15rem 0.35rem;
  }

  .fortune-tab { font-size: 0.8rem; }
  .time-label,
  .volume-pct { font-size: 0.65rem; }
}

/* ============================================
   滚动浮现动画（由 scroll 事件 + rAF 实时驱动）
   ============================================ */

.reveal-up {
  /* 默认可见：JS 未加载/加载失败时内容不丢失（健壮性兜底） */
  opacity: 1;
  transform: none;
}

/* JS 正常运行时：隐藏，等待 IntersectionObserver 弹性入场 */
html.js .reveal-up {
  opacity: 0;
  transform: translateY(40px); /* 多 5px 行程给弹性更多空间 */
}

/* ============================================
   星座星空 Section
   ============================================ */

.zodiac-section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  margin-top: 0;
  padding: 2rem 0 4rem; /* 顶部呼吸空间 + 底部与页脚拉开距离 */
}

/* 星图背景 — 全 section 铺满，藏在 UI 后面；白天模式隐藏 */
.starchart-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
}
/* 夜间模式：显示星空背景 */
html.night-mode .starchart-canvas {
  display: block;
}

.zodiac-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 大标题 */
.zodiac-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 0.5rem;
}

.zodiac-title-text {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 400;
  letter-spacing: clamp(0.2em, 1vw, 0.4em);
  margin: 0;
  color: var(--text-primary);
  /* 浅蓝微光晕，不喧宾夺主 */
  text-shadow:
    0 0 3px  rgba(160, 200, 225, 0.4),
    0 0 8px  rgba(150, 195, 220, 0.2),
    0 0 16px rgba(170, 210, 235, 0.1);
  animation: mist-breathe 4s ease-in-out infinite;
}

@keyframes mist-breathe {
  0%, 100% {
    text-shadow:
      0 0 3px  rgba(160, 200, 225, 0.35),
      0 0 8px  rgba(150, 195, 220, 0.18),
      0 0 16px rgba(170, 210, 235, 0.08);
    transform: scale(1);
  }
  50% {
    text-shadow:
      0 0 5px  rgba(160, 200, 225, 0.55),
      0 0 12px rgba(150, 195, 220, 0.3),
      0 0 22px rgba(170, 210, 235, 0.15);
    transform: scale(1.015);
  }
}

.zodiac-title-deco {
  font-size: 2.6rem;
  color: var(--accent);
  opacity: 0.7;
  animation: deco-twinkle 2s ease-in-out infinite;
}
.zodiac-title .zodiac-title-deco:last-child {
  animation-delay: 0.7s;
}

@keyframes deco-twinkle {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  25%      { opacity: 0.95; transform: scale(1.2); }
  50%      { opacity: 0.95; transform: scale(1.2); }
}

/* 副标题 */
.zodiac-subtitle {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 0.18em;
  margin-bottom: 2rem;
}

.tarot-deck {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}


/* ---- 中心神谕文字 ---- */
.tarot-center {
  text-align: center;
  min-height: 3.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin: 0.3rem 0;
}

.tarot-oracle {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text-primary);
  letter-spacing: 0.1em;
  min-height: 2.2rem;
  display: inline-block;
  transition: color 0.4s ease;
}

/* 星座图标出现 — 由 JS 每次切换时重放（class 'pop' 强制回流） */
.tarot-oracle.pop {
  animation: oracle-pop 0.4s var(--ease-premium);
}
@keyframes oracle-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.65); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tarot-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: opacity 0.5s ease;
}

/* ---- 确认区 — 固定高度容器：确认按钮/结果面板切换不引起布局抖动 ---- */
.tarot-actions {
  min-height: 3.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

/* ---- 揭晓按钮 ---- */
.tarot-confirm {
  padding: 0.55rem 2rem;
  border: 1.5px solid rgba(232, 184, 96, 0.5);
  border-radius: 22px;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(232, 184, 96, 0.15) 100%
  );
  color: #B87A20;
  font-size: 0.95rem;
  font-family: var(--font-cn);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    opacity 0.4s ease,
    transform 0.3s var(--ease-premium),
    box-shadow 0.3s ease,
    background 0.3s ease,
    color 0.3s ease;
  animation: tarot-reveal 0.45s var(--ease-premium) both;
}

@keyframes tarot-reveal {
  from { opacity: 0; transform: translateY(12px) scale(0.88); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tarot-confirm:hover {
  transform: scale(1.06);
  box-shadow: 0 0 24px rgba(232, 184, 96, 0.35);
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(232, 184, 96, 0.28) 100%
  );
}

.tarot-confirm:active {
  transform: scale(0.9);
  transition: transform var(--dur-instant) var(--ease-snappy);
}

/* 确认选择按钮 — 夜间深蓝毛玻璃底 + 亮金文字（避免白色渐变按钮在深蓝背景上刺眼） */
html.night-mode .tarot-confirm {
  border-color: rgba(232, 184, 96, 0.55);
  background: linear-gradient(135deg,
    rgba(25, 45, 70, 0.8) 0%,
    rgba(232, 184, 96, 0.16) 100%
  );
  color: #E8C268;
}
html.night-mode .tarot-confirm:hover {
  box-shadow: 0 0 24px rgba(232, 184, 96, 0.4);
  background: linear-gradient(135deg,
    rgba(38, 64, 96, 0.85) 0%,
    rgba(232, 184, 96, 0.26) 100%
  );
}



/* ============================================
   星轨滑星 — 统一的生日选择器（白天/夜间皮肤）
   双弧星轨：内弧月份节点 + 外弧日期星点 + 星核拖动
   ============================================ */

/* 星轨容器 — 默认允许垂直滚动（弧形轨道内由 .trail-arc-hit 声明 touch-action: none 接管） */
.star-trail {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  touch-action: pan-y;
}

.star-trail-svg {
  width: 100%;
  height: auto;
  display: block;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* 日期弧线 — 一条完整的纯色细线（不随星座分段，任何背景都完整可见；无动画，直接显示） */
.trail-day-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.9;
}
html.night-mode .trail-day-line {
  opacity: 1;
}

/* 日期星点 — 全部常显（换月重建时沿弧依次点亮，animation-delay 由 JS 递增设置） */
.trail-star {
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.25s ease;
  animation: trail-star-spawn 0.45s var(--ease-premium) backwards;
}
@keyframes trail-star-spawn {
  0%   { opacity: 0; transform: scale(0.3); }
  100% { opacity: 1; transform: scale(1); }
}

/* 日期数字 — 外弧外侧常显；换月时从弧线上依次升起（沿半径径向飘出 + 淡入缩放），
   选中日金色高亮（class 由 JS 维护）；--rise-x/-y 为由 JS 计算的弧线→标签径向偏移 */
.trail-day-label {
  font-size: 10px;
  font-weight: 500;
  fill: var(--text-secondary);
  opacity: 0.6;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 0.25s ease, opacity 0.25s ease;
  animation: trail-label-rise 0.5s var(--ease-premium) backwards;
}
@keyframes trail-label-rise {
  from {
    opacity: 0;
    transform: translate(var(--rise-x, 0), var(--rise-y, 0)) scale(0.4);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}
.trail-day-label.active {
  fill: #F6C660;
  opacity: 1;
  font-weight: 600;
}

/* 选中涟漪 — 金环从选中星点扩散消散（由 JS 在选中日时创建，animationend 自清理） */
.trail-ring {
  fill: none;
  stroke: rgba(255, 238, 190, 0.95);
  stroke-width: 1.6;
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
  animation: trail-ring-out 0.55s var(--ease-premium) forwards;
}
@keyframes trail-ring-out {
  0%   { opacity: 1; transform: scale(0.55); }
  100% { opacity: 0; transform: scale(2.8); }
}

/* 防抖降级：重建间隔 <350ms 时跳过一次性动画（快速连点/连续收尾，避免动画重放闪跳） */
.trail-day-arc.no-anim .trail-star,
.trail-day-arc.no-anim .trail-day-label,
.trail-month-arc.no-anim .month-node.active {
  animation: none;
}

/* 选中日星点 — 微光外溢 */
.trail-star.active {
  filter: drop-shadow(0 0 4px rgba(255, 238, 190, 0.95));
}
html.night-mode .trail-star.active {
  filter: drop-shadow(0 0 5px rgba(255, 238, 190, 1));
}

/* 今日标记 — 柔和呼吸 */
.trail-today {
  animation: trail-today-breathe 2.8s ease-in-out infinite;
}
@keyframes trail-today-breathe {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* 星核 — 拖动选择器（事件由 svg 统一处理，自身不拦截）
   非拖拽状态（点选/换月/换日）下星核带平滑飞行过渡 */
.trail-core-group {
  cursor: grab;
  pointer-events: none;
  transition: transform 0.35s var(--ease-premium);
}
.trail-core-group.dragging {
  cursor: grabbing;
  transition: none;   /* 拖拽中每帧直写，禁用过渡避免滞后 */
}
.trail-core-halo {
  transform-box: fill-box;
  transform-origin: center;
  animation: trail-core-breathe 2s ease-in-out infinite;
}
@keyframes trail-core-breathe {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.95; transform: scale(1.12); }
}
.trail-core-group.dragging .trail-core-halo {
  animation: trail-core-breathe-fast 0.7s ease-in-out infinite;
}
@keyframes trail-core-breathe-fast {
  0%, 100% { opacity: 0.85; transform: scale(1.05); }
  50%      { opacity: 1; transform: scale(1.22); }
}
.trail-core-inner {
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 0.4s ease, transform 0.25s ease;
  /* 白心在浅色底上的描边轮廓：白天增加可见性 */
  stroke: rgba(137, 196, 225, 0.65);
  stroke-width: 1.5;
}
html.night-mode .trail-core-inner {
  stroke: rgba(220, 240, 255, 0.55);
}
.trail-core-group.dragging .trail-core-inner {
  transform: scale(1.15);
}
.trail-core-group.confirmed .trail-core-inner {
  fill: #F6C660;
}

/* 月份弧：12 节点均分 + 标签（内弧）；激活节点弹跳动效 */
.month-node {
  transition: filter 0.25s ease;
  pointer-events: none;
  stroke: #FFFFFF;
  stroke-width: 1.4;
  transform-box: fill-box;
  transform-origin: center;
}
.month-node.active {
  filter: drop-shadow(0 0 5px rgba(255, 238, 190, 0.95));
  animation: month-node-pop 0.45s var(--ease-premium);
}
@keyframes month-node-pop {
  0%   { transform: scale(0.6); }
  100% { transform: scale(1); }
}
.month-label {
  font-size: 13px;
  font-weight: 500;
  fill: var(--text-secondary);
  opacity: 0.85;
  pointer-events: none;
  transition: fill 0.25s ease, opacity 0.25s ease;
}
.month-label.active {
  fill: #F6C660;
  opacity: 1;
  font-weight: 600;
}

/* 移动端：细线略加粗、标签放大。
   这两个 font-size 作用在 SVG 用户坐标里，会随 viewBox 等比缩小 ——
   viewBox 宽 640 在 375px 屏上缩放约 0.54，原来的 12 实际只有约 6.5px（320px 屏约 5.4px）。
   日期数字间距约 25 单位、月份标签约 46 单位，18px 的两位数字约占 20 单位，放得下且不重叠 */
@media (max-width: 480px) {
  .trail-day-line { stroke-width: 3; }
  .trail-day-label { font-size: 18px; }
  .month-label { font-size: 18px; }
}

/* 两条独立的弧形滑动轨道（透明命中带）：
   点在/滑在带内即锁定该弧维度（月轨 or 日轨），带内手势不触发页面滚动；
   带外（容器 pan-y 区域）仍可正常滚动。 */
.trail-arc-hit {
  fill: none;
  stroke: rgba(0, 0, 0, 0);   /* 完全透明，不参与视觉 */
  /* 72：缩放后小屏仍有约 38px 宽的触摸命中带（375px 屏）。
     两条弧半径差 85 单位，72 的带各占 36，尚余 13 单位间隙，不会互相覆盖导致维度误判 */
  stroke-width: 72;
  pointer-events: stroke;
  touch-action: none;
  cursor: pointer;
}

/* 内弧引导线 — 提示内弧可滑动（外弧日期自带完整细线，无需引导线） */
.trail-month-guide {
  fill: none;
  stroke: rgba(137, 196, 225, 0.55);
  stroke-width: 2.5;
  stroke-linecap: round;
  pointer-events: none;
}
html.night-mode .trail-month-guide {
  stroke: rgba(160, 200, 230, 0.4);
}


.tarot-deck .orbit-result {
  /* 白天模式：流式布局，自然排列 */
  position: static;
  transform: none;
  bottom: auto;
  left: auto;
  text-align: center;
  color: var(--text-primary);
  font-size: 0.88rem;
  white-space: normal;
  pointer-events: auto;
  animation: tarot-result-in 0.45s var(--ease-premium) forwards;
  margin-top: 0.4rem;
}


/* 结果面板内的「重新选择」按钮 — 与确认选择按钮同款配色/大小 */
.orbit-redo {
  pointer-events: auto;
  display: inline-block;
  margin: 0;
  padding: 0.55rem 2rem;
  font-size: 0.95rem;
  color: #B87A20;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(232, 184, 96, 0.15) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(232, 184, 96, 0.5);
  border-radius: 22px;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-cn);
  transition: color 0.25s ease, background 0.3s ease, border-color 0.25s ease, box-shadow 0.3s ease;
}
.orbit-redo:hover {
  box-shadow: 0 0 24px rgba(232, 184, 96, 0.35);
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(232, 184, 96, 0.28) 100%
  );
}

/* 白天模式：不使用 translateX(-50%)，自然居中 */
@keyframes tarot-result-in {
  0%   { opacity: 0; transform: translateY(12px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}


/* 运势面板 — 浮动在星环下方（白天间距 2rem，夜间 6.5rem 容纳 hint/按钮） */
.zodiac-grid {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  margin-top: 2rem;
}

html.night-mode .zodiac-grid {
  margin-top: 6.5rem;
}

/* ---- 通用卡片 — 白天浅蓝毛玻璃，夜间深色底 */
.zodiac-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1px solid var(--card-border);
  padding: 1.6rem;
  box-shadow: 0 2px 20px rgba(137, 196, 225, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: box-shadow 0.35s var(--ease-premium), transform 0.3s var(--ease-playful-soft);
  position: relative;
  overflow: hidden;
}

.zodiac-card:hover {
  box-shadow: 0 6px 32px rgba(137, 196, 225, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-3px);
}

.zodiac-card .card-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  line-height: 1;
}

.zodiac-card .card-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

/* ---- 运势卡片（通栏） ---- */

/* 头部：图标+标题 在左，Tab 在右 */
.fortune-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.fortune-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fortune-header-left .card-icon {
  margin-bottom: 0;
}

.fortune-header-left .card-title {
  margin-bottom: 0;
}

/* Tab 切换 */
.fortune-tabs {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.fortune-tab {
  border: none;
  background: var(--accent-soft);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-cn);
  transition: background var(--transition-fast), color var(--transition-fast), transform 0.2s var(--ease-playful-soft), box-shadow var(--transition-fast);
}

.fortune-tab:hover {
  background: var(--accent-glow);
  color: var(--text-primary);
  transform: scale(1.06);
}

.fortune-tab:active {
  transform: scale(0.92);
  transition: transform var(--dur-instant) var(--ease-snappy);
}

.fortune-tab.active {
  background: var(--accent-hover);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(109, 179, 212, 0.35);
  transform: scale(1);
}

/* 主体：指数条 + 概述/幸运/宜忌 横排 */
.fortune-body {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

/* 运势指数条 */
.fortune-indexes {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.fortune-idx {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.idx-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 2em;
  text-align: right;
}

.idx-bar {
  flex: 1;
  height: 6px;
  background: var(--accent-soft);
  border-radius: 3px;
  overflow: hidden;
}

.idx-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.7s var(--ease-playful-soft);
}

.idx-pct {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 2.6em;
  font-variant-numeric: tabular-nums;
}

/* 指数条下方星座信息 — 居中对称填补空白 */
.fortune-sign-info {
  flex: 1;
  text-align: center;
  padding-top: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
}
.sign-info-line {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.sign-info-element {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--accent-hover);
  letter-spacing: 0.1em;
}
.sign-info-secondary {
  letter-spacing: 0.03em;
}

.fortune-summary {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.65;
  margin-bottom: 0.7rem;
}

/* 幸运信息 */
.fortune-lucky {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.lucky-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.lucky-item em {
  font-style: normal;
  color: var(--accent-hover);
  font-weight: 500;
}

/* 宜忌 */
.fortune-todo {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.todo-yi,
.todo-ji {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.todo-yi em { font-style: normal; color: #5a9a6a; }
.todo-ji em { font-style: normal; color: #c47a7a; }

/* 详细运势（折叠） */
.fortune-details {
  margin-top: 0.5rem;
  border-top: 1px solid rgba(137, 196, 225, 0.2);
  padding-top: 0.6rem;
}

.fortune-details summary {
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
}

.fortune-detail-text {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.fortune-detail-text p {
  margin-bottom: 0.5rem;
}

.fortune-detail-text strong {
  color: var(--text-primary);
}

.fortune-loading {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.fortune-error {
  text-align: center;
  font-size: 0.85rem;
  color: #c47a7a;
  margin-top: 1rem;
}

/* ---- 响应式：星座 Section ---- */
@media (max-width: 768px) {
  .zodiac-section {
    margin-top: 0;
    padding: 0;
  }

  .zodiac-container {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 3rem 1rem 5rem;
    justify-content: flex-start;
  }

  .zodiac-title-deco {
    font-size: 1.6rem;
  }

  .zodiac-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  .zodiac-card {
    padding: 1.3rem;
  }

  .zodiac-grid {
    margin-top: 2.5rem;
  }
}

/* 桌面端运势双栏布局 */
@media (min-width: 769px) {
  .fortune-body {
    grid-template-columns: 220px 1fr;
    gap: 2rem;
  }
}

/* 移动端单列布局 + 运势始终展开 */
@media (max-width: 768px) {
  /* 运势头部 — 竖排 */
  .fortune-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .fortune-body {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    max-height: none !important;
    overflow: visible !important;
    margin-top: 0.5rem !important;
  }
  .fortune-details {
    max-height: none !important;
    overflow: visible !important;
    margin-top: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(168, 212, 232, 0.3);
  }
  .fortune-loading,
  .fortune-error {
    max-height: none !important;
    overflow: visible !important;
    margin-top: 1rem;
  }
  .fortune-tabs {
    align-self: flex-start;
    max-height: none !important;
    overflow: visible !important;
    margin-top: 0.6rem;
  }
  .fortune-header-left {
    cursor: default;
    user-select: auto;
    width: 100%;
  }
  .fortune-card {
    display: flex;
    flex-direction: column;
  }
}

/* 页脚响应式 */
@media (max-width: 640px) {
  .site-footer {
    padding: 2rem 1.5rem 2rem;
    margin-top: 2rem;
  }

  .footer-brand {
    font-size: 1.2rem;
  }
}

/* ============================================
   移动端 hover 清理 — 触屏设备不需要 hover 假态
   ============================================ */
@media (hover: none) {
  .social-link:hover { transform: none !important; box-shadow: none !important; background: rgba(255, 255, 255, 0.45) !important; color: var(--text-primary) !important; }
  .music-btn:hover { transform: none !important; box-shadow: none !important; }
  .music-btn--sm:hover { transform: none !important; background: transparent !important; color: var(--text-secondary) !important; }
  .zodiac-card:hover { transform: none !important; box-shadow: 0 2px 20px rgba(137, 196, 225, 0.15) !important; }
  .fortune-tab:hover { transform: none !important; }
  .orbit-redo:hover { transform: none !important; box-shadow: none !important; background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(232, 184, 96, 0.15) 100%) !important; color: #B87A20 !important; border-color: rgba(232, 184, 96, 0.5) !important; }
  html.night-mode .social-link:hover { background: rgba(30, 50, 75, 0.55) !important; color: var(--text-primary) !important; }
  html.night-mode .music-btn--sm:hover { background: transparent !important; color: var(--text-secondary) !important; }
  html.night-mode .fortune-tab:hover { background: rgba(30, 50, 75, 0.55) !important; color: rgba(180, 208, 228, 0.6) !important; }
  html.night-mode .orbit-redo:hover { background: linear-gradient(135deg, rgba(25, 45, 70, 0.8) 0%, rgba(232, 184, 96, 0.16) 100%) !important; color: #E8C268 !important; border-color: rgba(232, 184, 96, 0.55) !important; }
  html.night-mode .music-btn:hover { background: rgba(30, 50, 75, 0.55) !important; box-shadow: none !important; }
}

/* ============================================
   Live2D 角色定位（CDN 版本）
   ============================================ */

/* 角色容器 — 右下角 */
#waifu {
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  /* 低于 .music-player（z-index: 2）。看板娘占右下 300×300，层级更高时会把落在
     该区域上的点击全部吃掉，表现为播放器/播放列表点不动。
     看板娘自身的悬停与点击交互不受影响，只是与播放器重叠时让播放器在上层 */
  z-index: 1 !important;
}

/* 对话气泡 — 暖色调适配 */
#waifu-tips {
  color: var(--text-primary) !important;
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  font-family: var(--font-cn) !important;
  box-shadow: 0 2px 12px rgba(30, 59, 77, 0.1) !important;
}

/* 工具栏按钮 — 移到角色左侧，避免超出屏幕 */
#waifu-tool {
  right: auto !important;
  left: -32px !important;
}
#waifu-tool span { color: var(--text-secondary); }
#waifu-tool span:hover { color: var(--warm-accent); }

/* 重新出现按钮 — 右下角 */
#waifu-toggle {
  right: 0 !important;
  left: auto !important;
  z-index: 7 !important;
}

/* 移动端隐藏 */
@media (max-width: 768px) {
  #waifu { display: none !important; }
  #waifu-toggle { display: none !important; }
  .cursor-fish { pointer-events: none !important; }
}

/* ============================================
   Twemoji 统一 emoji 渲染
   ============================================ */

/* Twemoji 将 emoji 替换为 <img>，用 !important 覆盖其内联宽高，
   让图片继承父元素的 font-size 来缩放。
   同时禁用图片的默认交互行为，使其表现与原始文字 emoji 一致 */
.emoji {
  width: 1em !important;
  height: 1em !important;
  vertical-align: -0.1em;
  display: inline;
  pointer-events: none;        /* 点击穿透 — 不拦截鼠标/涟漪事件 */
  user-select: none;           /* 禁止选中高亮 */
  -webkit-user-select: none;
  -webkit-user-drag: none;     /* 禁止拖拽（图片默认可拖拽，会造成"被鼠标影响"的感觉） */
  -webkit-touch-callout: none; /* iOS 长按不弹出菜单 */
}

/* ============================================
   backdrop-filter 降级支持
   ============================================ */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .music-player,
  .social-link,
  .orbit-redo,
  .fortune-tab,
  .toast,
  .social-tip,
  .mode-tip,
  .zodiac-card,
  .settings-panel {
    background: rgba(255, 255, 255, 0.85) !important;
  }
  html.night-mode .music-player,
  html.night-mode .social-link,
  html.night-mode .orbit-redo,
  html.night-mode .fortune-tab,
  html.night-mode .toast,
  html.night-mode .social-tip,
  html.night-mode .mode-tip,
  html.night-mode .zodiac-card,
  html.night-mode .settings-panel {
    background: rgba(25, 45, 70, 0.92) !important;
  }
}

/* ============================================
   深夜模式 — 19:00–06:00 自动切换深蓝夜空
   ============================================ */

html.night-mode {
  /* 天空背景 */
  --sky-top: #0B1A30;
  --sky-mid: #132744;
  --sky-bot: #1C3358;
  /* 文字 — 浅色保证可读性 */
  --text-primary: #CFDFF0;
  --text-secondary: #A0C0D8;
  --text-muted: #5E7A94;
  /* 卡片 — 深色毛玻璃 */
  --card-bg: rgba(16, 32, 52, 0.78);
  --card-border: rgba(255, 255, 255, 0.12);
  /* 光晕和云层 */
  --glow-color: rgba(100, 160, 210, 0.5);
  --cloud-white: rgba(180, 200, 230, 0.3);
  /* 星图粒子调色 — 夜间偏亮蓝白，在深空底上更鲜明 */
  --star-rgb: 210, 225, 245;
  --star-line-rgb: 175, 200, 230;
  --star-meteor-rgb: 255, 248, 235;
}

/* 按钮和覆盖层 — 白天是白色半透明，夜间改为深色半透明 */
html.night-mode .social-link,
html.night-mode .music-btn {
  background: rgba(30, 50, 75, 0.55);
  color: var(--text-primary);
}
html.night-mode .music-btn.playing {
  background: rgba(35, 60, 90, 0.65);
  box-shadow: 0 3px 16px rgba(100, 160, 210, 0.25);
}
html.night-mode .music-btn:hover {
  background: rgba(40, 65, 95, 0.7);
  box-shadow: 0 4px 18px rgba(100, 160, 210, 0.3);
}
html.night-mode .music-btn--sm:hover {
  background: rgba(30, 50, 75, 0.55);
  color: var(--text-primary);
}
html.night-mode .music-btn--sm.mode-list,
html.night-mode .music-btn--sm.mode-single,
html.night-mode .music-btn--sm.mode-shuffle {
  color: #6DAED4;
  background: rgba(30, 50, 75, 0.45);
}
/* 重新选择按钮 — 夜间与确认选择按钮同款：深蓝毛玻璃底 + 亮金文字 */
html.night-mode .orbit-redo {
  border-color: rgba(232, 184, 96, 0.55);
  background: linear-gradient(135deg,
    rgba(25, 45, 70, 0.8) 0%,
    rgba(232, 184, 96, 0.16) 100%
  );
  color: #E8C268;
}
html.night-mode .orbit-redo:hover {
  box-shadow: 0 0 24px rgba(232, 184, 96, 0.4);
  background: linear-gradient(135deg,
    rgba(38, 64, 96, 0.85) 0%,
    rgba(232, 184, 96, 0.26) 100%
  );
}
/* 卡片 — 夜间切换到深色阴影 */
html.night-mode .zodiac-card {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(120, 170, 210, 0.08);
}
html.night-mode .zodiac-card:hover {
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(120, 170, 210, 0.15);
}
/* 运势 tab — 夜间改回深底 */
html.night-mode .fortune-tab {
  background: rgba(30, 50, 75, 0.55);
  color: rgba(180, 208, 228, 0.6);
}
html.night-mode .fortune-tab:hover {
  background: rgba(40, 65, 95, 0.7);
  color: #D8EAF8;
}
html.night-mode .social-tip,
html.night-mode .mode-tip,
html.night-mode .toast {
  background: rgba(25, 45, 70, 0.88);
  color: var(--text-primary);
}
/* 飞鱼瞳孔保持深色（不能跟随文字变量变浅） */
html.night-mode .cursor-fish .fish-eye-pupil {
  fill: #1A2D3D;
}

/* 夜间进度条和音量条 — 自定义 div 系统 */
html.night-mode .progress-bar::before,
html.night-mode .volume-bar-wrap::before {
  background: rgba(140, 180, 210, 0.25);
}
html.night-mode .progress-fill::after,
html.night-mode .volume-fill::after {
  background: #fff;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.4),
    0 0 0 2px var(--accent-hover),
    0 0 8px var(--accent-glow);
}
html.night-mode .progress-bar:hover .progress-fill::after,
html.night-mode .volume-bar-wrap:hover .volume-fill::after {
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.45),
    0 0 0 4px rgba(160, 210, 240, 0.5);
}
html.night-mode .progress-bar:active .progress-fill::after,
html.night-mode .volume-bar-wrap:active .volume-fill::after {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 0 0 3px rgba(140, 190, 230, 0.55);
}

/* 播放列表面板 — 夜间适配 */
html.night-mode .playlist-divider,
html.night-mode .playlist-divider-bottom {
  background: rgba(140, 180, 210, 0.2);
}
html.night-mode .playlist-item {
  color: var(--text-secondary);
}
html.night-mode .playlist-item:hover {
  background: rgba(40, 65, 95, 0.45);
  color: var(--text-primary);
}
html.night-mode .playlist-item.current {
  background: rgba(100, 160, 210, 0.12);
}
html.night-mode .playlist-item.current::before {
  background: var(--accent-hover);
}
html.night-mode .playlist-inner::-webkit-scrollbar-thumb {
  background: rgba(140, 180, 210, 0.25);
}

/* 列表标签页与失效条目 — 夜间适配 */
html.night-mode .playlist-tab:hover {
  background: rgba(40, 65, 95, 0.45);
  color: var(--text-primary);
}
html.night-mode .playlist-tab[aria-selected='true'] {
  background: rgba(100, 160, 210, 0.18);
  color: var(--accent-hover);
}
html.night-mode .playlist-cta {
  color: var(--accent-hover);
  border-color: rgba(140, 180, 210, 0.45);
}
html.night-mode .playlist-cta:hover {
  background: rgba(40, 65, 95, 0.45);
}

/* 触摸设备没有真正的悬停态：点过的行会一直留着"悬停"底色和亮色文字，
   看起来像选中了另一首，真正的当前曲目反而被盖住 —— 触摸端一律不启用悬停样式 */
@media (hover: none) {
  .playlist-item:hover {
    background: none;
    color: var(--text-secondary);
  }
  .playlist-item.current:hover {
    background: rgba(137, 196, 225, 0.08);
    color: var(--accent-hover);
  }
  .playlist-tab:hover {
    background: none;
    color: var(--text-secondary);
  }
  .playlist-tab[aria-selected='true']:hover {
    background: var(--accent-soft);
    color: var(--accent-hover);
  }
  .playlist-cta:hover {
    background: none;
  }
  html.night-mode .playlist-item:hover {
    background: none;
    color: var(--text-secondary);
  }
  html.night-mode .playlist-item.current:hover {
    background: rgba(100, 160, 210, 0.12);
  }
  html.night-mode .playlist-tab:hover {
    background: none;
    color: var(--text-secondary);
  }
  html.night-mode .playlist-tab[aria-selected='true']:hover {
    background: rgba(100, 160, 210, 0.18);
    color: var(--accent-hover);
  }
  html.night-mode .playlist-cta:hover {
    background: none;
  }
}

/* ============================================
   设置面板（#settings-toggle → #settings-overlay）
   ============================================ */

/* 遮罩层 */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 42, 61, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  /* 遮罩自己不吃滚动：滚轮/触摸落在空白处不传给页面。
     注意不能用 touch-action: none —— 触摸滚动的判定取的是"目标到滚动容器"整条祖先链的交集，
     祖先设 none 会把面板内部的触摸滚动一起封掉；这里用 pan-y + 事件里拦截空白处拖动 */
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.settings-overlay.open { opacity: 1; visibility: visible; }

/* 面板卡片 */
.settings-panel {
  width: min(420px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(15, 42, 61, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-fast);
}
.settings-overlay.open .settings-panel { transform: translateY(0) scale(1); }

/* 头部 */
.settings-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px 12px;
}
.settings-title {
  margin: 0;
  flex: 1;
  text-align: center;
  font-family: var(--font-cn);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.settings-close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.settings-close:hover { background: var(--accent); color: #fff; transform: translateY(-50%) rotate(90deg); }
.settings-close:focus-visible,
.settings-toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

/* 主体 */
.settings-body {
  padding: 4px 20px 20px;
  overflow-y: auto;
  /* 滚到顶/底后不把滚动传给页面 */
  overscroll-behavior-y: contain;
  /* 遮罩禁了触摸滚动，面板内部要恢复垂直触摸滚动 */
  touch-action: pan-y;
  /* 滚动条与播放列表统一：细窄、淡蓝滑块、无边框，避免默认滚动条显得突兀 */
  scrollbar-width: thin;
  scrollbar-color: rgba(137, 196, 225, 0.35) transparent;
}
.settings-body::-webkit-scrollbar {
  width: 6px;
}
.settings-body::-webkit-scrollbar-track {
  background: transparent;
}
.settings-body::-webkit-scrollbar-thumb {
  background: rgba(137, 196, 225, 0.35);
  border-radius: 3px;
}
.settings-body::-webkit-scrollbar-thumb:hover {
  background: rgba(137, 196, 225, 0.55);
}

/* 分区 */
.settings-section { margin-top: 18px; }
.settings-section-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

/* 分段选择器（主题 / 播放模式） */
.settings-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--accent-soft);
  border-radius: 12px;
}
.seg-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}
.seg-btn:hover { color: var(--text-primary); }
.seg-btn[aria-checked="true"] {
  background: var(--card-bg);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 42, 61, 0.12);
}

/* 音乐模式/音量行 */
.settings-mode,
.settings-volume {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.settings-mode .settings-seg { flex: 1; }
.settings-seg--sm .seg-btn { padding: 6px 4px; font-size: 0.84rem; }
.settings-mode-label {
  flex-shrink: 0;
  width: 68px;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 本地音乐：来源信息 + 选择/更改按钮 */
.settings-local {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}
.settings-local-path {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-secondary);
  word-break: break-all;
}
.settings-local-hint {
  margin: 6px 0 0;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--text-muted);
}
/* 权限说明：网页只能读取所选内容，不会改动电脑上的文件 */
.settings-local-note {
  margin: 4px 0 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-muted);
  opacity: 0.85;
}
.settings-local-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.settings-local-btn {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid var(--accent-hover);
  border-radius: 10px;
  background: none;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--accent-hover);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.settings-local-btn:hover {
  background: var(--accent-soft);
}
.settings-local-btn:focus-visible,
.settings-local-clear:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}
/* 清除选择：次级操作，用弱化的细边框与主按钮区分 */
.settings-local-clear {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 7px 6px;
  border: 1px solid rgba(110, 144, 160, 0.35);
  border-radius: 10px;
  background: none;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.settings-local-clear:hover {
  background: rgba(217, 83, 79, 0.1);
  border-color: rgba(217, 83, 79, 0.55);
  color: #D9534F;
}

/* 开关 */
.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.settings-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  border-radius: 24px;
  background: rgba(110, 144, 160, 0.35);
  transition: background var(--transition-fast);
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 42, 61, 0.3);
  transition: transform var(--transition-fast);
}
.settings-toggle input:checked + .toggle-track { background: var(--accent-hover); }
.settings-toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* 夜间适配 */
html.night-mode .settings-panel {
  background: rgba(20, 38, 60, 0.82);
  border-color: rgba(90, 130, 170, 0.35);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}
html.night-mode .settings-title { color: #E8EFF6; }
html.night-mode .settings-section-title { color: #DCE7F2; }
html.night-mode .settings-close { background: rgba(90, 140, 190, 0.2); color: var(--text-secondary); }
html.night-mode .settings-close:hover { background: var(--accent-hover); }
html.night-mode .seg-btn { color: var(--text-secondary); }
html.night-mode .seg-btn:hover { color: var(--text-primary); }
html.night-mode .seg-btn[aria-checked="true"] {
  background: rgba(70, 110, 155, 0.5);
  color: #E8EFF6;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
html.night-mode .settings-mode-label { color: var(--text-muted); }
html.night-mode .settings-local {
  border-top-color: rgba(140, 180, 210, 0.22);
}
html.night-mode .settings-local-btn {
  color: var(--accent-hover);
  border-color: rgba(140, 180, 210, 0.45);
}
html.night-mode .settings-local-btn:hover {
  background: rgba(40, 65, 95, 0.45);
}
html.night-mode .settings-local-clear {
  color: rgba(205, 220, 232, 0.62);
  border-color: rgba(140, 180, 210, 0.25);
}
html.night-mode .settings-local-clear:hover {
  background: rgba(217, 83, 79, 0.18);
  border-color: rgba(233, 139, 134, 0.6);
  color: #E98B86;
}
html.night-mode .settings-body {
  scrollbar-color: rgba(140, 180, 210, 0.3) transparent;
}
html.night-mode .settings-body::-webkit-scrollbar-thumb {
  background: rgba(140, 180, 210, 0.3);
}
html.night-mode .settings-body::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 180, 210, 0.5);
}
html.night-mode .toggle-track { background: rgba(90, 120, 150, 0.4); }
html.night-mode .toggle-label { color: var(--text-secondary); }
html.night-mode .settings-overlay { background: rgba(4, 12, 22, 0.5); }

/* 面板内提示条 */
.settings-notice {
  margin: 4px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--text-primary);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.settings-notice.show { opacity: 1; transform: translateY(0); }
html.night-mode .settings-notice { color: #DCE7F2; }

/* 移动端适配 */
@media (max-width: 480px) {
  .settings-panel { width: 100%; max-height: 86vh; border-radius: 18px; }
  .settings-body { padding: 2px 16px 16px; }
}

