:root {
  color-scheme: light;
  --ink: #25211d;
  --muted: #71685f;
  --line: #ded7cd;
  --paper: #fffaf2;
  --panel: rgba(255, 255, 255, 0.78);
  --rose: #c95169;
  --rose-dark: #9d3148;
  --mint: #307c72;
  --sun: #f3b84b;
  --shadow: 0 20px 60px rgba(64, 42, 34, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 10%, rgba(243, 184, 75, 0.28), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(48, 124, 114, 0.16), transparent 32%),
    linear-gradient(120deg, #fff0dc, #fffaf2 46%, #f7efe5);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.intro {
  min-height: 8vh;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0 12px;
}

.profile-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(157, 49, 72, 0.18);
  border-radius: 999px;
  padding: 5px 13px 5px 5px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.profile-button img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-panel {
  width: min(420px, 100%);
  margin: 0 0 18px;
  padding: 16px;
}

.profile-panel[hidden] {
  display: none;
}

.profile-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.profile-option {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.profile-option.active {
  border-color: rgba(201, 81, 105, 0.32);
  background: rgba(201, 81, 105, 0.12);
  color: var(--rose-dark);
}

.avatar-cropper {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 14px 0 16px;
}

.avatar-cropper[hidden] {
  display: none;
}

.avatar-crop-frame {
  position: relative;
  width: min(220px, 70vw);
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid rgba(201, 81, 105, 0.34);
  border-radius: 50%;
  background: #fff8ef;
  cursor: grab;
  touch-action: none;
}

.avatar-crop-frame:active {
  cursor: grabbing;
}

.avatar-crop-frame img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  user-select: none;
  pointer-events: none;
}

.avatar-crop-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.range-field {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  align-items: center;
  width: min(320px, 100%);
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.range-field input {
  width: 100%;
  accent-color: var(--rose);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rose-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 12px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(2.45rem, 6vw, 5.3rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.subtitle {
  max-width: 560px;
  margin-bottom: 0;
  color: #4f4740;
  font-size: 1.05rem;
  line-height: 1.7;
}

.intro-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.install-button {
  min-height: 40px;
  border: 1px solid rgba(157, 49, 72, 0.22);
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--rose-dark);
  font-weight: 900;
  cursor: pointer;
}

.install-button[hidden] {
  display: none;
}

.update-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(157, 49, 72, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--rose-dark);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.update-button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.install-tip {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px auto;
  border: 1px solid rgba(201, 81, 105, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 250, 242, 0.92);
  color: var(--muted);
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(64, 42, 34, 0.1);
}

.install-tip[hidden] {
  display: none;
}

.install-tip span {
  flex: 1;
}

.workspace {
  display: block;
}

.workspace[hidden] {
  display: none;
}

.panel,
.main-panel {
  border: 1px solid rgba(68, 49, 39, 0.12);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.upload-page {
  width: min(520px, 100%);
  margin: 18px auto 0;
  padding: 18px;
}

.upload-page[hidden] {
  display: none;
}

.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  font-weight: 800;
}

.library-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.playlist-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdf8;
  color: var(--ink);
  outline: none;
}

.field input:focus,
.playlist-form input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(201, 81, 105, 0.14);
}

.upload-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.dropzone {
  min-height: 138px;
  border: 1.5px dashed rgba(201, 81, 105, 0.48);
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 18px;
  background: rgba(255, 250, 242, 0.8);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.dropzone strong {
  color: var(--ink);
}

.dropzone input {
  display: none;
}

.selected-files {
  display: grid;
  gap: 8px;
}

.selected-files:empty {
  display: none;
}

.file-chip {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 253, 248, 0.86);
}

.file-chip-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  font-weight: 800;
}

.file-size,
.file-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee5da;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
  transition: width 180ms ease;
}

.file-chip.is-error .progress-bar {
  background: var(--rose);
}

.file-chip.is-done .progress-bar {
  background: var(--mint);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--rose);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.secondary-button {
  background: var(--mint);
}

.secondary-button.compact {
  min-height: 38px;
  padding: 0 14px;
}

.danger-button {
  width: 100%;
  margin-top: 14px;
  background: rgba(157, 49, 72, 0.1);
  color: var(--rose-dark);
  border: 1px solid rgba(157, 49, 72, 0.24);
}

.mode-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.main-panel {
  min-width: 0;
  padding: 18px;
}

.now-playing {
  min-height: 176px;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(37, 33, 29, 0.92), rgba(86, 49, 60, 0.88));
  color: #fffaf2;
}

.record {
  width: 126px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, #1b1715 0 6px, #292421 7px 8px),
    #1b1715;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.05), 0 20px 40px rgba(0, 0, 0, 0.22);
}

.record-core {
  width: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sun);
}

.is-playing .record {
  animation: spin 4.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.track-copy {
  min-width: 0;
}

.track-copy h2 {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 4vw, 2.3rem);
  line-height: 1.12;
}

.track-copy p:last-child {
  margin-bottom: 0;
  color: rgba(255, 250, 242, 0.74);
}

audio {
  width: 100%;
  margin-bottom: 14px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0 16px;
}

.tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tab.active {
  border-color: rgba(201, 81, 105, 0.32);
  background: rgba(201, 81, 105, 0.12);
  color: var(--rose-dark);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.song-list,
.playlist-grid {
  display: grid;
  gap: 10px;
}

.song-row,
.playlist-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
}

.song-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.song-title {
  margin-bottom: 5px;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.song-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}

.ghost-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fffdf8;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.ghost-button.danger {
  border-color: rgba(157, 49, 72, 0.24);
  color: var(--rose-dark);
}

.playlist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.playlist-card {
  padding: 14px;
}

.playlist-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.playlist-card summary::-webkit-details-marker {
  display: none;
}

.playlist-card summary::after {
  content: "展开";
  flex: 0 0 auto;
  color: var(--mint);
  font-size: 0.86rem;
}

.playlist-card[open] summary {
  margin-bottom: 10px;
}

.playlist-card[open] summary::after {
  content: "收起";
}

.playlist-count {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  margin-left: auto;
}

.playlist-card ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.58);
  text-align: center;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 520px);
    padding-top: 14px;
  }

  .intro {
    min-height: 8vh;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .intro-actions {
    width: auto;
    align-self: flex-end;
    justify-content: flex-end;
  }

  .workspace,
  .now-playing {
    grid-template-columns: 1fr;
  }

  .record {
    width: 106px;
  }

  .song-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-content: start;
  }
}
