:root {
  --ink: #171411;
  --ink-soft: #2b241d;
  --paper: #f7f1e8;
  --paper-2: #fffaf2;
  --paper-3: #eee2d1;
  --studio: #181512;
  --studio-2: #211d18;
  --studio-3: #2a241e;
  --line: rgba(23, 20, 17, 0.12);
  --line-soft: rgba(23, 20, 17, 0.07);
  --studio-line: rgba(255, 248, 236, 0.12);
  --muted: #756a5b;
  --muted-2: #978977;
  --accent: #d9572b;
  --accent-deep: #a93a21;
  --green: #3f6b55;
  --gold: #c69a5a;
  --gold-soft: rgba(198, 154, 90, 0.14);
  --white: #fffdf8;
  --shadow: 0 18px 42px rgba(35, 27, 18, 0.11);
  --shadow-soft: 0 8px 18px rgba(35, 27, 18, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 20, 17, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(23, 20, 17, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(217, 87, 43, 0.055), transparent 30%, rgba(63, 107, 85, 0.045)),
    var(--paper);
  background-size: 30px 30px, 30px 30px, auto, auto;
  font-family: "Noto Serif SC", "Songti SC", "PingFang SC", serif;
  line-height: 1.5;
  overflow-x: hidden;
}
.app-main {
  width: min(1760px, 100%);
  margin: 0 auto;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: 0; }
h1 { margin-bottom: 0; font-size: clamp(26px, 2.55vw, 38px); line-height: 1.06; }
h2 { margin-bottom: 0; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.12; }

main, .app-main, .tool-shell, .composer-panel, .result-workspace, .parameter-panel, .advanced-panel, .task-list-panel, .lyrics-panel { min-width: 0; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 66px;
  padding: 10px clamp(14px, 2.8vw, 32px);
  color: var(--paper-2);
  background:
    linear-gradient(90deg, rgba(217, 87, 43, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255, 248, 236, 0.055), transparent 58%),
    rgba(24, 21, 18, 0.96);
  border-bottom: 1px solid rgba(255, 248, 236, 0.12);
  box-shadow: 0 12px 28px rgba(16, 12, 9, 0.18);
  backdrop-filter: blur(18px);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: 5px 13px 5px 5px;
  border: 1px solid rgba(255, 248, 236, 0.12);
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 248, 236, 0.08);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.brand:hover {
  border-color: rgba(198, 154, 90, 0.42);
  background: rgba(255, 248, 236, 0.07);
  transform: translateY(-1px);
}
.brand-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: var(--studio);
  background:
    radial-gradient(circle at 50% 50%, var(--paper-2) 0 23%, transparent 24%),
    radial-gradient(circle at 50% 50%, transparent 0 39%, rgba(255, 248, 236, 0.28) 40% 42%, transparent 43%),
    radial-gradient(circle at 50% 50%, transparent 0 58%, rgba(255, 248, 236, 0.16) 59% 61%, transparent 62%),
    linear-gradient(145deg, var(--accent), #b64225 54%, #6f2f22);
  border: 1px solid rgba(255, 248, 236, 0.26);
  border-radius: 50%;
  box-shadow:
    inset 0 8px 12px rgba(255, 248, 236, 0.16),
    inset 0 -12px 18px rgba(86, 24, 15, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.brand-mark::before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 10px;
  height: 8px;
  border-radius: 999px 999px 7px 7px;
  background: var(--green);
  transform: rotate(-8deg);
  z-index: 2;
  box-shadow: 0 -1px 0 rgba(255, 248, 236, 0.22);
}
.brand-glyph {
  position: relative;
  z-index: 3;
  margin-top: -2px;
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 248, 236, 0.4);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 248, 236, 0.2);
  border-radius: 999px;
  z-index: 1;
}
.brand-lines {
  position: absolute;
  right: 5px;
  bottom: 7px;
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 12px;
  z-index: 4;
  transform: rotate(-8deg);
}
.brand-lines i {
  display: block;
  width: 2px;
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.76);
}
.brand-lines i:nth-child(1) { height: 6px; }
.brand-lines i:nth-child(2) { height: 12px; }
.brand-lines i:nth-child(3) { height: 8px; }
.brand-copy {
  display: block;
  padding-right: 1px;
}
.brand strong, .brand em { display: block; }
.brand strong {
  color: var(--paper-2);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: 0;
  white-space: nowrap;
}
.brand em, .section-kicker, .panel-label, .parameter-label, .model-chip, .preset-button, .feel-button, .option-button, .task-status, .task-row span, .task-actions, .account-bar, .package-card small {
  font-family: "DIN Alternate", "Courier New", monospace;
  letter-spacing: 0.03em;
}
.brand em {
  margin-top: 3px;
  color: rgba(255, 248, 236, 0.66);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0;
}

.account-bar {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
#creditBadge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 148px;
  padding: 0 12px;
  overflow: hidden;
  color: rgba(255, 248, 236, 0.88);
  border: 1px solid rgba(255, 248, 236, 0.11);
  background: rgba(255, 248, 236, 0.055);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-bar button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 248, 236, 0.14);
  border-radius: 8px;
  color: var(--paper-2);
  background: rgba(255, 248, 236, 0.045);
  font-size: 12px;
  font-weight: 900;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.account-bar button:hover {
  border-color: rgba(255, 248, 236, 0.28);
  background: rgba(255, 248, 236, 0.08);
  transform: translateY(-1px);
}
#buyButton {
  color: #21160f;
  border-color: rgba(198, 154, 90, 0.75);
  background: linear-gradient(180deg, #e0b66f, var(--gold));
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(410px, 0.84fr) minmax(0, 1.16fr);
  gap: 12px;
  align-items: start;
  min-height: calc(100vh - 60px);
  padding: 14px;
}

.composer-panel, .result-workspace {
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  box-shadow: var(--shadow-soft);
}
.composer-panel {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 88px);
  padding: 13px;
  background: rgba(255, 250, 242, 0.9);
  overflow: auto;
  scrollbar-color: rgba(117, 106, 91, 0.28) transparent;
  scrollbar-width: thin;
}
.composer-panel::-webkit-scrollbar { width: 6px; }
.composer-panel::-webkit-scrollbar-track { background: transparent; }
.composer-panel::-webkit-scrollbar-thumb {
  background: rgba(117, 106, 91, 0.22);
  border-radius: 999px;
}
.composer-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(217, 87, 43, 0.08), transparent 34%);
}
.composer-panel > * { position: relative; z-index: 1; }

.composer-head, .result-head, .lyrics-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.composer-head { margin-bottom: 10px; }
.head-note {
  max-width: 520px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.section-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.panel-label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}
.model-chip {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: var(--paper-2);
  background: var(--studio);
  border: 1px solid rgba(23, 20, 17, 0.9);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.generator-form { display: grid; gap: 8px; }
.generator-form label, .generator-form label span { display: block; }
.generator-form label span {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}
.generator-form input, .generator-form textarea {
  width: 100%;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  outline: none;
}
.generator-form input {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}
.generator-form textarea {
  min-height: 128px;
  padding: 11px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.62;
}
.generator-form input:focus, .generator-form textarea:focus {
  border-color: rgba(217, 87, 43, 0.72);
  box-shadow: 0 0 0 3px rgba(217, 87, 43, 0.12);
}
.generator-form input::placeholder, .generator-form textarea::placeholder { color: #a59682; }

.copy-field {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.72);
}
.copy-field::before {
  content: "";
  position: absolute;
  top: 28px;
  bottom: 38px;
  left: 18px;
  width: 1px;
  background: linear-gradient(180deg, rgba(217, 87, 43, 0.42), rgba(198, 154, 90, 0.12));
}
.copy-step {
  position: relative;
  padding-left: 22px;
}
.copy-step::before {
  content: attr(data-step);
  position: absolute;
  top: 1px;
  left: -1px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--paper-2);
  background: var(--studio);
  border: 1px solid rgba(23, 20, 17, 0.16);
  border-radius: 999px;
  font-family: "DIN Alternate", "Courier New", monospace;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
}
.copy-field small {
  display: block;
  padding-left: 22px;
  color: var(--muted);
  font-size: 12px;
}
.copy-field b { color: var(--accent); }

.parameter-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(23, 20, 17, 0.09);
  border-radius: 12px;
  background: rgba(238, 226, 209, 0.48);
}
.panel-row-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(23, 20, 17, 0.07);
}
.panel-row-head small {
  color: var(--muted);
  font-size: 12px;
}
.option-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}
.parameter-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.preset-grid, .feel-grid, .option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.scene-control {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.custom-scene-field {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(420px, 100%);
  min-height: 30px;
  padding: 3px 4px 3px 10px;
  border: 1px solid rgba(217, 87, 43, 0.22);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: inset 0 -1px 0 rgba(23, 20, 17, 0.04);
}
.custom-scene-field[hidden] { display: none; }
.custom-scene-field span {
  flex: 0 0 auto;
  margin: 0;
  color: var(--accent-deep);
  font-family: "DIN Alternate", "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}
.custom-scene-field input {
  min-height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  box-shadow: none;
}
.custom-scene-field input:focus {
  border-color: transparent;
  box-shadow: none;
}
.preset-button, .feel-button, .option-button {
  position: relative;
  min-height: 26px;
  max-width: 100%;
  padding: 0 9px;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid rgba(23, 20, 17, 0.1);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.88);
  font-size: 11px;
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(23, 20, 17, 0.05);
}
.preset-button:hover, .feel-button:hover, .option-button:hover {
  border-color: rgba(217, 87, 43, 0.42);
  color: var(--accent-deep);
  background: rgba(217, 87, 43, 0.055);
}
.preset-button.is-active, .feel-button.is-active, .option-button.is-active {
  border-color: rgba(217, 87, 43, 0.78);
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.14), transparent 46%),
    var(--accent);
  color: var(--paper-2);
  box-shadow: inset 0 -8px 14px rgba(103, 30, 15, 0.14);
}
.advanced-panel {
  border-top: 1px solid rgba(23, 20, 17, 0.07);
  padding-top: 8px;
}
.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.advanced-prompt { grid-column: 1 / -1; }
.advanced-prompt {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}
.advanced-prompt span {
  margin: 0;
  color: var(--muted);
  font-family: "DIN Alternate", "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.submit-row {
  position: sticky;
  bottom: -13px;
  display: grid;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 -13px -13px;
  padding: 10px 13px 13px;
  border-top: 1px solid rgba(23, 20, 17, 0.08);
  background: rgba(255, 250, 242, 0.94);
  backdrop-filter: blur(10px);
}
.submit-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--paper-2);
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(217, 87, 43, 0.22);
  font-size: 13px;
  font-weight: 900;
}
.submit-row button:hover { background: var(--accent-deep); }
.submit-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.submit-row button:disabled, .result-actions button:disabled, .lyrics-titlebar button:disabled, .result-actions a[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}
.form-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.generation-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.generation-steps li {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  color: rgba(117, 106, 91, 0.78);
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.56);
  font-family: "DIN Alternate", "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
}
.generation-steps li.is-active {
  color: var(--paper-2);
  border-color: rgba(217, 87, 43, 0.55);
  background: var(--accent);
}
.generation-steps li.is-done {
  color: var(--paper-2);
  border-color: rgba(63, 107, 85, 0.38);
  background: var(--green);
}

.result-workspace {
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: calc(100vh - 88px);
  padding: 13px;
  color: var(--paper-2);
  background:
    linear-gradient(135deg, rgba(198, 154, 90, 0.08), transparent 34%),
    linear-gradient(180deg, var(--studio-2) 0%, var(--studio) 100%);
  border-color: rgba(255, 248, 236, 0.08);
  box-shadow: 0 22px 60px rgba(23, 20, 17, 0.18);
}
.result-head {
  margin-bottom: 0;
  align-items: flex-end;
}
.result-head h2 { color: var(--paper-2); }
.result-head .section-kicker { color: var(--gold); }
#statusPill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  color: var(--paper-2);
  background: var(--green);
  border: 1px solid rgba(255, 248, 236, 0.1);
  border-radius: 999px;
  font-family: "DIN Alternate", "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(280px, 0.98fr);
  gap: 10px;
  min-height: 0;
  flex: 1;
}
.task-list-panel, .lyrics-panel {
  min-width: 0;
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  background: rgba(255, 248, 236, 0.035);
}
.task-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.list-head {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 94px 70px;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-bottom: 1px solid var(--studio-line);
  color: rgba(255, 248, 236, 0.55);
  font-family: "DIN Alternate", "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
}
.task-list {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 9px;
  overflow: auto;
}
.task-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 94px 70px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  color: var(--paper-2);
  border: 1px solid rgba(255, 248, 236, 0.08);
  border-radius: 10px;
  background: rgba(255, 248, 236, 0.035);
  font-size: 12px;
}
.task-row:hover { border-color: rgba(198, 154, 90, 0.36); background: rgba(198, 154, 90, 0.08); }
.task-row:focus-visible {
  outline: 2px solid rgba(198, 154, 90, 0.72);
  outline-offset: 2px;
}
.task-row.is-selected {
  border-color: rgba(217, 87, 43, 0.72);
  background:
    linear-gradient(90deg, rgba(217, 87, 43, 0.18), rgba(217, 87, 43, 0.07)),
    rgba(255, 248, 236, 0.035);
  box-shadow: inset 3px 0 0 var(--accent);
}
.task-row.is-processing {
  border-color: rgba(198, 154, 90, 0.34);
  background:
    linear-gradient(90deg, rgba(198, 154, 90, 0.14), rgba(255, 248, 236, 0.035)),
    rgba(255, 248, 236, 0.035);
}
.task-row.is-processing .task-actions {
  color: #ffe1ae;
}
.task-row.is-processing .task-status {
  position: relative;
  padding-left: 18px;
}
.task-row.is-processing .task-status::before {
  content: "";
  position: absolute;
  left: 7px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(198, 154, 90, 0.14);
}
.task-row strong, .task-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-status {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(255, 248, 236, 0.12);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}
.task-status.succeeded { background: rgba(63, 107, 85, 0.62); }
.task-status.failed { background: rgba(217, 87, 43, 0.2); }
.task-status.generating_music, .task-status.generating_lyrics, .task-status.queued, .task-status.saving_audio, .task-status.failed_retryable {
  color: #ffe1ae;
  border-color: rgba(198, 154, 90, 0.3);
  background: rgba(198, 154, 90, 0.14);
}
.task-actions {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
}
.task-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  color: #ffe1ae;
  border: 1px solid rgba(198, 154, 90, 0.42);
  border-radius: 999px;
  background: rgba(198, 154, 90, 0.1);
  font-size: 10px;
  font-weight: 900;
}
.task-download:hover { border-color: rgba(198, 154, 90, 0.78); }

.lyrics-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 9px;
  padding: 13px 12px 12px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.05), rgba(255, 248, 236, 0.022)),
    rgba(255, 248, 236, 0.035);
}
.lyrics-panel::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--green));
  pointer-events: none;
}
.lyrics-titlebar { position: relative; align-items: flex-start; }
.lyrics-titlebar > div {
  min-width: 0;
  padding-right: 58px;
}
.lyrics-titlebar strong {
  display: block;
  max-width: 100%;
  color: var(--paper-2);
  font-size: 17px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lyrics-titlebar p {
  margin: 5px 0 0;
  color: rgba(255, 248, 236, 0.64);
  font-size: 12px;
}
.lyrics-titlebar button {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: 28px;
  min-width: 68px;
  padding: 0 9px;
  color: var(--paper-2);
  border: 1px solid var(--studio-line);
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.045);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.record-stamp {
  position: absolute;
  top: 18px;
  right: 13px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(198, 154, 90, 0.24);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(198, 154, 90, 0.14), transparent 52%),
    rgba(24, 21, 18, 0.36);
  opacity: 0.68;
  pointer-events: none;
}
.record-stamp span {
  display: block;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(255, 248, 236, 0.2);
  border-radius: 999px;
  box-shadow: 0 0 0 7px rgba(255, 248, 236, 0.035), 0 0 0 14px rgba(217, 87, 43, 0.035);
}
.lyrics-panel audio {
  display: none;
  width: 100%;
  height: 36px;
}
.lyrics-panel audio.is-visible { display: block; }
.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.result-actions button, .result-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  color: var(--paper-2);
  border: 1px solid var(--studio-line);
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.045);
  font-size: 11px;
  font-weight: 900;
}
.result-actions a:not([aria-disabled="true"]) {
  color: #ffe1ae;
  border-color: rgba(198, 154, 90, 0.42);
  background: var(--gold-soft);
}
#lyricsOutput {
  position: relative;
  margin: 0;
  min-height: 220px;
  padding: 13px;
  overflow: auto;
  color: rgba(255, 248, 236, 0.9);
  border: 1px solid rgba(255, 248, 236, 0.09);
  border-radius: 12px;
  background:
    linear-gradient(rgba(255, 248, 236, 0.035) 1px, transparent 1px),
    rgba(24, 21, 18, 0.56);
  background-size: 100% 28px, auto;
  font: inherit;
  font-size: 13px;
  line-height: 1.74;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-history {
  position: relative;
  grid-column: 1 / -1;
  min-height: 72px;
  margin: 0;
  padding: 14px 14px 14px 46px;
  display: grid;
  place-items: center start;
  color: rgba(255, 248, 236, 0.65);
  border: 1px dashed rgba(255, 248, 236, 0.12);
  border-radius: 12px;
  background: rgba(255, 248, 236, 0.025);
  font-size: 12px;
}
.empty-history::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 1px solid rgba(198, 154, 90, 0.42);
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(198, 154, 90, 0.055);
}

.pay-modal, .login-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(24, 21, 18, 0.6);
  backdrop-filter: blur(8px);
}
.pay-modal.is-open, .login-modal.is-open { display: grid; }
.pay-card, .login-card {
  position: relative;
  width: min(600px, 100%);
  padding: 18px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}
.login-card {
  width: min(520px, 100%);
  background:
    linear-gradient(180deg, rgba(7, 193, 96, 0.08), transparent 34%),
    var(--paper-2);
}
.pay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 18px;
  line-height: 1;
}
.pay-head h2 { margin: 0 38px 6px 0; color: var(--ink); }
.pay-head p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.wechat-kicker {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #07c160;
}
.wechat-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #07c160;
  box-shadow: 0 0 0 4px rgba(7, 193, 96, 0.13);
}
.package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 15px;
}
.package-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  text-align: left;
}
.package-card small {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 2px 6px;
  color: var(--paper-2);
  background: var(--green);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}
.package-card.is-active {
  border-color: rgba(217, 87, 43, 0.82);
  box-shadow: 0 0 0 3px rgba(217, 87, 43, 0.1);
}
.package-card strong { padding-right: 34px; font-size: 15px; }
.package-card span { color: var(--muted); font-size: 12px; }
.package-card em {
  align-self: end;
  color: var(--accent);
  font-family: "DIN Alternate", "Courier New", monospace;
  font-size: 22px;
  font-style: normal;
  font-weight: 900;
}
.pay-actions {
  display: block;
  margin-top: 13px;
}
#payStatus { color: var(--muted); font-size: 12px; }
.qr-box {
  display: grid;
  justify-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 13px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  background: rgba(23, 20, 17, 0.025);
}
.qr-box img { width: 180px; height: 180px; }
.qr-box p { margin: 0; color: var(--muted); font-size: 12px; }
.wechat-login-box {
  display: grid;
  place-items: center;
  min-height: 430px;
  margin-top: 12px;
  border: 1px solid rgba(7, 193, 96, 0.18);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(7, 193, 96, 0.06), transparent 42%),
    rgba(23, 20, 17, 0.025);
  overflow: hidden;
}
.wechat-login-box iframe {
  width: 410px;
  height: 410px;
  border: 0;
}
.wechat-login-brand {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 10px 12px;
  color: #076f3d;
  border: 1px solid rgba(7, 193, 96, 0.14);
  border-radius: 12px;
  background: rgba(7, 193, 96, 0.07);
}
.wechat-login-brand span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
}
.wechat-login-brand span::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 14px;
  border-radius: 9px 9px 9px 3px;
  background: #07c160;
  box-shadow: 12px 5px 0 -4px rgba(7, 193, 96, 0.46);
}
.wechat-login-brand small {
  color: rgba(7, 111, 61, 0.72);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .tool-shell { grid-template-columns: 1fr; }
  .composer-panel { position: relative; top: auto; max-height: none; overflow: hidden; }
  .result-workspace { position: static; min-height: auto; }
  .result-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .app-header { grid-template-columns: minmax(0, 1fr); }
  .account-bar { grid-column: 1 / -1; justify-content: end; }
}

@media (max-width: 660px) {
  body { background-size: 24px 24px, 24px 24px, auto, auto; }
  .app-header { min-height: 54px; padding: 8px 12px; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand em { display: none; }
  .account-bar { justify-content: stretch; }
  #creditBadge, .account-bar button { flex: 1 1 auto; justify-content: center; }
  .tool-shell { padding: 8px; gap: 8px; }
  .composer-panel, .result-workspace { border-radius: 14px; box-shadow: none; }
  .composer-head, .result-head, .lyrics-titlebar { flex-direction: column; align-items: flex-start; }
  h1 { font-size: clamp(23px, 8vw, 30px); }
  .option-row, .advanced-grid, .advanced-prompt, .submit-row, .result-actions, .package-grid { grid-template-columns: 1fr; }
  .parameter-label { min-height: auto; }
  .custom-scene-field { width: 100%; border-radius: 10px; }
  .preset-grid, .feel-grid, .option-grid { gap: 5px; }
  .list-head, .task-row {
    grid-template-columns: 58px minmax(0, 1fr) 54px;
    gap: 6px;
  }
  .list-head span:nth-child(3), .task-row span:nth-child(3) { display: none; }
  .package-card { min-height: 94px; }
  .wechat-login-box { min-height: 360px; }
  .wechat-login-box iframe { width: 340px; height: 360px; }
}
