/* 音乐 · Yinyue
   视觉人格：印刷排版（骨架） + 封面渗色（血液）
   亮色＝米白纸张，暗色＝暖炭黑油墨。同一套排版骨架，两种材质。
   移动优先：默认单栏，≥900px 切双栏（左列表 / 右播放器）
   触摸基准：可点目标 ≥44px，输入框 16px（避免 iOS 聚焦缩放） */

/* 拉丁衬线只覆盖拉丁字符（11.6KB），中文靠系统宋体回退。
   没打包中文字体：那会让二进制从 11MB 涨到 13MB，还得引入子集化构建依赖。 */
@font-face{
  font-family:'Instrument Serif';
  font-style:normal; font-weight:400; font-display:swap;
  src:url('/fonts/instrument-serif.woff2') format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,
    U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root{
  /* —— 屏幕：中性冷白，不偏蓝也不偏黄 ——
     列表页已经离开「纸」这个隐喻，全站只剩一套底色；
     播放页的庄重感改由衬线排版 + 封面渗色承担，不再靠米黄。 */
  --bg:#FAFAFA;
  --bg-2:#FFFFFF;
  --bg-glass:rgba(250,250,250,.86);
  --surface:#F1F1EF;      /* 填充块：搜索框、标签、选中态 */
  --surface-2:#E9E9E7;
  --ink:#1A1A1A;
  --ink-2:#48484C;
  --sub:#71717A;
  --rule:#ECECEC;
  --rule-2:#DCDCDE;

  /* 渗色：由 app.js 按当前封面写入，下面只是空态兜底（中性灰，不再用暖棕） */
  --accent:#63636A;
  --accent-ink:#63636A;
  --accent-fg:#FFFFFF;
  --accent-soft:rgba(99,99,106,.40);
  --accent-wash:rgba(99,99,106,.10);

  --serif:'Instrument Serif','Songti SC','Noto Serif SC','Source Han Serif SC',SimSun,'Times New Roman',serif;
  --sans:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  --mono:ui-monospace,'SF Mono','Cascadia Mono',Menlo,Consolas,'Courier New',monospace;

  --r-xs:4px; --r-sm:8px; --r-md:10px; --r-lg:14px; --r-pill:999px;
  --pad:16px;
  --row:64px;
  --tab-h:54px;
  --sat:env(safe-area-inset-top,0px);
  --sab:env(safe-area-inset-bottom,0px);
  --ease:cubic-bezier(.32,.72,0,1);
  --ease-io:cubic-bezier(.4,0,.2,1);
}

/* —— 暗色：中性炭灰，不是黑纸 —— */
@media (prefers-color-scheme:dark){
  :root{
    --bg:#141416;
    --bg-2:#1C1C1F;
    --bg-glass:rgba(20,20,22,.86);
    --surface:#232326;
    --surface-2:#2B2B2F;
    --ink:#EDEDEF;
    --ink-2:#C9C9CE;
    --sub:#9A9AA2;
    --rule:#26262A;
    --rule-2:#37373C;
    --accent-fg:#141416;
  }
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}

html{
  height:100%;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

body{
  margin:0; min-height:100%;
  background:var(--bg); color:var(--ink);
  font:400 15px/1.55 var(--sans);
  overscroll-behavior-y:none;
  transition:background .3s var(--ease-io);
}

body.standalone{background:var(--bg)}

.hidden{display:none!important}
img{-webkit-touch-callout:none}

button{
  font:inherit; color:inherit; background:none; border:0; padding:0;
  cursor:pointer; touch-action:manipulation; -webkit-user-select:none; user-select:none;
}
input,select{font:inherit; color:inherit}
input,textarea{-webkit-user-select:text; user-select:text}
input[type=text],input[type=password],input[type=search]{
  font-size:16px; appearance:none; -webkit-appearance:none; border-radius:0;
}

/* 纸的颗粒。固定层、静态图，滚动不重绘 */
body::after{
  content:""; position:fixed; inset:0; z-index:70; pointer-events:none;
  opacity:.032;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme:dark){
  body::after{opacity:.05}
}

/* ---------- 基础容器 ---------- */

#app{
  max-width:640px; margin:0 auto; position:relative;
  min-height:100%; padding-top:var(--sat);
}

.page{
  padding:0 var(--pad) calc(168px + var(--sab));
  counter-reset:sec;
}

/* 页头：列表页是工具，标题走无衬线，不再用下划线收口。
   衬线只留给登录页的品牌名和播放页的大歌名——那两个才是「仪式时刻」。 */
.hd{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 0 6px; margin-bottom:0;
}
.hd h1{
  margin:0;
  font:700 22px/1.2 var(--sans);
  letter-spacing:-.01em;
}
.ghost{
  font:500 12.5px/1 var(--sans); letter-spacing:.04em;
  color:var(--ink-2); min-height:44px; padding:0 2px;
  display:inline-flex; align-items:center;
}
.ghost:active{color:var(--ink)}
.back{font-size:13px; letter-spacing:0}

/* 分组标题：只留字。编号、发丝线、字距全部去掉，
   分组靠「一块留白 + 一行灰字」就够，不必再画目录。 */
.sec-title{
  margin:22px 0 6px;
  font:600 12.5px/1.4 var(--sans);
  letter-spacing:.02em;
  color:var(--sub);
}
.sec-title::before{content:none}

/* ---------- 登录 ---------- */

.login{padding:22vh 26px 0; text-align:center}
.brand{
  font:400 46px/1 var(--serif);
  letter-spacing:.16em; margin-left:.16em;
}
.login .sub{
  font:400 12.5px/1.7 var(--sans); letter-spacing:.04em;
  color:var(--sub); margin:16px 0 40px;
}
.login input{
  width:100%; padding:14px 2px; text-align:center;
  background:none; border:0; border-bottom:1px solid var(--rule-2);
  outline:none; letter-spacing:.08em;
}
.login input:focus{border-bottom-color:var(--accent)}
.primary{
  margin-top:22px; width:100%; min-height:50px; padding:0 14px;
  border-radius:var(--r-md);
  background:var(--ink); color:var(--bg-2);
  font:600 14px/1 var(--sans); letter-spacing:.02em;
  transition:opacity .15s, transform .15s var(--ease-io);
}
.primary:active{opacity:.82; transform:scale(.995)}
.err{color:var(--sub); font:400 12.5px/1.7 var(--sans); letter-spacing:.01em; margin-top:14px; min-height:18px}

/* 导入失败要留在面板上：靠 3 秒 toast 报错等于没报错。
   左侧一道 accent 竖线，不用刺眼的纯红，和纸/墨的调子一致。 */
.imp-err{
  margin:-2px 0 0; padding-left:10px; border-left:2px solid var(--accent);
  color:var(--accent-ink); font:500 12.5px/1.65 var(--sans); letter-spacing:.01em;
}
.imp-err[hidden]{display:none}

/* 服务退出后 SW 仍然拿缓存渲染页面，所有请求才会静默失败；这条横幅是唯一的自证。 */
.offline{
  position:fixed; top:0; left:0; right:0; z-index:200;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:calc(10px + var(--sat)) 16px 10px;
  background:var(--accent-ink); color:var(--accent-fg);
  font:500 12.5px/1.5 var(--sans); letter-spacing:.01em;
}
.offline[hidden]{display:none}
.offline .ghost{color:var(--accent-fg); min-height:32px; padding:0 8px; opacity:.85}
/* 横幅是 fixed 的，不撑开文档流；不给 #app 让出高度就会压住「音乐」标题 */
body.offline-on #app{padding-top:calc(var(--sat) + 46px)}

/* ---------- 搜索 ---------- */

/* 填充式圆角输入框：纯白底上它是一块「可按的平面」，
   而不是一条飘着的下划线（下划线是印刷表单的语言，列表页不再用它） */
.searchbox{
  display:flex; align-items:center; gap:9px;
  padding:0 12px; min-height:46px;
  background:var(--surface); border-radius:var(--r-md);
  border:0;
  transition:background .18s, box-shadow .18s;
}
.searchbox:focus-within{
  background:var(--bg-2);
  box-shadow:inset 0 0 0 1px var(--rule-2);
}
.searchbox input{
  flex:1; min-width:0; border:0; background:none; outline:none; height:44px;
}
.searchbox input::placeholder{color:var(--sub); letter-spacing:.01em}
.searchbox input::-webkit-search-cancel-button{-webkit-appearance:none}

.ic{width:14px; height:14px; fill:none; stroke:var(--sub); stroke-width:1.8; stroke-linecap:round; flex:none}

.chips{display:flex; flex-wrap:wrap; gap:8px}
.chip{
  font:500 12.5px/1 var(--sans); letter-spacing:.01em;
  min-height:34px; padding:8px 13px; border-radius:var(--r-sm);
  background:var(--surface); border:0; color:var(--ink-2);
  transition:background .14s, color .14s;
}
.chip:active{background:var(--surface-2)}
.chip.on{background:var(--ink); color:var(--bg-2)}

/* ---------- 列表 ---------- */

/* 紧凑清单：无分隔线、无编号，靠 14px 间距与字重分级。
   行高 64、封面 48/圆角 6——比上版小一号、圆一圈，一屏多两首。 */
.list{display:flex; flex-direction:column}
.row{
  display:flex; align-items:center; gap:14px;
  min-height:var(--row); padding:8px 0;
  transition:background .14s;
  position:relative;
}
.row:active{background:var(--surface)}
.row .cover{
  width:48px; height:48px; border-radius:6px; flex:none;
  background:var(--surface) center/cover no-repeat;
  border:0;
  box-shadow:0 1px 3px rgba(0,0,0,.10);
}
.row .meta{min-width:0; flex:1}
.row .name{
  font:600 15px/1.35 var(--sans);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.row .by{
  font:400 12.5px/1.4 var(--sans); color:var(--sub);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px;
}

/* 正在播放：不画刻痕、不加色条，只让歌名吃渗色 + 封面套一圈细环 */
.row.playing .name{color:var(--accent-ink)}
.row.playing .cover{box-shadow:0 0 0 1.5px var(--accent), 0 1px 3px rgba(0,0,0,.10)}

/* 音质徽标：三档靠「渗色底 / 描边 / 纯灰」分级，不用实心大色块抢视线 */
.badge{
  font:600 11px/1 var(--sans); letter-spacing:.02em;
  padding:4px 7px; border-radius:var(--r-xs); flex:none; white-space:nowrap;
  border:1px solid transparent; color:var(--sub);
}
.badge.q1{color:var(--accent-ink); background:var(--accent-wash)}
.badge.q2{color:var(--ink-2); border-color:var(--rule-2)}
.badge.q3{color:var(--sub)}

.head-arrow{display:none}
.empty{
  padding:40px 6px; text-align:center;
  font:400 12.5px/1.9 var(--sans); letter-spacing:.02em; color:var(--sub);
}

/* ---------- 歌单 ---------- */

.sec-line{display:flex; align-items:center; justify-content:space-between}
.sec-line .sec-title{flex:1; margin:22px 0 2px}
.sec-line .ghost{min-height:32px}

/* 歌单走三列封面网格：封面本来就最好认，列表行把它压到 48px 等于藏起来 */
.pl-grid{
  display:grid; grid-template-columns:repeat(3,1fr);
  gap:16px 12px; margin-top:10px;
}
.pl-card{cursor:pointer; min-width:0}
.pl-card:active .pl-card-cover{transform:scale(.985)}
.pl-card-cover{
  width:100%; aspect-ratio:1/1; border-radius:var(--r-sm);
  background:var(--surface) center/cover no-repeat;
  box-shadow:0 1px 3px rgba(0,0,0,.10);
  transition:transform .16s var(--ease-io);
}
.pl-card-name{
  margin-top:8px;
  font:500 12.5px/1.35 var(--sans); color:var(--ink);
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
.pl-card-count{
  margin-top:2px;
  font:400 11.5px/1.4 var(--sans); color:var(--sub);
}
/* 空态落在网格里时要占满整行，否则会缩在左上角第一格 */
.pl-grid .empty{grid-column:1/-1; margin-top:6px}

.pl-head{display:flex; gap:16px; align-items:flex-end; padding:10px 0 18px}
.pl-cover{
  width:92px; height:92px; border-radius:var(--r-md); flex:none;
  background:var(--surface) center/cover no-repeat;
  box-shadow:0 1px 3px rgba(0,0,0,.10), 0 16px 32px -18px rgba(0,0,0,.45);
}
.pl-info{min-width:0; padding-bottom:2px}
.pl-name{
  font:700 20px/1.3 var(--sans); letter-spacing:-.01em;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
.pl-sub{
  font:400 12.5px/1.6 var(--sans); letter-spacing:.01em;
  color:var(--sub); margin-top:6px;
}

.pl-actions{display:flex; align-items:center; gap:6px; margin:0 0 10px}
.primary.compact{
  width:auto; min-height:40px; padding:0 18px;
  font-size:13px; letter-spacing:.02em; margin-top:0;
  border-radius:var(--r-md);
}
.pl-actions .ghost{min-height:40px; padding:0 12px}

.import-body{padding:6px 20px calc(22px + var(--sab)); display:flex; flex-direction:column; gap:14px}
.import-body input{
  width:100%; padding:13px 12px; border-radius:var(--r-md);
  background:var(--surface); border:0; outline:none;
}
.import-body input:focus{box-shadow:inset 0 0 0 1px var(--rule-2); background:var(--bg-2)}
.import-body .primary{margin-top:2px}
.sentinel{height:1px}

/* ---------- 迷你播放条（仅手机） ---------- */

.mini{
  position:fixed; left:0; right:0; bottom:calc(var(--tab-h) + var(--sab));
  max-width:640px; margin:0 auto; display:flex; align-items:center; gap:11px;
  padding:9px 14px;
  background:var(--bg-glass);
  -webkit-backdrop-filter:saturate(1.6) blur(14px); backdrop-filter:saturate(1.6) blur(14px);
  border-top:1px solid var(--rule);
  z-index:20; touch-action:manipulation;
}
.mini-bar-wrap{position:absolute; left:0; right:0; top:-1px; height:2px; background:var(--rule)}
.mini-bar{height:100%; width:0; background:var(--accent); transition:width .2s linear}
.mini .cover{
  width:40px; height:40px; border-radius:5px;
  background:var(--surface) center/cover no-repeat; flex:none;
  box-shadow:0 1px 3px rgba(0,0,0,.12);
}
.mini .meta{flex:1; min-width:0}
.mini .name{
  font:400 13px/1.4 var(--sans); font-weight:500;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.mini .by{
  font:400 11.5px/1.5 var(--sans); letter-spacing:.01em; color:var(--sub);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

.iconbtn{
  width:44px; height:44px; display:flex; align-items:center; justify-content:center; flex:none;
  border-radius:50%; transition:background .14s, opacity .14s;
}
.iconbtn:active{background:var(--accent-wash)}
.iconbtn svg{
  width:18px; height:18px; fill:none; stroke:var(--ink);
  stroke-width:1.4; stroke-linecap:round; stroke-linejoin:round;
}
.iconbtn.on svg{stroke:var(--accent-ink); stroke-width:1.8}
.iconbtn.lg svg{width:22px; height:22px}
.iconbtn:disabled{opacity:.35}

/* 歌词按钮：底部唯一一个文字按钮（衬线「词」）。
   汉字在圆形容器里默认偏下 1px，靠 padding-bottom 抬回光学中心；
   激活只换颜色——中文没有可控的中间字重，加粗在不同设备的回退字体上表现不一致 */
.iconbtn.txt{
  font:400 16px/1 var(--serif);
  color:var(--ink);
  padding-bottom:1px;
  transition:color .14s, background .14s;
}
.iconbtn.txt.on{color:var(--accent-ink)}

/* ---------- 底部导航 ---------- */

.tabs{
  position:fixed; left:0; right:0; bottom:0; max-width:640px; margin:0 auto;
  display:flex; border-top:1px solid var(--rule);
  background:var(--bg-glass);
  -webkit-backdrop-filter:saturate(1.6) blur(14px); backdrop-filter:saturate(1.6) blur(14px);
  padding-bottom:var(--sab); z-index:22;
}
.tab{
  flex:1; height:var(--tab-h);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px;
  font:500 12px/1 var(--sans); letter-spacing:.06em; color:var(--sub);
  touch-action:manipulation; transition:color .16s;
}
.tab::after{
  content:""; width:16px; height:2px; border-radius:1px;
  background:transparent; transition:background .2s, width .2s var(--ease-io);
}
.tab.active{color:var(--ink)}
.tab.active::after{background:var(--accent)}

/* ---------- 全屏播放器 ---------- */

.player{
  position:fixed; left:0; right:0; top:0; height:100vh; height:100dvh;
  z-index:40; background:var(--bg);
  transform:translateY(100%);
  transition:transform .3s var(--ease);
  display:flex; flex-direction:column;
  overflow:hidden;
  will-change:transform;
}
.player.open{transform:translateY(0)}
.player.dragging{transition:none}

/* 封面的颜色渗进来：重模糊 + 纸面遮罩，保证文字永远压在纸上 */
.p-bg{
  position:absolute; inset:-14%; z-index:0;
  background:center/cover no-repeat;
  filter:blur(56px) saturate(1.45);
  opacity:.38;
  transform:scale(1.08);
  transition:background-image .3s, opacity .5s;
}
@media (prefers-color-scheme:dark){
  .p-bg{opacity:.46}
}
.p-veil{
  position:absolute; inset:0; z-index:1; pointer-events:none;
  background:linear-gradient(180deg,
    var(--bg) 0%, var(--bg) 6%,
    transparent 34%, transparent 58%,
    var(--bg) 94%, var(--bg) 100%);
}

.sheet{
  position:relative; z-index:2;
  flex:1; display:flex; flex-direction:column; min-height:0;
  padding:0 22px calc(18px + var(--sab));
  overflow-y:auto; -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}

/* 顶部只有一件东西：返回箭头。负边距把它左边缘对齐正文左缘——
   不这样做，44px 点击区会把图标推到离页边 12px，看起来是「飘着的」而不是页首。
   viewport-fit=cover 下必须让开状态栏，否则箭头会贴在刘海底下点不中 */
.p-top{
  position:relative; display:flex; align-items:center; justify-content:flex-start;
  height:44px; padding-top:var(--sat); flex:none;
  box-sizing:content-box;
}
.p-back{margin-left:-10px}
/* 比底部图标稍大稍重：它是这一屏唯一的出口，不能跟着「一排小图标」同一个分量 */
.p-back svg{width:20px; height:20px; stroke-width:1.6}

/* ---------- 封面舞台 ---------- */

.p-stage{
  flex:1 1 auto; min-height:0;
  display:flex; align-items:center; justify-content:center;
  padding:6px 0 2px;
}
.pcover{
  width:100%; max-width:min(288px,36vh);
  aspect-ratio:1; flex:none;
  border-radius:var(--r-sm);
  background:var(--bg-2) center/cover no-repeat;
  border:1px solid var(--rule);
  box-shadow:0 2px 6px rgba(0,0,0,.10), 0 22px 50px -16px rgba(0,0,0,.32);
  touch-action:pan-y;
}

/* ---------- 标题区：唱片内页的一块标签 ---------- */

.p-id{
  flex:none; text-align:center; padding-top:20px;
}
.p-id::before{
  content:""; display:block; width:44px; height:1px;
  background:var(--rule-2); margin:0 auto 18px;
}
.pname{
  font:400 26px/1.26 var(--serif);
  letter-spacing:.005em;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
.pby{
  font:400 12.5px/1.5 var(--sans); color:var(--sub); margin-top:8px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
/* 播放器里标的是"本次实际听到的音质"，可能因跨源补齐而高于列表标注 */
.pqual{
  font:500 11.5px/1.3 var(--sans); letter-spacing:.06em;
  color:var(--sub); margin-top:8px; min-height:15px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* ---------- 进度条：2px 轨道 + 2px 竖条滑块，像印刷的刻度 ---------- */

.progress{margin-top:18px; flex:none}
.progress input[type=range]{
  -webkit-appearance:none; appearance:none;
  width:100%; height:36px; background:transparent; outline:none;
  margin:0; touch-action:none;
}
.progress input[type=range]::-webkit-slider-runnable-track{
  height:2px; border-radius:1px;
  background:linear-gradient(to right,
    var(--accent) 0%, var(--accent) var(--p,0%),
    var(--rule-2) var(--p,0%), var(--rule-2) 100%);
}
.progress input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none; width:2px; height:14px; border-radius:1px;
  background:var(--accent); margin-top:-6px;
}
.progress input[type=range]:active::-webkit-slider-thumb{
  box-shadow:0 0 0 7px var(--accent-wash);
  border-radius:3px;
}
.progress input[type=range]::-moz-range-track{height:2px; border-radius:1px; background:var(--rule-2)}
.progress input[type=range]::-moz-range-progress{height:2px; border-radius:1px; background:var(--accent)}
.progress input[type=range]::-moz-range-thumb{
  width:2px; height:14px; border:0; border-radius:1px; background:var(--accent);
}

.times{
  display:flex; justify-content:space-between;
  font:500 11px/1 var(--mono); letter-spacing:.04em; color:var(--sub);
  margin-top:2px; font-variant-numeric:tabular-nums;
}

/* ---------- 控件 ---------- */

.controls{
  display:flex; align-items:center; justify-content:center; gap:26px;
  margin-top:10px; flex:none;
}
.round{
  width:62px; height:62px; border-radius:50%;
  background:var(--accent); color:var(--accent-fg);
  display:flex; align-items:center; justify-content:center; flex:none;
  box-shadow:0 8px 22px -8px var(--accent-soft);
  transition:transform .16s var(--ease-io), box-shadow .3s;
}
.round:active{transform:scale(.94)}
.round svg{width:18px; height:18px; fill:currentColor; stroke:none}
.round svg *{fill:inherit; stroke:none}

.pfoot{
  display:flex; align-items:center; justify-content:center; gap:4px;
  margin-top:auto; padding-top:12px; flex:none;
}

/* ---------- 歌词第二态 ---------- */

.lyric-view{
  display:none; flex:1 1 auto; min-height:0;
  flex-direction:column; gap:12px; padding-top:2px;
}
body.lrc-view .p-stage{display:none}
body.lrc-view .lyric-view{display:flex; animation:lvin .3s var(--ease-io) both}
@keyframes lvin{from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:none}}
/* 歌词态下标题区已经上移到歌词头部，省出空间给文字 */
body.lrc-view .p-id{display:none}

.lv-head{display:flex; align-items:center; gap:12px; flex:none; padding-right:2px}
.lv-cover{
  width:42px; height:42px; border-radius:var(--r-xs); flex:none;
  background:var(--bg-2) center/cover no-repeat; border:1px solid var(--rule);
}
.lv-meta{min-width:0; flex:1}
.lv-name{
  font:400 17px/1.3 var(--serif);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.lv-by{
  font:400 12px/1.7 var(--sans); letter-spacing:.02em; color:var(--sub);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

.lyric{
  /* position:relative 是必须的：scrollLyric 用子元素的 offsetTop 定位，
     没有它 offsetParent 会一路找到 .player，滚动位置整体偏掉 */
  position:relative;
  flex:1 1 auto; min-height:0;
  overflow-y:auto; -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  padding:14px 0 40px;
  scrollbar-width:none;
  -webkit-mask-image:linear-gradient(180deg,transparent 0,#000 9%,#000 86%,transparent 100%);
  mask-image:linear-gradient(180deg,transparent 0,#000 9%,#000 86%,transparent 100%);
}
.lyric::-webkit-scrollbar{width:0; height:0}
/* pre-wrap 必须挂在行上：挂在容器上会把 <p> 之间的缩进当空行渲染，行距翻倍 */
.lrc-line{
  margin:0; padding:6px 0;
  font:400 17px/1.5 var(--serif);
  color:var(--ink); opacity:.38;
  transition:opacity .25s var(--ease-io), color .25s;
  white-space:pre-wrap;
}
.lrc-line.cur{opacity:1; color:var(--accent-ink); font-weight:600}
.lrc-empty{
  font:400 13px/1.9 var(--sans); letter-spacing:.02em;
  color:var(--sub); padding:28px 0; opacity:1;
}

/* ---------- 底部抽屉 / 队列 / 长按菜单 ---------- */

.scrim{
  position:fixed; inset:0; background:rgba(22,20,17,.34);
  opacity:0; pointer-events:none; transition:opacity .24s; z-index:30;
  -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
}
.scrim.on{opacity:1; pointer-events:auto}

.sheet-panel{
  position:fixed; left:0; right:0; bottom:0; max-width:640px; margin:0 auto; z-index:50;
  background:var(--bg-2); border-radius:var(--r-lg) var(--r-lg) 0 0;
  border:0; box-shadow:0 -10px 40px -12px rgba(0,0,0,.22);
  max-height:76vh; display:flex; flex-direction:column;
  transform:translateY(100%); transition:transform .3s var(--ease);
  padding-bottom:var(--sab);
}
.sheet-panel.open{transform:translateY(0)}
.sheet-hd{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 20px 6px; flex:none;
  font:700 15px/1.4 var(--sans); letter-spacing:.01em;
  color:var(--ink);
  border-bottom:0;
}
.sheet-panel .list{
  overflow-y:auto; -webkit-overflow-scrolling:touch; padding:0 20px 16px;
  overscroll-behavior:contain;
}
.sheet-body{
  overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  padding:0 20px calc(20px + var(--sab));
}

.act{
  display:flex; align-items:center; gap:14px; min-height:54px;
  border-bottom:1px solid var(--rule); font-size:15px; text-align:left; width:100%;
}
.act:last-child{border-bottom:0}
.act:active{background:var(--bg-2)}
.act svg{
  width:17px; height:17px; fill:none; stroke:var(--ink); stroke-width:1.4;
  stroke-linecap:round; stroke-linejoin:round; flex:none;
}
.act svg.solid{fill:var(--ink); stroke:none}
.act-sub{
  font:400 11.5px/1.3 var(--sans); letter-spacing:.01em; color:var(--sub);
  margin-left:auto; max-width:42%;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
/* 长按菜单顶部的一行说明，不可点，用来交代音质与来源 */
.act-info{
  font:400 11.5px/1.7 var(--sans); letter-spacing:.01em; color:var(--sub);
  padding:0 0 12px; margin-bottom:2px;
  border-bottom:1px solid var(--rule);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* 键盘弹起：收起底部固定条，避免被 visual viewport 顶起错位 */
body.kb .tabs, body.kb .mini{display:none!important}

/* ---------- 设置 ---------- */

.set-block{padding:18px 0; border-bottom:1px solid var(--rule)}
.set-block:last-child{border-bottom:0}
.set-label{
  font:600 12px/1.4 var(--sans); letter-spacing:.05em;
  color:var(--ink-2); margin-bottom:12px;
}
.setting{display:flex; gap:10px; align-items:center}
.setting input{
  flex:1; min-width:0; padding:12px 2px; border-radius:0;
  background:none; border:0; border-bottom:1px solid var(--rule-2); outline:none;
}
.setting input:focus{border-bottom-color:var(--ink)}
.setting button{
  flex:none; min-width:48px; min-height:44px;
  font:500 12.5px/1 var(--sans); letter-spacing:.02em; color:var(--ink-2);
}
.setting button:active{color:var(--ink)}
.hint{
  font:400 12px/1.9 var(--sans); letter-spacing:.01em; color:var(--sub);
  margin:10px 0 0; padding-left:10px; border-left:1px solid var(--rule-2);
}
.qual{
  border:1px solid var(--rule-2); border-radius:var(--r-xs);
  height:42px; padding:0 12px;
  font:500 13px/1 var(--sans); letter-spacing:.02em;
  background:none; color:var(--ink); outline:none;
  appearance:none; -webkit-appearance:none;
}
.danger{
  width:100%; min-height:48px; text-align:left;
  font:500 13px/1 var(--sans); letter-spacing:.02em; color:var(--ink-2);
}
.danger:active{color:var(--ink)}

.toast{
  position:fixed; left:50%; bottom:calc(140px + var(--sab)); transform:translateX(-50%);
  background:var(--ink); color:var(--bg-2);
  font:500 12px/1.4 var(--sans); letter-spacing:.04em;
  padding:11px 18px; border-radius:var(--r-sm); z-index:60; opacity:0;
  transition:opacity .2s; max-width:80vw; text-align:center;
  pointer-events:none;
  box-shadow:0 10px 30px -10px rgba(0,0,0,.5);
}
.toast.on{opacity:1}

/* =======================================================================
   桌面双栏（≥900px）：左侧列表 + 右侧常驻播放器
   ======================================================================= */

@media (min-width:900px){
  html,body{height:100%; overflow:hidden}

  /* 未登录时播放器不能占着右栏，否则会压住居中的登录表单 */
  body:not(.authed) #player{display:none}

  #app{
    max-width:1360px; margin:0 auto; height:100vh;
    display:grid;
    grid-template-columns:minmax(360px,430px) 1fr;
    /* 三行：内容 / 迷你条 / 底部导航。迷你条只在收起态出现，展开时该行高度为 0 */
    grid-template-rows:1fr auto auto;
    padding-top:0; min-height:0;
    border-left:1px solid var(--rule); border-right:1px solid var(--rule);
  }

  body:not(.authed) #app{grid-template-columns:1fr; border:0}

  #login{grid-column:1/-1; grid-row:1/-1; align-self:center; max-width:400px; margin:0 auto; padding-top:0}

  #main{
    grid-column:1; grid-row:1;
    overflow-y:auto; -webkit-overflow-scrolling:touch;
    border-right:1px solid var(--rule);
    overscroll-behavior:contain;
  }
  .page{padding:0 20px 32px}
  .hd{padding:26px 0 14px}
  .hd h1{font-size:34px}

  #tabs{
    grid-column:1; grid-row:3; position:static; max-width:none; margin:0;
    border-top:1px solid var(--rule); padding-bottom:0;
  }
  .tab{height:52px}

  #mini{display:none!important}
  #scrim{display:none!important}

  .player{
    grid-column:2; grid-row:1/4;
    position:relative; height:auto; transform:none!important;
    transition:none; border:0; background:var(--bg-2);
    overflow:hidden;
  }
  .player .sheet{
    max-width:540px; width:100%; margin:0 auto;
    padding:20px 34px 28px; overflow-y:auto;
  }
  .p-top{height:36px}
  .p-back{width:36px; height:36px; margin-left:-8px}
  .p-back svg{width:17px; height:17px}
  .pcover{max-width:min(320px,34vh)}
  .pname{font-size:30px}
  .progress{margin-top:22px}
  .controls{margin-top:12px; gap:30px}
  .round{width:66px; height:66px}
  .pfoot{margin-top:20px}
  .lyric-view{padding-top:8px}
  .lrc-line{font-size:19px}

  /* —— 收起态：右栏让位，列表铺满，迷你条接管底部 ——
     没有这一段，箭头在桌面上就是个假按钮：.player 有 transform:none!important，
     closePlayer() 摘掉 .open 后画面纹丝不动 */
  body.p-collapsed #app{grid-template-columns:1fr}
  body.p-collapsed .player{display:none}
  body.p-collapsed #main{border-right:0; width:100%; max-width:880px; margin:0 auto}
  body.p-collapsed #tabs,
  body.p-collapsed #mini{width:100%; max-width:880px; margin:0 auto}
  /* :not(.hidden) 不能少——首页还没播歌时 #mini 带 .hidden，
     否则会先长出一条空白底栏 */
  body.p-collapsed #mini:not(.hidden){
    display:flex!important;
    position:relative; left:auto; right:auto; bottom:auto;
    grid-column:1; grid-row:2;
    border-top:1px solid var(--rule);
  }

  /* 抽屉改成右侧滑入 */
  .sheet-panel{
    left:auto; right:0; width:400px; max-width:400px; max-height:100vh;
    transform:translateX(100%);
    border-radius:var(--r-sm) 0 0 var(--r-sm);
    border-top:0; border-left:1px solid var(--rule-2); padding-bottom:0;
  }
  .sheet-panel.open{transform:translateX(0)}
  .toast{bottom:44px}
}

@media (min-width:1280px){
  #app{grid-template-columns:minmax(430px,490px) 1fr}
  .player .sheet{max-width:560px}
  .pcover{max-width:min(340px,36vh)}
  .pname{font-size:32px}
}

/* =======================================================================
   小屏 / 矮屏 / 横屏
   ======================================================================= */

@media (max-height:720px) and (max-width:899px){
  .pcover{max-width:min(228px,33vh)}
  .p-id{padding-top:14px}
  .p-id::before{margin-bottom:12px}
  .pname{font-size:21px}
  .progress{margin-top:12px}
  .controls{margin-top:6px}
  .round{width:54px; height:54px}
  .pfoot{padding-top:6px}
  .sheet{padding-left:20px; padding-right:20px}
}

/* 横屏：左侧封面 + 右侧信息/进度/控件，歌词让位 */
@media (orientation:landscape) and (max-height:520px) and (max-width:899px){
  .sheet{
    display:grid;
    grid-template-columns:minmax(0,32vh) 1fr;
    grid-template-rows:auto auto auto auto auto;
    grid-template-areas:
      "cover name"
      "cover by"
      "cover prog"
      "cover ctrl"
      "cover foot";
    column-gap:22px; row-gap:3px;
    align-content:center; align-items:center;
    padding:8px 20px calc(8px + var(--sab));
    overflow:hidden;
  }
  /* 横屏矮屏：整行藏掉，箭头改成浮在左上角的小圆片。
     不能让它参与网格——.sheet 是按 grid-template-areas 摆的，多一个自动放置的子项会挤出一行 */
  .p-top{
    position:absolute; top:4px; left:6px; z-index:3;
    height:auto; display:block;
  }
  .p-back{
    width:36px; height:36px; margin:0;
    background:var(--bg-glass); border:1px solid var(--rule-2);
    -webkit-backdrop-filter:saturate(1.6) blur(12px); backdrop-filter:saturate(1.6) blur(12px);
  }
  .p-back svg{width:16px; height:16px}
  .p-stage{grid-area:cover; grid-row:1/-1; padding:0; min-height:0}
  .pcover{width:100%; max-width:32vh; margin:0}
  .p-id{
    display:contents;
  }
  .p-id::before{display:none}
  .pname{
    grid-area:name; text-align:left; margin:0;
    font-size:16px; align-self:end;
    -webkit-line-clamp:1;
  }
  .pby{grid-area:by; text-align:left; margin:0; font-size:11.5px; align-self:start}
  .pqual{display:none}
  .progress{grid-area:prog; margin:0; width:100%}
  .controls{grid-area:ctrl; margin:0; justify-content:flex-start; gap:22px}
  .round{width:48px; height:48px}
  .pfoot{grid-area:foot; margin:0; padding-top:0; justify-content:flex-start; gap:2px}
  /* 横屏高不够，歌词整页态会挤掉控件，这一档不提供（点歌词会提示转回竖屏） */
  .lyric-view{display:none!important}
  body.lrc-view .p-stage{display:flex}
}

@media (orientation:landscape) and (max-height:460px){
  :root{--tab-h:44px}
  .page{padding-bottom:calc(112px + var(--sab))}
}

@media (prefers-reduced-motion:reduce){
  *{transition-duration:.01ms!important; animation-duration:.01ms!important}
}
