/* ============================================================
   karaokequeen.art — 邓丽君主题视觉
   意象：柔焦舞台灯光 / 唱片封套绢纸 / 月亮代表我的心
   绢纸米白 + 豆沙玫瑰粉 + 香槟金描边 + 月光黄点缀
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Light / 浅色（默认）- "淡淡幽情"：绢纸与玫瑰 */
  --bg: #F7F0E6;
  --bg-card: #FDF9F0;
  --text-primary: #3B3532;
  --text-secondary: #8C8178;
  --accent: #C9757E;          /* 豆沙玫瑰粉：激活态、假名注音 */
  --accent-dark: #A85A63;
  --accent-contrast: #FDF6EE;
  --gold: #C9A86A;            /* 香槟金：描边、装饰、播放键 */
  --gold-strong: #B08D4F;
  --gold-soft: #D9C69C;
  --romaji: #A68B5B;          /* 暖棕金：罗马字 */
  --border: #E5D9C4;
  --border-gold: #D3BC8E;
  --btn-bg: #FBF5E9;
  --hover-bg: #F6E7E7;        /* 行 hover：极淡的粉 */
  --hero-bg: #352A2C;         /* 视频卡：舞台幕布暖棕黑 */
  --hero-label: #CBB59A;
  --shadow: 2px 2px 0 rgba(120, 92, 60, 0.14);
  --shadow-hover: 3px 3px 0 rgba(120, 92, 60, 0.2);
}

[data-theme="dark"] {
  /* Dark / 深色 - "夜来香"：暖调夜色，非冷蓝紫 */
  --bg: #231D22;
  --bg-card: #322830;
  --text-primary: #F3E9DC;
  --text-secondary: #A79A93;
  --accent: #E09AA2;
  --accent-dark: #C9757E;
  --accent-contrast: #3A2428;
  --gold: #D4B57E;
  --gold-strong: #B8965C;
  --gold-soft: #8A7248;
  --romaji: #C9B08A;
  --border: #4A3C42;
  --border-gold: #6B5836;
  --btn-bg: #3B2F36;
  --hover-bg: #3E3038;
  --hero-bg: #1C1619;
  --hero-label: #8F7A6B;
  --shadow: 2px 2px 0 rgba(15, 10, 12, 0.5);
  --shadow-hover: 3px 3px 0 rgba(15, 10, 12, 0.65);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* 背景图（light.png / dark.png） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  opacity: 0.5;
}

:root {
  --bg-image: url('../light.png');
}

[data-theme="dark"] {
  --bg-image: url('../dark.png');
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 28px 40px;
}

/* ===== 顶部导航 ===== */
.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 4px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}

.logo {
  font-family: "Noto Serif SC", "Noto Serif JP", "Songti SC", serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}

.logo span {
  color: var(--accent);
  font-weight: 600;
}

.logo::before {
  content: '♪ ';
  font-family: "Inter", sans-serif;
  color: var(--gold);
}

.topnav .spacer {
  flex: 1;
}

.nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--gold-soft);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* 语言切换：香槟金描边小按键（无阴影） */
.nav-circle {
  min-width: 38px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
  background: var(--btn-bg);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.nav-circle:hover {
  border-color: var(--gold-strong);
}

/* ===== 主舞台：左视频 + 右歌词（两栏等高、底部对齐） ===== */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  column-gap: 30px;
  align-items: start;
}

@media (max-width: 960px) {
  .stage {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }
}

/* 视频卡：舞台幕布色"放映框" */
.video-card {
  background: var(--hero-bg);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.6s ease both;
}

.video-label {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--hero-label);
  padding: 2px 6px 12px;
}

.video-label::after {
  content: '  ✦';
  color: var(--gold);
  letter-spacing: 0;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* 歌曲信息（K 歌按钮在右侧） */
.song-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding: 20px 6px 4px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.song-meta .spacer {
  flex: 1;
}

.song-meta .play-btn {
  align-self: center;
}

.song-title {
  font-family: "Noto Serif JP", "Noto Serif SC", "Songti SC", serif;
  font-size: 29px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.song-title::after {
  content: ' ✦';
  font-family: "Inter", sans-serif;
  font-size: 15px;
  color: var(--gold);
}

.artist {
  font-size: 14px;
  color: var(--text-secondary);
}

/* K歌播放键：金色圆键 + 玫瑰粉三角（页面唯一圆形按钮，黑胶唱机意象） */
.play-btn {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--gold-strong);
  background: radial-gradient(circle at 35% 30%, var(--gold-soft), var(--gold));
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.play-btn i {
  font-style: normal;
  display: none;
}

.play-btn i.play-icon {
  display: inline-block;
  transform: translateX(2px);
}

.play-btn i.stop-icon b {
  display: inline-block;
  width: 5px;
  height: 15px;
  background: var(--accent-dark);
  margin: 0 3px;
  border-radius: 1px;
}

.play-btn.active i.play-icon {
  display: none;
}

.play-btn.active i.stop-icon {
  display: inline-block;
}

/* ===== 歌词面板 ===== */
.lyrics-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 22px 16px;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.6s ease 0.15s both;
}

@media (min-width: 961px) {
  .lyrics-card {
    position: sticky;
    top: 20px;
    /* JS 会将 max-height 精确同步为左栏高度；此处为 JS 生效前的兜底 */
    max-height: calc(100vh - 40px);
  }
}

.lyrics-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  /* 印刷式双线 */
  border-bottom: 3px double var(--border-gold);
}

.lyrics-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.lyrics-header h2::before {
  content: '♪ ';
  color: var(--accent);
}

.lyrics-counter {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* 切换按键：绢纸底 + 香槟金描边（无阴影），激活为玫瑰粉实心 */
.toggle-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 0 6px;
}

.pill {
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 12px;
  border: 1px solid var(--border-gold);
  background: var(--btn-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pill:hover {
  color: var(--text-primary);
  border-color: var(--gold-strong);
}

/* 激活：玫瑰粉实心、深一号描边 */
.pill.active {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: var(--accent-contrast);
}

.pill-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--gold-soft);
  flex: none;
}

#themeToggle.active .pill-dot {
  background: var(--accent-contrast);
}

/* 歌词列表 */
.lyrics-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0 2px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-gold) transparent;
}

.lyric-line {
  position: relative;
  padding: 14px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.22s ease, opacity 0.22s ease;
  border: 1px solid transparent;
  scroll-margin: 12px;
}

.lyric-line:hover {
  background: color-mix(in srgb, var(--hover-bg) 50%, transparent);
}

/* 有当前行时，其余行自然退后 */
.lyrics-section.has-active .lyric-line:not(.active) {
  opacity: 0.5;
}

.lyrics-section.has-active .lyric-line:not(.active):hover {
  opacity: 0.85;
}

/* 当前行：不换底色（保证可读性），只用香槟金左竖条 + 文字放大 */
.lyric-line.active {
  box-shadow: inset 3px 0 0 var(--gold);
  opacity: 1;
  margin-top: 20px;
}

/* 当前行上方的 "CURRENT LINE" 小标签 */
.lyric-line.active::before {
  content: 'CURRENT LINE';
  position: absolute;
  top: -16px;
  left: 4px;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  pointer-events: none;
}

.lyric-jp-with-furigana,
.lyric-jp-plain {
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.9;
  margin-bottom: 2px;
  transition: font-size 0.2s ease;
}

.lyric-line.active .lyric-jp-with-furigana,
.lyric-line.active .lyric-jp-plain {
  font-size: 19px;
}

/* 假名注音：玫瑰粉小字 */
.lyric-jp-with-furigana rt {
  color: var(--accent);
  font-size: 0.55em;
  font-weight: 400;
  letter-spacing: 0;
}

.lyric-romaji {
  font-family: "Inter", -apple-system, sans-serif;
  font-size: 13.5px;
  color: var(--romaji);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  margin-bottom: 2px;
}

.lyric-cn {
  font-size: 13.5px;
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* Hidden states */
.lyric-line .lyric-romaji,
.lyric-line .lyric-cn {
  transition: opacity 0.3s ease;
}

.hide-romaji .lyric-romaji,
.hide-cn .lyric-cn {
  display: none;
}

.lyric-jp-with-furigana {
  display: block;
}

.hide-furigana .lyric-jp-with-furigana {
  display: none;
}

.lyric-jp-plain {
  display: none;
}

.hide-furigana .lyric-jp-plain {
  display: block;
}

/* ===== 首页歌单 ===== */
.index-hero {
  padding: 4px 4px 24px;
  animation: fadeInDown 0.6s ease;
}

.index-hero .song-title {
  font-size: 31px;
  margin-bottom: 6px;
}

.song-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  animation: fadeInUp 0.6s ease 0.15s both;
}

.song-card {
  display: block;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.15s ease;
}

.song-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.song-card .song-card-title {
  font-family: "Noto Serif JP", "Noto Serif SC", "Songti SC", serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.song-card .song-card-title::after {
  content: ' ♪';
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.song-card:hover .song-card-title::after {
  opacity: 1;
}

.song-card .song-card-artist {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 52px 24px 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.footer p::before {
  content: '✦ ';
  color: var(--gold);
}

.footer p::after {
  content: ' ✦';
  color: var(--gold);
}

/* ===== Animations ===== */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.lyric-line {
  opacity: 0;
  animation: lyricFadeIn 0.45s ease forwards;
}

@keyframes lyricFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger animation */
.lyric-line:nth-child(1) { animation-delay: 0.03s; }
.lyric-line:nth-child(2) { animation-delay: 0.06s; }
.lyric-line:nth-child(3) { animation-delay: 0.09s; }
.lyric-line:nth-child(4) { animation-delay: 0.12s; }
.lyric-line:nth-child(5) { animation-delay: 0.15s; }
.lyric-line:nth-child(6) { animation-delay: 0.18s; }
.lyric-line:nth-child(7) { animation-delay: 0.21s; }
.lyric-line:nth-child(8) { animation-delay: 0.24s; }
.lyric-line:nth-child(9) { animation-delay: 0.27s; }
.lyric-line:nth-child(10) { animation-delay: 0.3s; }
.lyric-line:nth-child(n+11) { animation-delay: 0.33s; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .container {
    padding: 14px 16px 32px;
  }

  .topnav {
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 20px;
  }

  .logo {
    font-size: 18px;
  }

  .song-title {
    font-size: 24px;
  }

  .video-card {
    padding: 12px 12px 10px;
  }

  .lyrics-card {
    padding: 18px 16px 12px;
  }

  .lyric-line {
    padding: 11px 13px;
  }
}
