:root {
  color-scheme: light;
  --paper: #f5efe4;
  --surface: #fffdf8;
  --aged: #f2e8db;
  --ink: #2f251f;
  --muted: #6b5549;
  --walnut: #30231b;
  --red: #a03125;
  --red-dark: #8a271c;
  --border: #e3d3c3;
  --notice: #f8ead4;
  --notice-ink: #673b1d;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", SimSun, serif;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55; }
button, input, textarea, select { font: inherit; color: inherit; }
button, summary, label.audio-picker, input[type=range] { cursor: pointer; }
a { color: var(--red-dark); text-underline-offset: .19em; }
:focus-visible { outline: 3px solid #b34927; outline-offset: 3px; }
#make-title:focus, #songs-title:focus, #results-title:focus, #conflict-note:focus { outline-offset: 3px; }
.shell { width: min(100% - 32px, 1160px); margin-inline: auto; }
main.shell { padding-top: 22px; padding-bottom: 56px; }
.masthead { position: sticky; top: 0; z-index: 1; background: var(--paper); border-bottom: 1px solid var(--border); }
.masthead-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 800 clamp(1.05rem, 4vw, 1.4rem)/1 var(--serif); white-space: nowrap; }
.record-mark, .player-record {
  border-radius: 50%;
  display: block;
  flex: none;
  background: radial-gradient(circle, #f7d8b8 0 6%, #b04531 7% 23%, #382922 24% 37%, #594239 38% 40%, #342620 41% 56%, #594239 57% 60%, #32241e 61% 100%);
}
.record-mark { width: 33px; height: 33px; }
.sections { display: flex; gap: 3px; align-items: center; }
.sections a { display: grid; place-items: center; min-height: 46px; padding: 5px 13px; border-radius: 5px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.sections a[aria-current=page] { background: #eddfd0; color: var(--red-dark); }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1, h2 { font-family: var(--serif); font-weight: 800; }
h2 { font-size: clamp(1.38rem, 4vw, 1.78rem); line-height: 1.25; }
h3 { font-size: 1.08rem; line-height: 1.35; }
.room-hero {
  min-height: clamp(225px, 29vw, 323px);
  display: flex;
  align-items: center;
  border-radius: 18px;
  padding: clamp(22px, 6vw, 68px);
  margin-bottom: clamp(20px, 4vw, 35px);
  color: #fffaee;
  background-color: #2e2119;
  background-image: linear-gradient(90deg, rgba(23, 16, 12, .93) 0%, rgba(28, 19, 13, .62) 42%, rgba(31, 20, 14, .08) 93%), url('/record-room.jpg');
  background-size: cover;
  background-position: center, 65% 50%;
}
.hero-copy { max-width: 525px; }
.hero-copy h1 { font-size: clamp(1.9rem, 5.9vw, 3.4rem); line-height: 1.2; }
.hero-copy p { color: #f8e9d5; margin-top: 13px; }
.mobile-break { display: none; }
.surface { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.gate { max-width: 530px; padding: clamp(20px, 4vw, 32px); margin: 0 auto; }
.gate > p { margin-top: 8px; color: var(--muted); }
.gate form, .fields { display: grid; gap: 7px; }
.gate form { margin-top: 18px; gap: 12px; }
.loading { padding-block: 15px; color: var(--muted); }
.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px 16px; }
.muted, small { color: var(--muted); font-size: .9rem; }
small { font-weight: 550; display: inline-block; }
.make-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 29px); align-items: start; }
.form-surface, .task-surface, .playlist, .empty-library { padding: clamp(16px, 3.4vw, 29px); }
.modes { border: 0; padding: 0; margin: 17px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.modes label { position: relative; text-align: center; }
.visually-hidden, .modes input, .optimize input { position: absolute; height: 1px; width: 1px; overflow: hidden; clip-path: inset(50%); }
.modes span { display: grid; align-content: center; min-height: 54px; padding: 6px; border: 1px solid var(--border); border-radius: 7px; font-weight: 750; cursor: pointer; }
.modes input:checked + span { color: var(--red-dark); background: #f5e4d9; border-color: #bd7666; }
.modes input:focus-visible + span, .optimize input:focus-visible + .switch { outline: 3px solid #b34927; outline-offset: 3px; }
label, .recording-label { display: block; font-weight: 700; }
input:not([type=radio]):not([type=file]):not([type=range]):not([type=checkbox]), textarea, select {
  min-width: 0; width: 100%; background: white; border: 1px solid #bfaa9b; border-radius: 7px; padding: 11px 12px;
}
input:not([type=radio]):not([type=file]):not([type=range]):not([type=checkbox]), select { min-height: 52px; }
input::placeholder, textarea::placeholder { color: #77665b; }
textarea { resize: vertical; }
.fields label:not(:first-child) { margin-top: 10px; }
.recording { padding: 12px 14px; margin-bottom: 17px; border-radius: 9px; background: var(--aged); }
.recording .muted { margin-top: 7px; }
.audio-picker { margin-top: 7px; }
#audio:focus-visible + .audio-picker { outline: 3px solid #b34927; outline-offset: 3px; }
#audio:disabled + .audio-picker { opacity: .6; cursor: default; }
#original { display: block; width: 100%; min-height: 52px; margin-block: 5px; }
button, .primary, .secondary, .download {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 51px; min-width: 0; padding: 8px 13px; border-radius: 7px; border: 1px solid transparent; font-weight: 750;
}
.primary { background: var(--red); color: #fffef7; width: 100%; min-height: 60px; font-size: 1.12rem; text-decoration: none; }
.primary:hover:not(:disabled) { background: var(--red-dark); }
.secondary { background: var(--surface); color: var(--red-dark); border-color: #bd7666; }
button:disabled { color: #6f5d52; background: #f0e7de; border-color: #e0d1c7; cursor: default; }
.text-button { padding-inline: 8px; background: transparent; color: var(--red-dark); text-decoration: underline; text-underline-offset: .2em; }
.feedback { color: var(--notice-ink); font-weight: 650; }
.feedback:not(:empty) { margin-top: 8px; }
.notice { background: var(--notice); padding: 11px 13px; border-radius: 7px; color: var(--notice-ink); }
#service { margin-bottom: 16px; }
#conflict-note { margin-top: 7px; }
.optimize { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; padding: 12px 14px; margin-top: 20px; border: 1px solid var(--border); border-radius: 9px; background: var(--aged); cursor: pointer; }
.optimize strong { display: block; font-size: 1.03rem; }
.optimize .muted { font-weight: 500; }
.switch { position: relative; width: 57px; height: 33px; flex: none; border: 1px solid #947f71; border-radius: 18px; background: #a28e80; }
.switch::after { position: absolute; content: ""; width: 25px; height: 25px; top: 3px; left: 3px; border-radius: 50%; background: white; }
.optimize input:checked + .switch { background: var(--red); border-color: var(--red); }
.optimize input:checked + .switch::after { transform: translateX(24px); }
details { margin-top: 17px; border-top: 1px solid var(--border); }
summary { min-height: 51px; padding-block: 11px; color: var(--red-dark); font-weight: 750; }
.settings { display: grid; gap: 9px; }
.settings .text-button { justify-self: start; }
.setting { display: grid; gap: 5px; padding: 10px 13px; background: var(--aged); border-radius: 7px; }
.duration-custom { padding: 8px 0 0; }
.setting-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.setting output { color: var(--red-dark); font-weight: 750; }
input[type=range] { accent-color: var(--red); width: 100%; height: 44px; margin: 0; }
.submit { margin-top: 13px; }
#fee { margin-bottom: 9px; }
.job-list, .record-list { margin: 0; padding: 0; list-style: none; }
.job-list > li, .record-entry { padding-block: 14px; border-top: 1px solid var(--border); }
.job-list > li:first-child { margin-top: 10px; }
.job-list > li:last-child, .record-entry:last-child { padding-bottom: 0; }
.job-list progress { display: block; margin-block: 7px; width: 100%; accent-color: var(--red); }
.job-list .notice { margin-top: 7px; }
.job-meta { font-size: .84rem; color: var(--muted); }
.library-heading { margin: 3px 0 17px; }
.library-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(16px, 3vw, 27px); align-items: start; }
.library-grid .playlist > h3 { margin-bottom: 12px; }
.empty-library { max-width: 640px; }
.empty-library p { margin: 7px 0 14px; color: var(--muted); }
.empty-library .primary { width: auto; }
.player-panel { padding: clamp(17px, 4vw, 30px); border-radius: 14px; background: var(--walnut); color: #fff4e7; }
.now-playing {
  display: flex; align-items: center; gap: 13px; min-height: 104px; padding: 12px;
  border: 1px solid #745848; border-radius: 9px; background-color: #402e24;
  background-image: linear-gradient(90deg, rgba(54, 39, 30, .97) 0%, rgba(54, 39, 30, .87) 66%, rgba(54, 39, 30, .57) 100%), url('/record-room.jpg');
  background-size: cover; background-position: center, 80% 56%;
}
.now-playing h3 { font: 800 clamp(1.15rem, 5vw, 1.65rem)/1.25 var(--serif); }
.now-playing p, .cache-status, .elapsed { color: #e4cfbc; }
.track-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 9px; margin-top: 5px; font-size: .89rem; font-variant-numeric: tabular-nums; }
.player-record { width: 62px; height: 62px; border: 1px solid #604d42; }
.transport { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 7px; margin-top: 16px; }
.transport button, .player-retry { background: #48352b; color: #fff4e7; border-color: #7d5d4a; }
.transport button { padding-inline: 4px; gap: .3em; white-space: nowrap; }
.transport-icon { font-family: system-ui, sans-serif; font-size: .88em; }
.transport button:disabled { background: #37291f; border-color: #675247; color: #c0a793; }
.transport .play-button { background: #fbebde; color: #692d20; border-color: #fbebde; }
.player-panel input[type=range], .player-panel input[type=checkbox] { accent-color: #df9078; }
#seek { display: block; }
.elapsed { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; font-size: .9rem; margin-top: -3px; }
.player-foot { display: flex; gap: 8px 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.continuous { display: flex; gap: 8px; align-items: center; min-height: 48px; cursor: pointer; }
.continuous input { width: 21px; height: 21px; margin: 0; }
.download { border-color: #b89079; color: #fff4e7; text-decoration: none; }
.cache-status, .player-feedback { font-size: .9rem; margin-top: 6px; }
.player-retry { margin-top: 5px; }
.record-heading, .job-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
.record-heading { margin-bottom: 8px; }
.record-entry h4 { font: 800 1.12rem/1.3 var(--serif); margin: 0; overflow-wrap: anywhere; }
.record-heading .muted { white-space: nowrap; font-variant-numeric: tabular-nums; }
.version-list { display: flex; gap: 7px; flex-wrap: wrap; }
.version-list button { display: inline-flex; gap: 8px; background: var(--surface); color: var(--ink); border-color: #d6c2b3; }
.version-list small { font-variant-numeric: tabular-nums; }
.version-list button[aria-current=true] { color: var(--red-dark); background: #f5e4d9; border-color: #bd7666; }
#library-status { margin-bottom: 10px; }
#library-status:empty { margin: 0; }
@media (min-width: 1000px) {
  .shell { width: min(100% - 80px, 1240px); }
  .task-surface, .player-panel { position: sticky; top: 89px; }
  .task-surface { max-height: calc(100dvh - 110px); overflow: auto; }
  .settings { grid-template-columns: 1fr 1fr; }
  .settings > .setting:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .make-grid, .library-grid { grid-template-columns: minmax(0, 1fr); }
  .room-hero { background-position: center, 63% 50%; }
  .mobile-break { display: initial; }
}
@media (max-width: 370px) {
  .shell { width: calc(100% - 22px); }
  .brand { gap: 6px; }
  .sections a { padding-inline: 8px; font-size: .94rem; }
  .modes span { font-size: .93rem; }
}
