:root {
  color-scheme: dark;
  --bg: #0b0b10;
  --ink: #f3f1f8;
  --muted: #a29fae;
  --line: #ffffff18;
  --lilac: #c0abff;
  --content: 720px;
  font-family: Inter, Geist, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 280px; }
body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, audio:focus-visible { outline: 2px solid var(--lilac); outline-offset: 5px; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: white; background: #68549a; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.site-header {
  height: 78px; position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  padding-inline: clamp(20px, 4vw, 64px); border-bottom: 1px solid #ffffff09;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #f0edf6; font-size: 20px; font-weight: 650; letter-spacing: .03em; }
.brand-mark { height: 26px; display: flex; align-items: center; gap: 2.5px; transform: skew(-9deg); }
.brand-mark i { display: block; width: 3px; border-radius: 2px; background: linear-gradient(#ded7ff, #ac95f3); }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 24px; }
.brand-mark i:nth-child(4) { height: 14px; }
.brand-mark i:nth-child(5) { height: 7px; }
#new-chat { display: none; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; background: #ffffff05; color: #cdc9d7; font-size: 13px; }
#new-chat:hover { background: #ffffff0c; }
#new-chat span { color: var(--lilac); }
#studio {
  position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: calc(100vh - 78px); min-height: calc(100svh - 78px); padding: 24px 24px clamp(72px, 14vh, 146px);
}
.ambient { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.ambient::before {
  content: ""; display: block; position: absolute; left: 50%; top: 38%; translate: -50% -50%; width: min(1100px, 140%); height: 620px;
  background: radial-gradient(ellipse at 50% 45%, #8d68dc0e 0%, #71609a06 37%, transparent 69%);
}
#intro { width: 100%; text-align: center; animation: intro-in .65s both; }
.soundform { width: min(390px, 86vw); aspect-ratio: 390 / 180; margin: 0 auto clamp(16px, 3vh, 30px); position: relative; }
#soundform { width: 100%; height: 100%; display: block; }
h1 { margin: 0 0 32px; font-weight: 530; font-size: clamp(29px, 3.5vw, 54px); line-height: 1.37; letter-spacing: -.055em; color: #f2eff8; }
.composer-zone { width: min(100%, var(--content)); position: relative; z-index: 2; text-align: center; }
#composer {
  display: flex; align-items: flex-end; gap: 14px; padding: 17px 17px 17px 22px; isolation: isolate; position: relative;
  border: 1px solid #393640; border-radius: 21px; min-height: 83px; text-align: left;
  background: linear-gradient(115deg, #1b191f, #17171d 65%, #1c1924); box-shadow: 0 6px 24px #0003, inset 0 1px #ffffff05;
  transition: box-shadow .25s, border-color .25s;
}
#composer:focus-within { border-color: #7a6b95; box-shadow: 0 4px 27px #0004, 0 0 0 3px #a98ee309; }
#prompt {
  flex: 1; width: 0; background: none; color: var(--ink); border: 0; outline: none; resize: none; box-shadow: none;
  min-height: 46px; max-height: 150px; padding: 10px 0; line-height: 26px; font-size: 16px; letter-spacing: .015em; border-radius: 0;
  overflow-y: auto; scrollbar-color: #62596f transparent; scrollbar-width: thin;
}
#prompt::placeholder { color: #9c97a8; opacity: 1; }
#send {
  flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #d5c4ff50; border-radius: 50%;
  background: linear-gradient(145deg, #d0bbff, #ae94e7); color: #241c36;
  transition: background .2s, box-shadow .2s, transform .2s; margin-bottom: 1px;
}
#send:hover:not(:disabled) { box-shadow: 0 0 24px #b494ff36; transform: translateY(-1px); }
#send:active:not(:disabled) { transform: translateY(0) scale(.95); }
#send:disabled { opacity: .66; }
.arrow-up { display: block; width: 18px; height: 20px; position: relative; }
.arrow-up::before, .arrow-up::after { position: absolute; content: ""; }
.arrow-up::before { height: 15px; width: 1.9px; background: currentColor; top: 3px; left: 8px; border-radius: 2px; }
.arrow-up::after { width: 10px; height: 10px; border: solid currentColor; border-width: 1.9px 1.9px 0 0; transform: rotate(-45deg); left: 4px; top: 3px; }
.sample { display: inline-flex; align-items: center; gap: 6px; margin: 13px 0 0; padding: 8px; color: #96909f; background: none; border: 0; font-size: 13px; line-height: 1.5; transition: color .2s; }
.sample:hover { color: #d5c6ee; }
.sample-spark { color: #b8a2d6; font-size: 17px; line-height: 1; }
#thread { display: none; }
body[data-view="chat"] { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
body[data-view="chat"] .site-header { flex: 0 0 66px; }
body[data-view="chat"] #studio { flex: 1; min-height: 0; padding: 0 24px; justify-content: flex-start; overflow: hidden; }
body[data-view="chat"] .ambient, body[data-view="chat"] #intro, body[data-view="chat"] .sample { display: none; }
body[data-view="chat"] #new-chat { display: inline-flex; }
body[data-view="chat"] #thread {
  width: min(calc(100% + 24px), calc(var(--content) + 24px)); min-height: 0; display: flex; flex: 1; flex-direction: column;
  padding: 32px 12px 22px; gap: 22px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3e3849 transparent;
}
body[data-view="chat"] .composer-zone { flex-shrink: 0; padding: 10px 0 max(19px, env(safe-area-inset-bottom)); }
body[data-view="chat"] #composer { min-height: 68px; padding: 10px 12px 10px 18px; border-radius: 17px; }
.message { max-width: 94%; font-size: 16px; line-height: 1.82; overflow-wrap: anywhere; animation: message-in .32s both; }
.message .speaker { display: block; margin-bottom: 6px; color: #aca3bd; font-size: 12px; line-height: 1.5; font-weight: 550; letter-spacing: .04em; }
.message-body { white-space: pre-wrap; }
.message.user { align-self: flex-end; background: #25212e; color: #e8e1f3; border: 1px solid #ffffff0b; border-radius: 17px 17px 4px 17px; padding: 11px 17px; }
.message.user .speaker { display: none; }
.message.assistant { align-self: flex-start; color: #e1dce9; }
.message.assistant .speaker { color: #c0abed; }
.waiting-indicator {
  display: flex; align-items: center; gap: 11px; min-height: 28px;
  color: #c3b9d3; font-size: 14px; line-height: 1.6;
}
.waiting-wave {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  gap: 3px; height: 24px; color: var(--lilac);
}
.waiting-wave i {
  display: block; width: 3px; height: 12px; border-radius: 3px; background: currentColor;
  animation: waiting-beat 1.05s ease-in-out infinite;
}
.waiting-wave i:nth-child(2) { height: 19px; animation-delay: -.79s; }
.waiting-wave i:nth-child(3) { height: 23px; animation-delay: -.57s; }
.waiting-wave i:nth-child(4) { height: 17px; animation-delay: -.36s; }
.waiting-wave i:nth-child(5) { height: 10px; animation-delay: -.15s; }
.waiting-song { margin-top: 12px; }
.waiting-song .waiting-wave i { animation-duration: .82s; }
@keyframes waiting-beat {
  0%, 100% { transform: scaleY(.32); opacity: .62; }
  48% { transform: scaleY(1); opacity: 1; }
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.primary-action, .secondary-action {
  border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 14px; line-height: 1.5; transition: background .16s, opacity .16s; text-decoration: none;
}
.primary-action { background: #c1a8ef; color: #241a30; font-weight: 650; border: 1px solid #d5bfff66; }
.primary-action:hover:not(:disabled) { background: #d4bcff; }
.secondary-action { border: 1px solid #ffffff21; background: #ffffff05; color: #cec6dc; }
.secondary-action:hover:not(:disabled) { background: #ffffff0e; }
.primary-action:disabled, .secondary-action:disabled { opacity: .52; }
.track-card {
  width: min(100%, 440px); min-width: min(250px, 100%); margin-block: 12px 3px; padding: 18px;
  border: 1px solid #b79ee733; border-radius: 16px; background: linear-gradient(125deg, #292334, #19181f); color: var(--ink); overflow: hidden;
}
.track-title { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.45; }
.track-copy { font-size: 14px; color: #bab3c7; margin: 7px 0; }
.track-card audio, .message audio { display: block; max-width: 100%; width: 100%; margin-top: 13px; }
.track-card a.secondary-action { display: inline-block; margin-top: 12px; }
.message a { color: #d3bcff; }
.message a.primary-action { color: #241a30; }
body[data-busy="true"] .brand-mark i { animation: listen .9s ease-in-out infinite alternate; }
body[data-busy="true"] .brand-mark i:nth-child(even) { animation-delay: -.6s; }
body[data-busy="true"] .brand-mark i:nth-child(3) { animation-delay: -.35s; }
@keyframes listen { to { transform: scaleY(.42); } }
@keyframes intro-in { from { transform: translateY(4px); } to { transform: translateY(0); } }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .site-header { height: 64px; padding-inline: 21px; }
  .brand { font-size: 18px; }
  #studio { min-height: calc(100svh - 64px); padding: 18px 18px clamp(75px, 12vh, 110px); }
  h1 { margin-bottom: 25px; letter-spacing: -.055em; }
  .soundform { width: min(310px, 84vw); margin-bottom: 17px; }
  #composer { min-height: 70px; padding: 11px 11px 11px 16px; border-radius: 18px; gap: 8px; }
  #prompt { font-size: 16px; }
  #send { width: 41px; height: 41px; flex-basis: 41px; margin-bottom: 2px; }
  body[data-view="chat"] #studio { padding-inline: 15px; }
  body[data-view="chat"] .site-header { flex-basis: 57px; }
  body[data-view="chat"] #thread { gap: 20px; padding-top: 20px; }
  .message { max-width: 96%; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .site-header { height: 50px; }
  #studio { min-height: calc(100svh - 50px); padding-block: 10px; }
  .soundform { width: 180px; margin-bottom: 0; }
  h1 { font-size: 30px; margin-bottom: 15px; }
  .sample { margin: 2px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .waiting-wave i { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
