/* 屿音 YuYin · 主题变量与明暗切换
   深色为默认；body.light-theme 覆盖为浅色。 */

body.yc-theme{
  --yc-bg:#0b1310;
  --yc-bg-2:#0f1a14;
  --yc-panel:rgba(20,34,28,.72);
  --yc-panel-strong:rgba(26,46,34,.92);
  --yc-border:rgba(255,255,255,.09);
  --yc-border-strong:rgba(255,255,255,.16);
  --yc-text:#eefdf4;
  --yc-text-2:#b9d3c6;
  --yc-muted:#7a9a88;
  --yc-primary:#4ade80;
  --yc-primary-2:#22c55e;
  --yc-secondary:#7dd3fc;
  --yc-radius:18px;
  --yc-blur:blur(14px);
  --yc-shadow:0 20px 60px rgba(0,0,0,.42);
  --yc-warn:#ffc978;
  --yc-danger:#ff7c92;

  background:
    radial-gradient(circle at 8% -5%, rgba(74,222,128,.10), transparent 34%),
    radial-gradient(circle at 92% 4%, rgba(34,197,94,.08), transparent 30%),
    linear-gradient(180deg,#0a1310 0%,#101d16 48%,#0b1310 100%);
  color:var(--yc-text);
}

/* 让旧变量跟随新主题，避免两套颜色打架 */
body.yc-theme{
  --bg:#0b1310;
  --bg2:#0f1a14;
  --panel:#14221c;
  --panel2:#1a2e22;
  --line:var(--yc-border);
  --text:var(--yc-text);
  --muted:var(--yc-muted);
  --accent:var(--yc-primary);
  --accent2:var(--yc-primary-2);
}

body.yc-theme.light-theme{
  --yc-bg:#f3f8f4;
  --yc-bg-2:#ffffff;
  --yc-panel:rgba(255,255,255,.86);
  --yc-panel-strong:#ffffff;
  --yc-border:rgba(16,60,38,.13);
  --yc-border-strong:rgba(16,60,38,.22);
  --yc-text:#122a1e;
  --yc-text-2:#3c5a4b;
  --yc-muted:#5d7a6b;
  --yc-primary:#16a34a;
  --yc-primary-2:#15803d;
  --yc-secondary:#0e7490;
  --yc-shadow:0 18px 50px rgba(18,60,40,.14);
  --yc-warn:#b45309;
  --yc-danger:#be123c;

  --bg:#f3f8f4;
  --bg2:#ffffff;
  --panel:#ffffff;
  --panel2:#eef6f0;
  --line:var(--yc-border);
  --text:var(--yc-text);
  --muted:var(--yc-muted);
  --accent:var(--yc-primary);
  --accent2:var(--yc-primary-2);

  background:
    radial-gradient(circle at 10% -10%, rgba(22,163,74,.10), transparent 38%),
    radial-gradient(circle at 95% 0%, rgba(14,116,144,.07), transparent 32%),
    linear-gradient(180deg,#ffffff 0%,#eef6f0 100%);
  color:var(--yc-text);
}

/* 浅色下修正写死的深色底/浅色字 */
body.yc-theme.light-theme .sidebar{background:rgba(255,255,255,.9);border-right-color:var(--yc-border)}
body.yc-theme.light-theme .topbar{background:rgba(255,255,255,.82)}
body.yc-theme.light-theme .nav button{color:var(--yc-text-2)}
body.yc-theme.light-theme .nav button:nth-child(1),
body.yc-theme.light-theme .nav button:nth-child(2),
body.yc-theme.light-theme .nav button:nth-child(3),
body.yc-theme.light-theme .nav button:nth-child(4){filter:none;opacity:.62}
body.yc-theme.light-theme .card,
body.yc-theme.light-theme .hero-main,
body.yc-theme.light-theme .hero-side,
body.yc-theme.light-theme .editor,
body.yc-theme.light-theme .insight,
body.yc-theme.light-theme .modal-card,
body.yc-theme.light-theme .stat,
body.yc-theme.light-theme .version-card{background:var(--yc-panel);border-color:var(--yc-border);color:var(--yc-text)}
body.yc-theme.light-theme input,
body.yc-theme.light-theme textarea,
body.yc-theme.light-theme select{background:rgba(255,255,255,.92);color:var(--yc-text);border-color:var(--yc-border-strong)}
body.yc-theme.light-theme .hero-main h1,
body.yc-theme.light-theme h1,
body.yc-theme.light-theme h2,
body.yc-theme.light-theme h3{color:var(--yc-text)}
body.yc-theme.light-theme .lyric-area,
body.yc-theme.light-theme .lyrics-area{background:rgba(255,255,255,.94);color:var(--yc-text)}
body.yc-theme.light-theme .modal{background:rgba(12,30,20,.42)}
body.yc-theme.light-theme #toast{background:#122a1e;color:#f3f8f4}
body.yc-theme.light-theme .badge{background:rgba(22,163,74,.12);color:var(--yc-primary)}
body.yc-theme.light-theme ::-webkit-scrollbar-thumb{background:rgba(16,60,38,.22)}

/* 细节统一 */
body.yc-theme ::selection{background:rgba(74,222,128,.32)}
body.yc-theme ::-webkit-scrollbar{width:9px;height:9px}
body.yc-theme ::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14);border-radius:6px}
body.yc-theme ::-webkit-scrollbar-track{background:transparent}

/* 素材灵感卡 */
body.yc-theme .inspire-card{background:linear-gradient(135deg,rgba(74,222,128,.10),rgba(125,211,252,.06));border:1px solid rgba(74,222,128,.28)}
body.yc-theme .inspire-swatch{display:inline-block;width:26px;height:26px;border-radius:7px;border:1px solid rgba(255,255,255,.22)}
body.yc-theme .inspire-tag{display:inline-block;padding:3px 9px;margin:0 6px 6px 0;border-radius:999px;font-size:12px;background:rgba(74,222,128,.12);color:var(--yc-text-2)}

/* 全流程按钮 */
body.yc-theme .btn.flow{background:linear-gradient(135deg,var(--yc-primary),var(--yc-primary-2));color:#052e18;font-weight:700}
body.yc-theme .btn.flow:disabled{opacity:.6;cursor:progress}

/* 流程步骤条 */
body.yc-theme .flow-steps{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
body.yc-theme .flow-step{padding:4px 11px;border-radius:999px;font-size:12px;border:1px solid var(--yc-border);color:var(--yc-muted)}
body.yc-theme .flow-step.active{border-color:var(--yc-primary);color:var(--yc-primary);background:rgba(74,222,128,.10)}
body.yc-theme .flow-step.done{border-color:rgba(74,222,128,.45);color:var(--yc-primary-2)}

/* ── 侧边栏图标 ──
   页面内联规则里的 background:transparent!important 会把图标图清掉，
   这里用同样重要的优先级补回来。深色主题用浅色图标，浅色主题换成深色图标，
   不使用 filter:invert（那会把按钮底色一起反相，变成紫红色）。 */
body.yc-theme .nav button{
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:23px!important;
  filter:none;
  opacity:.72;
}
body.yc-theme .nav button:nth-child(1){background-image:url('./assets/icons/icon-home.svg')!important;filter:none!important}
body.yc-theme .nav button:nth-child(2){background-image:url('./assets/icons/icon-create.svg')!important;filter:none!important}
body.yc-theme .nav button:nth-child(3){background-image:url('./assets/icons/icon-heart.svg')!important;filter:none!important}
body.yc-theme .nav button:nth-child(4){background-image:url('./assets/icons/icon-spark.svg')!important;filter:none!important}
body.yc-theme.light-theme .nav button:nth-child(1){background-image:url('./assets/icons/icon-home-dark.svg')!important}
body.yc-theme.light-theme .nav button:nth-child(2){background-image:url('./assets/icons/icon-create-dark.svg')!important}
body.yc-theme.light-theme .nav button:nth-child(3){background-image:url('./assets/icons/icon-heart-dark.svg')!important}
body.yc-theme.light-theme .nav button:nth-child(4){background-image:url('./assets/icons/icon-spark-dark.svg')!important}
body.yc-theme .nav button.active,
body.yc-theme .nav button:hover{opacity:1}

/* toast 不再撑爆屏幕 */
body.yc-theme .toast{max-width:min(560px,82vw);line-height:1.55;white-space:normal;word-break:break-word}

/* 右下角浮动操作（重新策划 / 生成整首） */
body.yc-theme .floating-actions{
  position:fixed;right:24px;bottom:24px;z-index:45;display:flex;gap:10px;align-items:center;
  padding:10px;border-radius:16px;
  background:var(--yc-panel-strong);border:1px solid var(--yc-border);
  box-shadow:var(--yc-shadow);backdrop-filter:var(--yc-blur);
}
body.yc-theme .floating-actions .btn{white-space:nowrap}
body.yc-theme .toast{bottom:104px!important}
@media(max-width:640px){
  body.yc-theme .floating-actions{right:12px;bottom:12px;padding:8px;gap:8px}
  body.yc-theme .toast{bottom:88px!important}
}

/* 日间模式：标签/胶囊/侧栏提示的对比度修正 */
body.yc-theme.light-theme .section-tab{
  color:#2f5344!important;background:#ffffff!important;border-color:rgba(16,60,38,.18)!important;
}
body.yc-theme.light-theme .section-tab.active{
  color:#14532d!important;
  background:linear-gradient(135deg,rgba(22,163,74,.20),rgba(22,163,74,.10))!important;
  border-color:rgba(22,163,74,.40)!important;
  font-weight:600;
}
body.yc-theme.light-theme .chip{
  color:#2f5344!important;background:#ffffff!important;border-color:rgba(16,60,38,.18)!important;
}
body.yc-theme.light-theme .chip.selected{
  color:#14532d!important;background:rgba(22,163,74,.14)!important;border-color:rgba(22,163,74,.35)!important;
}
body.yc-theme.light-theme .nav button::after{
  background:#ffffff!important;color:#122a1e!important;border-color:#c8e6d0!important;
}

/* 侧边栏头像入口 */
.avatar-btn{
  width:40px;height:40px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 8px;cursor:pointer;font-weight:700;font-size:15px;
  color:#eafff4;background:linear-gradient(135deg,#1f6f4a,#2f9d68);
  border:1px solid rgba(74,222,128,.35);
  transition:box-shadow .15s ease,transform .15s ease;
}
.avatar-btn:hover{box-shadow:0 0 0 3px rgba(74,222,128,.14);transform:translateY(-1px)}
body.yc-theme.light-theme .avatar-btn{
  color:#fff;background:linear-gradient(135deg,#159a5b,#2f9d68);border-color:rgba(16,60,38,.2);
}

.lyric-wrap{position:relative;overflow:hidden;border-radius:12px}
.lyric-hl{box-sizing:border-box;padding:13px 15px;border:1px solid transparent;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;overflow:hidden}
.lyric-wrap textarea{box-sizing:border-box;width:100%;overflow-wrap:anywhere;word-break:break-word}
/* 稳定方案：不再用透明 textarea + 覆盖层，直接显示 textarea 文本，彻底避免错位/溢出 */
.lyric-hl{display:none!important}
.lyric-wrap textarea{color:var(--text,#e8f6ee)!important;-webkit-text-fill-color:currentColor!important;background:transparent!important}
body.yc-theme.light-theme .lyric-wrap textarea{color:#122a1e!important;-webkit-text-fill-color:#122a1e!important}
/* 歌词编辑器：段落/表演标记着色（textarea 文字透明，底层 pre 负责显示） */
.lyric-wrap{position:relative}
.lyric-wrap textarea{position:relative;z-index:2;background:transparent;color:transparent;-webkit-text-fill-color:transparent;caret-color:var(--accent, #4ade80)}
.lyric-wrap textarea::selection{background:rgba(74,222,128,.28)}
.lyric-hl{position:absolute;inset:0;z-index:1;margin:0;overflow:hidden;white-space:pre-wrap;word-break:break-word;pointer-events:none;background:transparent!important;border-color:transparent!important;color:var(--text,#e8f6ee)}
.lyric-hl .sec{color:rgba(134,239,172,.5);font-weight:700}
.lyric-hl .perf{color:rgba(134,239,172,.52);font-style:italic;font-weight:400}
body.yc-theme.light-theme .lyric-hl{color:var(--yc-text,#1c2a24)}
body.yc-theme.light-theme .lyric-wrap textarea{caret-color:#15803d}
body.yc-theme.light-theme .lyric-wrap textarea::placeholder{color:rgba(28,42,36,.45)}
body.yc-theme.light-theme .lyric-hl .sec{color:rgba(21,128,61,.42)}
body.yc-theme.light-theme .lyric-hl .perf{color:rgba(21,128,61,.5);font-style:italic;font-weight:400}
#pureMusicBtn.active{background:linear-gradient(135deg,#22c55e,#4ade80)!important;color:#052e16!important;border-color:transparent!important;box-shadow:0 0 0 2px rgba(74,222,128,.55),0 8px 26px rgba(74,222,128,.42)!important}
body.yc-theme.light-theme #pureMusicBtn.active{color:#052e16!important}