* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 不写死 height:100%——背景层要跟着内容一起长、一起滚，写死了滚下去就露底 */
html, body { margin: 0; overflow-x: hidden; }
body {
  background: #08070a;
  color: #eae7ee;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  min-height: 100vh;
  padding-bottom: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* 背景：整张铺满、不裁不暗，同时图里那颗发光白球要正好套住黑胶。
   两个要求一起满足靠的不是 cover，是 together.js 里的 alignBg()——
   按"白球圆心对齐黑胶圆心、白球直径=黑胶直径×BALL_RATIO"实时算 size/position。
   absolute（不是 fixed）才能跟着页面一起滚，滚到歌词区背景也不会脱节。
   背景色兜住图片没盖到的边角，图四角本来就接近纯黑，看不出接缝。 */
.tg-bg { position: absolute; inset: 0; z-index: -1;
  background-image: url('together_full_bg.jpg'); background-repeat: no-repeat;
  background-color: #08070a; }

/* ── top bar ── */
/* 标题绝对居中：左边一个按钮、右边两个，用 space-between 的话标题会被挤偏 */
.tg-top { position: relative; width: 100%; max-width: 480px; display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top, 14px) 16px 6px; box-sizing: border-box; }
.tg-back, .tg-icon-btn { width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.06); color: #cfc9d6; display: flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer; }
.tg-back:active, .tg-icon-btn:active { background: rgba(255,255,255,.12); }
.tg-top-btns { display: flex; gap: 8px; }
/* top 用"安全区 + 半个按钮高"对齐按钮的垂直中心；直接写 top:50% 会因为顶部安全区而偏上 */
.tg-title { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 14px) + 18px);
  transform: translate(-50%, -50%);
  font-size: 14px; letter-spacing: 2px; color: #a89cb0; pointer-events: none; }

/* ── avatar pair + counter ── */
.tg-pair { position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 14px; }
.tg-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.15);
  position: relative; z-index: 1; }
/* 传统有线耳机：两只入耳式耳塞分别塞在两人外侧，线各自垂下来、在下方汇成一根。
   z-index:0 压在头像下面，线跟头像重叠的那一小段自然被挡住，看着就是"从耳朵里出来的"。 */
.tg-earbuds { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); z-index: 0;
  color: rgba(255,255,255,.5); transition: color .3s ease; pointer-events: none; }
.tg-pair.playing .tg-earbuds { color: rgba(255,255,255,.9); filter: drop-shadow(0 0 3px rgba(255,255,255,.3)); }
/* 留出耳机线垂下来的高度，别让线压在下面这行字上 */
.tg-together-since { text-align: center; font-size: 11.5px; color: #93899e; margin-top: 36px; letter-spacing: .3px; }

/* ── vinyl stage ── */
/* 这段留白不是空的——背景图里那两个小人正好落在这里（白球上方那一截），
   所以间距要够，不然小人会顶到头像和"一起听了X分钟"那行字上。
   整块往上收了一些给歌词让位；背景是按黑胶实际位置算的，会自动跟着一起上移。 */
.tg-stage { position: relative; width: 100%; max-width: 420px; display: flex; align-items: center; justify-content: center;
  margin-top: 96px; }
.tg-vinyl-wrap { position: relative; width: 66vw; max-width: 260px; height: 66vw; max-height: 260px; }
.tg-vinyl {
  position: relative; z-index: 1;
  width: 100%; height: 100%; border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E"),
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.07) 0 1px, transparent 1px 3.5px),
    radial-gradient(circle at 42% 38%, #2e2b33, #0a090c 72%);
  box-shadow: 0 18px 50px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center;
  animation: tg-spin 12s linear infinite; animation-play-state: paused;
}
.tg-vinyl.spinning { animation-play-state: running; }
@keyframes tg-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.tg-vinyl-cover {
  position: relative; width: 64%; height: 64%; border-radius: 50%; background: #22202a center/cover no-repeat;
  box-shadow: 0 0 0 3px rgba(0,0,0,.55), 0 0 0 4.5px rgba(255,255,255,.1), inset 0 0 24px rgba(0,0,0,.35);
}
.tg-vinyl-cover::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #0c0b0e; box-shadow: 0 0 0 1px rgba(255,255,255,.2);
}
.tg-tonearm {
  position: absolute; z-index: 2; top: -6%; right: 2%; width: 42%; height: 42%;
  transform-origin: 88% 12%; transform: rotate(-24deg);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.tg-tonearm.down { transform: rotate(4deg); }
.tg-tonearm::before {
  content: ""; position: absolute; top: 8%; right: 6%; width: 4px; height: 78%; border-radius: 3px;
  background: linear-gradient(#d8d2c8, #9a9188); box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.tg-tonearm::after {
  content: ""; position: absolute; top: 2%; right: 0%; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #efe9df, #b8ada0); box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

/* ── floating captions：挂在两个头像下面，不压黑胶也不挤歌词 ──
   .tg-caption-zone 高度为 0（不占位），气泡绝对定位往下飘，
   正好落在头像和黑胶之间那段留白里，谁说的就贴谁那一侧。 */
.tg-caption-zone { position: relative; width: 100%; max-width: 330px; height: 0; z-index: 3; }
.tg-caption-stack { position: absolute; top: 8px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.tg-caption {
  position: relative; max-width: 68%; padding: 9px 14px; border-radius: 15px 15px 15px 4px; font-size: 12.5px; line-height: 1.5;
  background: rgba(255,255,255,.1); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #f2eef5; text-align: left; box-shadow: 0 6px 16px rgba(0,0,0,.28);
  opacity: 0; animation: tg-caption-in .35s ease forwards, tg-caption-out .5s ease 5.6s forwards;
  align-self: flex-start; /* 晏说的话贴左边，跟晏的头像同一侧 */
}
.tg-caption.mine { background: rgba(201,155,143,.28); border-radius: 15px 15px 4px 15px;
  align-self: flex-end; /* 云熙自己说的话贴右边，跟云熙的头像同一侧 */ }
@keyframes tg-caption-in {
  0% { opacity: 0; transform: translateY(8px) scale(.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tg-caption-out {
  0% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-4px); }
}

/* ── meta / progress / controls ── */
/* 背景不压暗（她要原图的亮度），所以文字落在月亮最亮那片会糊。
   解法是只在字的周围垫一圈暗影——不是给整块加底色，远看不出来有东西，字却能读清。 */
.tg-meta { text-align: center; margin-top: 20px; padding: 0 24px; }
.tg-song-title { font-size: 16.5px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 14px rgba(0,0,0,.9), 0 0 5px rgba(0,0,0,.75); }
.tg-song-artist { font-size: 12.5px; color: rgba(255,255,255,.72); margin-top: 3px;
  text-shadow: 0 1px 12px rgba(0,0,0,.85), 0 0 4px rgba(0,0,0,.6); }

.tg-progress-row { width: 100%; max-width: 380px; display: flex; align-items: center; gap: 10px;
  padding: 14px 24px 0; }
.tg-time { font-size: 10.5px; color: #837990; width: 32px; flex: none; font-variant-numeric: tabular-nums; }
.tg-time:last-child { text-align: right; }
.tg-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.1); cursor: pointer; position: relative; }
.tg-bar i { display: block; height: 100%; width: 0%; border-radius: 2px; background: #c99b8f; }

.tg-controls { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.tg-ctl { width: 42px; height: 42px; border-radius: 50%; border: none; background: transparent;
  color: #d8d2de; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tg-ctl-main { width: 56px; height: 56px; background: #eae7ee; color: #1a1720; }
.tg-ctl-main:active { opacity: .85; }
.tg-ctl:active { opacity: .7; }
/* 随机/红心：比主控件弱一档，不抢中间播放键的视觉 */
.tg-ctl-sm { width: 36px; height: 36px; color: rgba(255,255,255,.45); }
#shuffleBtn.on { color: #c99b8f; }
#likeBtn.on { color: #ff6b81; }
#likeBtn.on #likePath { fill: #ff6b81; }
#likeBtn.pending { opacity: .45; }

/* ── lyrics ── */
/* 固定成 4 行左右的高度（行高约 29px），不再用 30vh——那样整页会被撑得老长、一直往下拉。
   上下的 padding 是留给"当前这句滚到正中间"用的，不是视觉留白。 */
.tg-lyrics { width: 100%; max-width: 420px; height: 142px; overflow-y: auto;
  margin-top: 12px; padding: 52px 26px; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent); scrollbar-width: none; }
.tg-lyrics::-webkit-scrollbar { display: none; }
.tg-lyric-line { text-align: center; font-size: 14px; line-height: 2.1; color: #6d6478; cursor: pointer;
  transition: color .25s, transform .25s; padding: 2px 8px; }
.tg-lyric-line.active { color: #f2eef5; font-size: 15.5px; font-weight: 600; }
.tg-lyric-line:active { color: #c99b8f; }
.tg-lyric-line.has-note::after { content: " ·"; color: #c99b8f; }
/* 外文歌的中文翻译：网易云自带的，挂在原词下面小一号 */
.tg-lyric-trans { display: block; font-size: 11.5px; line-height: 1.5; color: #6a6274;
  font-weight: 400; margin-top: -4px; }
.tg-lyric-line.active .tg-lyric-trans { color: #a79eb2; }

/* ── say bar ── */
.tg-say-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: center;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(16,14,19,.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid rgba(255,255,255,.06); }
.tg-say-bar input { flex: 1; height: 38px; border-radius: 19px; border: none; background: rgba(255,255,255,.08);
  color: #f2eef5; padding: 0 16px; font-size: 14px; outline: none; }
.tg-say-bar input::placeholder { color: #766c82; }
.tg-say-bar button { width: 38px; height: 38px; border-radius: 50%; border: none; background: #c99b8f; color: #1a1720;
  display: flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
.tg-say-bar button:active { opacity: .8; }

/* ── queue sheet ── */
.tg-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 20; }
.tg-scrim.open { opacity: 1; pointer-events: auto; }
.tg-queue-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 72vh; background: #1c1922;
  border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .3s cubic-bezier(.32,.72,0,1);
  z-index: 21; padding: 8px 18px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; }
.tg-queue-sheet.open { transform: translateY(0); }
.tg-sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); margin: 6px auto 10px; }
.tg-sheet-title { font-size: 13px; color: #a89cb0; margin-bottom: 8px; letter-spacing: 1px; }
.tg-queue-list { overflow-y: auto; flex: 1; min-height: 60px; }
.tg-queue-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.tg-queue-item img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: rgba(255,255,255,.06); flex: none; }
.tg-queue-item .qi-body { min-width: 0; flex: 1; }
.tg-queue-item .qi-title { font-size: 13px; color: #f2eef5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-queue-item .qi-sub { font-size: 11px; color: #857b91; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-queue-item .qi-tag { font-size: 10px; color: #c99b8f; flex: none; }
.tg-queue-empty { text-align: center; color: #665e70; font-size: 12.5px; padding: 20px 0; }
.tg-add-row { display: flex; gap: 8px; margin-top: 10px; flex: none; }
.tg-add-row input { flex: 1; height: 38px; border-radius: 12px; border: none; background: rgba(255,255,255,.08);
  color: #f2eef5; padding: 0 14px; font-size: 13.5px; outline: none; }
.tg-add-row button { width: 52px; height: 38px; border-radius: 12px; border: none; background: #c99b8f; color: #1a1720;
  font-size: 13.5px; cursor: pointer; }

/* ── 歌单快捷入口（只挂她真在听的两个） ── */
.tg-playlists { display: flex; gap: 8px; margin-bottom: 10px; flex: none; }
.tg-pl { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px;
  background: rgba(255,255,255,.06); cursor: pointer; min-width: 0; }
.tg-pl:active { background: rgba(255,255,255,.12); }
.tg-pl img { width: 32px; height: 32px; border-radius: 7px; object-fit: cover; flex: none;
  background: rgba(255,255,255,.06); }
.tg-pl-body { min-width: 0; flex: 1; }
.tg-pl-name { font-size: 12.5px; color: #f2eef5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-pl-sub { font-size: 10.5px; color: #857b91; }

/* ── 退出时的小结卡片 ── */
.tg-summary-mask { position: fixed; inset: 0; z-index: 40; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(8,7,10,.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tg-summary-mask.open { display: flex; }
.tg-summary-card { width: min(320px, 86vw); padding: 26px 22px 20px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(60,52,64,.96), rgba(30,26,34,.96));
  box-shadow: 0 20px 60px rgba(0,0,0,.5); text-align: center; }
.tg-sm-head { display: flex; justify-content: center; gap: 0; margin-bottom: 10px; }
.tg-sm-head img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,.2); }
.tg-sm-head img:last-child { margin-left: -8px; }
.tg-sm-date { font-size: 11px; color: #8d8398; letter-spacing: .5px; margin-bottom: 18px; }
.tg-sm-grid { display: flex; gap: 12px; }
.tg-sm-cell { flex: 1; }
.tg-sm-label { font-size: 11px; color: #948a9e; margin-bottom: 5px; }
.tg-sm-value { font-size: 19px; font-weight: 600; color: #f4d9d2; }
.tg-sm-total { font-size: 11.5px; color: #8d8398; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.08); }
.tg-sm-btns { display: flex; gap: 10px; margin-top: 18px; }
.tg-sm-stay, .tg-sm-leave { flex: 1; height: 38px; border-radius: 19px; border: none; font-size: 13px;
  display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.tg-sm-stay { background: rgba(255,255,255,.08); color: #d8d2de; }
.tg-sm-leave { background: #c99b8f; color: #1a1720; }

/* ── history sheet：回顾这首歌下面聊过的话 ── */
.tg-history-list { overflow-y: auto; flex: 1; min-height: 80px; display: flex; flex-direction: column; gap: 10px; padding: 4px 0 10px; }
.tg-history-row { display: flex; align-items: flex-end; gap: 8px; }
.tg-history-row.mine { flex-direction: row-reverse; }
.tg-history-row img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; }
.tg-history-row .hr-bubble { max-width: 72%; padding: 8px 13px; border-radius: 14px 14px 14px 4px; font-size: 13px;
  line-height: 1.5; background: rgba(255,255,255,.07); color: #ece8f0; }
.tg-history-row.mine .hr-bubble { border-radius: 14px 14px 4px 14px; background: rgba(201,155,143,.22); }
.tg-history-empty { text-align: center; color: #665e70; font-size: 12.5px; padding: 24px 0; }
