:root {
  color-scheme: dark;
  --bg: #101319;
  --panel: #f6f8fb;
  --panel-2: #e9eef5;
  --panel-3: #ffffff;
  --ink-panel: #151a22;
  --line: #d9e0ea;
  --line-soft: #cfd8e6;
  --text: #f7f8fb;
  --dark-text: #161b24;
  --muted: #687386;
  --dim: #8a95a8;
  --gold: #ffb545;
  --gold-2: #ffd37c;
  --green: #18b889;
  --red: #e85072;
  --blue: #1677ff;
  --cyan: #16b8c7;
  --violet: #6554e8;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  width: 100vw;
  height: 100vh;
  min-width: 1120px;
  min-height: 720px;
  display: grid;
  grid-template-rows: 68px 1fr;
  background:
    radial-gradient(circle at 12% 10%, rgba(22, 184, 199, 0.22), transparent 26%),
    radial-gradient(circle at 90% 4%, rgba(255, 181, 69, 0.18), transparent 22%),
    linear-gradient(180deg, #f4f7fb 0, #e9eef7 48%, #dde5ef 100%);
}

.topbar {
  display: grid;
  grid-template-columns: 260px minmax(360px, 1fr) 300px;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(207, 216, 230, 0.8);
  background: rgba(249, 251, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-app-region: drag;
}

.brand,
.tabs,
.top-actions {
  -webkit-app-region: no-drag;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: conic-gradient(from 210deg, #111827, #1677ff, #16b8c7, #111827);
  border: 1px solid rgba(22, 119, 255, 0.22);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 17px;
  font-weight: 850;
  color: var(--dark-text);
}

.brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  justify-self: center;
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(207, 216, 230, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.tab {
  min-width: 92px;
  height: 36px;
  border-radius: 6px;
  background: transparent;
  color: #526074;
  font-weight: 750;
}

.tab.is-active {
  background: #121722;
  color: white;
}

.tab b {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--cyan);
  color: white;
  font-size: 11px;
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(207, 216, 230, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: #536174;
  font-size: 18px;
}

.suno-btn,
.primary,
.cta {
  min-height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #151b25, var(--blue));
  color: white;
  font-weight: 850;
  box-shadow: 0 12px 28px rgba(52, 168, 255, 0.18);
}

.suno-btn {
  padding: 0 20px;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 310px minmax(520px, 1fr) 330px;
  gap: 18px;
  padding: 18px;
}

.upload-panel,
.status-panel,
.lyrics-panel {
  min-height: 0;
  border: 1px solid rgba(207, 216, 230, 0.95);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--dark-text);
  box-shadow: 0 22px 60px rgba(48, 64, 90, 0.16);
  backdrop-filter: blur(18px);
}

.upload-panel,
.lyrics-panel {
  overflow: auto;
  padding: 18px;
}

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

h2 {
  font-size: 18px;
  font-weight: 850;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title span {
  width: 32px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #121722;
  color: #b7f8ff;
  font-size: 12px;
  font-weight: 900;
}

.section-title.compact span {
  background: rgba(22, 184, 199, 0.14);
  color: #6ee7f0;
}

.account-card {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-3);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dim);
  box-shadow: 0 0 0 4px rgba(100, 109, 125, 0.12);
}

.status-dot.is-on {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(55, 211, 153, 0.14), 0 0 18px rgba(55, 211, 153, 0.32);
}

.primary,
.secondary,
.wide,
.danger,
.success,
.copy {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  font-weight: 800;
}

.bookmarklet-link {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
  border: 1px dashed rgba(22, 119, 255, 0.45);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff, #eaf3ff);
  color: #0d4eb8;
  font-weight: 900;
  text-decoration: none;
  user-select: none;
}

.bookmarklet-link::before {
  content: "拖到书签栏：";
  margin-right: 4px;
  color: #6b7890;
  font-size: 12px;
  font-weight: 750;
}

.secondary,
.wide {
  border: 1px solid var(--line);
  background: #f9fbff;
  color: var(--dark-text);
}

.danger {
  margin-top: 10px;
  border: 1px solid rgba(255, 91, 123, 0.3);
  background: rgba(255, 91, 123, 0.12);
  color: #ffc3cf;
}

.danger:disabled,
.cta:disabled,
.wide:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hint,
.field small,
.mini-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.hint {
  margin: 9px 0 12px;
}

.file-card {
  position: relative;
  min-height: 126px;
  display: grid;
  place-items: center;
  gap: 6px;
  margin: 18px 0 10px;
  padding: 18px;
  border: 1px dashed #b8c4d6;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(22, 184, 199, 0.1), transparent 62%),
    #f8fbff;
  text-align: center;
}

.file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #111827, #253041);
  color: var(--gold-2);
  font-size: 24px;
}

.file-card strong {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card span {
  color: var(--muted);
  font-size: 12px;
}

.signal-strip {
  width: 100%;
  height: 26px;
  display: block;
  margin-top: 4px;
  border-radius: 6px;
  background:
    linear-gradient(90deg,
      transparent 0 4%, rgba(22, 184, 199, 0.3) 4% 7%, transparent 7% 12%,
      rgba(255, 181, 69, 0.34) 12% 15%, transparent 15% 22%,
      rgba(22, 119, 255, 0.26) 22% 26%, transparent 26% 34%,
      rgba(24, 184, 137, 0.34) 34% 38%, transparent 38% 47%,
      rgba(22, 184, 199, 0.24) 47% 52%, transparent 52% 65%,
      rgba(255, 181, 69, 0.34) 65% 70%, transparent 70% 76%,
      rgba(22, 119, 255, 0.3) 76% 81%, transparent 81% 100%),
    #edf3fa;
}

.remove-file {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #ffe5ee;
  color: #d73662;
  font-size: 18px;
  line-height: 1;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span,
.check-row span {
  color: #dce3ee;
  font-size: 13px;
  font-weight: 780;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-3);
}

.segment {
  height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 820;
}

.segment.is-active {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1c1720;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--dark-text);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 116px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0 14px;
}

.check-row input {
  width: 17px;
  height: 17px;
}

.status-panel {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(180px, 1fr);
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(16, 19, 25, 0.97), rgba(24, 30, 42, 0.94)),
    #111827;
  color: var(--text);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(55, 211, 153, 0.22);
  border-radius: 999px;
  background: rgba(55, 211, 153, 0.1);
  color: #9ff1d1;
  font-size: 12px;
  font-weight: 850;
}

.hero-status {
  padding: 34px 0 24px;
}

.hero-status h1 {
  font-size: 38px;
  font-weight: 920;
}

.audio-lane {
  height: 64px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 7px;
  margin-top: 24px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.audio-lane i {
  display: block;
  min-height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  opacity: 0.88;
}

.audio-lane i:nth-child(1) { height: 28%; }
.audio-lane i:nth-child(2) { height: 62%; }
.audio-lane i:nth-child(3) { height: 42%; }
.audio-lane i:nth-child(4) { height: 78%; }
.audio-lane i:nth-child(5) { height: 54%; }
.audio-lane i:nth-child(6) { height: 36%; }
.audio-lane i:nth-child(7) { height: 88%; }
.audio-lane i:nth-child(8) { height: 48%; }
.audio-lane i:nth-child(9) { height: 70%; }
.audio-lane i:nth-child(10) { height: 32%; }
.audio-lane i:nth-child(11) { height: 58%; }
.audio-lane i:nth-child(12) { height: 44%; }

.hero-status p {
  margin-top: 10px;
  color: var(--muted);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.progress-row strong {
  color: var(--text);
}

.progress {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #262c38;
}

.progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  transition: width 180ms ease;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.steps li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
}

.steps b {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #232935;
  color: var(--dim);
}

.steps span {
  font-size: 12px;
  line-height: 1.2;
}

.steps li.is-current,
.steps li.is-done {
  color: var(--text);
}

.steps li.is-current b {
  background: var(--gold);
  color: #14100a;
}

.steps li.is-done b {
  background: var(--green);
  color: #06120d;
}

.task-table {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.7fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.task-table div {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.task-table div:last-child {
  border-right: 0;
}

.task-table span {
  color: var(--dim);
  font-size: 12px;
}

.task-table strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.log-wrap {
  min-height: 0;
  margin-top: 16px;
  overflow: hidden;
}

.log-wrap summary {
  margin-bottom: 8px;
  color: #dce3ee;
  cursor: pointer;
  font-weight: 780;
}

#logBox {
  height: calc(100% - 28px);
  min-height: 150px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070a10;
  color: #dce6f6;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
}

.row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.success {
  background: rgba(55, 211, 153, 0.16);
  color: #a8f5d8;
}

.copy {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #18100a;
}

.mini-card {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.mini-card h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.mini-card .wide {
  margin-top: 12px;
}
