:root{
  --inset-top: env(safe-area-inset-top, 0px);
  /* 播放页头部可用起点：浏览器取安全区；App 沉浸式时由页面脚本改为“状态栏 + 菜单栏” */
  --app-top: var(--inset-top);
  /* 清新绿主题 */
  --bg:#eefaf3;
  --bg2:#ffffff;
  --card:#ffffff;
  --line:#d6ecdf;
  --text:#16352a;
  --muted:#5d8574;
  --dim:#8aa99a;
  --pri:#10b981;
  --pri2:#34d399;
  --pri-deep:#059669;
  --pri-soft:#e7f9f0;
  --amber:#e8a33d;
  --paper:#ffffff;
  --paper-ink:#1b3a2c;
  --key:#ffffff;
  --key-ink:#16352a;
  --shadow:0 8px 24px rgba(21,94,66,.10);
  --shadow-sm:0 2px 8px rgba(21,94,66,.08);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;}
html,body{
  -webkit-touch-callout:none;-webkit-user-drag:none;height:100%;margin:0;}
body{
  background:
    radial-gradient(120% 70% at 10% 0%, #ffffff 0%, rgba(255,255,255,0) 55%),
    radial-gradient(90% 60% at 100% 100%, #c9efdc 0%, rgba(201,239,220,0) 60%),
    linear-gradient(165deg, #f4fdf8 0%, #e8f9f0 42%, #d8f2e5 100%);
  background-attachment:fixed;
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:15px;line-height:1.5;overscroll-behavior:none;
  -webkit-user-select:none;user-select:none;
  -webkit-text-size-adjust:100%;
}
#app{height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden;
  box-sizing:border-box;}
.view{flex:1;display:flex;flex-direction:column;min-height:0;}
.hidden{display:none !important;}

/* ================= 曲库 ================= */
/* 首页整体限手机宽度居中，宽屏也按手机版式展示 */
#viewList{max-width:520px;margin:0 auto;width:100%;}
@media (min-width:560px){
  #viewList{
    box-shadow:0 0 0 1px rgba(16,185,129,.12),0 24px 70px rgba(21,94,66,.16);
    min-height:100%;background:rgba(255,255,255,.55);backdrop-filter:blur(6px);
  }
}
.banner{
  flex:none;margin:0;padding:0;line-height:0;position:relative;overflow:hidden;
  aspect-ratio:1080/800;background:#dff6ea;
}
.banner img{
  width:100%;height:100%;display:block;
  object-fit:cover;-webkit-user-drag:none;user-select:none;
}
/* 底部渐变过渡：只压住图片最底边 24px，不碰副标题 */
.banner .banner-fade{
  position:absolute;left:0;right:0;bottom:0;height:24px;z-index:1;pointer-events:none;
  background:linear-gradient(180deg,rgba(238,250,243,0),#eefaf3);
}
/* 沉浸式：状态栏压在图上的区域加一层很淡的暗角，保证时间/信号可读 */
.banner::after{
  content:"";position:absolute;left:0;right:0;top:0;pointer-events:none;z-index:2;
  height:calc(var(--inset-top) + 14px);
  background:linear-gradient(180deg,rgba(0,0,0,.30),rgba(0,0,0,0));
}
.list-head{padding:12px 14px 6px;flex:none;}
.search{
  display:flex;align-items:center;gap:8px;
  background:linear-gradient(180deg,#ffffff,#f8fdfa);
  border:1px solid var(--line);border-radius:14px;padding:0 12px;height:44px;
  box-shadow:var(--shadow-sm);
}
.search-ico{font-size:13px;opacity:.55;}
.search input{
  flex:1;background:transparent;border:0;outline:0;color:var(--text);
  font-size:15px;height:100%;min-width:0;
}
.search input::placeholder{color:var(--dim);}
.search-clear{
  border:0;background:transparent;color:var(--dim);font-size:20px;line-height:1;
  padding:6px;cursor:pointer;display:none;
}
.search.has-val .search-clear{display:block;}
.chips{
  display:flex;gap:8px;margin-top:10px;overflow-x:auto;padding-bottom:4px;
  scrollbar-width:thin;scrollbar-color:#a9dfc7 transparent;
  cursor:grab;
}
.chips.dragging{cursor:grabbing;scroll-behavior:auto;}
.chips::-webkit-scrollbar{height:6px;}
.chips::-webkit-scrollbar-button{display:none;width:0;height:0;}
.chips::-webkit-scrollbar-thumb{background:#a9dfc7;border-radius:3px;}
.chips::-webkit-scrollbar-track{background:transparent;}
@media (pointer:coarse){
  .chips{scrollbar-width:none;cursor:default;}
  .chips::-webkit-scrollbar{display:none;}
}
.chip{
  flex:none;border:1px solid var(--line);
  background:linear-gradient(180deg,#ffffff,#f3fcf7);
  color:var(--muted);
  border-radius:999px;padding:5px 12px;font-size:12.5px;cursor:pointer;
  box-shadow:var(--shadow-sm);
}
.chip:active{background:linear-gradient(180deg,#e9f9f1,#dcf4e8);border-color:#a9dcc3;}
.chip.on{
  background:linear-gradient(180deg,#12a374,#067a52);
  border-color:#056b48;color:#fff;font-weight:700;
  box-shadow:0 4px 12px rgba(6,122,82,.28);
}
.chip i{
  font-style:normal;font-size:10.5px;margin-left:4px;opacity:.75;
  font-variant-numeric:tabular-nums;
}
.chip.on i{opacity:.9;}

.list-scroll{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:4px 12px calc(var(--safe-b) + 20px);scrollbar-width:none;}
.list-scroll::-webkit-scrollbar{width:0;height:0;}
.song-row{
  display:flex;align-items:center;padding:12px 14px;border-radius:14px;cursor:pointer;
  background:linear-gradient(180deg,#ffffff,#fbfffd);
  border:1px solid #bfe0d0;
  box-shadow:var(--shadow-sm);
  margin-bottom:8px;
  transition:transform .12s,box-shadow .12s;
}
/* iOS 老版 WKWebView 不支持 flex gap，用相邻兄弟 margin 代替，保证排名/曲名/封面间距一致 */
.song-row > * + *{margin-left:12px;}
.song-row:active{transform:scale(.99);box-shadow:0 1px 4px rgba(21,94,66,.1);}
.song-rank{width:26px;flex:none;text-align:center;color:var(--dim);font-size:12.5px;font-variant-numeric:tabular-nums;}
.song-rank.top{
  color:#fff;font-weight:700;
  background:linear-gradient(135deg,#34d399,#10b981);
  border-radius:8px;padding:1px 0;box-shadow:0 3px 8px rgba(16,185,129,.35);
}
.song-main{flex:1;min-width:0;}
.song-name{font-size:15.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text);}
.song-meta{font-size:11.5px;color:var(--dim);margin-top:2px;}
.song-row.imageonly .song-name::after{
  content:"图";font-size:10px;color:var(--muted);border:1px solid var(--line);
  border-radius:4px;padding:0 3px;margin-left:6px;vertical-align:2px;
}
.list-more{text-align:center;color:var(--dim);font-size:12px;padding:16px 0 4px;}
.list-empty{text-align:center;color:var(--dim);padding:48px 0;font-size:13px;}

/* ================= 练习 ================= */
.play-head{
  display:flex;align-items:center;gap:8px;flex:none;position:relative;
  padding:calc(var(--app-top) + 8px) 10px 8px;
  border-bottom:1px solid rgba(16,185,129,.12);
  background:#ffffff;
}
.icon-btn{
  width:38px;height:38px;flex:none;border-radius:11px;border:1px solid var(--line);
  background:linear-gradient(180deg,#ffffff,#f4fcf8);
  color:var(--text);font-size:22px;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;padding:0;
  box-shadow:var(--shadow-sm);
}
.icon-btn.text{font-size:13px;font-weight:600;color:var(--muted);}
.icon-btn.on{
  background:linear-gradient(180deg,#e9fbf2,#d5f5e6);
  border-color:#8fd9b6;color:var(--pri-deep);
}
.title-wrap{flex:1;min-width:0;text-align:center;}
/* 左侧有按钮时标题仍按屏幕居中；高度与按钮一致，logo 垂直对齐 */
.play-head .title-wrap{
  position:absolute;left:72px;right:72px;bottom:8px;height:38px;
  display:flex;align-items:center;justify-content:center;
  pointer-events:none;
}
.song-title{font-size:16px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
/* 页头品牌 logo：替代重复的曲名 */
.brand-logo{display:block;height:24px;width:auto;}
.audio-tip{
  position:absolute;left:0;right:0;top:32px;height:12px;line-height:12px;
  font-size:10px;color:var(--dim);margin:0;
}
.audio-tip.warn{color:var(--amber);}

/* 修饰键（对应游戏鼠标左/中/右键） */
.mods{display:flex;gap:6px;flex:none;padding:6px 12px 4px;max-width:760px;margin:0 auto;width:100%;}
.mod{
  -webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;
  flex:1;display:flex;align-items:center;justify-content:center;gap:5px;height:40px;
  border:1px solid #cde7da;
  background:linear-gradient(180deg,#ffffff,#f7fdfa);
  color:#3d6f5a;font-weight:600;
  border-radius:12px;padding:0 4px;font-size:13px;cursor:pointer;font-family:inherit;
  touch-action:none;transition:background .1s,border-color .1s,color .1s,box-shadow .1s;
  -webkit-user-select:none;user-select:none;
  box-shadow:0 2px 0 #d9ebe2;
}
.mod b{
  font-size:9.5px;font-weight:700;color:#7aa694;
  border:1px solid #d5ece1;border-radius:4px;padding:0 3px;line-height:13px;
  background:#fbfefc;
}
body.touch .mod{font-size:14px;font-weight:600;letter-spacing:.5px;}
.mod.on,.mod.on.hint{
  background:linear-gradient(180deg,#0f9d6b,#067a52);
  border-color:#056b48;color:#fff;
  box-shadow:0 4px 14px rgba(6,122,82,.32);
}
.mod.on b{color:#d8fff0;border-color:rgba(255,255,255,.35);background:rgba(255,255,255,.14);}
.tool-btn{
  border:1px solid var(--line);
  background:linear-gradient(180deg,#ffffff,#f4fcf8);
  color:var(--muted);
  border-radius:10px;padding:8px 12px;font-size:12.5px;cursor:pointer;font-family:inherit;flex:none;
  box-shadow:var(--shadow-sm);
}
.tool-btn.on{background:linear-gradient(180deg,#e9fbf2,#d5f5e6);border-color:#8fd9b6;color:var(--pri-deep);}

/* ---- 乐谱纸 ---- */
.score-panel{
  flex:1;min-height:0;overflow:auto;-webkit-overflow-scrolling:touch;
  margin:0 auto;width:calc(100% - 24px);max-width:760px;border-radius:16px;
  background:linear-gradient(180deg,#ffffff,#fbfffd);
  border:1px solid rgba(16,185,129,.12);
  box-shadow:0 10px 30px rgba(21,94,66,.12);
  scrollbar-width:none;
}
.score-panel::-webkit-scrollbar{width:0;height:0;}
.score-wrap{position:relative;}
.score-inner{padding:16px 14px 22px;color:var(--paper-ink);width:max-content;transform-origin:left top;}
.score-title{font-size:16px;font-weight:700;text-align:center;margin-bottom:6px;letter-spacing:.5px;color:#124b36;}
.legend{
  display:flex;justify-content:center;gap:10px;flex-wrap:wrap;
  font-size:10px;color:#7d9c8e;margin-bottom:12px;
}
.legend i{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:3px;vertical-align:-1px;}
.legend .up{background:#f6e0bc;border:1px solid #d4923c;}
.legend .dn{background:#c8ecd8;border:1px solid #3d9a6a;}
.score-line{display:flex;align-items:flex-end;margin-bottom:12px;}
/* 宽屏铺满模式：每行按可用宽度均分 */
.score-inner.fill .score-line{width:100%;justify-content:space-between;}
/* 宽屏下不要用 space-between 拉大音符间距：多余空间留在两侧 */
@media (min-width:561px){
  .score-inner.fill .score-line{justify-content:center;}
}
.score-inner.fill .note{
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;flex:0 0 auto;}
.note{
  position:relative;display:flex;flex-direction:column;align-items:center;
  width:34px;flex:none;transition:background .12s,transform .12s;border-radius:8px;
}
.note.gap{width:15px;}
/* 自动演奏：正在播放的音 */
.note.cur{
  background:linear-gradient(180deg,#12a374 0%,#067a52 100%);
  border-radius:10px;
  box-shadow:0 0 0 2px rgba(6,122,82,.22),0 0 18px rgba(6,122,82,.35);
  transform:translateY(-2px);
}
.note.cur .note-digit,.note.cur .note-sharp{color:#fff;}
.note.cur .note-lyric{color:#eafff5;}
.note.cur .dot{background:#eafff5;}
.note.cur .note-key{background:rgba(255,255,255,.92);border-color:rgba(255,255,255,.92);color:#0a5c3e;}

/* 跟弹：当前应弹的音 */
.note.cursor{
  background:linear-gradient(180deg,rgba(52,211,153,.18),rgba(16,185,129,.22));
  box-shadow:inset 0 0 0 2px rgba(16,185,129,.75);
  border-radius:10px;
}
.note.cursor .note-digit{color:#0a6b4a;}
.note.miss{
  background:linear-gradient(180deg,rgba(248,113,113,.28),rgba(239,68,68,.22));
  border-radius:10px;transition:background .12s;
}
/* 琴键提示：下一个该按的键 */
.hkey.hint{
  background:linear-gradient(180deg,#ffffff 0%,#d6f8e7 100%);
  border:2px solid #12a374;
  color:#0a5c3e;
  box-shadow:0 3px 0 #a7dcc4,0 0 0 3px rgba(18,163,116,.16),0 0 18px rgba(18,163,116,.22);
  animation:hintPulse 1.2s ease-in-out infinite;
}
.hkey.hint .hk-digit{color:#0a5c3e;}
.hkey.hint .hk-letter{color:#2f8f6d;}
.hkey.hint .hk-dot{background:#0a5c3e;}
@keyframes hintPulse{
  0%,100%{box-shadow:0 3px 0 #045c3e,0 0 0 3px rgba(6,122,82,.18),0 0 12px rgba(6,122,82,.28);}
  50%{box-shadow:0 3px 0 #045c3e,0 0 0 4px rgba(6,122,82,.35),0 0 24px rgba(6,122,82,.5);}
}
/* 修饰键提示：需要按住哪个调音键 */
.mod.hint{
  border:2px solid #12a374;color:#0a5c3e;
  background:linear-gradient(180deg,#ffffff,#d9f8e9);
  box-shadow:0 0 0 3px rgba(18,163,116,.16),0 4px 12px rgba(18,163,116,.18);
}
.mod.hint b{color:#2f8f6d;border-color:#9de0c4;background:#f4fffa;}
/* 按错调音：浅红提示 */
.mod.miss{
  background:linear-gradient(180deg,#fff2f2,#ffdede);
  border:2px solid #ef8b8b;color:#8f2a2a;
  box-shadow:0 0 0 3px rgba(239,139,139,.18);
}
.mod.miss b{color:#a33c3c;border-color:#f3b4b4;background:#fff;}

/* 进度 */
.speed-btn{min-width:64px;padding:8px 5px;font-size:11.5px;font-variant-numeric:tabular-nums;letter-spacing:-.2px;}
.speed-btn.on{background:linear-gradient(180deg,#e9fbf2,#d5f5e6);border-color:#8fd9b6;color:#0a5c3e;}
/* 速度面板 */
.bpm-row{
  flex:none;display:flex;flex-wrap:wrap;gap:6px;
  padding:8px 12px 10px;max-width:760px;margin:0 auto;width:100%;
  background:linear-gradient(180deg,#ffffff,#f7fdfa);
}
.bpm-chip{
  flex:0 0 auto;min-width:52px;padding:7px 10px;border-radius:9px;
  border:1px solid #cde7da;background:#fff;color:#3d6f5a;
  font-size:12.5px;font-weight:600;font-family:inherit;cursor:pointer;
  font-variant-numeric:tabular-nums;
}
.bpm-chip.on{
  background:linear-gradient(180deg,#12a374,#067a52);border-color:#056b48;color:#fff;
  box-shadow:0 3px 10px rgba(6,122,82,.28);
}
.speed-btn::after{content:"";}
.progress{
  flex:none;font-size:12px;color:var(--pri-deep);font-weight:600;
  font-variant-numeric:tabular-nums;min-width:52px;text-align:right;
  background:#e8f7f0;border:1px solid #cde7da;border-radius:999px;padding:3px 10px;
}
.note-dots{height:11px;display:flex;flex-direction:column-reverse;align-items:center;justify-content:flex-end;gap:2px;}
.note-dots.down{height:11px;flex-direction:column;justify-content:flex-start;margin-top:1px;}
.dot{width:3.6px;height:3.6px;border-radius:50%;background:var(--paper-ink);}
.note-digit{
  position:relative;font-size:22px;font-weight:700;line-height:1.15;
  min-width:18px;text-align:center;padding-bottom:2px;
}
.note.dur8 .note-digit{border-bottom:2px solid var(--paper-ink);}
.note.dur16 .note-digit{border-bottom:2px solid var(--paper-ink);box-shadow:0 3px 0 -1px var(--paper-ink);}
.note-sharp{font-size:11px;font-weight:700;vertical-align:8px;margin-right:-1px;}
.note-bar{font-size:15px;font-weight:700;margin-left:1px;}
.note-key{
  margin-top:3px;font-size:9.5px;font-weight:800;letter-spacing:.2px;
  border-radius:5px;padding:0 3px;line-height:13px;min-width:13px;text-align:center;
  background:#e4f8ee;color:#0f5b41;border:1px solid #8ed3b3;
}
.note-key.hi{background:#fdf0d8;color:#7a3e0c;border-color:#dda65a;}
.note-key.lo{background:#c9f0db;color:#0d5c3c;border-color:#5cb98f;}
.note-lyric{
  font-size:11.5px;color:#33564a;margin-top:2px;height:16px;
  white-space:nowrap;max-width:34px;overflow:hidden;
}
.score-img{max-width:100%;display:block;margin:0 auto;border-radius:8px;}
.score-empty{color:#7d9c8e;text-align:center;padding:40px 0;font-size:13px;}

/* ---- 播放工具条 ---- */
.play-toolbar{display:flex;align-items:center;gap:8px;padding:10px 12px 4px;flex:none;max-width:760px;margin:0 auto;width:100%;}
.play-btn{
  flex:1;display:flex;align-items:center;justify-content:center;gap:6px;
  border:0;border-radius:14px;padding:12px 0;font-size:14px;font-weight:700;
  white-space:nowrap;
  background:linear-gradient(135deg,#12a374 0%,#07835a 55%,#056b48 100%);
  color:#fff;cursor:pointer;font-family:inherit;
  box-shadow:0 6px 16px rgba(6,122,82,.30);
  transition:transform .1s,box-shadow .1s,filter .1s;
}
/* 图标固定宽度：不同机型 ♯/▶ 字形宽度不同，固定后文案不换行、按钮不抖动 */
.pb-ico{
  width:16px;height:16px;flex:none;
  display:inline-flex;align-items:center;justify-content:center;
  line-height:1;
}
.pb-ico svg{display:block;width:100%;height:100%;}
.pb-txt{white-space:nowrap;}
.play-btn:active{transform:translateY(1px);box-shadow:0 4px 12px rgba(16,185,129,.3);filter:brightness(.98);}
.play-btn.playing{
  background:linear-gradient(135deg,#fb7185,#e11d48);
  animation:playingPulse 1.4s ease-in-out infinite;
}
@keyframes playingPulse{
  0%,100%{box-shadow:0 6px 16px rgba(225,29,72,.30),0 0 0 0 rgba(225,29,72,.35);}
  50%{box-shadow:0 8px 22px rgba(225,29,72,.45),0 0 0 10px rgba(225,29,72,0);}
}
/* 自动变调开关：默认浅色描边，开启后同绿色系实底 */
.play-btn.automod{
  background:linear-gradient(180deg,#ffffff,#f2fbf7);
  color:#0a5c3e;
  box-shadow:inset 0 0 0 1.5px #8fd9b6,0 4px 12px rgba(21,94,66,.08);
}
.play-btn.automod.on{
  background:linear-gradient(135deg,#12a374,#067a52);
  color:#fff;
  box-shadow:0 6px 16px rgba(6,122,82,.30);
}
/* 图片谱：禁用自动演奏/自动变调，给出明确状态 */
.play-btn:disabled,
.play-btn.automod:disabled{
  background:linear-gradient(180deg,#f2f9f5,#e4f2eb);
  color:#8aa99a;box-shadow:none;cursor:not-allowed;
}
.play-btn:disabled:active{transform:none;filter:none;}
.tool-group{display:flex;gap:6px;}

/* ---- 底栏承托：白底把琴键从绿色背景里分离出来 ---- */
.dock{
  flex:none;position:relative;
  background:linear-gradient(180deg,#ffffff 0%,#f7fdfa 100%);
  border-top:1px solid rgba(16,185,129,.18);
  border-radius:20px 20px 0 0;
  box-shadow:0 -10px 28px rgba(21,94,66,.12);
  /* 额外留 10px：部分手机浏览器底部自带工具条，会把最后一行控件吃掉 */
  padding-bottom:calc(var(--safe-b) + 10px);
}
/* ---- 琴键 ---- */
.keys-dock{
  flex:none;display:flex;gap:5px;padding:14px 12px 4px;max-width:760px;margin:0 auto;width:100%;
  touch-action:none;
}
.hkey{
  -webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;
  flex:1;min-width:0;position:relative;height:78px;
  background:linear-gradient(180deg,#ffffff 0%,#f4fcf8 100%);
  border-radius:13px;border:1px solid #cde7da;
  box-shadow:0 3px 0 #bedecd,0 6px 14px rgba(21,94,66,.08);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:var(--key-ink);cursor:pointer;touch-action:none;
  transition:transform .06s,box-shadow .06s,background .06s;
}
.hkey .hk-digit{font-size:23px;font-weight:800;line-height:1;}
.hkey .hk-dots{height:9px;display:flex;flex-direction:column-reverse;align-items:center;gap:2px;margin-bottom:1px;}
.hkey .hk-dot{width:3.6px;height:3.6px;border-radius:50%;background:#123a2b;}
.hkey .hk-letter{font-size:10px;font-weight:800;color:#6d9a86;margin-top:3px;}
.hkey[data-id="i"] .hk-letter{font-size:14px;line-height:1;margin-top:1px;color:#3f7f68;}
.hkey .hk-lyric{font-size:9px;color:#6d9a86;margin-top:1px;}
.hkey.pressed,
.hkey.hint.pressed{
  transform:translateY(3px);
  box-shadow:0 0 0 #045c3e,0 2px 8px rgba(6,122,82,.28);
  background:linear-gradient(180deg,#0f9d6b,#067a52);
  border-color:#056b48;
  color:#fff;
}
.hkey.pressed .hk-digit,.hkey.hint.pressed .hk-digit{color:#fff;}
.hkey.pressed .hk-letter,.hkey.hint.pressed .hk-letter{color:#c7f7e2;}
.hkey.pressed .hk-dot,.hkey.hint.pressed .hk-dot{background:#eafff5;}
.hkey.auto-on{
  background:linear-gradient(180deg,#12a374,#067a52);
  border-color:#056b48;
  box-shadow:0 0 0 2px rgba(6,122,82,.25),0 0 20px rgba(6,122,82,.4);
}
.hkey.auto-on .hk-digit{color:#fff;}
.hkey.auto-on .hk-letter{color:#c7f7e2;}
.hkey.auto-on .hk-dot{background:#eafff5;}
.mod.auto-on{
  background:linear-gradient(180deg,#12a374,#067a52);
  border-color:#056b48;color:#fff;
}
.mod.auto-on b{color:#d8fff0;border-color:rgba(255,255,255,.35);background:rgba(255,255,255,.14);}
.hint-bar{
  flex:none;text-align:center;font-size:10.5px;line-height:1.3;color:#3f735c;font-weight:600;
  padding:2px 12px 10px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* ================= 横屏提示 ================= */
.rotate-tip{
  position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;
  background:rgba(8,40,28,.55);backdrop-filter:blur(4px);padding:20px;
  animation:tipFade .18s ease-out;
}
@keyframes tipFade{from{opacity:0}to{opacity:1}}
.rotate-card{
  width:100%;max-width:320px;padding:20px 18px 16px;text-align:center;
  background:linear-gradient(180deg,#ffffff,#f4fcf8);
  border:1px solid #b9e6cf;border-radius:18px;
  box-shadow:0 18px 48px rgba(10,60,42,.22);
  animation:tipPop .22s ease-out;
}
@keyframes tipPop{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}
.rotate-ico{
  width:44px;height:44px;margin:0 auto 10px;border-radius:50%;
  background:#e7f9f0;color:#0a7a52;font-size:24px;line-height:44px;font-weight:700;
}
.rotate-card h3{margin:0 0 6px;font-size:16px;color:#124b36;}
.rotate-card p{margin:0 0 16px;font-size:12.5px;line-height:1.6;color:#5d8574;}
.rotate-stay{
  width:100%;border:0;border-radius:12px;padding:11px 0;cursor:pointer;
  font-size:14px;font-weight:700;font-family:inherit;color:#fff;
  background:linear-gradient(135deg,#12a374,#067a52);
  box-shadow:0 6px 16px rgba(6,122,82,.26);
}

/* ---- 曲目封面（首页列表） ---- */
/* 只在行底部渲染一层淡主色，正文保持白底，避免渐变压字 */
.song-row.has-cover{
  position:relative;overflow:hidden;
  background:linear-gradient(180deg,#ffffff,#fbfffd);
  box-shadow:0 2px 6px rgba(21,94,66,.07), 0 8px 18px -8px var(--tone), inset 0 1px 0 rgba(255,255,255,.95);
}
.song-row.has-cover::before{
  content:"";position:absolute;left:0;right:0;bottom:0;height:6px;
  background:linear-gradient(0deg,var(--tone),rgba(255,255,255,0));
  opacity:.9;pointer-events:none;
}
/* 底边一像素级的深色收口，给卡片一点厚度 */
.song-row.has-cover::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:2px;
  background:var(--tone);filter:brightness(.9) saturate(1.15);
  opacity:.85;pointer-events:none;
}
.song-row.has-cover > *{position:relative;z-index:1;}
.song-cover{
  width:clamp(48px,8vw,56px);height:clamp(48px,8vw,56px);
  flex:none;border-radius:10px;object-fit:cover;
  border:1.5px solid rgba(255,255,255,.95);background:#e7f9f0;
  box-shadow:0 3px 10px rgba(0,0,0,.12), 0 0 0 1px rgba(16,185,129,.12);
}
/* 生成封面：哈希配色 + 首字 + 音符角标 */
.song-cover.gen{
  position:relative;display:flex;align-items:center;justify-content:center;
  overflow:hidden;color:#124b36;font-weight:800;
}
.song-cover.gen span{font-size:22px;line-height:1;z-index:1;}
.song-cover.gen i{
  position:absolute;right:4px;bottom:1px;font-style:normal;
  font-size:13px;color:#124b36;opacity:.45;
}

/* ================= 换谱面板 ================= */.sheet-mask{
  position:fixed;inset:0;background:rgba(21,94,66,.28);z-index:40;
  display:flex;align-items:flex-end;justify-content:center;
  animation:fade .16s ease;backdrop-filter:blur(3px);
}
@media (min-width:521px){ .sheet-mask{padding:0 calc((100vw - 520px)/2);} }
@keyframes fade{from{opacity:0}to{opacity:1}}
.sheet{
  width:100%;max-width:620px;max-height:78dvh;
  background:linear-gradient(180deg,#ffffff,#f7fdfa);
  border-radius:20px 20px 0 0;border-top:1px solid rgba(16,185,129,.18);
  box-shadow:0 -10px 40px rgba(21,94,66,.18);
  display:flex;flex-direction:column;animation:up .2s ease;
  padding-bottom:var(--safe-b);
}
@keyframes up{from{transform:translateY(24px)}to{transform:none}}
.sheet-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 14px;font-size:14px;font-weight:700;flex:none;
}
.sheet-head .icon-btn{font-size:20px;width:32px;height:32px;border-radius:9px;}
.sheet-search{margin:0 14px 8px;flex:none;height:40px;}
.sheet-list{flex:1;overflow-y:auto;padding:0 8px 12px;scrollbar-width:none;}
.sheet-list::-webkit-scrollbar{width:0;height:0;}
.sheet-item{
  display:flex;align-items:center;gap:10px;padding:11px 12px;border-radius:12px;cursor:pointer;
  border:1px solid transparent;
}
.sheet-item:active{background:#eefaf4;}
.sheet-item.active{
  background:linear-gradient(180deg,#e9fbf2,#d8f6e8);
  border-color:#a5e0c4;
}
.sheet-item .t{flex:1;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sheet-item .l{font-size:11.5px;color:var(--dim);}
.sheet-empty{text-align:center;color:var(--dim);padding:32px 0;font-size:13px;}

/* 横屏 */
/* 横屏首页：Banner 按 1080:800 算出的高度会超过横屏可视高度（常见 320-430px），
   把 flex:1 的列表区压成 0 高度导致无法滑动；这里把 Banner 限高成条带、收紧列表头，
   保证曲库列表始终留有可滚动空间 */
@media (orientation:landscape) and (max-height:600px){
  .banner{max-height:26vh;max-height:26dvh;}
  .list-head{padding:8px 12px 4px;}
  .list-head .search{height:38px;}
  .chips{margin-top:6px;padding-bottom:2px;}
  .list-scroll{padding-top:2px;}
}

/* 横屏：压缩头部与控件，把高度让给曲谱 */
@media (orientation:landscape) and (max-height:520px){
  .play-head{padding:calc(var(--app-top) + 4px) 10px 2px;gap:6px;}
  .audio-tip{display:none;}
  .play-head .title-wrap{bottom:2px;height:30px;}
  .brand-logo{height:20px;}
  .song-title{font-size:15px;}
  .icon-btn{width:30px;height:30px;font-size:18px;border-radius:8px;}
  .icon-btn.text{font-size:11.5px;}

  .score-panel{margin:0 10px;border-radius:12px;min-height:110px;}
  .score-inner{padding:8px 12px 10px;}
  .score-title{display:none;}
  .legend{display:none;}
  .score-line{margin-bottom:6px;}
  .note{width:30px;}
  .note-digit{font-size:19px;}
  .note-key{font-size:8.5px;line-height:11px;margin-top:2px;min-width:12px;}
  .note-lyric{font-size:10px;height:13px;margin-top:1px;max-width:30px;}
  .note-dots{height:8px;}
  .note-dots.down{height:8px;}

  .play-toolbar{padding:3px 12px 2px;gap:6px;}
  .play-btn{padding:6px 0;font-size:12.5px;border-radius:9px;}
  .speed-btn{padding:6px 4px;font-size:11px;min-width:58px;}
  .progress{padding:2px 8px;font-size:11px;}

  .dock{border-radius:14px 14px 0 0;padding-bottom:0;}
  .dock::before{display:none;}
  .keys-dock{padding:6px 12px 2px;gap:4px;}
  .hkey{height:46px;border-radius:9px;}
  .hkey .hk-digit{font-size:18px;}
  .hkey .hk-letter{font-size:9px;margin-top:1px;}
  .hkey .hk-dots{height:6px;margin-bottom:0;}

  .mods{padding:2px 12px 4px;gap:6px;}
  .mod{height:26px;font-size:11px;border-radius:8px;}
  .mod b{font-size:8.5px;line-height:11px;}

  .hint-bar{display:none;}
  .bpm-row{padding:6px 12px 8px;gap:5px;}
  .bpm-chip{padding:5px 8px;font-size:12px;min-width:46px;}
}

/* 极小高度竖屏机型：压缩底部控件，只改几何不改配色，避免短屏上按键被挤出可视区 */
@media (max-height:680px) and (orientation:portrait){
  .play-toolbar{padding:6px 12px 2px;gap:6px;}
  .play-btn{padding:10px 0;font-size:13px;border-radius:11px;}
  .speed-btn{padding:7px 5px;}
  .keys-dock{padding:10px 12px 2px;gap:4px;}
  .hkey{height:60px;border-radius:11px;box-shadow:0 2px 0 #bedecd,0 4px 10px rgba(21,94,66,.08);}
  .hkey .hk-digit{font-size:19px;}
  .hkey .hk-letter{font-size:9px;margin-top:2px;}
  .hkey[data-id="i"] .hk-letter{font-size:12px;}
  .hkey .hk-dots{height:7px;}
  .mods{padding:4px 12px 2px;}
  .mod{height:34px;font-size:12px;border-radius:10px;}
  .mod b{font-size:8.5px;line-height:11px;}
  .hint-bar{font-size:10px;padding:2px 12px 6px;}
}

/* 窄屏：播放按钮字号降一档，图标同步收窄，避免“自动演奏/自动变调”被挤换行 */
@media (max-width:360px){
  .play-btn{font-size:12px;}
  .pb-ico{width:14px;height:14px;}
  .speed-btn{font-size:10.5px;min-width:56px;}
}

/* App 内音频通路慢时的一行灰字 */
.slow-tip{
  flex:none;display:block;width:100%;max-width:760px;margin:0 auto;
  padding:5px 14px 2px;
  font-size:10.5px;line-height:1.4;color:#9ab3a6;text-align:center;
}
