:root {
  color-scheme: dark;
  --bg: #08090c;
  --panel: #111318;
  --panel-2: #171a20;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f1ea;
  --muted: #9297a3;
  --accent: #ff7057;
  --accent-2: #f6c768;
  --ok: #56d69a;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

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

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(680px, 1fr) minmax(420px, 500px);
}

.preview-column {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  padding: 28px 32px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 111, 87, 0.14), transparent 28%),
    radial-gradient(circle at 76% 74%, rgba(61, 103, 196, 0.15), transparent 34%),
    #090a0e;
}

.brand {
  width: min(100%, 1050px);
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), #7b52ff);
  font-weight: 900;
}

.brand p,
.brand h1 {
  margin: 0;
}

.brand p {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.22em;
}

.brand h1 {
  margin-top: 3px;
  font-size: 22px;
}

.phone-shell {
  position: relative;
  width: min(100%, 1050px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(rgba(7, 8, 12, 0.62), rgba(7, 8, 12, 0.72)),
    var(--photo, radial-gradient(circle at center, #3c4250, #11151c));
  background-size: cover;
  background-position: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
  isolation: isolate;
}

.phone-shell::before {
  content: "";
  position: absolute;
  inset: -30px;
  z-index: -1;
  background: inherit;
  filter: blur(24px) saturate(0.75);
  transform: scale(1.08);
}

.ambient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 30%, rgba(248, 148, 97, 0.18), transparent 32%),
    linear-gradient(130deg, rgba(0, 0, 0, 0.1), rgba(4, 7, 13, 0.56));
}

.headline {
  position: absolute;
  z-index: 4;
  top: 8%;
  left: 7%;
  right: 48%;
  display: grid;
  gap: 5px;
  text-shadow: 0 4px 20px #000;
}

.headline small {
  color: rgba(255, 255, 255, 0.64);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.headline strong {
  overflow: hidden;
  font-size: clamp(22px, 2.8vw, 36px);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.headline span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.tilt-stage {
  position: absolute;
  z-index: 3;
  inset: 0;
  perspective: 900px;
}

.music-card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(4, 6, 10, 0.86), rgba(4, 6, 10, 0.15)),
    var(--photo, linear-gradient(135deg, #313b4d, #151820));
  background-size: cover;
  background-position: center;
  box-shadow: none;
  animation: tilt-intro 1.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes tilt-intro {
  from {
    transform: perspective(900px) rotateY(-13deg) rotateX(4deg) rotate(-2deg) scale(0.91);
  }
  to {
    transform: none;
  }
}

.lyrics-preview {
  position: absolute;
  top: 11%;
  left: 7%;
  width: 48%;
  display: grid;
  gap: 8px;
}

.lyrics-preview span {
  display: block;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.48);
  font-size: clamp(11px, 1.1vw, 16px);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.lyrics-preview span.active {
  color: #fff;
  font-size: clamp(14px, 1.35vw, 20px);
  font-weight: 800;
}

.lyrics-preview span.active::before {
  content: "●";
  margin-right: 7px;
  color: var(--accent-2);
}

.disc {
  position: absolute;
  top: 8%;
  right: 10%;
  width: 30%;
  aspect-ratio: 1;
  border: 9px solid rgba(5, 6, 8, 0.96);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 14%, rgba(224, 218, 207, 0.96) 14% 27%, transparent 27%),
    var(--photo, linear-gradient(135deg, #ca6653, #2e4666));
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  animation: spin 12s linear infinite;
}

.disc-center {
  position: absolute;
  inset: 45%;
  border-radius: 50%;
  background: #15171b;
}

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

.player-line {
  position: absolute;
  right: 9%;
  bottom: 23%;
  width: 32%;
  height: 2px;
  background: rgba(255, 255, 255, 0.28);
}

.player-line i {
  display: block;
  width: 42%;
  height: 100%;
  background: #fff;
}

.player-icons {
  position: absolute;
  right: 18%;
  bottom: 14%;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
}

.reflection {
  position: absolute;
  top: 68%;
  left: 46%;
  width: 54%;
  height: 32%;
  opacity: 0.28;
  background: linear-gradient(rgba(255, 255, 255, 0.26), transparent);
  filter: blur(8px);
  transform: rotate(2deg) skewX(-8deg);
  mask-image: linear-gradient(#000, transparent);
}

.phone-foot {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 2.6%;
  z-index: 4;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.form-column {
  min-height: 100vh;
  padding: 38px 34px 30px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #121419, #0e1014);
}

.panel-heading p,
.panel-heading h2 {
  margin: 0;
}

.panel-heading p {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.panel-heading h2 {
  margin-top: 7px;
  font-size: 30px;
}

.panel-heading > span {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

form {
  margin-top: 28px;
}

.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.step-number {
  padding-top: 17px;
  color: rgba(255, 255, 255, 0.32);
  font-size: 12px;
  font-weight: 800;
}

.upload-box {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 15px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.upload-box:hover {
  border-color: rgba(255, 112, 87, 0.68);
  background: rgba(255, 112, 87, 0.04);
}

.upload-box input,
.file-inline input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-box strong {
  font-size: 14px;
}

.upload-box span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.persist-photo {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  cursor: pointer;
}

.persist-photo input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.lyrics-input {
  display: grid;
  gap: 8px;
}

textarea,
input[type="text"],
input[type="number"],
select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  outline: none;
  background: #0b0d11;
  color: var(--text);
  padding: 11px 12px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(255, 112, 87, 0.65);
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

.file-inline {
  width: fit-content;
  color: var(--accent-2);
  font-size: 12px;
  cursor: pointer;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 18px;
}

.meta-grid label,
.manual-start label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.check-label {
  grid-template-columns: 20px 1fr;
  align-items: center;
  padding: 8px 0;
}

.check-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.check-label strong,
.check-label small {
  display: block;
}

.check-label strong {
  color: var(--text);
  font-size: 13px;
}

.check-label small {
  margin-top: 3px;
  color: var(--muted);
}

.manual-start {
  margin-top: 12px;
}

.analysis-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(246, 199, 104, 0.24);
  border-radius: 12px;
  background: rgba(246, 199, 104, 0.055);
}

.analysis-box strong,
.analysis-box span {
  display: block;
}

.analysis-box strong {
  color: var(--text);
  font-size: 13px;
}

.analysis-box span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.analysis-box button {
  flex: 0 0 auto;
  border: 1px solid rgba(246, 199, 104, 0.35);
  border-radius: 9px;
  padding: 8px 11px;
  background: transparent;
  color: var(--accent-2);
  cursor: pointer;
}

.analysis-box button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.render-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 22px;
  border: 0;
  border-radius: 14px;
  padding: 15px 18px;
  background: linear-gradient(135deg, var(--accent), #ff9d5c);
  color: #130a08;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(255, 112, 87, 0.2);
}

.render-button:disabled {
  opacity: 0.56;
  cursor: wait;
}

.button-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.render-button strong,
.render-button small {
  display: block;
}

.render-button strong {
  font-size: 16px;
}

.render-button small {
  margin-top: 3px;
  opacity: 0.68;
  font-size: 11px;
}

.status-box,
.result-box {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(246, 199, 104, 0.09);
}

.status-box strong,
.status-box span,
.result-box strong,
.result-box span {
  display: block;
}

.status-box strong,
.result-box strong {
  font-size: 13px;
}

.status-box span,
.result-box span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.status-box.working .status-dot {
  background: var(--accent);
  animation: pulse 0.9s ease-in-out infinite alternate;
}

.status-box.ok .status-dot {
  background: var(--ok);
}

@keyframes pulse {
  to {
    transform: scale(1.65);
  }
}

.result-box {
  justify-content: space-between;
  border-color: rgba(86, 214, 154, 0.25);
}

.result-box a {
  flex: 0 0 auto;
  border-radius: 9px;
  padding: 9px 13px;
  background: var(--ok);
  color: #06130d;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .preview-column {
    min-height: auto;
    padding: 24px 18px 30px;
  }

  .phone-shell {
    width: min(94vw, 960px);
  }

  .form-column {
    min-height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .form-column {
    padding: 30px 20px;
  }

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

  .phone-shell {
    width: min(96vw, 760px);
  }
}
