/* ============================================================
 * Melodia Studio · style.css v3 — 黑白琴键艺术风
 * 视觉语言：黑色琴房 / 象牙白琴键 / 细线谱 / 线条音符 / 克制哑金
 * ============================================================ */
:root {
  --bg: #0b0b0e;
  --bg2: #101014;
  --panel: rgba(255, 252, 245, 0.028);
  --panel2: rgba(20, 20, 25, 0.85);
  --line: rgba(245, 242, 234, 0.09);
  --line2: rgba(245, 242, 234, 0.28);
  --txt: #f0ede6;
  --txt-dim: #9a948a;
  --txt-faint: #6b665e;
  --ivory: #f5f2ea;          /* 琴键白 */
  --ivory-dim: #cfc9bd;
  --black-key: #17171c;
  --gold: #c8a45c;           /* 克制哑金 */
  --gold-bright: #ddbc77;
  --ok: #9fbf8f;
  --err: #d98a8a;
  --radius: 16px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  --font: "Georgia", "Times New Roman", "Songti SC", "SimSun", serif;
  --font-ui: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  /* 语义面（随主题反转的硬编码去处） */
  --btn-face: linear-gradient(180deg, #fdfaf3, #e6e0d2);   /* 白键 */
  --btn-ink: #17171c;
  --btn-ghost-hover: rgba(245,242,234,0.045);
  --stave: rgba(245, 242, 234, 0.22);
  --note-c: rgba(245, 242, 234, 0.34);
  --input-bg: rgba(10, 10, 13, 0.65);
  --header-bg: rgba(11, 11, 14, 0.72);
  --task-bg: linear-gradient(160deg, rgba(23,23,28,0.85), rgba(13,13,17,0.8));
  --item-bg: linear-gradient(160deg, rgba(23,23,28,0.8), rgba(12,12,16,0.7));
  --detail-bg: rgba(8, 8, 11, 0.45);
  --spec-a: #f5f2ea; --spec-b: #8a887f;
  --bar-track: rgba(245,242,234,0.08);
  --focus-ring: rgba(245,242,234,0.06);
  --cover-ring: rgba(245,242,234,0.22);
  --keys-fade: rgba(11,11,14,0.9);
  --card-hi: rgba(255,255,255,0.035);
  --track-bg: rgba(10, 10, 13, 0.6);          /* tabs / seg 容器 */
  --placeholder: rgba(154, 148, 138, 0.85);
}
/* ============ 浅色主题（白色琴房） ============ */
html[data-theme="light"] {
  --bg: #f7f3ea;
  --bg2: #efe9dc;
  --panel: rgba(255, 255, 255, 0.55);
  --panel2: rgba(255, 255, 255, 0.85);
  --line: rgba(30, 26, 20, 0.1);
  --line2: rgba(30, 26, 20, 0.32);
  --txt: #26231d;
  --txt-dim: #4a4438;
  --txt-faint: #6b6353;
  --ivory: #221f19;                 /* 反转：亮面变墨 */
  --ivory-dim: #4a443a;
  --gold: #8a6b32;                  /* 哑金（DOG1 V7: 小字对比度≥4.5） */
  --gold-bright: #a37f3e;
  --shadow: 0 18px 50px rgba(90, 80, 60, 0.16);
  --btn-face: linear-gradient(180deg, #2a2722, #17151a);   /* 浅色：黑键渐变（配流动高光） */
  --btn-ink: #f3efe6;
  --btn-ghost-hover: rgba(20, 18, 14, 0.05);
  --stave: rgba(40, 34, 24, 0.2);
  --note-c: rgba(40, 34, 24, 0.4);
  --input-bg: rgba(255, 255, 255, 0.75);
  --header-bg: rgba(247, 243, 234, 0.75);
  --task-bg: linear-gradient(160deg, rgba(255,255,255,0.85), rgba(240,234,220,0.8));
  --item-bg: linear-gradient(160deg, rgba(255,255,255,0.9), rgba(243,237,225,0.8));
  --detail-bg: rgba(250, 246, 236, 0.7);
  --spec-a: #55504a; --spec-b: #a39c8e;
  --bar-track: rgba(40, 34, 24, 0.1);
  --focus-ring: rgba(154, 122, 63, 0.18);
  --cover-ring: rgba(60, 52, 40, 0.24);
  --keys-fade: rgba(247, 243, 234, 0.95);
  --card-hi: rgba(255, 255, 255, 0.5);
  --track-bg: rgba(40, 34, 24, 0.055);        /* 浅色：浅灰容器，未选中深字可读 */
  --note-pop: #8a6b32;                         /* 点击音符：浅色主题用深金（米白底可见） */
  --ok: #557a3f; --err: #b04a45;        /* V3 状态色浅色加深 */
  --placeholder: rgba(60, 54, 44, 0.68);
}
/* 浅色主题可见性修复 */
html[data-theme="light"] audio::-webkit-media-controls-panel { background: #efe9db; }
html[data-theme="light"] .tab.on, html[data-theme="light"] .seg .opt.on, html[data-theme="light"] .chip.on {
  background: #221f19;
  color: #f7f2e8;
  box-shadow: 0 3px 10px rgba(45, 38, 26, 0.35);
  font-weight: 600;
  border-color: transparent;
}
html[data-theme="light"] .tab { font-weight: 500; }
html[data-theme="light"] .tab:not(.on), html[data-theme="light"] .seg .opt:not(.on) {
  color: #3f3a30;
  font-weight: 500;
}
html[data-theme="light"] .chip:not(.on) { color: #3f3a30; }
/* 主按钮流动高光保留（Cai 喜欢），浅色下减弱透明度避免突兀 */
html[data-theme="light"] .btn::after {
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.55), transparent);
}
html[data-theme="light"] .keys.bottom { background: rgba(60, 52, 40, 0.07); border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(60,52,40,0.12); }
html[data-theme="light"] .keys.bottom .w { background: linear-gradient(180deg, #fffdf7, #e6e0d2); box-shadow: inset -0.5px 0 0 rgba(0,0,0,0.3), inset 0 -2px 0 rgba(0,0,0,0.07); }
html[data-theme="light"] .keys .edge { opacity: 0; }   /* 米白渐隐层会冲淡黑键，隐藏让黑白分明 */
/* ---- DOG1 审查修复（2026-09-05，V1-V13） ---- */
/* V1 toast 黑字黑底：toast 保持深底，文字强制浅色 */
html[data-theme="light"] .toast { color: #f5f2ea; }
/* V2 lib-detail prompt 硬编码浅灰不可读 + 分隔线消失 */
html[data-theme="light"] .lib-detail .prompt { color: #4a4438; }
html[data-theme="light"] .lib-detail { border-top-color: rgba(60,54,44,0.14); }
/* V4 nav 悬停白字悬米白 */
html[data-theme="light"] .nav a:hover { color: var(--txt); background: rgba(20,18,14,0.05); }
/* V5 ::selection 白字不可读 */
html[data-theme="light"] ::selection { background: rgba(138, 107, 50, 0.3); color: var(--txt); }
/* V6 header 琴键条与底部一致（统一 .keys 浅色化） */
html[data-theme="light"] .keys { background: rgba(60, 52, 40, 0.08); }
html[data-theme="light"] .keys .w { background: linear-gradient(180deg, #fffdf7, #e6e0d2); box-shadow: inset -0.5px 0 0 rgba(0,0,0,0.25), inset 0 -2px 0 rgba(0,0,0,0.06); }
html[data-theme="light"] .keys.bottom { background: rgba(60, 52, 40, 0.07); border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(60,52,40,0.12); }
/* V8 白系装饰族令牌化（6 处） */
html[data-theme="light"] .spin { border-color: rgba(60,54,44,0.15); border-top-color: var(--gold); }
html[data-theme="light"] .ex-chip { border-color: rgba(60,54,44,0.3); background: rgba(255,255,255,0.45); }
html[data-theme="light"] h2.sec .line { background: linear-gradient(90deg, rgba(60,54,44,0.22), transparent); }
html[data-theme="light"] header::after { background: linear-gradient(90deg, transparent, rgba(60,54,44,0.16), transparent); }
html[data-theme="light"] .brand .logo { border-color: rgba(60,54,44,0.4); }
/* V9 主按钮黑影过重 */
html[data-theme="light"] .btn { box-shadow: 0 10px 30px rgba(90,80,60,0.22), inset 0 1px 0 rgba(255,255,255,0.35); }
/* V10 hero h1 黑晕 */
html[data-theme="light"] .hero h1 { text-shadow: 0 2px 24px rgba(90,80,60,0.22); }
/* V11 开关滑轨关态难辨 */
html[data-theme="light"] .slider { background: rgba(60,54,44,0.16); }
html[data-theme="light"] .slider:before { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); border: 1px solid rgba(60,54,44,0.2); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background:
    radial-gradient(1200px 700px at 18% -10%, rgba(255, 250, 240, 0.05) 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 12%, rgba(200, 164, 92, 0.045) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-color: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  line-height: 1.65;
  overflow-x: hidden;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px 110px; position: relative; z-index: 1; }
::selection { background: rgba(200, 164, 92, 0.35); color: #fff; }

/* 背景：极淡的琴键山峦 + 星尘（保留一点点纹理，不抢戏） */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 14% 24%, rgba(255,255,255,0.16) 0, transparent 100%),
    radial-gradient(1px 1px at 38% 62%, rgba(255,255,255,0.1) 0, transparent 100%),
    radial-gradient(1.4px 1.4px at 58% 14%, rgba(255,255,255,0.13) 0, transparent 100%),
    radial-gradient(1px 1px at 78% 46%, rgba(255,255,255,0.1) 0, transparent 100%),
    radial-gradient(1px 1px at 90% 82%, rgba(255,255,255,0.12) 0, transparent 100%),
    radial-gradient(1.2px 1.2px at 8% 88%, rgba(255,255,255,0.1) 0, transparent 100%);
}

/* ---------- 钢琴键盘（琴键条） ---------- */
.keys {
  position: relative; height: 26px; overflow: hidden; user-select: none;
  background: rgba(0, 0, 0, 0.3); flex: none;
}
.keys .w { position: absolute; top: 0; bottom: 0; background: linear-gradient(180deg, #f8f5ee, #e8e4da); box-shadow: inset 0 -3px 0 rgba(0,0,0,0.12); }
.keys .b { position: absolute; top: 0; width: 4.6%; height: 60%; background: linear-gradient(180deg, #1c1c22, #0d0d11); border-radius: 0 0 3px 3px; box-shadow: 0 2px 5px rgba(0,0,0,0.55); z-index: 2; }
.keys .edge { position: absolute; inset: 0; background: linear-gradient(180deg, var(--keys-fade), transparent); pointer-events: none; z-index: 3; }
.keys.bottom { position: relative; margin-top: 40px; opacity: 0.8; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(14px); background: var(--header-bg);
}
header .keys { height: 22px; }
header .nav {
  display: flex; align-items: center; gap: 6px; max-width: 1120px; margin: 0 auto; padding: 10px 20px 9px;
}
header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245,242,234,0.14), transparent);
}
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  border: 1.5px solid rgba(245,242,234,0.55); color: var(--ivory);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.12), transparent 60%), rgba(255,255,255,0.02);
}
.brand b { font-size: 19px; font-weight: 400; letter-spacing: 3.5px; color: var(--ivory); font-family: var(--font); }
.brand small { color: var(--txt-faint); font-size: 10.5px; letter-spacing: 2px; margin-left: 2px; }
.nav a {
  color: var(--txt-dim); text-decoration: none; font-size: 13.5px; padding: 7px 15px; border-radius: 999px; cursor: pointer; transition: 0.18s; letter-spacing: 0.5px;
}
.nav a:hover { color: #fff; background: rgba(245,242,234,0.06); }
.nav a.on { color: var(--bg); background: var(--ivory); box-shadow: 0 2px 14px rgba(245,242,234,0.18); }
.nav .spacer { flex: 1; }
.pill { font-size: 10.5px; letter-spacing: 1px; color: var(--txt-dim); border: 1px solid var(--line); padding: 3px 12px; border-radius: 999px; background: rgba(245,242,234,0.03); white-space: nowrap; }
.theme-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); flex: none;
  background: var(--panel); color: var(--gold); cursor: pointer; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: 0.18s; padding: 0;
}
.theme-btn:hover { border-color: var(--line2); color: var(--gold-bright); transform: translateY(-1px); background: var(--btn-ghost-hover); }

/* ---------- Hero：五线谱 + 音符 ---------- */
.hero { position: relative; text-align: center; padding: 56px 0 34px; overflow: hidden; }
.hero::before {   /* 五线谱：5 条细线 */
  content: ""; position: absolute; left: -5%; right: -5%; top: 30px; height: 76px; pointer-events: none; opacity: 0.55;
  background: repeating-linear-gradient(180deg, transparent 0 13.4px, var(--stave) 13.4px 14.4px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.hero h1 {
  position: relative; font-size: clamp(32px, 5vw, 52px); font-weight: 400; letter-spacing: 2px;
  color: var(--ivory); font-family: var(--font);
  text-shadow: 0 2px 30px rgba(0,0,0,0.6);
}
.hero .sub { position: relative; color: var(--txt-dim); margin: 14px auto 0; font-size: 14.5px; max-width: 620px; letter-spacing: 0.4px; }
.hero .badge {
  position: relative; display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  font-size: 11px; color: var(--gold); letter-spacing: 0.6px;
  border: 1px solid rgba(200, 164, 92, 0.3); padding: 5px 16px; border-radius: 999px;
  background: rgba(200, 164, 92, 0.05);
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: blink 1.8s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
/* 漂浮音符 */
.note { position: absolute; color: var(--note-c); font-family: serif; pointer-events: none; animation: floatNote 6s ease-in-out infinite; }
@keyframes floatNote { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-13px) rotate(5deg); } }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  z-index: 0;                    /* 建层叠上下文，让 ::before 高光压在背景与内容之间 */
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(150deg, var(--card-hi), transparent 40%);
  z-index: -1;                   /* 不再盖住卡片内容（根治 tab 左白右黑） */
}
.grid { display: grid; gap: 20px; }
.grid.2 { grid-template-columns: 1.3fr 1fr; align-items: start; }
@media (max-width: 900px) { .grid.2 { grid-template-columns: 1fr; } .hero { padding: 40px 0 20px; } }
h2.sec { font-size: 13px; margin-bottom: 16px; color: var(--ivory); display: flex; align-items: center; gap: 14px; font-weight: 400; letter-spacing: 2.5px; }
h2.sec .line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(245,242,234,0.22), transparent); }
h2.sec .ic { font-size: 15px; color: var(--gold); }

/* ---------- 输入/控件 ---------- */
label.lb { display: block; font-size: 11.5px; color: var(--txt-dim); margin: 18px 0 8px; letter-spacing: 1.2px; }
input[type=text], input[type=password], textarea {
  width: 100%; background: var(--input-bg); color: var(--txt);
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; font-size: 14px; outline: none;
  font-family: inherit; transition: border-color 0.2s, box-shadow 0.2s;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus { border-color: var(--line2); box-shadow: 0 0 0 3px var(--focus-ring); }
textarea { min-height: 150px; resize: vertical; line-height: 1.8; }
::placeholder { color: var(--placeholder); opacity: 1; }

/* tabs / seg：白键选中态 */
.tabs { display: flex; gap: 6px; margin: 6px 0 14px; background: var(--track-bg); padding: 4px; border-radius: 11px; border: 1px solid var(--line); }
.tab { flex: 1; text-align: center; padding: 8px 0; border-radius: 8px; font-size: 13px; color: var(--txt-dim); cursor: pointer; transition: 0.18s; letter-spacing: 0.5px; }
.tab.on { color: var(--bg); background: var(--ivory); box-shadow: 0 2px 10px rgba(245,242,234,0.16); }

.seg { display: flex; gap: 4px; background: var(--track-bg); padding: 4px; border-radius: 10px; border: 1px solid var(--line); }
.seg .opt { flex: 1; text-align: center; padding: 7px 0; border-radius: 7px; font-size: 12.5px; color: var(--txt-dim); cursor: pointer; transition: 0.16s; user-select: none; }
.seg .opt.on { color: var(--bg); background: var(--ivory); box-shadow: 0 2px 10px rgba(245,242,234,0.15); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12px; color: var(--txt-dim); cursor: pointer; background: rgba(245,242,234,0.025);
  transition: 0.15s; user-select: none; letter-spacing: 0.4px;
}
.chip:hover { border-color: var(--line2); color: var(--ivory); }
.chip.on { color: var(--bg); background: var(--ivory); border-color: transparent; box-shadow: 0 2px 12px rgba(245,242,234,0.14); }

.switchrow { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 13px; color: var(--txt-dim); cursor: pointer; }
.switch { position: relative; width: 42px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: rgba(245,242,234,0.09); border-radius: 999px; transition: 0.2s; border: 1px solid var(--line); }
.slider:before { content: ""; position: absolute; width: 17px; height: 17px; left: 2px; top: 2px; background: #b9b4a8; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: linear-gradient(90deg, #8a7038, var(--gold)); border-color: transparent; }
.switch input:checked + .slider:before { transform: translateX(19px); background: #fff; }

/* 按钮：主键=象牙白（白键手感），幽灵=细线 */
.btn {
  position: relative; display: block; width: 100%; margin-top: 22px; padding: 14px; border: none; border-radius: 12px;
  font-size: 14.5px; font-weight: 600; letter-spacing: 2px; color: var(--btn-ink); cursor: pointer; overflow: hidden;
  background: var(--btn-face); color: var(--btn-ink); font-family: var(--font-ui);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255,255,255,0.9); transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1.5px); box-shadow: 0 14px 38px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.95); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn::after { /* 琴键高光扫过 */
  content: ""; position: absolute; top: 0; bottom: 0; width: 60px;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.75), transparent);
  transform: skewX(-20deg); animation: shine 4.2s infinite; left: -80px;
}
@keyframes shine { 0% { left: -90px; } 50% { left: 115%; } 100% { left: 115%; } }
.btn.ghost { background: transparent; color: var(--txt-dim); border: 1px solid var(--line); box-shadow: none; font-weight: 400; letter-spacing: 1px; }
.btn.ghost::after { display: none; }
.btn.ghost:hover { color: var(--ivory); border-color: var(--line2); background: var(--btn-ghost-hover); box-shadow: none; }
.btn.small { width: auto; padding: 8px 17px; font-size: 12.5px; margin-top: 0; border-radius: 9px; letter-spacing: 1px; }
.btn.small::after { display: none; }

/* ---------- 示例/段落工具 ---------- */
.examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.ex-chip {
  border: 1px dashed rgba(245,242,234,0.18); background: rgba(245,242,234,0.02);
  color: var(--txt-dim); font-size: 11.5px; padding: 4px 12px; border-radius: 999px; cursor: pointer; transition: 0.15s; letter-spacing: 0.3px;
}
.ex-chip:hover { border-color: var(--gold); color: var(--ivory); background: rgba(200, 164, 92, 0.06); }

.lyric-tools { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.lyric-tool {
  font-size: 11px; letter-spacing: 0.5px; color: var(--gold); border: 1px solid rgba(200,164,92,0.28);
  background: rgba(200,164,92,0.05); border-radius: 7px; padding: 3px 11px; cursor: pointer; transition: 0.15s;
}
.lyric-tool:hover { background: rgba(200,164,92,0.12); }
.lyric-tools .count { margin-left: auto; color: var(--txt-faint); font-size: 11px; align-self: center; }

/* ---------- 任务卡 ---------- */
.taskcard {
  border: 1px solid var(--line); border-radius: 14px; padding: 17px; margin-top: 12px;
  background: var(--task-bg);
  transition: border-color 0.2s;
}
.taskcard:hover { border-color: var(--line2); }
.taskcard .top { display: flex; gap: 12px; align-items: flex-start; }
.taskcard .tt { font-weight: 400; color: var(--ivory); font-size: 15.5px; letter-spacing: 0.4px; font-family: var(--font); }
.taskcard .sub { color: var(--txt-dim); font-size: 11.5px; margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; }
.taskcard .sub .tag { border: 1px solid var(--line); padding: 0 8px; border-radius: 5px; font-size: 10px; color: var(--txt-faint); letter-spacing: 0.4px; }
.taskcard .status { margin-left: auto; font-size: 11.5px; white-space: nowrap; display: flex; align-items: center; gap: 6px; letter-spacing: 0.5px; }
.st-done { color: var(--ok); } .st-error { color: var(--err); } .st-run { color: var(--gold); } .st-qu { color: var(--txt-dim); }
.bar { height: 4px; border-radius: 2px; background: var(--bar-track); margin-top: 13px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #6b665e, var(--gold)); border-radius: 2px; transition: width 0.6s; }

.spec { display: flex; gap: 3px; align-items: flex-end; height: 34px; margin-top: 13px; }
.spec i { flex: 1; background: linear-gradient(180deg, var(--spec-a), var(--spec-b)); border-radius: 2px; animation: eq 1s ease-in-out infinite; opacity: 0.8; }
@keyframes eq { 0%,100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }

.actions { display: flex; gap: 8px; margin-top: 13px; flex-wrap: wrap; align-items: center; }
audio { width: 100%; margin-top: 13px; height: 36px; }
audio::-webkit-media-controls-panel { background: #17171c; }

.waveform { width: 100%; height: 58px; margin-top: 13px; border-radius: 9px; background: rgba(8, 8, 11, 0.55); border: 1px solid var(--line); display: block; }
.wave-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--txt-faint); margin-top: 5px; letter-spacing: 0.8px; }

/* ---------- 作品库 ---------- */
.library .empty { text-align: center; color: var(--txt-dim); padding: 80px 0; font-size: 13.5px; }
.library .empty .big { font-size: 44px; margin-bottom: 14px; opacity: 0.55; color: var(--gold); }
.filter { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.lib-item {
  border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px;
  background: var(--item-bg);
  overflow: hidden; transition: border-color 0.2s;
}
.lib-item:hover { border-color: var(--line2); }
.lib-row { display: flex; gap: 14px; align-items: center; padding: 13px 16px; cursor: pointer; }
.lib-row .cover {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--cover-ring); background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.1), transparent 65%), rgba(245,242,234,0.03);
  color: var(--gold); font-size: 17px; font-family: serif;
}
.lib-row .meta { flex: 1; min-width: 0; }
.lib-row .meta .t { color: var(--ivory); font-weight: 400; font-size: 14px; letter-spacing: 0.4px; font-family: var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-row .meta .s { color: var(--txt-dim); font-size: 11.5px; margin-top: 1px; }
.lib-row .dur { color: var(--txt-faint); font-size: 11.5px; }
.lib-detail { border-top: 1px dashed rgba(245,242,234,0.12); padding: 13px 16px; font-size: 12.5px; color: var(--txt-dim); background: var(--detail-bg); }
.lib-detail .prompt { font-style: italic; color: #cfc9bd; line-height: 1.8; margin-bottom: 8px; white-space: pre-wrap; font-family: var(--font); }
.lib-detail .meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px 14px; font-size: 11px; }
.lib-detail .k { color: var(--txt-faint); }
@media (max-width: 640px) { .lib-row { flex-wrap: wrap; } .lib-row audio { width: 100%; } }

/* ---------- 页脚 ---------- */
footer { text-align: center; color: var(--txt-faint); font-size: 11.5px; padding: 30px 20px 34px; position: relative; z-index: 1; letter-spacing: 0.5px; }
footer .ai-mark {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(200,164,92,0.25); color: var(--gold);
  padding: 2px 14px; border-radius: 999px; font-size: 10.5px; margin-bottom: 8px; letter-spacing: 1px;
}

/* 备案号（法规要求：网站底部标注 + 工信部链接；双主题均走语义变量，对比度>=4.5:1） */
footer .icp { margin-top: 9px; font-size: 11px; letter-spacing: 0.6px; }
footer .icp a {
  color: var(--txt-dim); text-decoration: none;
  border-bottom: 1px solid var(--line2); padding-bottom: 1px; transition: 0.2s;
}
footer .icp a:hover { color: var(--gold); border-bottom-color: var(--gold); }

.hint { font-size: 11.5px; color: var(--txt-dim); }
.err-text { color: var(--err); font-size: 12px; margin-top: 8px; }
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(24px);
  background: rgba(30, 30, 36, 0.97); color: var(--ivory); padding: 12px 26px; border-radius: 12px;
  border: 1px solid rgba(245,242,234,0.16); font-size: 13px; opacity: 0; pointer-events: none; transition: 0.28s;
  z-index: 99; box-shadow: 0 18px 50px rgba(0,0,0,0.6); backdrop-filter: blur(10px); letter-spacing: 0.5px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,0.15); border-top-color: var(--gold); border-radius: 50%; animation: rot 0.8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
 * 点击音符特效（Melodia v0.5.2）
 * ============================================================ */
.click-note {
  position: fixed; z-index: 300; pointer-events: none; user-select: none;
  font-family: "Segoe UI Symbol", "Noto Music", serif;
  color: var(--note-pop, #e8c98a);
  text-shadow: 0 0 14px rgba(200, 164, 92, 0.5);
  opacity: 0;
  animation: noteRise var(--dur, 1.1s) ease-out forwards;
  will-change: transform, opacity;
}
@keyframes noteRise {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.6) rotate(var(--rot0, 0deg)); }
  12%  { opacity: 0.95; transform: translate(calc(var(--dx, 0px) * 0.2), -14px) scale(1.05) rotate(var(--rot1, 8deg)); }
  60%  { opacity: 0.9; transform: translate(calc(var(--dx, 0px) * 0.65), calc(var(--rise, -90px) * 0.7)) scale(1) rotate(var(--rot2, -6deg)); }
  100% { opacity: 0; transform: translate(var(--dx, 0px), var(--rise, -110px)) scale(0.92) rotate(var(--rot3, 4deg)); }
}

/* ============================================================
 * Melodia v0.5 · 账号 / 游客 / 充值 UI
 * ============================================================ */
#user-area { display: flex; align-items: center; }
.user-chip {
  display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); cursor: pointer;
  background: var(--panel); border-radius: 999px; padding: 4px 12px 4px 5px; color: var(--txt-dim);
  font-size: 12px; transition: 0.16s; letter-spacing: 0.3px;
}
.user-chip:hover { border-color: var(--line2); color: var(--txt); background: var(--btn-ghost-hover); }
.user-chip.guest { padding: 6px 14px; }
.u-avatar {
  width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--gold), #8a6b32); color: #fff; font-size: 12px; font-weight: 700; flex: none;
}
.u-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); }
.u-balance { color: var(--gold); font-weight: 600; font-size: 12.5px; }

/* Modal 通用 */
.mask {
  position: fixed; inset: 0; background: rgba(8, 8, 11, 0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 18px; animation: fadeIn 0.18s ease;
}
.modal {
  position: relative; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 18px; padding: 26px;
  box-shadow: var(--shadow); animation: popIn 0.22s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(10px); } to { opacity: 1; transform: none; } }
.m-close {
  position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--txt-dim); font-size: 16px; cursor: pointer; line-height: 1;
}
.m-close:hover { color: var(--txt); border-color: var(--line2); }
.m-title { font-size: 19px; font-weight: 400; color: var(--ivory); font-family: var(--font); letter-spacing: 1.5px; margin-bottom: 18px; }

/* 登录 */
.auth-tabs { display: flex; gap: 6px; margin-bottom: 8px; background: var(--track-bg); padding: 4px; border-radius: 10px; border: 1px solid var(--line); }
.auth-tabs span { flex: 1; text-align: center; padding: 7px 0; border-radius: 7px; font-size: 13px; color: var(--txt-dim); cursor: pointer; }
.auth-tabs span.on { color: var(--bg); background: var(--ivory); font-weight: 600; }
.auth-hint { margin-top: 12px; font-size: 11px; color: var(--txt-faint); text-align: center; letter-spacing: 0.3px; }

/* 用户中心 */
.wallet-head { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--task-bg); margin-bottom: 14px; }
.u-avatar.big { width: 46px; height: 46px; font-size: 20px; }
.w-user { font-size: 16px; color: var(--txt); font-family: var(--font); letter-spacing: 0.5px; }
.w-sub { font-size: 11px; color: var(--txt-faint); margin-top: 2px; }
.w-bal { margin-left: auto; text-align: right; }
.w-bal-label { font-size: 10.5px; color: var(--txt-faint); letter-spacing: 1px; }
.w-bal-num { font-size: 22px; color: var(--gold); font-weight: 700; font-family: var(--font); }

/* 充值 */
.recharge-bal { text-align: center; font-size: 13px; color: var(--txt-dim); margin-bottom: 16px; }
.recharge-bal b { color: var(--gold); font-size: 20px; font-family: var(--font); margin-left: 4px; }
.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.plan {
  position: relative; border: 1px solid var(--line); border-radius: 13px; padding: 16px 12px 13px; text-align: center;
  cursor: pointer; background: var(--task-bg); transition: 0.16s; animation: fadeIn 0.3s ease backwards;
}
.plan:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.2); }
.plan.hot { border-color: rgba(200, 164, 92, 0.6); }
.plan-tag { position: absolute; top: -8px; right: 10px; font-size: 10px; background: linear-gradient(90deg, #8a7038, var(--gold)); color: #fff; padding: 2px 10px; border-radius: 999px; letter-spacing: 1px; }
.plan-price { font-size: 25px; font-weight: 700; color: var(--ivory); font-family: var(--font); font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }
.plan-label { font-size: 12px; color: var(--txt-dim); margin-top: 3px; }
.plan-give { font-size: 11px; color: var(--gold); margin-top: 4px; }
.recharge-note { margin-top: 14px; font-size: 10.5px; color: var(--txt-faint); text-align: center; line-height: 1.7; }

/* 收银台 */
.checkout { text-align: center; }
.co-amount { font-size: 38px; font-weight: 700; color: var(--ivory); font-family: var(--font); letter-spacing: 1px; margin: 6px 0 2px; }
.co-give { font-size: 13px; color: var(--gold); margin-bottom: 16px; }
.co-method {
  display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; margin: 14px 0 8px; background: var(--task-bg); color: var(--txt); font-size: 14px;
}
.mi { width: 24px; height: 24px; border-radius: 6px; background: #07c160; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-style: normal; font-weight: 700; }
.co-badge { font-size: 10px; color: var(--txt-faint); border: 1px dashed var(--line2); padding: 1px 8px; border-radius: 5px; margin-left: 4px; }
.co-order { font-size: 11px; color: var(--txt-faint); margin: 6px 0 4px; letter-spacing: 0.5px; }
@media (max-width: 560px) { .plan-grid { grid-template-columns: 1fr 1fr; } .modal { padding: 20px 16px; } }

/* ============================================================
 * 窄屏响应式（手机 header 防溢出）
 * ============================================================ */
@media (max-width: 760px) {
  header .nav { max-width: none; padding: 8px 12px 7px; gap: 4px; }
  .brand { gap: 7px; min-width: 0; }
  .brand .logo { width: 28px; height: 28px; font-size: 14px; }
  .brand b { font-size: 17px; letter-spacing: 2px; white-space: nowrap; }
  .brand small { display: none; }            /* 副标题让位 */
  #prov-pill { display: none; }              /* 体验模式 pill 窄屏隐藏 */
  .nav a { padding: 6px 9px; font-size: 12.5px; white-space: nowrap; }
  .user-chip { padding: 4px 10px 4px 4px; font-size: 11.5px; }
  .user-chip.guest { padding: 5px 10px; }
  .u-name { max-width: 60px; }
  .u-balance { font-size: 11px; }
  .theme-btn { width: 30px; height: 30px; font-size: 13px; }
}
@media (max-width: 430px) {
  header .nav { padding: 8px 8px 7px; gap: 3px; }
  .nav a { padding: 5px 7px; font-size: 12px; }
  .u-balance { display: none; }              /* 最窄屏只留名字，余额进用户中心 */
}
