/* 音序 v3 · 基础层：设计变量、外壳（顶栏 / 页脚 / 播放条）、通用控件与弹层。用法见 DESIGN.md。 */
@font-face { font-family: "CDEF Mono"; src: url(/fonts/mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "CDEF Mono"; src: url(/fonts/mono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
:root {
  /* 冷石墨底（和 logo 的深底同一色相）+ 暖象牙字。强调色取自 logo：绿是唯一强调，黄只做点缀，渐变只留在 logo 里。 */
  --bg: #0d1013; --bg-deep: #0a0c0f; --panel: #13171b; --raise: #191e23;
  --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .18);
  --fg: #e8e6e1; --mute: #8b9197; --dim: #5c6268;
  --acc: #02e387; --acc-rgb: 2, 227, 135; --acc-fg: #012313;
  --hi: #fddc52; --hi-rgb: 253, 220, 82;
  --ok: #9be7c4; --ok-rgb: 155, 231, 196; --err: #f0716c; --err-rgb: 240, 113, 108;
  --warn: #f0a04b; --warn-rgb: 240, 160, 75; --busy: var(--hi);
  --hover: rgba(255, 255, 255, .06); --on: rgba(255, 255, 255, .1);
  --wave: rgba(232, 230, 225, .32); --wave-on: var(--acc); --wave-soft: rgba(255, 255, 255, .14);
  --r: 6px; --gut: 28px; --top: 64px; --pb: 72px;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --mono: "CDEF Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); color: var(--fg); font: 15px/1.6 var(--sans); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; color-scheme: dark; }
body { min-height: 100dvh; padding-bottom: calc(var(--pb) + env(safe-area-inset-bottom)); }
body.no-pb { padding-bottom: env(safe-area-inset-bottom); }
button, textarea, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
:root:not([data-kb]) :focus-visible { outline: none; }
main:focus { outline: 0; }
::selection { background: rgba(var(--acc-rgb), .3); }
.num { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; word-spacing: -.25em; }
.ic { display: block; width: 14px; height: 14px; fill: currentColor; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 99; background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: var(--r); font-size: 14px; }
.skip:focus { top: 8px; }

/* ---------- 顶栏 ---------- */
.top { position: relative; z-index: 5; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: var(--top); padding: 0 var(--gut); background: var(--panel); border-bottom: 1px solid var(--line); }
.top-l { justify-self: start; display: flex; align-items: center; gap: 18px; min-width: 0; }
.brand { display: inline-flex; align-items: center; white-space: nowrap; }
.brand-logo { display: block; height: 40px; width: auto; }
@media (max-width: 720px) { .brand-logo { height: 32px; } }
.brand-stack { display: block; height: 104px; width: auto; }
.slogan { font-size: 12px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 34px; font-size: 14px; }
.nav a { color: var(--mute); padding: 6px 0; }
.nav a:hover, .nav a[aria-current] { color: var(--fg); }
.top-r { justify-self: end; display: flex; align-items: center; gap: 14px; font-size: 13px; white-space: nowrap; }
.top-units { color: var(--mute); }
a.top-units:hover { color: var(--fg); }
.btn-top { display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: var(--r); font-size: 14px; }
.btn-top:hover { border-color: var(--fg); }
.btn-top span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.acc::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 8px; border: solid var(--mute); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.top-menu { display: none; }

/* ---------- 通用控件 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--r); background: var(--acc); color: var(--acc-fg); font-size: 14px; font-weight: 700; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { background: var(--on); color: var(--dim); filter: none; }
.btn.ghost { background: none; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 500; }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--fg); filter: none; }
.btn.ghost:disabled { color: var(--dim); box-shadow: inset 0 0 0 1px var(--line); }
.btn.danger { background: var(--err); color: #210908; }
.tx { font-size: 13px; color: var(--mute); white-space: nowrap; }
.tx:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.tx:disabled { color: var(--dim); text-decoration: none; }
.ib { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); color: var(--mute); flex: none; }
.ib:hover { color: var(--fg); background: var(--hover); }
.in { display: block; width: 100%; height: 40px; padding: 0 12px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r); font-size: 15px; outline: 0; }
.in:focus { border-color: var(--acc); }
.in::placeholder { color: var(--dim); }
.in[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
textarea.in { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld-l { font-size: 12px; color: var(--mute); letter-spacing: .08em; }
.ck { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; padding: 5px 0; }
.ck input { -webkit-appearance: none; appearance: none; flex: none; width: 18px; height: 18px; margin-top: 2px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg); display: grid; place-items: center; cursor: pointer; }
.ck input:checked { background: var(--acc); border-color: var(--acc); }
.ck input:checked::after { content: ""; width: 9px; height: 5px; border: solid var(--acc-fg); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.ck a, .fine a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.fine { font-size: 12px; color: var(--mute); }
.notice { font-size: 13px; line-height: 1.5; color: var(--acc); padding: 8px 12px; background: rgba(var(--acc-rgb), .08); border-left: 2px solid var(--acc); }
.notice a, .notice button { margin-left: 10px; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.notice.bad { color: var(--err); background: rgba(var(--err-rgb), .08); border-left-color: var(--err); }
.notice.good { color: var(--ok); background: rgba(var(--ok-rgb), .08); border-left-color: var(--ok); }
.notice.warn { color: var(--warn); background: rgba(var(--warn-rgb), .08); border-left-color: var(--warn); }
.netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 90; padding: 6px 16px; background: var(--err); color: #1d0b06; font-size: 13px; font-weight: 600; text-align: center; }

/* ---------- 弹窗 / 浮层 / 提示 ---------- */
.dlg { margin: auto; border: 1px solid var(--line-2); background: var(--raise); color: var(--fg); padding: 0; border-radius: 10px; width: min(calc(100vw - 32px), var(--w, 420px)); max-height: min(86dvh, 720px); box-shadow: 0 24px 60px rgba(0, 0, 0, .5); overflow: hidden; }
.dlg[open] { display: flex; }
.dlg::backdrop { background: rgba(6, 7, 8, .68); }
.dlg-m { --w: 560px; }
.dlg-l { --w: 900px; }
.dlg-in { display: flex; flex-direction: column; min-height: 0; width: 100%; }
.dlg-h { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.dlg-h h2 { font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.dlg-b { padding: 18px 20px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.dlg-b > p { color: var(--fg); }
.dlg-f { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.pop { position: fixed; z-index: 60; background: var(--raise); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); min-width: 200px; max-width: min(340px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow: auto; }
.pop-scrim { position: fixed; inset: 0; z-index: 59; }
.pop-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; width: 240px; }
.pop-hint { font-size: 12px; color: var(--mute); }
.pop-hint.bad { color: var(--err); }
.menu { padding: 6px; display: flex; flex-direction: column; }
.menu-h { display: flex; justify-content: space-between; gap: 20px; padding: 8px 10px 6px; font-size: 12px; color: var(--mute); letter-spacing: .06em; }
.menu-h .num { letter-spacing: 0; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; min-height: 38px; padding: 6px 10px; border-radius: 5px; font-size: 14px; text-align: left; }
.menu-row:hover:not(:disabled), .menu-row:focus-visible { background: var(--hover); }
.menu-row[aria-checked=true] { color: var(--acc); font-weight: 600; }
.menu-row small { display: block; font-size: 12px; color: var(--mute); font-weight: 400; }
.menu-row .num { color: var(--mute); flex: none; }
.menu-row.danger { color: var(--err); }
.menu-row:disabled { color: var(--dim); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-note { padding: 8px 10px; font-size: 12px; color: var(--mute); max-width: 300px; }
.share-b { display: flex; flex-direction: column; gap: 10px; padding: 4px 10px 10px; width: 300px; max-width: 100%; }
.share-b .menu-note { padding: 0; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--pb) + 16px); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--fg); color: var(--bg); padding: 9px 16px; font-size: 14px; border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }

/* ---------- 状态块 / 骨架 ---------- */
.state { padding: 22px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; border-top: 1px solid var(--line); }
.state-t { font-size: 14px; font-weight: 600; }
.state-d { font-size: 13px; color: var(--mute); }
.state .btn { margin-top: 8px; height: 34px; }
.sk-row { display: flex; align-items: center; gap: 12px; height: 57px; border-top: 1px solid var(--line); }
.sk-row i { display: block; height: 10px; border-radius: 3px; background: var(--on); animation: sk 1.4s ease-in-out infinite; }
.sk-row .sk-a { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.sk-row .sk-b { width: 40px; height: 40px; flex: none; border-radius: 4px; }
.sk-row .sk-d { width: 34px; margin-left: auto; }
.sk-take .sk-row { height: 96px; }
@keyframes sk { 50% { opacity: .45; } }

/* ---------- 封面 / 波形 ---------- */
.cover { display: block; aspect-ratio: 1; width: 100%; background: var(--raise); overflow: hidden; }
.cover svg, .cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wave { position: relative; min-width: 0; }
.wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wave[role=slider] { cursor: pointer; touch-action: none; }
.play { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.play .ic { width: 12px; height: 12px; }
.play:hover { box-shadow: inset 0 0 0 1px var(--fg); }
.is-playing > .play { background: var(--fg); color: var(--bg); box-shadow: none; }
.cv-open { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 12, 15, .56); color: var(--fg); opacity: 0; transition: opacity .15s; }
a:hover > .cv-open, a:focus-visible > .cv-open { opacity: 1; }

/* ---------- 页脚 ---------- */
.foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 28px; min-height: 52px; padding: 12px var(--gut); border-top: 1px solid var(--line); font-size: 13px; color: var(--mute); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.foot a:hover { color: var(--fg); }

/* ---------- 底部播放条 ---------- */
#player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; min-height: var(--pb); padding-bottom: env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line); }
body.no-pb #player, #player:has(> .pb[hidden]) { display: none; }
.pb { position: relative; display: grid; grid-template-columns: minmax(180px, 280px) auto minmax(100px, 1fr) auto auto auto; align-items: center; gap: 24px; height: var(--pb); padding: 0 var(--gut); margin-top: -1px; border-top: 1px solid var(--line); }
.pb-info { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pb-info:hover .pb-title { text-decoration: underline; text-underline-offset: 4px; }
.pb-open { color: var(--mute); margin-left: -10px; }
.pb-open:hover { color: var(--fg); }
.pb-cover { width: 46px; flex: none; border-radius: 4px; overflow: hidden; }
.pb-text { display: flex; flex-direction: column; min-width: 0; }
.pb-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-no { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-time { font-size: 13px; white-space: nowrap; }
.pb-wave { height: 34px; }
.pb-ctl { display: flex; align-items: center; gap: 6px; }
.pl { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--fg); flex: none; }
.pl:hover { background: var(--on); }
.pl-lg { width: 46px; height: 46px; background: var(--fg); color: var(--bg); }
.pl-lg:hover { background: #fff; }
.pl-lg .ic { width: 16px; height: 16px; }
.pb-vol { display: flex; align-items: center; gap: 8px; color: var(--mute); }
.range { -webkit-appearance: none; appearance: none; width: 90px; height: 24px; background: transparent; cursor: pointer; --v: 100%; }
.range::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--fg) var(--v), var(--line-2) var(--v)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--fg); margin-top: -4px; }
.range::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line-2); }
.range::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--fg); }
.range::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--fg); }
.pb-line { display: none; position: absolute; left: 0; right: 0; top: -1px; height: 2px; }
.pb-line i { display: block; height: 100%; width: 0; background: var(--acc); }

/* ---------- 歌词（lyrics.js：播放页、带次、单曲页共用；播放页的大字在 play.css）---------- */
.lyr { position: relative; min-width: 0; --lyr-pad: 0px; }
.lyr-scroll { position: relative; }
.lyr-in { display: flex; flex-direction: column; align-items: flex-start; }
.lyr-l { position: relative; display: block; max-width: 100%; text-align: left; font-size: 14px; line-height: 1.55; padding: 4px 0; color: var(--fg); opacity: .6; overflow-wrap: anywhere; transition: opacity .3s ease; }
button.lyr-l:hover { opacity: .95; }
.lyr-l[aria-current] { opacity: 1; }
.lyr-l::before { content: ""; position: absolute; left: -12px; top: .5em; bottom: .5em; width: 2px; background: var(--acc); opacity: 0; transition: opacity .3s ease; }
.lyr-l[aria-current]::before { opacity: 1; }
.lyr-tag { font-size: 11px; line-height: 1.4; letter-spacing: .14em; color: var(--acc); opacity: .86; margin-top: 16px; padding-bottom: 2px; }
.lyr-in > .lyr-tag:first-child, .lyr-note + .lyr-tag { margin-top: 0; }
.lyr-gap { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 6px 0; color: var(--fg); text-align: left; }
.lyr-gap .lyr-tag { margin: 0; padding: 0; opacity: .6; color: var(--mute); }
.lyr-dots { display: inline-flex; gap: 6px; }
.lyr-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .3; }
.lyr-gap[aria-current] .lyr-tag { color: var(--acc); opacity: .86; }
.lyr-gap[aria-current] .lyr-dots i { animation: lyrdot 1.8s ease-in-out infinite; }
.lyr-gap[aria-current] .lyr-dots i:nth-child(2) { animation-delay: .3s; }
.lyr-gap[aria-current] .lyr-dots i:nth-child(3) { animation-delay: .6s; }
@keyframes lyrdot { 0%, 100% { opacity: .3; } 40% { opacity: 1; } }
.lyr-note { color: var(--mute); font-size: 13px; padding-bottom: 10px; }
.lyr.is-panel .lyr-scroll { max-height: 216px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 6px, #000 40px, #000 calc(100% - 44px), transparent calc(100% - 6px), transparent 100%); mask-image: linear-gradient(180deg, transparent 0, transparent 6px, #000 40px, #000 calc(100% - 44px), transparent calc(100% - 6px), transparent 100%); }
.lyr.is-panel .lyr-scroll::-webkit-scrollbar { display: none; }
.lyr.is-panel .lyr-in { padding: 40px 0 46px 12px; }
.lyr.is-page .lyr-in { padding-left: 14px; }
.lyr.is-page .lyr-l::before { left: -14px; }

.mm { padding: 8px 24px 32px; overflow: auto; display: flex; flex-direction: column; gap: 22px; }
.mm-nav { display: flex; flex-direction: column; }
.mm-nav a { font-size: 22px; font-weight: 700; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--mute); }
.mm-nav a[aria-current] { color: var(--fg); }
.mm-acc { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; color: var(--mute); }
.mm-legal { display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 13px; color: var(--mute); }
.mm-legal a { padding: 12px 0; }

/* ---------- 登录 ---------- */
.lg-form { display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 1280px) { .slogan { display: none; } }
@media (max-width: 1100px) { .pb-vol { display: none; } .pb { grid-template-columns: minmax(160px, 240px) auto minmax(80px, 1fr) auto auto; } }
@media (max-width: 760px) {
  :root { --gut: 16px; --pb: 60px; }
  .top { grid-template-columns: 1fr auto; }
  .nav, .top-units { display: none; }
  .top-r { gap: 8px; }
  .btn-top { height: 36px; padding: 0 12px; }
  .btn-top span { max-width: 72px; }
  .top-menu { display: inline-flex; }
  .dlg { margin: auto 0 0; width: 100vw; max-width: 100vw; max-height: 92dvh; border-radius: 14px 14px 0 0; border-width: 1px 0 0; }
  .dlg-full { height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; background: var(--bg); }
  .dlg-h .ib { width: 44px; height: 44px; }
  .btn { height: 44px; }
  .menu-row { min-height: 46px; }
  .pop { left: 8px !important; right: 8px; max-width: none; }
  .share-b { width: auto; }
  .in { height: 44px; font-size: 16px; }
  .ck { padding: 9px 0; }
  .foot { flex-direction: column; align-items: flex-start; padding-top: 16px; padding-bottom: 20px; }
  .foot nav { gap: 0 22px; }
  .foot nav a { padding: 11px 0; }
  .pb { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 0 8px 0 var(--gut); }
  .pb-time, .pb-wave, .pb-skip, .pb-open { display: none; }
  .pb-line { display: block; }
  .pb-ctl .pl-lg { background: none; color: var(--fg); }
  .pb-cover { width: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }
