html.page-player {
  --bg: #0e1014;
  --shell: #161920;
  --surface: #1c1f28;
  --inset: #252a34;
  --border: #2e3340;
  --text: #e6e8ec;
  --muted: #8b909a;
  --accent: #c4a574;
  --accent-dim: #8f7350;
  --ok: #3d6b5a;
  --danger: #a35a5a;
  --fs-header: 16px;
  --fs-title: 20px;
  --fs-body: 13px;
  --fs-meta: 11px;
  overflow-y: auto;
  overflow-x: hidden;
}

html.page-player body {
  width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.4;
}

html.page-player *,
html.page-player *::before,
html.page-player *::after {
  box-sizing: border-box;
}

.app-shell {
  width: 1280px;
  height: 800px;
  margin: 24px auto;
  background: var(--shell);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  position: relative;
}

.app-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/logo.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 62% auto;
  opacity: 0.005;
  pointer-events: none;
  z-index: 5;
}

.stage-side {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  border-radius: 3px;
  background: transparent;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
  opacity: 0.5;
}

.brand-title {
  margin: 0;
  font-size: var(--fs-header);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.library-col {
  width: 400px;
  min-width: 400px;
  max-width: 400px;
  height: 800px;
  min-height: 800px;
  max-height: 800px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--shell);
}

.library-head {
  height: 48px;
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  margin: 0;
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--text);
}

.count-chip {
  font-size: var(--fs-meta);
  color: var(--muted);
}

.library-actions {
  height: 52px;
  min-height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.library-actions .btn-icon {
  flex: 1;
  width: auto;
  min-width: 0;
  max-width: none;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
}

.library-actions .btn-icon svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.track-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 16px 12px 8px;
  position: relative;
  scrollbar-width: none;
}

.track-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.empty-hint {
  margin: 48px 16px 0;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-body);
}

.empty-hint.is-hidden {
  display: none;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  margin: 0 0 4px;
}

.track-item .track-row {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
}

.track-item .btn-icon {
  flex-shrink: 0;
}

.track-pick {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0 0 0 8px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--inset);
  cursor: pointer;
}

.track-pick:checked {
  background: var(--accent);
  border-color: var(--accent-dim);
}

.track-row {
  width: 100%;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  padding: 0 10px;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-body);
  text-align: left;
  cursor: pointer;
}

.track-row:hover {
  background: var(--inset);
}

.track-row.is-active {
  background: var(--inset);
  border-color: var(--accent-dim);
}

.track-num {
  width: 22px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: var(--fs-meta);
}

.track-text {
  flex: 1;
  min-width: 0;
}

.track-name,
.track-sub,
.now-title,
.now-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-name {
  display: block;
  font-size: var(--fs-body);
  color: var(--text);
}

.track-sub {
  display: block;
  font-size: var(--fs-meta);
  color: var(--muted);
}

.track-time {
  width: 40px;
  flex-shrink: 0;
  text-align: right;
  font-size: var(--fs-meta);
  color: var(--muted);
}

.stage-col {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 24px 28px 16px;
  display: flex;
  flex-direction: column;
}

.now-card {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 180px;
}

.artwork {
  width: 180px;
  height: 180px;
  min-width: 180px;
  min-height: 180px;
  border-radius: 8px;
  background: var(--inset);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.artwork-icon {
  display: block;
}

.artwork-icon.is-hidden {
  display: none;
}

.artwork-img {
  width: 180px;
  height: 180px;
  min-width: 180px;
  min-height: 180px;
  object-fit: cover;
  display: block;
  position: absolute;
  left: 0;
  top: 0;
}

.artwork-img.is-hidden {
  display: none;
}

.now-meta {
  min-width: 0;
  flex: 1;
}

.now-title {
  margin: 0 0 8px;
  font-size: var(--fs-title);
  font-weight: 600;
  color: var(--text);
}

.now-artist {
  margin: 0 0 10px;
  font-size: var(--fs-body);
  color: var(--muted);
}

.now-format {
  margin: 0;
  width: 48px;
  height: 22px;
  line-height: 20px;
  text-align: center;
  font-size: var(--fs-meta);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
}

.seek-block {
  margin-top: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-label {
  width: 40px;
  flex-shrink: 0;
  font-size: var(--fs-meta);
  color: var(--muted);
}

.time-label:last-child {
  text-align: right;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--inset);
  border: 0;
  outline: none;
  padding: 0;
  margin: 0;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 6px;
  background: var(--accent);
  border: 0;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 6px;
  background: var(--accent);
  border: 0;
  cursor: pointer;
}

.transport {
  margin-top: 18px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.transport-group {
  display: flex;
  align-items: center;
  height: 48px;
  gap: 10px;
}

.transport .btn-icon svg,
.transport .btn-play svg {
  width: 26px;
  height: 26px;
}

.volume-wrap {
  margin-left: auto;
  width: 180px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.slider-volume {
  width: 140px;
  flex: 1;
}

.lyrics-panel {
  margin-top: 24px;
  flex: 1;
  min-height: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.lyrics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  min-height: 40px;
  gap: 10px;
}

.lyrics-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.lyrics-head-left .btn-icon {
  flex-shrink: 0;
}

.lyrics-match {
  font-size: var(--fs-meta);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.lyrics-sync {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lyrics-offset {
  width: 48px;
  text-align: center;
  font-size: var(--fs-meta);
  color: var(--muted);
}

.lyrics-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  margin-top: 8px;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.lyrics-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.lyrics-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  text-align: center;
}

.lyrics-line {
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  text-align: center;
  width: 100%;
}

.lyrics-line-prev {
  font-size: var(--fs-body);
  color: var(--muted);
  white-space: nowrap;
}

.lyrics-line-current {
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
  white-space: normal;
  line-height: 1.25;
  margin: 12px 0;
}

.lyrics-line-next {
  font-size: var(--fs-header);
  color: var(--muted);
  white-space: normal;
}

.lyrics-empty {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-body);
  text-align: center;
  width: 100%;
}

.log-bar {
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.log-viewer {
  margin: 0;
  height: 72px;
  padding: 8px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: Consolas, "Segoe UI", monospace;
  font-size: var(--fs-meta);
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: none;
}

.log-viewer::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: var(--fs-body);
  line-height: 34px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent-dim);
  color: #161920;
}

.btn-primary:hover {
  background: var(--accent);
}

.btn-secondary {
  background: var(--inset);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--inset);
}

.btn-icon,
.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--inset);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 6px;
}

.btn-icon.is-on {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.btn-play {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 6px;
  background: var(--accent);
  border-color: var(--accent-dim);
  color: #161920;
  overflow: hidden;
}

.btn-icon svg,
.btn-play svg {
  display: block;
}

.btn-icon svg.is-hidden,
.btn-play svg.is-hidden,
.is-hidden {
  display: none;
}

.btn:focus-visible,
.btn-icon:focus-visible,
.btn-play:focus-visible,
.slider:focus-visible,
.track-row:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.add-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e1014b8;
}

.add-overlay.is-hidden {
  display: none;
}

.add-card {
  min-width: 240px;
  max-width: 360px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  animation: add-pop 160ms ease-out;
}

.add-copy {
  margin: 0;
  color: var(--text);
  font-size: var(--fs-title);
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes add-pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
