/* =========================================================
   光韵 Guangyun · 全局样式
   设计气质参考 shandianhub.cn：清爽、现代、科技感
   主题色通过 :root 变量切换；data-theme 控制预设
   ========================================================= */

:root {
  --primary: #F25C05;
  --primary-2: #FF9E45;
  --primary-soft: rgba(242, 92, 5, 0.12);
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #EEF0F7;
  --text: #1F2233;
  --muted: #8A8FA3;
  --border: #E6E8F0;
  --shadow: 0 8px 24px rgba(31, 34, 51, 0.08);
  --shadow-sm: 0 2px 8px rgba(31, 34, 51, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --bottom-bar: 64px;
  --player-h: 64px;
  --header-h: 56px;
}

/* 主题预设 */
[data-theme="night"] {
  --primary: #BB86FC;
  --primary-2: #7C5CFC;
  --primary-soft: rgba(187, 134, 252, 0.16);
  --bg: #0F1226;
  --surface: #181C33;
  --surface-2: #20253F;
  --text: #ECEEFB;
  --muted: #9AA0C0;
  --border: #2A3050;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
}
[data-theme="teal"] {
  --primary: #00BFA5;
  --primary-2: #1DE9B6;
  --primary-soft: rgba(0, 191, 165, 0.12);
}
[data-theme="sunset"] {
  --primary: #FF7E5F;
  --primary-2: #FFB05C;
  --primary-soft: rgba(255, 126, 95, 0.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; }
a { color: var(--primary); text-decoration: none; }

/* 滚动条轻量化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ---------------- 应用骨架 ---------------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px var(--border);
  overflow: hidden;
}
@media (min-width: 481px) {
  body { display: flex; align-items: center; justify-content: center; padding: 24px; }
  .app { height: 860px; max-height: 92vh; border-radius: 28px; box-shadow: var(--shadow); }
}

/* ---------------- 顶部栏 ---------------- */
.header {
  height: var(--header-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 19px; letter-spacing: .5px;
}
.header .brand .logo-img {
  width: 36px; height: 36px; border-radius: 10px; object-fit: contain;
  background: var(--surface-2); padding: 3px;
  box-shadow: var(--shadow-sm);
}
.header .brand small { font-weight: 500; font-size: 11px; color: var(--muted); display: block; line-height: 1; }
.header .icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text);
}
.header .icon-btn svg { width: 20px; height: 20px; }
.header .icon-btn:active { transform: scale(.94); }

/* 搜索框 */
.search {
  margin: 12px 16px 4px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 9px 14px;
}
.search input { border: none; outline: none; background: transparent; flex: 1; color: var(--text); }
.search .si { color: var(--muted); }

/* ---------------- 内容区 ---------------- */
.content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 150px;
  -webkit-overflow-scrolling: touch;
}
.view { display: none; padding: 8px 0 16px; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 18px 16px 10px;
}
.section-title h2 { font-size: 17px; margin: 0; font-weight: 700; }
.section-title .more { font-size: 12px; color: var(--muted); }

/* Hero */
.hero {
  margin: 8px 16px 0;
  border-radius: var(--radius);
  padding: 22px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero::after {
  content: "♪"; position: absolute; right: -10px; top: -20px;
  font-size: 120px; opacity: .12; transform: rotate(-15deg);
}
.hero h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: 1px; }
.hero p { margin: 0; opacity: .92; font-size: 13px; }
.hero .hero-actions { margin-top: 16px; display: flex; gap: 10px; }
.btn {
  border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: 14px;
  transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: #fff; color: var(--primary); }
.btn-ghost { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.4); }

/* 分类快捷入口 */
.quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 16px 0;
}
.quick {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 6px; text-align: center; box-shadow: var(--shadow-sm);
}
.quick .emoji { font-size: 22px; }
.quick .label { font-size: 12px; margin-top: 4px; color: var(--text); }

/* 歌曲卡片（列表） */
.song-list { margin: 6px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.song {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; box-shadow: var(--shadow-sm);
  transition: transform .1s;
}
.song:active { transform: scale(.99); }
.song .cover {
  width: 52px; height: 52px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface-2));
  display: grid; place-items: center; font-size: 26px;
}
.song .meta { flex: 1; min-width: 0; }
.song .meta .t { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .meta .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .tags { display: flex; gap: 6px; margin-top: 5px; }
.tag {
  font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.tag.lang { background: var(--surface-2); color: var(--muted); }
.song .play {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; display: grid; place-items: center; font-size: 16px;
}
.song.playing .play { box-shadow: 0 0 0 4px var(--primary-soft); }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 14px; }

/* ---------------- 分类页筛选 ---------------- */
.filters { padding: 8px 16px 0; }
.filter-group { margin-bottom: 12px; }
.filter-group .gl { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
.chip.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; }
.chip:active { transform: scale(.96); }

/* ---------------- 我的页 ---------------- */
.profile {
  margin: 12px 16px; padding: 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.profile .avatar {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.22);
  display: grid; place-items: center; font-size: 26px; border: 2px solid rgba(255,255,255,.5);
}
.profile .info .name { font-size: 18px; font-weight: 700; }
.profile .info .sub { font-size: 12px; opacity: .9; margin-top: 2px; }

.menu { margin: 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.menu .item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.menu .item:last-child { border-bottom: none; }
.menu .item .mi { font-size: 18px; width: 22px; text-align: center; }
.menu .item .ml { flex: 1; font-size: 15px; }
.menu .item .mr { color: var(--muted); font-size: 13px; }
.menu .item:active { background: var(--surface-2); }

/* 设置弹层 */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60;
  display: none; align-items: flex-end; justify-content: center;
}
.sheet-mask.open { display: flex; }
.sheet {
  width: 100%; max-width: 480px; background: var(--surface);
  border-radius: 22px 22px 0 0; padding: 18px 18px 28px; animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet h3 { margin: 4px 0 14px; font-size: 16px; }
.sheet .row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.sheet .row .rl { font-size: 14px; }
.theme-dots { display: flex; gap: 10px; }
.theme-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); }
.theme-dot.active { border-color: var(--text); transform: scale(1.1); }
.theme-dot[data-t="default"] { background: linear-gradient(135deg,#F25C05,#FF9E45); }
.theme-dot[data-t="night"] { background: #181C33; }
.theme-dot[data-t="teal"] { background: #00BFA5; }
.theme-dot[data-t="sunset"] { background: linear-gradient(135deg,#FF7E5F,#FFB05C); }
.lang-seg { display: flex; gap: 8px; }
.lang-seg .chip { padding: 7px 16px; }

/* ---------------- 底部 Tab ---------------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--bottom-bar);
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; z-index: 30;
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: 11px;
}
.tabbar .tab .ti { font-size: 21px; }
.tabbar .tab.active { color: var(--primary); font-weight: 600; }

/* ---------------- 迷你播放器 ---------------- */
.player {
  position: absolute; left: 0; right: 0; bottom: var(--bottom-bar); height: var(--player-h);
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 14px; z-index: 31;
  transform: translateY(120%); transition: transform .3s ease;
}
.player.show { transform: translateY(0); }
.player .pcover { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface-2)); }
.player .pmeta { flex: 1; min-width: 0; }
.player .pmeta .pt { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .pmeta .ps { font-size: 11px; color: var(--muted); }
.player .pctrl { display: flex; gap: 8px; }
.player .pctrl button { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 16px; }
.player .pctrl .main { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq span { width: 3px; background: var(--primary); border-radius: 2px; animation: eq .8s infinite ease-in-out; }
.eq span:nth-child(2){ animation-delay:.2s } .eq span:nth-child(3){ animation-delay:.4s }
@keyframes eq { 0%,100%{height:4px} 50%{height:14px} }

/* 进度条 */
.progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--border); }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

/* ---------------- 通用弹窗 / Toast ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 70;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-mask.open { display: flex; }
.modal {
  width: 100%; max-width: 420px; max-height: 86vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px; padding: 20px; animation: fade .2s ease;
}
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { resize: vertical; min-height: 64px; }
.modal .actions { display: flex; gap: 10px; margin-top: 6px; }
.modal .actions .btn { flex: 1; text-align: center; }
.btn-block { width: 100%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.note { font-size: 12px; color: var(--muted); margin-top: 8px; }

.toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%) translateY(-20px);
  background: rgba(31,34,51,.92); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 100; opacity: 0; transition: all .3s; pointer-events: none; max-width: 80%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 登录引导（未登录） */
.login-cta { margin: 12px 16px; text-align: center; padding: 24px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--border); }
.login-cta .big { font-size: 40px; }
.login-cta p { color: var(--muted); font-size: 13px; margin: 8px 0 16px; }
.login-cta .big svg { width: 52px; height: 52px; }

/* ---------------- 板块（三大板块：标题 + 内容区域） ---------------- */
.sec { padding: 4px 0 6px; scroll-margin-top: 8px; }
.sec-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 20px 16px 12px; padding-left: 11px;
  border-left: 4px solid var(--primary);
}
.sec-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.sec-head .sub { font-size: 12px; color: var(--muted); }
.sec + .sec { border-top: 1px solid var(--border); }

/* ---------------- 浮动音符播放器（固定右下角） ---------------- */
.fab { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab .now {
  max-width: 220px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: none;
}
.play-fab {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 24px rgba(108,92,231,.45);
  display: grid; place-items: center;
  transition: transform .12s ease, box-shadow .2s ease;
}
.play-fab:active { transform: scale(.93); }
.play-fab svg { width: 30px; height: 30px; fill: #fff; }
.play-fab.playing { animation: fabPulse 1.4s ease-in-out infinite; }
@keyframes fabPulse {
  0%,100% { box-shadow: 0 10px 24px rgba(108,92,231,.45); transform: translateY(0); }
  50% { box-shadow: 0 14px 30px rgba(108,92,231,.65); transform: translateY(-4px); }
}
/* 播放中用伪元素显示“正在播放”小圆点，避免依赖表情符号 */
.play-fab.playing::after {
  content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; top: 6px; right: 6px; box-shadow: 0 0 0 3px rgba(255,255,255,.35);
}

/* ---------------- 底部三大板块导航 ---------------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(480px, 100%); height: 64px; z-index: 49;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(31,34,51,.06);
}
.bottom-nav .nav-item {
  flex: 1; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; font-weight: 600;
  transition: color .2s;
}
.bottom-nav .nav-item svg { width: 22px; height: 22px; stroke-width: 2; }
.bottom-nav .nav-item.active { color: var(--primary); }
.bottom-nav .nav-item.active svg { stroke: var(--primary); }

/* ---------------- 头像 ---------------- */
.avatar-row { display: flex; align-items: center; gap: 14px; margin: 8px 16px 14px; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  background: var(--surface-2); border: 2px solid var(--border);
  display: grid; place-items: center; color: var(--muted);
}
.avatar svg { width: 32px; height: 32px; }
.avatar-change {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.avatar-change svg { width: 16px; height: 16px; }

/* ---------------- 音频上传输入 ---------------- */
input[type="file"] {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px dashed var(--border); background: var(--bg); color: var(--text);
  font-size: 13px;
}
input[type="file"]::file-selector-button {
  border: none; border-radius: 8px; padding: 6px 12px; margin-right: 10px;
  background: var(--primary); color: #fff; font-weight: 600;
}

/* SVG 图标尺寸统一 */
.cover svg, .qicon { width: 28px; height: 28px; }
.play svg { width: 18px; height: 18px; }
.menu .mi svg { width: 18px; height: 18px; }
.search .si svg { width: 18px; height: 18px; }
