:root {
  --ink: #18201c;
  --muted: #6b756f;
  --paper: #eef1ee;
  --line: #cfd6d1;
  --green: #2b7654;
  --green-dark: #174b35;
  --amber: #e0a21b;
  --red: #a84b43;
  --stage: #111614;
  --surface: #f8faf8;
}
* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}
html {
  background: var(--paper);
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(43, 78, 57, 0.05) 1px, transparent 0);
  background-size: 18px 18px;
  font:
    14px/1.5 "Microsoft YaHei UI",
    "PingFang SC",
    "Noto Sans SC",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(28, 48, 35, 0.04);
}
button,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button,
.back-link {
  position: relative;
  transform-origin: center;
  transition:
    transform 0.1s ease,
    filter 0.1s ease,
    box-shadow 0.1s ease;
}
button::after,
.back-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.27);
  opacity: 0;
  transform: scale(0.72);
  transition:
    opacity 0.1s ease,
    transform 0.1s ease;
  pointer-events: none;
}
button:hover:not(:disabled),
.back-link:hover {
  filter: brightness(1.04);
}
button:active:not(:disabled),
button.pressing:not(:disabled),
.back-link:active,
.back-link.pressing {
  transform: translateY(1px) scale(0.96);
  filter: brightness(0.94);
}
button:active:not(:disabled)::after,
button.pressing:not(:disabled)::after,
.back-link:active::after,
.back-link.pressing::after {
  opacity: 1;
  transform: scale(1);
}
button:focus-visible,
.back-link:focus-visible {
  outline: 3px solid rgba(56, 142, 96, 0.3);
  outline-offset: 3px;
}
.app {
  width: min(920px, 100%);
  margin: auto;
  padding: 24px 20px 54px;
}
.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 3px;
  color: #66766c;
  font:
    700 10px/1.2 "Cascadia Mono",
    monospace;
  letter-spacing: 1.6px;
  text-shadow: 0 1px 0 #fff;
}
h1,
.library h2 {
  margin: 0;
  font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif;
  letter-spacing: 0;
}
h1 {
  font-size: 29px;
  text-shadow: 0 1px 0 #fff;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.storage-status,
.back-link {
  border: 1px solid #bbc7be;
  border-radius: 6px;
  color: #46594d;
  background: linear-gradient(#fff, #e7ece8);
  box-shadow:
    inset 0 1px 0 #fff,
    0 2px 0 #bcc7bf,
    0 3px 6px rgba(34, 50, 40, 0.08);
  text-shadow: 0 1px 0 #fff;
}
.storage-status {
  padding: 6px 9px;
  font-size: 10px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}
.back-link img { width: 17px; height: 17px; }
.player {
  position: relative;
  overflow: hidden;
  border: 1px solid #9fada5;
  border-radius: 8px;
  background: linear-gradient(145deg, #fbfdfb 0%, #e6ece8 48%, #d6dfd9 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 2px rgba(58, 78, 65, 0.08),
    inset 0 0 0 5px rgba(106, 126, 113, 0.06),
    0 3px 0 #b1bdb4,
    0 12px 26px rgba(31, 46, 37, 0.11);
}
.player::before,
.player::after {
  content: "";
  position: absolute;
  z-index: 8;
  top: 7px;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(77, 94, 83, 0.3);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f7faf7 0 18%, #b3bdb5 58%, #7e8a83 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
  opacity: 0.5;
  pointer-events: none;
}
.player::before {
  left: 7px;
}
.player::after {
  right: 7px;
}
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  color: #fff;
  border-bottom: 1px solid #78867d;
  background-color: var(--stage);
  background-image: repeating-linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.018) 0,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 9px
  );
  touch-action: none;
  user-select: none;
}
.stage::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 5px;
  border: 1px solid rgba(177, 196, 184, 0.14);
  border-radius: 4px;
  pointer-events: none;
}
.stage::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.25),
    inset 0 0 22px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.stage.audio-mode::before,
.stage.audio-mode::after {
  display: none;
}
.media-element {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: #000;
}
.stage.video-mode .media-element {
  display: block;
}
#audio {
  display: none;
}
.audio-visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: #102538;
}
.audio-visual::before,
.audio-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.audio-visual::before {
  z-index: -2;
  inset: -16px;
  background: url("assets/audio-background.png") center / cover no-repeat;
  filter: blur(12px) saturate(0.85);
}
.audio-visual.tts-audio::before {
  background-image: url("assets/tts-background.png");
}
.audio-visual::after {
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 20, 33, 0.68), rgba(7, 24, 38, 0.76));
}
.audio-visual[hidden] {
  display: none;
}
/* 音频播放页标题：霓虹招牌（字号由 player.js 按播放区宽度设置在 .audio-frame 上）
   霓虹颜色跟随背景：上传的音频是蓝色背景配蓝色霓虹，TTS 是绿色背景配绿色霓虹 */
.audio-visual {
  --neon-core: #e3f1ff;
  --neon-edge: #7cc0ff;
  --neon-edge-rgb: 124, 192, 255;
  --neon-rgb: 64, 156, 255;
  --neon-soft-rgb: 40, 110, 255;
  --neon-text: #f3f8ff;
  --neon-text-rgb: 160, 205, 255;
  --neon-text-soft-rgb: 60, 140, 255;
  --neon-fill: rgba(4, 14, 34, 0.3);
  --neon-shade: rgba(0, 12, 30, 0.6);
  --neon-breathe-duration: 2s;
}
.audio-visual.tts-audio {
  --neon-core: #dcfff0;
  --neon-edge: #7dffc6;
  --neon-edge-rgb: 125, 255, 198;
  --neon-rgb: 61, 255, 170;
  --neon-soft-rgb: 40, 235, 150;
  --neon-text: #f3fffb;
  --neon-text-rgb: 140, 255, 225;
  --neon-text-soft-rgb: 40, 215, 170;
  --neon-fill: rgba(3, 24, 18, 0.3);
  --neon-shade: rgba(0, 20, 15, 0.6);
}
.audio-frame {
  position: absolute;
  top: 41%;
  left: 50%;
  box-sizing: border-box;
  width: max-content;
  max-width: 90%;
  padding: 0.55em 1.15em 0.62em;
  border: 0.075em solid var(--neon-core);
  border-radius: 0.5em;
  background: var(--neon-fill);
  box-shadow:
    0 0 0.05em #fff,
    0 0 0.2em var(--neon-edge),
    inset 0 0 0.05em #fff,
    inset 0 0 0.2em rgba(var(--neon-edge-rgb), 0.9);
  font-size: 40px;
  text-align: center;
  transform: translate(-50%, -50%);
}
.neon-glow {
  position: absolute;
  inset: -0.075em;
  border-radius: inherit;
  box-shadow:
    0 0 0.35em rgba(var(--neon-rgb), 0.85),
    0 0 0.9em rgba(var(--neon-soft-rgb), 0.5),
    0 0 1.8em rgba(var(--neon-soft-rgb), 0.26),
    inset 0 0 0.45em rgba(var(--neon-rgb), 0.45),
    inset 0 0 1.1em rgba(var(--neon-soft-rgb), 0.16);
  opacity: 1;
  pointer-events: none;
}
/* 呼吸灯：播放时光晕、边框灯管、文字的光一起变暗再亮回来（最暗时仍留一点光），
   整个招牌同步缩放：越亮越大、越暗越小（最亮时就是原始大小，不会超出播放区）；
   暂停时不动画，停在最亮、最大的样子（最亮 = 下面这些静态样式） */
.audio-visual.is-playing .neon-glow {
  animation: neon-breathe var(--neon-breathe-duration) ease-in-out infinite;
}
.audio-visual.is-playing .audio-frame {
  animation: neon-tube-breathe var(--neon-breathe-duration) ease-in-out infinite;
}
.audio-visual.is-playing .audio-title {
  animation: neon-text-breathe var(--neon-breathe-duration) ease-in-out infinite;
}
@keyframes neon-breathe {
  50% {
    opacity: 0.3;
  }
}
@keyframes neon-tube-breathe {
  50% {
    transform: translate(-50%, -50%) scale(0.92);
    box-shadow:
      0 0 0.04em #fff,
      0 0 0.1em var(--neon-edge),
      inset 0 0 0.04em #fff,
      inset 0 0 0.1em rgba(var(--neon-edge-rgb), 0.65);
  }
}
@keyframes neon-text-breathe {
  50% {
    text-shadow:
      0 0 0.02em #fff,
      0 0 0.07em rgba(var(--neon-text-rgb), 0.6),
      0 0 0.18em rgba(var(--neon-text-soft-rgb), 0.35),
      0 0.04em 0.08em var(--neon-shade);
  }
}
.audio-title {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--neon-text);
  font:
    400 1em/1.3 "Microsoft YaHei UI",
    "Microsoft YaHei",
    "PingFang SC",
    "Hiragino Sans GB",
    "Noto Sans SC",
    "Noto Sans CJK SC",
    "Source Han Sans SC",
    sans-serif;
  font-style: italic;
  /* 中文字体通常没有斜体字形，由浏览器把正体倾斜显示 */
  font-synthesis: style;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  text-wrap: balance;
  text-shadow:
    0 0 0.02em #fff,
    0 0 0.12em rgba(var(--neon-text-rgb), 0.95),
    0 0 0.34em rgba(var(--neon-text-soft-rgb), 0.75),
    0 0.04em 0.08em var(--neon-shade);
}
.title-phrase {
  white-space: nowrap;
}
.empty-stage-copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #8e9b93;
  text-align: center;
}
.empty-stage-copy strong {
  color: #d6ddd8;
  font-size: 18px;
}
.empty-stage-copy span {
  font-size: 11px;
}
.stage:not(.empty-stage) .empty-stage-copy {
  display: none;
}
.controls {
  position: absolute;
  z-index: 4;
  left: 14px;
  right: 14px;
  bottom: 12px;
  display: grid;
  grid-template-columns: 44px 44px 44px auto minmax(80px, 1fr) auto 54px;
  align-items: center;
  gap: 7px;
  min-height: 60px;
  padding: 8px 10px;
  transition:
    opacity 0.32s ease,
    transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0.32s;
  border: 1px solid #3f4b44;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(56, 66, 59, 0.95), rgba(20, 26, 22, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 2px 0 rgba(0, 0, 0, 0.35),
    0 8px 18px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
}
.controls > * {
  align-self: center;
}
.stage.controls-hidden .controls {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  visibility: hidden;
  pointer-events: none;
}
.stage.controls-hidden {
  cursor: none;
}
.controls button {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  color: #fff;
  line-height: 1;
  cursor: pointer;
}
.controls .icon-button,
.controls .play-button {
  width: 44px;
  height: 44px;
  border: 1px solid #b9c5bc;
  border-radius: 6px;
  color: #466052;
  background: linear-gradient(#fff, #e3eae5);
  box-shadow:
    inset 0 1px 0 #fff,
    0 2px 0 #b7c2b9,
    0 3px 5px rgba(35, 53, 41, 0.08);
}
.controls .icon-button img,
.controls .play-button img {
  display: block;
  width: 32px;
  height: 32px;
  pointer-events: none;
  transition: transform 0.1s ease;
}
.icon-button:active img,
.icon-button.pressing img,
.play-button:active img,
.play-button.pressing img {
  transform: scale(0.86);
}
.controls .icon-button:active,
.controls .icon-button.pressing,
.controls .play-button:active,
.controls .play-button.pressing {
  box-shadow:
    inset 0 1px 3px rgba(39, 61, 47, 0.14),
    0 1px 0 #b7c2b9;
}
.controls .rate-button {
  width: 54px;
  height: 36px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(35, 60, 47, 0.08);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.rate-button[data-rate="1"] {
  border-color: #a7bbae;
  background: #fff;
  color: #233c2f;
}
.rate-button[data-rate="1.5"] {
  border-color: #9fc8b2;
  background: #dcefe2;
  color: #20543a;
}
.rate-button[data-rate="2"] {
  border-color: #285a43;
  background: #285a43;
  color: #fff;
}
.rate-button:hover {
  filter: brightness(0.96);
}
.rate-button:focus-visible {
  outline: 2px solid #285a43;
  outline-offset: 2px;
}
.controls span {
  display: grid;
  align-items: center;
  height: 36px;
  color: #d8dfda;
  font:
    10px/1 "Cascadia Mono",
    monospace;
}
.seek {
  align-self: center;
  width: 100%;
  height: 4px;
  margin: 0;
  accent-color: #4fa276;
  cursor: pointer;
}
.gesture-hud {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 45%;
  min-width: 100px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  text-align: center;
  font-weight: 800;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.95);
  transition: 0.18s ease;
  pointer-events: none;
}
.gesture-hud.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.now-playing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  margin: 7px;
  padding: 13px 20px;
  border: 1px solid #b4c2b9;
  border-radius: 6px;
  background: linear-gradient(180deg, #f8fbf8 0%, #eaf0eb 42%, #dde5df 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(74, 94, 80, 0.1),
    inset 0 2px 4px rgba(39, 58, 45, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.7);
}
.now-playing > div {
  min-width: 0;
  flex: 1 1 auto;
}
.now-playing h2 {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kind-label {
  color: var(--green);
  font:
    800 9px/1 "Cascadia Mono",
    monospace;
  letter-spacing: 1px;
}
.library {
  position: relative;
  margin-top: 24px;
  padding: 20px 18px 18px;
  border: 1px solid #b4c2b9;
  border-radius: 8px;
  background: linear-gradient(145deg, #fcfdfb 0%, #e9efeb 52%, #dae3dd 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 2px rgba(49, 69, 56, 0.07),
    inset 0 0 0 5px rgba(112, 132, 119, 0.035),
    0 3px 0 #b9c4bc,
    0 10px 22px rgba(34, 51, 40, 0.09);
}
.library::before,
.library::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 8px;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(77, 94, 83, 0.28);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fafcf9 0 18%, #b9c3bb 58%, #85918a 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
  opacity: 0.45;
  pointer-events: none;
}
.library::before {
  left: 8px;
}
.library::after {
  right: 8px;
}
.library-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
  margin: 0 6px 15px;
}
.library h2 {
  font-size: 19px;
}
.sort-control {
  display: flex;
  padding: 4px;
  border: 1px solid #b4c2b9;
  border-radius: 7px;
  background: linear-gradient(#dae3dc, #e9eeea);
  box-shadow:
    inset 0 2px 4px rgba(38, 55, 44, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.7),
    0 1px 0 #fff;
}
.sort-button {
  border: 0;
  border-radius: 5px;
  padding: 6px 10px;
  color: #68746c;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.sort-button.active {
  color: #fff;
  background: linear-gradient(#398664, #236b4b);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 1px 0 #18563b,
    0 3px 6px rgba(29, 78, 51, 0.14);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.media-list {
  display: grid;
  gap: 8px;
}
.media-row {
  --download-progress: 0%;
  --play-progress: 0%;
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 68px;
  padding: 9px 10px;
  overflow: hidden;
  border: 1px solid #c2cdc5;
  border-radius: 7px;
  background: linear-gradient(#f8faf8, #eaf0eb);
  box-shadow:
    inset 0 1px 3px rgba(38, 58, 45, 0.06),
    inset 0 -1px 0 #fff,
    0 1px 3px rgba(35, 52, 41, 0.06);
  cursor: pointer;
  isolation: isolate;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
.media-row:hover {
  border-color: #a8bcae;
  box-shadow:
    inset 0 1px 3px rgba(38, 58, 45, 0.06),
    inset 0 -1px 0 #fff,
    0 3px 6px rgba(35, 52, 41, 0.09);
  transform: translateY(-1px);
}
.media-row::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0 auto 0 0;
  width: var(--download-progress);
  background: repeating-linear-gradient(110deg, #dceee3 0, #dceee3 15px, #cbe5d5 15px, #cbe5d5 30px);
  transition: width 0.2s linear;
}
.media-row.downloading::before {
  animation: download-stripes 0.7s linear infinite;
}
.media-row::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  width: var(--play-progress);
  height: 5px;
  background: #2f8a5c;
  box-shadow: 0 -1px 5px rgba(47, 138, 92, 0.24);
  transition: width 0.25s linear;
}
.media-row.active {
  border-color: #6e9f7f;
  box-shadow:
    inset 0 1px 3px rgba(38, 58, 45, 0.06),
    0 0 0 2px rgba(47, 125, 81, 0.1),
    0 3px 6px rgba(35, 52, 41, 0.09);
}
.media-row.playing {
  border-color: #5e9b73;
  background: linear-gradient(145deg, #f8fff9, #e3f1e7);
  animation: playing-row-glow 2.2s ease-in-out infinite;
}
@keyframes playing-row-glow {
  0%, 100% { box-shadow: inset 0 1px 3px rgba(38, 58, 45, 0.06), 0 0 0 2px rgba(47, 125, 81, 0.12), 0 3px 6px rgba(35, 52, 41, 0.08); }
  50% { box-shadow: inset 0 1px 3px rgba(38, 58, 45, 0.06), 0 0 0 3px rgba(47, 125, 81, 0.22), 0 5px 12px rgba(35, 92, 54, 0.14); }
}
.media-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 48px;
  overflow: hidden;
  border: 2px solid #edf2ee;
  border-radius: 5px;
  color: #557061;
  background: #dfe7e1;
  box-shadow:
    inset 0 1px 2px rgba(37, 55, 43, 0.08),
    0 1px 3px rgba(35, 53, 41, 0.12);
  font-size: 10px;
  font-weight: 900;
}
.media-thumb-artwork {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 3px;
}
.media-thumb-artwork > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-thumb img.tts-portrait-cover {
  /* Keep the portrait inside the frame instead of sizing an intrinsic grid row. */
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0;
}
.media-copy {
  min-width: 0;
}
.media-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0 0 4px;
}
.media-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-playing-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid #8eb99a;
  border-radius: 999px;
  color: #246440;
  background: linear-gradient(#f4fff6, #dcefe1);
  box-shadow: inset 0 1px 0 white, 0 1px 0 #b7d2bf, 0 2px 4px rgba(35, 80, 48, 0.1);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
}
.media-playing-bars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}
.media-playing-bars i {
  display: block;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: #2f8a53;
  animation: playing-bars 0.72s ease-in-out infinite alternate;
}
.media-playing-bars i:nth-child(2) { animation-delay: -0.42s; }
.media-playing-bars i:nth-child(3) { animation-delay: -0.18s; }
@keyframes playing-bars {
  from { height: 3px; }
  to { height: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .media-row.playing { animation: none; }
  .media-playing-bars i { animation: none; height: 8px; }
  .media-playing-bars i:nth-child(2) { height: 4px; }
}
.media-meta {
  display: flex;
  gap: 8px;
  color: #77827b;
  font-size: 9px;
}
.location-status {
  padding: 1px 5px;
  border: 1px solid #c4cec6;
  border-radius: 4px;
  font-weight: 800;
}
.location-status.local {
  color: #2d704d;
  border-color: #a9c9b4;
  background: #e2efe6;
}
.location-status.server {
  color: #68736c;
  background: #edf0ed;
}
.location-status.loading {
  color: #8b640e;
  border-color: #d8c07f;
  background: #f5ecd2;
}
.media-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.media-action {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 7px;
  border: 1px solid #b9c5bc;
  border-radius: 6px;
  color: #466052;
  background: linear-gradient(#fff, #e3eae5);
  box-shadow:
    inset 0 1px 0 #fff,
    0 2px 0 #b7c2b9,
    0 3px 5px rgba(35, 53, 41, 0.08);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.media-action img {
  display: block;
  width: 26px;
  height: 26px;
  pointer-events: none;
  transition: transform 0.1s ease;
}
.media-action:active img,
.media-action.pressing img {
  transform: scale(0.86);
}
.media-action:active:not(:disabled) {
  box-shadow:
    inset 0 1px 3px rgba(39, 61, 47, 0.14),
    0 1px 0 #b7c2b9;
}
.media-action.remove {
  color: #8a423b;
}
.media-action:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}
.comment-action {
  position: relative;
  overflow: visible;
  color: #a3aca6;
  background: linear-gradient(#f4f6f4, #e2e7e3);
}
.comment-action .comment-glyph {
  display: grid;
  place-items: center;
}
.comment-action img { filter: grayscale(1); opacity: .65; }
.comment-action.has-comments {
  color: #2b7654;
  background: linear-gradient(#fff, #dfeee5);
  border-color: #a9c9b4;
}
.comment-action.has-comments img { filter: none; opacity: 1; }
.comment-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 9px;
  color: #fff;
  background: #e5453a;
  font:
    800 10px/14px "Cascadia Mono",
    monospace;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.empty-list {
  padding: 36px 10px;
  color: #7c8880;
  text-align: center;
  font-size: 12px;
}
.toast-wrap {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 50%;
  width: min(460px, calc(100vw - 28px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 11px 14px;
  border: 1px solid #b8c9bd;
  border-radius: 7px;
  color: #28513a;
  background: #f7fbf8;
  box-shadow: 0 12px 32px rgba(31, 56, 39, 0.2);
  font-size: 12px;
  font-weight: 800;
  animation: toast-in 0.2s ease both;
  transition: 0.2s ease;
}
.toast.error {
  color: #843d36;
  border-color: #d3aaa5;
  background: #fff7f6;
}
@keyframes download-stripes {
  to {
    background-position: 30px 0;
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@media (max-width: 620px) {
  .app {
    padding: 15px 12px 40px;
  }
  .topbar {
    align-items: flex-start;
  }
  h1 {
    font-size: 24px;
  }
  .storage-status {
    display: none;
  }
  .stage {
    border-radius: 0;
  }
  .controls {
    left: 7px;
    right: 7px;
    bottom: 7px;
    grid-template-columns: 42px 42px 42px minmax(70px, 1fr) 50px;
    min-height: 56px;
  }
  .controls .icon-button,
  .controls .play-button {
    width: 42px;
    height: 42px;
  }
  .controls .icon-button img,
  .controls .play-button img {
    width: 30px;
    height: 30px;
  }
  .controls .rate-button {
    width: 50px;
    height: 36px;
  }
  .controls span {
    display: none;
  }
  .now-playing {
    min-height: 64px;
    padding: 10px 14px;
  }
  .library {
    padding: 13px 10px;
  }
  .media-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 7px;
  }
  .media-thumb {
    width: 44px;
    height: 43px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .audio-visual.is-playing .neon-glow,
  .audio-visual.is-playing .audio-frame,
  .audio-visual.is-playing .audio-title {
    animation: none;
  }
}
