:root {
  color-scheme: light;
  --ink: #1c1916;
  --muted: #5c574f;
  --paper: #f4f1eb;
  --card: #fffcf8;
  --line: #e4ddd2;
  --header: #141311;
  --cream: #f7f4ee;
  --gold: #e4c48a;
  --gold-ink: #2c2416;
  --green: #146b4f;
  --green-ink: #f4fff9;
  --danger: #9a3412;
  --shadow: 0 24px 60px rgba(20, 19, 17, 0.18);
  --header-h: 56px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

a { color: inherit; }

code {
  font-family: "SF Mono", "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.92em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(20, 19, 17, 0.94);
  color: var(--cream);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.header-bar {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: 0.16em;
  font-size: 14px;
}

.brand svg { width: 28px; height: 28px; display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1;
}

.nav a {
  color: #d9d3c9;
  text-decoration: none;
  font-size: 14px;
}

.nav a:hover { color: white; }

.account {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.auth {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d9d3c9;
  font-size: 14px;
}

.auth button,
.text-btn,
.btn,
.vip-btn {
  font: inherit;
  cursor: pointer;
}

.auth button,
.text-btn {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 6px 2px;
}

.auth button:hover,
.text-btn:hover { color: white; }

.vip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--gold);
  color: var(--gold-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.vip-btn:hover { background: #efd3a4; }

.hero-wrap {
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(228, 196, 138, 0.16), transparent 46%),
    radial-gradient(ellipse 45% 70% at 0% 100%, rgba(20, 107, 79, 0.38), transparent 52%),
    var(--header);
  color: var(--cream);
  padding: 16px 0 28px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kicker {
  margin: 0 0 6px;
  color: #8ddec4;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.kicker-gold { color: var(--gold); }

h1, h2, h3, p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.lead {
  margin: 8px 0 0;
  max-width: 40em;
  color: #d5cfc5;
  font-size: 15px;
}

.points {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.points li {
  position: relative;
  padding-left: 18px;
  color: #eee8df;
}

.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.studio {
  background: var(--card);
  color: var(--ink);
  border-radius: 28px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
}

.studio h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.studio-lead {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.studio-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.count {
  margin: 0 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.line-btn,
.remove {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.line-btn {
  border: 1px solid #e4ddd2;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--ink);
}

.line-btn:hover { border-color: var(--green); color: var(--green); }

.notice {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8f1e4;
  color: #6a4b16;
}

.drop {
  margin-top: 16px;
  border: 1.5px dashed #e0d8cc;
  border-radius: 18px;
  background: #fbfaf7;
  padding: 6px 16px;
}

.drop.is-empty {
  padding: 22px 18px 18px;
  text-align: center;
  cursor: pointer;
}

.drop.over {
  border-color: var(--green);
  background: #f3faf6;
}

.drop-mark {
  width: 72px;
  height: 36px;
  color: var(--green);
}

.drop-title {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 700;
}

.drop-note {
  margin: 8px auto 0;
  max-width: 34em;
  color: var(--muted);
}

#items {
  list-style: none;
  margin: 0;
  padding: 4px 8px 6px;
  max-height: 312px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #cfc6b8 transparent;
}

#items::-webkit-scrollbar { width: 10px; }
#items::-webkit-scrollbar-thumb {
  background: #d4cdc2;
  border: 2px solid #fbfaf7;
  border-radius: 99px;
}

.song {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 14px;
  align-items: center;
  padding: 10px 8px;
  border-top: 1px solid #efeae2;
}

.song:first-child { border-top: 0; }

.song.is-run {
  background: #f3faf6;
  border-radius: 12px;
}

.song-main { min-width: 0; }

.name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta,
.facts {
  color: var(--muted);
  font-size: 13px;
}

.meta {
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 2px;
}

.song-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

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

.remove { color: var(--danger); padding: 0; }

.bar {
  display: none;
  grid-column: 1 / -1;
  height: 3px;
  margin-top: 6px;
  border-radius: 99px;
  background: #efeae2;
  overflow: hidden;
}

.bar.on { display: block; }

.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
}

.bar.ok > span { width: 100%; }

.settings {
  margin-top: 16px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: #f7f4ef;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.setting-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.segments {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #efeae2;
}

.segments label {
  position: relative;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
}

.segments input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}

.segments label:has(input:checked) {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(28, 25, 22, 0.08);
}

.setting-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.setting-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(200px, 1.25fr);
  gap: 12px 14px;
  align-items: start;
  margin-top: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.volume-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 16px;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 36px 0 14px;
  border: 1px solid #e4ddd2;
  border-radius: 12px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6.2 8 10l4-3.8' stroke='%235c574f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  color: var(--ink);
  font: 14px/42px "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(28, 25, 22, 0.04);
}

.select:hover { border-color: #cfc6b8; }

.select:disabled {
  opacity: 0.45;
  cursor: default;
}

.volume-label,
.ticks {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ticks {
  margin-top: 4px;
  color: #9a948b;
  font-size: 11px;
}

input[type="range"] {
  width: 100%;
  height: 42px;
  margin: 0;
  accent-color: var(--green);
}

.start {
  flex: 0 0 auto;
  min-width: 132px;
  padding: 12px 22px;
}

.btn:disabled,
.line-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  background: var(--green);
  color: var(--green-ink);
  font-weight: 700;
}

.btn:hover { background: #0f5b43; }

.drop:not(.is-empty) {
  border-style: solid;
  border-color: #efeae2;
  background: #fbfaf7;
  padding: 0;
  overflow: hidden;
}

.status {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  max-width: 18em;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3efe8;
}
.status.bad { color: var(--danger); background: #fdece8; }
.status.ok { color: var(--green); background: #e7f5ef; }

a.download {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.noscript {
  margin: 12px 4px 4px;
  color: var(--muted);
}

.band { padding: 72px 0; }

.band-alt { background: #efeae2; }

.band-head {
  max-width: 40em;
  margin-bottom: 22px;
}

.band-head h2,
.vip-panel h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.band-head p,
.card p,
.steps p,
.faq p,
.vip-panel p,
.footer-bar p {
  color: var(--muted);
}

.band-head p { margin: 8px 0 0; }

.cards, .steps, .faq {
  display: grid;
  gap: 14px;
}

.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card, .faq article, .steps li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 16px;
}

.ext {
  margin: 0;
  color: var(--green);
  font-family: "SF Mono", "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 700;
}

.card h3, .steps h3, .faq h3 {
  margin: 8px 0 0;
  font-size: 18px;
}

.card p, .steps p, .faq p { margin: 8px 0 0; }

.steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.steps li { counter-increment: step; }

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  color: var(--gold-ink);
  background: var(--gold);
  width: 36px;
  height: 28px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  line-height: 28px;
  text-align: center;
}

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

.faq article:last-child { grid-column: 1 / -1; }

.vip-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 50% 120% at 100% 0%, rgba(228, 196, 138, 0.2), transparent 50%),
    var(--header);
  color: var(--cream);
}

.vip-panel p { margin: 10px 0 0; color: #d5cfc5; max-width: 40em; }

.vip-btn-dark { flex: 0 0 auto; padding: 12px 18px; }

.site-footer {
  background: var(--header);
  color: #d9d3c9;
  padding: 36px 0 18px;
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  margin: 0 0 6px;
  color: white;
  letter-spacing: 0.16em;
  font-weight: 750;
}

.footer-bar p { margin: 0; }

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-content: flex-start;
}

.site-footer a { color: #eee8df; text-decoration: none; font-size: 14px; }
.site-footer a:hover { color: white; }

.legal {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.legal p { margin: 0; font-size: 13px; color: #a39c93; }

#formats, #guide, #vip, #faq, #convert { scroll-margin-top: calc(var(--header-h) + 12px); }

dialog {
  width: min(420px, calc(100% - 32px));
  border: 0;
  border-radius: 20px;
  padding: 24px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop { background: rgba(20, 19, 17, 0.5); }

dialog h2 { margin: 0; font-size: 22px; }
dialog p { margin: 10px 0 18px; color: var(--muted); }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.site-header :focus-visible,
.site-footer :focus-visible,
.vip-panel :focus-visible {
  outline-color: var(--gold);
}

@media (max-width: 960px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .studio-top,
  .settings-head { flex-direction: column; align-items: stretch; }
  .setting-row { grid-template-columns: 1fr 1fr; }
  .start { width: 100%; }
}

@media (max-width: 800px) {
  .header-bar { flex-wrap: wrap; gap: 8px 16px; padding: 12px 0; }
  .nav {
    order: 3;
    flex: 1 0 100%;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .nav a { white-space: nowrap; }
  .steps, .faq { grid-template-columns: 1fr; }
  .faq article:last-child { grid-column: auto; }
  .vip-panel, .footer-bar { display: block; }
  .vip-btn-dark { margin-top: 18px; }
  .site-footer nav { margin-top: 16px; }
}

@media (max-width: 560px) {
  .wrap { width: min(1120px, calc(100% - 28px)); }
  .cards { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  .hero-wrap { padding-top: 18px; }
  #items { max-height: 260px; }
  .song { grid-template-columns: 1fr; }
  .song-side { flex-direction: row; justify-content: space-between; align-items: center; }
  .status { text-align: left; max-width: none; }
  .account { gap: 10px; }
  .vip-btn { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
