:root {
  --bg: #f2f5f1;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --surface-3: #edf3ee;
  --text: #18231f;
  --muted: #64726b;
  --line: #dce5dd;
  --line-strong: #c1cdc4;
  --accent: #147e72;
  --accent-strong: #0f665d;
  --accent-soft: rgba(20, 126, 114, 0.12);
  --accent-ring: rgba(20, 126, 114, 0.24);
  --accent-2: #bf4654;
  --amber: #b8791f;
  --ink: #101815;
  --player: #151d1a;
  --player-bar: #202a26;
  --shadow: 0 18px 44px rgba(22, 34, 29, 0.14);
  --shadow-soft: 0 10px 26px rgba(22, 34, 29, 0.08);
  --button-bg: rgba(255, 255, 255, 0.86);
  --button-hover: #eef6f2;
  --drawer: 388px;
  --album-height: 40vh;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0d1411;
  --surface: #151c19;
  --surface-2: #1a231f;
  --surface-3: #202b26;
  --text: #eef6f1;
  --muted: #99aaa2;
  --line: #293630;
  --line-strong: #3a4c44;
  --accent: #61d8c2;
  --accent-strong: #8ff2dd;
  --accent-soft: rgba(97, 216, 194, 0.15);
  --accent-ring: rgba(97, 216, 194, 0.28);
  --accent-2: #ff818e;
  --amber: #e0a84d;
  --ink: #050706;
  --player: #080b0a;
  --player-bar: #151d1a;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
  --button-bg: rgba(27, 35, 31, 0.86);
  --button-hover: #20312b;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body {
  overflow: hidden;
}

body.is-player-fallback-fullscreen {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  display: grid;
  width: 100vw;
  height: 100vh;
}

.icon-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 8px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 720;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.icon-button {
  width: 34px;
  border: 1px solid var(--line);
  background: var(--button-bg);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.icon-button:hover,
.text-button.secondary:hover {
  border-color: var(--line-strong);
  background: var(--button-hover);
  box-shadow: 0 8px 18px rgba(22, 34, 29, 0.08);
}

.library-toolbar .icon-button.is-active {
  border-color: var(--accent-ring);
  color: var(--accent-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent),
    var(--accent-soft);
}

:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .text-button.secondary {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .library-toolbar .icon-button.is-active {
  color: #9ce8d9;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    var(--accent-soft);
}

.icon-button:active,
.text-button:active {
  transform: translateY(1px);
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-button {
  gap: 7px;
  padding: 0 12px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 18px rgba(20, 126, 114, 0.18);
}

.text-button.secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--button-bg);
  box-shadow: none;
}

:root[data-theme="dark"] .text-button.secondary,
:root[data-theme="dark"] .icon-button {
  background: var(--button-bg);
}

.shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) var(--drawer);
  grid-template-rows: var(--album-height) minmax(0, 1fr);
  min-height: 0;
  height: 100vh;
}

.shell.drawer-hidden {
  grid-template-columns: minmax(0, 1fr) 0;
}

.panel {
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), transparent 120px),
    var(--surface);
}

:root[data-theme="dark"] .panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 120px),
    var(--surface);
}

.shell.drawer-hidden > .panel {
  display: none;
}

.album-panel {
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.library-panel {
  grid-column: 2;
  grid-row: 2;
  background:
    linear-gradient(180deg, var(--surface), var(--surface-2));
}

:root[data-theme="dark"] .library-panel {
  background:
    linear-gradient(180deg, var(--surface), #111815);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(12px);
}

:root[data-theme="dark"] .panel-header {
  background: rgba(21, 28, 25, 0.78);
}

.panel-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.panel-title h2 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 780;
  letter-spacing: 0.01em;
}

.panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.panel-actions,
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.album-list,
.video-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  height: calc(100% - 46px);
  padding: 10px;
  overflow: auto;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.album-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.album-item:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
}

:root[data-theme="dark"] .album-item:hover {
  border-color: var(--line-strong);
  background: rgba(32, 43, 38, 0.72);
  box-shadow: none;
}

.album-item:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: -2px;
}

.album-item.is-active {
  border-color: var(--accent-ring);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.34)),
    var(--accent-soft);
  box-shadow: var(--shadow-soft);
}

:root[data-theme="dark"] .album-item.is-active {
  border-color: var(--accent-ring);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--accent-soft);
  box-shadow: none;
}

.album-cover {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--accent-strong);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.55)),
    linear-gradient(145deg, rgba(20, 126, 114, 0.2), rgba(184, 121, 31, 0.16));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 20px rgba(22, 34, 29, 0.1);
}

:root[data-theme="dark"] .album-cover {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(97, 216, 194, 0.2), rgba(224, 168, 77, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.18);
}

.album-cover svg {
  width: 31px;
  height: 31px;
  overflow: visible;
}

.album-icon-shadow {
  fill: rgba(17, 24, 22, 0.16);
  transform: translateY(1px);
}

.album-icon-body {
  fill: #f7c45d;
  stroke: rgba(92, 60, 9, 0.32);
  stroke-width: 1.4;
}

.album-icon-lid {
  fill: none;
  stroke: rgba(92, 60, 9, 0.42);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.album-icon-mark {
  fill: #157f72;
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 0.8;
  stroke-linejoin: round;
}

.album-item.is-favorites .album-cover {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent),
    linear-gradient(145deg, #6be0cb, #159a89);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 12px 24px rgba(20, 126, 114, 0.18);
}

.album-item.is-favorites .album-icon-body {
  fill: #55d4bd;
  stroke: rgba(12, 83, 75, 0.44);
}

.album-item.is-favorites .album-icon-lid {
  stroke: rgba(12, 83, 75, 0.48);
}

.album-item.is-favorites .album-icon-mark {
  fill: #fff5bd;
  stroke: rgba(15, 104, 95, 0.52);
}

.album-item.is-favorites .album-meta strong::after {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  color: #0f685f;
  background: rgba(21, 127, 114, 0.12);
  font-size: 10px;
  vertical-align: 1px;
  content: "置顶";
}

:root[data-theme="dark"] .album-item.is-favorites .album-meta strong::after {
  color: #9ce8d9;
  background: rgba(85, 212, 189, 0.16);
}

.album-meta,
.video-meta {
  justify-self: stretch;
  min-width: 0;
  text-align: left;
}

.album-meta strong,
.video-meta strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 740;
}

.album-meta span,
.video-meta span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.album-play-button,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 730;
}

:root[data-theme="dark"] .status-pill {
  background: var(--surface-3);
}

.album-play-button {
  justify-self: end;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 1px solid rgba(21, 127, 114, 0.18);
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--accent-soft);
  transition: background 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.album-play-button:hover {
  color: #ffffff;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 18px rgba(20, 126, 114, 0.18);
  transform: translateY(-1px);
}

.status-pill.ok {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

:root[data-theme="dark"] .status-pill.ok {
  color: #8ff2dd;
  background: rgba(85, 212, 189, 0.16);
}

.status-pill.warn {
  color: #8c530e;
  background: #f5ead8;
}

:root[data-theme="dark"] .status-pill.warn {
  color: #ffd18a;
  background: rgba(217, 163, 76, 0.18);
}

.video-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent),
    var(--surface);
  cursor: default;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.52);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease, transform 150ms ease;
}

:root[data-theme="dark"] .video-item {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.video-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.video-item.is-playing {
  border-color: var(--accent-ring);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), transparent),
    var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-soft);
}

:root[data-theme="dark"] .video-item.is-playing {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(97, 216, 194, 0.08);
}

.thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(20, 126, 114, 0.86), rgba(16, 24, 21, 0.97)),
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(255, 255, 255, 0.08) 8px 9px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.is-placeholder {
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.24), transparent 28%),
    linear-gradient(135deg, rgba(20, 126, 114, 0.82), rgba(17, 28, 24, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(255, 255, 255, 0.08) 8px 9px);
}

:root[data-theme="dark"] .thumb.is-placeholder {
  background:
    radial-gradient(circle at 74% 22%, rgba(97, 216, 194, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(31, 92, 83, 0.82), rgba(10, 15, 13, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(255, 255, 255, 0.06) 8px 9px);
}

.thumb::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, 0.42));
  content: "";
  pointer-events: none;
}

.thumb-fallback {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 28px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.thumb-fallback svg {
  width: 32px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thumb-fallback svg path {
  fill: currentColor;
  stroke: none;
}

.video-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.drag-handle {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: grab;
  opacity: 0.72;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(20, 126, 114, 0.05), rgba(184, 121, 31, 0.05)),
    var(--surface-2);
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
}

:root[data-theme="dark"] .empty-state {
  background:
    linear-gradient(135deg, rgba(97, 216, 194, 0.06), rgba(224, 168, 77, 0.04)),
    #111815;
}

.player-grid > .empty-state {
  grid-column: 1 / -1;
  min-height: 100%;
  border-style: solid;
}

.player-stage {
  display: grid;
  grid-column: 1;
  grid-row: 1 / 3;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(20, 126, 114, 0.1), transparent 28%),
    linear-gradient(145deg, #e9eee9, #dfe7e0);
}

:root[data-theme="dark"] .player-stage {
  background:
    radial-gradient(circle at 18% 12%, rgba(97, 216, 194, 0.09), transparent 30%),
    linear-gradient(145deg, #0b0f0d, #101714);
}

.player-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(260px, 1fr);
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 8px;
  overflow: auto;
}

.app.multi-mode:not(.one-window) .player-grid {
  display: block;
  overflow: hidden;
}

.app.single-mode .player-grid {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(420px, 1fr);
}

.app.one-window .player-grid {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  overflow: hidden;
}

.app.single-mode .player-window:not(:first-child) {
  display: none;
}

.player-window {
  position: relative;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr) 48px;
  min-width: 240px;
  min-height: 168px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--player);
  box-shadow: 0 22px 48px rgba(11, 15, 13, 0.18);
}

.player-window:fullscreen {
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr) 58px;
  width: 100vw;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.player-window:fullscreen .video-surface {
  background: #000;
}

.player-window:fullscreen .video-surface video,
.video-surface video:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #000;
}

.player-window:fullscreen .window-top,
.player-window:fullscreen .controls {
  background: rgba(8, 12, 10, 0.92);
}

.player-window.is-fallback-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr) 58px;
  width: 100vw !important;
  height: 100vh !important;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
  touch-action: auto;
}

.player-window.is-fallback-fullscreen .window-top,
.player-window.is-fallback-fullscreen .controls {
  background: rgba(8, 12, 10, 0.94);
}

.player-window.is-fallback-fullscreen .video-surface {
  background: #000;
}

.player-window.is-fallback-fullscreen .video-surface video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #000;
}

.player-window.is-fallback-fullscreen .window-resize-handle {
  display: none;
}

.player-window.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 24px 54px rgba(11, 15, 13, 0.2);
}

.player-window.is-floating {
  position: absolute;
  min-width: 260px;
  min-height: 190px;
  touch-action: none;
}

.app.one-window .player-window {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.window-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 0 10px;
  color: #e8eee9;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    var(--player-bar);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.player-window.is-floating .window-top {
  cursor: move;
  user-select: none;
}

.window-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
  font-weight: 710;
}

.window-title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(97, 216, 194, 0.13);
  flex-shrink: 0;
}

.window-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mini-tool {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: #d5ded8;
  background: transparent;
  font-size: 13px;
  transition: background 150ms ease, color 150ms ease;
}

.mini-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.close-window {
  color: #ffd9dc;
  background: rgba(185, 65, 78, 0.2);
}

.app.single-mode .close-window,
.app.one-window .close-window {
  display: none;
}

.video-surface {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(97, 216, 194, 0.24), transparent 34%),
    linear-gradient(145deg, #26312d 0%, #0f1512 72%);
}

.video-surface video {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  background: #050706;
}

.video-placeholder {
  display: grid;
  place-items: center;
  width: clamp(64px, 12vw, 112px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.88);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(0, 0, 0, 0.16);
  font-size: clamp(28px, 5vw, 54px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.controls {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--player-bar);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.control-left,
.control-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.control-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #e8eee9;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.control-button:hover,
.rate-select:hover {
  background: rgba(255, 255, 255, 0.14);
}

.control-button:active {
  transform: translateY(1px);
}

.control-button.primary {
  color: #09231f;
  background: linear-gradient(180deg, #7be4d0, #55d4bd);
}

.control-button.single-only {
  font-size: 13px;
  font-weight: 760;
}

.app.multi-mode:not(.one-window) .control-button.single-only {
  display: none;
}

.rate-select {
  width: 54px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  color: #e8eee9;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  outline: none;
}

.progress {
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #b8c3bd;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.track {
  width: 100%;
  accent-color: var(--accent);
}

.volume {
  width: 64px;
  accent-color: var(--accent);
}

.window-resize-handle {
  display: none;
  position: absolute;
  z-index: 4;
}

.player-window.is-floating .window-resize-handle {
  display: block;
}

.resize-right {
  top: 34px;
  right: 0;
  bottom: 10px;
  width: 10px;
  cursor: ew-resize;
}

.resize-bottom {
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 10px;
  cursor: ns-resize;
}

.resize-corner {
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
}

.resize-corner::after {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.42);
  border-bottom: 2px solid rgba(255, 255, 255, 0.42);
  content: "";
}

body.is-moving-player,
body.is-resizing-player {
  user-select: none;
}

.drawer-width-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: calc(var(--drawer) - 4px);
  z-index: 15;
  width: 8px;
  cursor: col-resize;
}

.drawer-width-resizer::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: transparent;
  content: "";
}

.drawer-width-resizer:hover::after,
body.is-resizing-drawer .drawer-width-resizer::after {
  background: var(--accent);
}

.drawer-height-resizer {
  position: absolute;
  top: calc(var(--album-height) - 4px);
  right: 0;
  z-index: 16;
  width: var(--drawer);
  height: 8px;
  cursor: row-resize;
}

.drawer-height-resizer::after {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.drawer-height-resizer:hover::after,
body.is-resizing-split .drawer-height-resizer::after {
  background: var(--accent);
}

.shell.drawer-hidden .drawer-width-resizer,
.shell.drawer-hidden .drawer-height-resizer {
  display: none;
}

.drawer-floating-actions {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.drawer-toggle-floating {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--button-bg);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 720;
  backdrop-filter: blur(12px);
}

:root[data-theme="dark"] .drawer-toggle-floating {
  background: rgba(23, 29, 26, 0.94);
}

.shell.drawer-hidden + .drawer-floating-actions {
  display: flex;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(22, 34, 29, 0.16);
  font-size: 13px;
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

:root[data-theme="dark"] .toast {
  background: rgba(23, 29, 26, 0.96);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 24%, rgba(97, 216, 194, 0.16), transparent 34%),
    rgba(5, 8, 6, 0.5);
  backdrop-filter: blur(8px);
}

.processing-overlay[hidden] {
  display: none;
}

.processing-panel {
  display: grid;
  grid-template-columns: 46px minmax(180px, 280px);
  gap: 12px;
  width: min(380px, calc(100vw - 48px));
  padding: 16px;
  border: 1px solid rgba(97, 216, 194, 0.22);
  border-radius: 10px;
  color: #eef6f1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), transparent),
    rgba(13, 20, 17, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.processing-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  color: #9ce8d9;
  background: rgba(97, 216, 194, 0.14);
  box-shadow: inset 0 0 0 1px rgba(97, 216, 194, 0.22);
}

.processing-mark svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.processing-mark svg path:last-child {
  fill: currentColor;
  stroke: none;
}

.processing-copy {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.processing-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.processing-copy span {
  overflow: hidden;
  color: #b8c9c1;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.processing-progress {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.processing-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #61d8c2, #e0a84d);
  transition: width 120ms ease;
}

.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 30% 22%, rgba(97, 216, 194, 0.18), transparent 34%),
    radial-gradient(circle at 72% 76%, rgba(191, 70, 84, 0.13), transparent 32%),
    linear-gradient(145deg, #07100d 0%, #101815 48%, #050806 100%);
  background-color: #07100d;
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
}

.lock-overlay::before,
.lock-overlay::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.lock-overlay::before {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 5px
    );
  opacity: 0.16;
}

.lock-overlay::after {
  background:
    linear-gradient(120deg, transparent 0 38%, rgba(255, 255, 255, 0.08) 48%, transparent 58%),
    radial-gradient(circle at center, transparent 0 48%, rgba(0, 0, 0, 0.38) 100%);
  opacity: 0.72;
}

.lock-overlay[hidden] {
  display: none;
}

.lock-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px 16px;
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #eef6f1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 46%),
    rgba(19, 28, 24, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 28px 80px rgba(0, 0, 0, 0.34);
}

.lock-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  color: #0f2420;
  background: linear-gradient(145deg, #8ff2dd, #55d4bd);
  box-shadow: 0 14px 30px rgba(85, 212, 189, 0.2);
}

.lock-mark svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lock-copy {
  align-self: center;
  min-width: 0;
}

.lock-copy h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.lock-copy p {
  margin: 6px 0 0;
  color: #b8c7c0;
  font-size: 13px;
}

.lock-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 9px;
}

.lock-form[hidden] {
  display: none;
}

.lock-form label {
  color: #dce8e2;
  font-size: 12px;
  font-weight: 720;
}

.lock-form input {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #f5fbf8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent),
    rgba(255, 255, 255, 0.08);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.lock-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(97, 216, 194, 0.18);
}

.lock-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.lock-link {
  justify-self: start;
  padding: 0;
  color: #9ce8d9;
  background: transparent;
  font-size: 13px;
  font-weight: 720;
  text-underline-offset: 3px;
}

.lock-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.lock-message {
  grid-column: 1 / -1;
  min-height: 18px;
  color: #b8c7c0;
  font-size: 13px;
}

.lock-message[data-tone="error"] {
  color: #ffb7bd;
}

.lock-message[data-tone="success"] {
  color: #9ce8d9;
}

.context-menu {
  position: fixed;
  z-index: 60;
  min-width: 136px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(22, 34, 29, 0.18);
  backdrop-filter: blur(14px);
}

:root[data-theme="dark"] .context-menu {
  background: rgba(23, 29, 26, 0.98);
}

.context-menu[hidden] {
  display: none;
}

.context-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  transition: background 140ms ease, color 140ms ease;
}

.context-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

:root[data-theme="dark"] .context-menu button:hover {
  background: var(--accent-soft);
}

.context-menu button[data-action="delete"] {
  color: var(--accent-2);
}

@media (max-width: 1160px) {
  :root {
    --drawer: 352px;
  }
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .app {
    min-height: 100vh;
    height: auto;
  }

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(680px, 72vh) auto auto;
    height: auto;
  }

  .panel {
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .album-panel,
  .library-panel,
  .player-stage {
    grid-column: 1;
  }

  .player-stage {
    grid-row: 1;
    min-height: 720px;
  }

  .album-panel {
    grid-row: 2;
  }

  .library-panel {
    grid-row: 3;
  }

  .shell.drawer-hidden {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(680px, 100vh);
  }

  .drawer-width-resizer,
  .drawer-height-resizer {
    display: none;
  }

  .album-list,
  .video-list {
    height: auto;
    max-height: none;
  }

  .player-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .video-item {
    grid-template-columns: 90px minmax(0, 1fr) 26px;
  }

  .thumb {
    width: 90px;
  }

  .controls {
    grid-template-columns: 1fr;
  }
}
