:root {
  color-scheme: light;
  --canvas: oklch(0.965 0.008 82);
  --surface: oklch(0.99 0.004 82);
  --surface-strong: oklch(0.935 0.011 82);
  --ink: oklch(0.19 0.012 255);
  --ink-soft: oklch(0.39 0.016 255);
  --muted: oklch(0.47 0.015 255);
  --line: oklch(0.84 0.012 82);
  --accent: oklch(0.48 0.16 258);
  --accent-hover: oklch(0.42 0.17 258);
  --success: oklch(0.46 0.13 153);
  --error: oklch(0.49 0.18 28);
  --focus: oklch(0.61 0.14 258 / .28);
  --radius-sm: 10px;
  --radius-md: 14px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; background: var(--canvas); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); }
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  font-weight: 730;
  letter-spacing: -.015em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-word { font-style: italic; font-size: 17px; }
.micro-label, .step {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* Mandatory LeoProtect startup sequence */
.boot-sequence {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  animation: boot-away .58s var(--ease-out) 3.35s forwards;
}
.boot-inner { width: min(560px, calc(100% - 48px)); }
.boot-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}
.boot-meta code { color: var(--accent); font: 12px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; }
.boot-word {
  display: flex;
  align-items: baseline;
  perspective: 760px;
  transform-style: preserve-3d;
  margin-top: 36px;
  font-size: clamp(42px, 8vw, 70px);
  font-weight: 760;
  font-style: italic;
  letter-spacing: -.04em;
  line-height: 1;
}
.boot-word span {
  --roll-x: 0deg;
  --roll-y: 0deg;
  --roll-z: 0deg;
  --fly-x: 0px;
  --fly-y: 0px;
  opacity: 0;
  transform: translate3d(var(--fly-x), var(--fly-y), 0) rotateX(var(--roll-x)) rotateY(var(--roll-y)) rotateZ(var(--roll-z)) scale(.58);
  filter: blur(7px);
  transform-origin: center;
  backface-visibility: hidden;
  animation: letter-assemble .78s cubic-bezier(.2, .82, .25, 1) 1.48s forwards;
}
.boot-word span:nth-child(1) { --roll-x: -280deg; --roll-y: 120deg; --roll-z: -35deg; --fly-x: -82px; --fly-y: 20px; }
.boot-word span:nth-child(2) { --roll-x: 190deg; --roll-y: -250deg; --roll-z: 28deg; --fly-x: 54px; --fly-y: -48px; animation-delay: 1.53s; }
.boot-word span:nth-child(3) { --roll-x: -160deg; --roll-y: 290deg; --roll-z: -18deg; --fly-x: -26px; --fly-y: 58px; animation-delay: 1.58s; }
.boot-word span:nth-child(4) { --roll-x: 320deg; --roll-y: -140deg; --roll-z: 42deg; --fly-x: 70px; --fly-y: 36px; animation-delay: 1.63s; }
.boot-word span:nth-child(5) { --roll-x: -230deg; --roll-y: -220deg; --roll-z: -32deg; --fly-x: -64px; --fly-y: -34px; animation-delay: 1.68s; }
.boot-word span:nth-child(6) { --roll-x: 170deg; --roll-y: 300deg; --roll-z: 20deg; --fly-x: 44px; --fly-y: 62px; animation-delay: 1.73s; }
.boot-word span:nth-child(7) { --roll-x: -310deg; --roll-y: 160deg; --roll-z: -44deg; --fly-x: -52px; --fly-y: 42px; animation-delay: 1.78s; }
.boot-word span:nth-child(8) { --roll-x: 250deg; --roll-y: -280deg; --roll-z: 35deg; --fly-x: 62px; --fly-y: -56px; animation-delay: 1.83s; }
.boot-word span:nth-child(9) { --roll-x: -190deg; --roll-y: 240deg; --roll-z: -25deg; --fly-x: -38px; --fly-y: -62px; animation-delay: 1.88s; }
.boot-word span:nth-child(10) { --roll-x: 300deg; --roll-y: -190deg; --roll-z: 38deg; --fly-x: 76px; --fly-y: 28px; animation-delay: 1.93s; }
.boot-cursor {
  width: 3px;
  height: .78em;
  margin-left: 8px;
  background: var(--accent);
  animation: cursor-blink .72s steps(1) infinite;
}
.boot-checks {
  display: grid;
  margin-top: 10px;
  color: var(--ink-soft);
}
.boot-checks span {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.boot-checks i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .24s ease, box-shadow .24s ease; }
.boot-checks b { font-weight: 650; }
.boot-checks em { color: var(--muted); font-style: normal; font: 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; }
.boot-checks .is-ready i { background: var(--success); box-shadow: 0 0 0 3px oklch(0.46 0.13 153 / .13); }
.boot-checks .is-ready em { color: var(--success); }
.boot-checks .is-error i { background: var(--error); }
.boot-checks .is-error em { color: var(--error); }
.boot-progress { height: 2px; margin-top: 20px; overflow: hidden; background: var(--line); }
.boot-progress::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  animation: progress 1.8s cubic-bezier(.65, 0, .35, 1) .12s both;
}

/* Login */
.login-page { min-height: 100dvh; overflow-x: hidden; }
.login-shell {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(390px, .65fr);
  isolation: isolate;
  overflow: hidden;
}
.login-scene {
  position: absolute;
  inset: -3%;
  z-index: -2;
  background: url("/static/images/manhattan-dawn-v1.jpg") 42% center / cover no-repeat;
  transform: scale(1.035);
  animation: scene-drift 24s ease-in-out infinite alternate;
}
.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, oklch(0.12 0.018 255 / .76) 0%, oklch(0.15 0.018 255 / .4) 46%, transparent 72%);
}
.login-shell::after {
  content: "";
  position: absolute;
  left: -12%;
  bottom: -16%;
  z-index: -1;
  width: 72%;
  height: 46%;
  pointer-events: none;
  background: radial-gradient(ellipse, oklch(0.76 0.09 72 / .2), transparent 66%);
  animation: water-light 8s ease-in-out infinite alternate;
}
.login-story {
  min-width: 0;
  padding: clamp(30px, 4.2vw, 68px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
}
.login-story .brand-mark { background: var(--surface); color: var(--ink); }
.story-copy { max-width: 670px; padding: 70px 0 56px; }
.story-copy h1 {
  min-height: 1.2em;
  max-width: none;
  margin: 15px 0 18px;
  font-size: clamp(32px, 3.5vw, 46px);
  line-height: 1.08;
  letter-spacing: -.035em;
  text-wrap: balance;
  white-space: nowrap;
}
.type-cursor {
  display: inline-block;
  width: 2px;
  height: .88em;
  margin-left: 5px;
  vertical-align: -.08em;
  background: oklch(0.91 0.04 82);
  animation: cursor-blink .78s steps(1) infinite;
}
.story-copy > p:last-child {
  max-width: 36em;
  margin: 0;
  color: oklch(0.92 0.006 82);
  font-size: 16px;
  line-height: 1.75;
  text-wrap: pretty;
}
.login-story .micro-label { color: oklch(0.9 0.03 82); }
.security-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.security-strip span {
  padding: 8px 12px;
  border-radius: 999px;
  background: oklch(0.17 0.014 255 / .76);
  color: oklch(0.94 0.004 82);
  font-size: 11px;
  backdrop-filter: blur(8px);
}
.login-panel {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(28px, 4vw, 58px);
  background: oklch(0.965 0.008 82 / .97);
  box-shadow: -8px 0 20px oklch(0.1 0.01 255 / .12);
}
.login-card { width: min(100%, 430px); }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}
.status-chip i, .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px oklch(0.46 0.13 153 / .14);
}
.login-card h2 { margin: 26px 0 10px; font-size: 34px; line-height: 1.15; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 30px; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.machine-row {
  margin: 18px 0 22px;
  padding: 13px 0;
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.machine-row code { color: var(--ink-soft); font: 11px/1.5 ui-monospace, "SFMono-Regular", Menlo, monospace; overflow-wrap: anywhere; }

/* Shared controls */
.field { margin-bottom: 18px; }
.field label, .field-label, .strength-field legend { display: block; margin-bottom: 8px; color: var(--ink); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 13px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field input, .field select { height: 46px; }
.field textarea { min-height: 86px; padding-top: 12px; padding-bottom: 12px; resize: vertical; line-height: 1.6; }
.field input::placeholder, textarea::placeholder { color: oklch(0.43 0.012 255); opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--focus); }
.field small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.password-row { display: grid; grid-template-columns: 1fr auto; }
.password-row input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.generate-button {
  min-width: 62px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.generate-button:hover { color: var(--accent); background: var(--surface); }
.message {
  display: none;
  margin: 0 0 14px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: oklch(0.93 0.045 28);
  color: var(--error);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.message.show { display: block; }
.message.success { background: oklch(0.93 0.045 153); color: var(--success); }
.primary-button {
  width: 100%;
  min-height: 50px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--surface);
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 4px 8px oklch(0.1 0.01 255 / .14);
  transition: transform .18s var(--ease-out), background .18s ease, box-shadow .18s ease;
}
.primary-button:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 8px oklch(0.1 0.01 255 / .16); }
.primary-button:active { transform: translateY(0); }
.primary-button:focus-visible, .quiet-button:focus-visible, .generate-button:focus-visible, .drop-zone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.primary-button:disabled { opacity: .62; cursor: wait; transform: none; box-shadow: none; }
.login-submit {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  min-height: 54px;
  padding: 0 12px;
  border-radius: 12px;
  background: linear-gradient(125deg, oklch(0.2 0.025 255), oklch(0.39 0.15 258));
  text-align: left;
}
.login-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(105deg, transparent 24%, oklch(0.96 0.02 82 / .24) 46%, transparent 67%);
  transform: translateX(-120%);
  transition: transform .55s var(--ease-out);
}
.login-submit > *:not(.button-ripple) { position: relative; z-index: 1; }
.login-submit:hover::before { transform: translateX(120%); }
.button-sigil {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: oklch(0.97 0.006 82 / .16);
  color: oklch(0.98 0.004 82);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: -.02em;
  box-shadow: inset 0 0 0 1px oklch(0.98 0.004 82 / .23);
}
.login-submit .button-label { font-size: 13px; letter-spacing: .01em; }
.button-action { display: inline-flex; align-items: center; gap: 8px; color: oklch(0.91 0.025 82); font-size: 11px; font-weight: 650; }
.button-action i { font-size: 16px; font-style: normal; transition: transform .2s var(--ease-out); }
.login-submit:hover .button-action i { transform: translateX(3px); }
.login-submit.is-pressed { transform: scale(.985); }
.login-submit.is-loading .button-sigil { animation: sigil-pulse .85s ease-in-out infinite alternate; }
.login-submit.is-loading .button-action { opacity: .5; }
.login-submit:disabled { opacity: 1; }
.button-ripple {
  position: absolute;
  left: var(--ripple-x);
  top: var(--ripple-y);
  z-index: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: oklch(0.93 0.05 82 / .34);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: button-ripple .58s var(--ease-out) forwards;
}
.security-note { margin: 11px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.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; }

/* Persistent compact music player */
.music-player {
  --drag-x: 0px;
  --drag-y: 0px;
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 20;
  width: min(334px, calc(100% - 40px));
  min-height: 52px;
  padding: 7px 12px 7px 7px;
  display: grid;
  grid-template-columns: 38px 30px minmax(64px, auto) minmax(54px, 1fr) 32px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid oklch(1 0 0 / .56);
  border-radius: 999px;
  background: linear-gradient(115deg, oklch(0.99 0.004 82 / .7), oklch(0.92 0.018 258 / .48));
  color: var(--ink);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / .64), inset 0 -1px 0 oklch(0.52 0.03 255 / .12), 0 5px 8px oklch(0.1 0.01 255 / .16);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  contain: layout;
  transform: translate3d(var(--drag-x), var(--drag-y), 0);
  transition: background .22s ease, backdrop-filter .22s ease, box-shadow .22s ease, transform .12s var(--ease-out);
  animation: player-in .5s var(--ease-out) .35s both;
}
.music-player::before { content: ""; position: absolute; inset: 1px 22% auto 12%; height: 42%; border-radius: 999px; background: linear-gradient(180deg, oklch(1 0 0 / .42), transparent); pointer-events: none; }
.music-player.has-entered { animation: none; }
.music-cover {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: url("/static/images/manhattan-dawn-v1.jpg") 27% center / cover no-repeat;
  box-shadow: inset 0 0 0 2px oklch(0.16 0.01 255 / .15);
  animation: cover-spin 11s linear infinite;
  animation-play-state: paused;
}
.music-cover::after { content: ""; position: absolute; inset: 15px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2px oklch(0.18 0.01 255 / .38); }
.music-player.is-playing .music-cover { animation-play-state: running; }
.music-toggle {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  cursor: pointer;
  transition: transform .15s var(--ease-out), background .18s ease;
}
.music-toggle:hover { background: var(--accent-hover); transform: scale(1.04); }
.music-toggle:active { transform: scale(.96); }
.music-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.music-toggle .play-icon { margin-left: 2px; font-size: 11px; }
.music-toggle .pause-icon { display: none; font-size: 11px; font-weight: 800; letter-spacing: -1px; }
.music-player.is-playing .play-icon { display: none; }
.music-player.is-playing .pause-icon { display: inline; }
.music-copy { min-width: 0; display: grid; gap: 3px; }
.music-title-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.music-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.music-copy span { color: var(--muted); font-size: 10px; }
.music-bars { height: 10px; display: inline-flex; align-items: end; gap: 2px; opacity: .55; }
.music-bars i { width: 2px; height: 4px; border-radius: 999px; background: var(--accent); transform-origin: bottom; }
.music-player.is-playing .music-bars i { animation: music-bar .72s ease-in-out infinite alternate; }
.music-player.is-playing .music-bars i:nth-child(2) { animation-delay: -.3s; }
.music-player.is-playing .music-bars i:nth-child(3) { animation-delay: -.5s; }
.music-timeline { position: relative; height: 18px; display: grid; align-items: center; cursor: pointer; }
.music-timeline::before, .music-timeline i { content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 999px; }
.music-timeline::before { background: var(--line); }
.music-timeline i { background: var(--accent); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.music-timeline input { position: absolute; inset: 0; width: 100%; margin: 0; opacity: 0; cursor: pointer; }
.music-player time { color: var(--muted); font: 10px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; text-align: right; }
.music-player.has-error .music-copy span::after { content: " · 加载失败"; color: var(--error); }
.music-drag-handle {
  display: none;
  width: 20px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.music-drag-handle:hover, .music-drag-handle:focus-visible { color: var(--accent); background: oklch(0.9 0.016 82); outline: 0; }
.music-drag-handle i { font-size: 17px; font-style: normal; line-height: 1; }
.music-player.is-dragging { cursor: grabbing; background: linear-gradient(115deg, oklch(1 0 0 / .58), oklch(0.84 0.04 258 / .42)); backdrop-filter: blur(28px) saturate(1.55); -webkit-backdrop-filter: blur(28px) saturate(1.55); box-shadow: inset 0 1px 0 oklch(1 0 0 / .78), 0 7px 8px oklch(0.1 0.01 255 / .2); transform: translate3d(var(--drag-x), var(--drag-y), 0) scale(1.025); transition-duration: .12s; will-change: transform, backdrop-filter; }
.music-player.is-dragging .music-drag-handle { cursor: grabbing; background: oklch(1 0 0 / .28); color: var(--accent); }

/* Workspace tool switch and DeepSeek copywriter */
.tool-switch { width: fit-content; margin: 0 0 18px; padding: 4px; display: flex; gap: 4px; border-radius: 12px; background: var(--surface-strong); }
.tool-tab { min-width: 150px; padding: 9px 13px; display: grid; gap: 2px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.tool-tab span { font-size: 12px; font-weight: 750; }
.tool-tab small { font-size: 10px; }
.tool-tab:hover { color: var(--ink); }
.tool-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px oklch(0.2 0.01 255 / .1); }
.tool-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tool-panel:not([hidden]) { animation: panel-in .32s var(--ease-out) both; }
.copywriter-shell { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 18px; align-items: start; }
.copywriter-form, .copywriter-output { border-radius: var(--radius-md); background: var(--surface); padding: 28px; }
.copywriter-form { box-shadow: 0 4px 8px oklch(0.25 0.01 255 / .08); }
.copywriter-output { min-height: 620px; border: 1px solid var(--line); }
.copywriter-fields, .advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.copywriter-advanced { margin: 4px 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.copywriter-advanced summary { padding: 13px 0; color: var(--ink-soft); font-size: 12px; font-weight: 700; cursor: pointer; }
.copywriter-advanced[open] summary { margin-bottom: 4px; }
.copywriter-advanced .field { margin-bottom: 14px; }
.model-chip { padding: 6px 9px; border-radius: 999px; background: oklch(0.93 0.02 258); color: var(--accent); font-size: 10px; font-weight: 750; }
.copywriter-empty { min-height: 450px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); text-align: center; }
.copywriter-empty > span { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-strong); color: var(--ink-soft); font-family: ui-serif, "Songti SC", serif; font-size: 20px; }
.copywriter-empty strong { color: var(--ink-soft); font-size: 14px; }
.copywriter-empty p { max-width: 34em; margin: 0; font-size: 12px; line-height: 1.7; }
.copywriter-loading { min-height: 450px; display: grid; align-content: center; gap: 12px; }
.copywriter-loading i { height: 14px; border-radius: 5px; background: linear-gradient(90deg, var(--surface-strong), oklch(0.9 0.02 258), var(--surface-strong)); background-size: 220% 100%; animation: loading-sheen 1.2s linear infinite; }
.copywriter-loading i:nth-child(1) { width: 72%; }
.copywriter-loading i:nth-child(2) { width: 94%; }
.copywriter-loading i:nth-child(3) { width: 58%; }
.copywriter-loading span { margin-top: 7px; color: var(--muted); font-size: 11px; }
.copywriter-result { min-height: 450px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-soft); font: 13px/1.85 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
.copywriter-actions { margin-top: 18px; padding-top: 14px; display: flex; justify-content: flex-end; gap: 6px; border-top: 1px solid var(--line); }
.copywriter-submit { margin-top: 2px; }

/* Workspace */
.app-page { min-height: 100dvh; }
.app-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 70px;
  padding: 0 max(24px, calc((100% - 1380px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: oklch(0.965 0.008 82 / .94);
  backdrop-filter: blur(12px);
}
.nav-session { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 12px; }
.quiet-button { border: 0; padding: 7px 9px; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.quiet-button:hover { background: var(--surface-strong); color: var(--ink); }
.app-shell { width: min(1380px, calc(100% - 48px)); margin: auto; padding-bottom: 64px; }
.app-intro {
  padding: 46px 0 36px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 48px;
}
.app-intro h1 { margin: 10px 0 0; max-width: 13ch; font-size: 48px; line-height: 1.03; letter-spacing: -.04em; text-wrap: balance; }
.app-intro > p { max-width: 440px; margin: 0 0 4px; color: var(--ink-soft); font-size: 14px; line-height: 1.7; text-wrap: pretty; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, .68fr); gap: 18px; align-items: start; }
.source-panel, .settings-panel { border-radius: var(--radius-md); background: var(--surface); }
.source-panel { padding: 28px; box-shadow: 0 4px 8px oklch(0.25 0.01 255 / .08); }
.settings-panel { position: sticky; top: 88px; padding: 28px; border: 1px solid var(--line); }
.panel-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 22px; }
.panel-head h2 { margin: 5px 0 0; font-size: 21px; letter-spacing: -.025em; }
.drop-zone {
  min-height: 164px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border: 1px dashed oklch(0.66 0.02 255);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  cursor: pointer;
  transition: transform .2s var(--ease-out), border-color .2s ease, background .2s ease;
}
.drop-zone:hover, .drop-zone.is-dragging, .drop-zone.has-file { border-color: var(--accent); background: oklch(0.95 0.018 258); transform: translateY(-2px); }
.drop-zone input { position: absolute; width: 1px; opacity: 0; }
.file-glyph { display: grid; place-items: center; width: 52px; height: 58px; border-radius: 8px; background: var(--ink); color: var(--surface); font: 750 12px/1 ui-monospace, Menlo, monospace; }
.drop-zone small, .strength-option small { color: var(--muted); }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: 11px; }
.or::before, .or::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.source-panel textarea {
  width: 100%;
  min-height: 330px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  resize: vertical;
  background: oklch(0.225 0.012 255);
  color: oklch(0.94 0.004 82);
  font: 13px/1.75 ui-monospace, "SFMono-Regular", Menlo, monospace;
  caret-color: oklch(0.78 0.12 82);
}
.source-panel textarea::placeholder { color: oklch(0.72 0.008 255); }
.strength-field { border: 0; padding: 0; margin: 23px 0; }
.strength-option { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.strength-option input { accent-color: var(--accent); }
.strength-option span { display: grid; gap: 3px; }
.strength-option b { font-size: 13px; }
.strength-option small { font-size: 10px; }
.strength-option em { color: var(--accent); font-size: 10px; font-style: normal; font-weight: 700; }

@keyframes letter-assemble {
  0% { opacity: 0; transform: translate3d(var(--fly-x), var(--fly-y), -120px) rotateX(var(--roll-x)) rotateY(var(--roll-y)) rotateZ(var(--roll-z)) scale(.58); filter: blur(7px); }
  64% { opacity: 1; transform: translate3d(0, 0, 0) rotateX(-8deg) rotateY(5deg) rotateZ(-2deg) scale(1.085); filter: blur(0); }
  82% { transform: translate3d(0, 0, 0) rotateX(3deg) rotateY(-2deg) rotateZ(1deg) scale(.975); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0) rotateY(0) rotateZ(0) scale(1); filter: blur(0); }
}
@keyframes check-in { to { opacity: 1; transform: translateY(0); } }
@keyframes cursor-blink { 50% { opacity: 0; } }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes boot-away { to { opacity: 0; visibility: hidden; transform: scale(1.015); } }
@keyframes player-in { from { opacity: 0; transform: translate3d(var(--drag-x), calc(var(--drag-y) + 12px), 0); } to { opacity: 1; transform: translate3d(var(--drag-x), var(--drag-y), 0); } }
@keyframes cover-spin { to { transform: rotate(360deg); } }
@keyframes music-bar { from { transform: scaleY(.45); } to { transform: scaleY(1.55); } }
@keyframes button-ripple { to { opacity: 0; transform: translate(-50%, -50%) scale(22); } }
@keyframes sigil-pulse { to { background: oklch(0.97 0.006 82 / .31); transform: scale(.92); } }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loading-sheen { to { background-position: -220% 0; } }
@keyframes scene-drift { from { transform: scale(1.035) translate3d(-.6%, 0, 0); } to { transform: scale(1.07) translate3d(.8%, -.5%, 0); } }
@keyframes water-light { from { transform: translate3d(-2%, 0, 0) scaleX(.95); opacity: .5; } to { transform: translate3d(8%, -2%, 0) scaleX(1.08); opacity: 1; } }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr); }
  .story-copy h1 { font-size: 42px; }
  .workspace { grid-template-columns: 1fr; }
  .copywriter-shell { grid-template-columns: 1fr; }
  .copywriter-output { min-height: 480px; }
  .settings-panel { position: static; }
  .app-intro { align-items: start; flex-direction: column; gap: 18px; }
}

@media (max-width: 1024px), (pointer: coarse) {
  .music-player { grid-template-columns: 38px 30px minmax(60px, auto) minmax(46px, 1fr) 32px 18px; padding-right: 7px; }
  .music-drag-handle { display: grid; }
}

@media (max-width: 680px) {
  .login-shell { min-height: 100dvh; display: block; overflow: visible; background: var(--canvas); }
  .login-scene { position: absolute; inset: 0 0 auto; height: 42dvh; background-position: 38% center; animation-duration: 18s; }
  .login-shell::before { height: 42dvh; background: linear-gradient(0deg, oklch(0.14 0.018 255 / .56), oklch(0.14 0.018 255 / .18)); }
  .login-shell::after { top: 18dvh; bottom: auto; width: 100%; height: 22dvh; }
  .login-story { min-height: 42dvh; padding: 22px 20px 28px; }
  .story-copy { padding: 34px 0 0; }
  .story-copy h1 { margin: 10px 0 0; font-size: 29px; line-height: 1.12; }
  .story-copy > p:last-child, .security-strip { display: none; }
  .login-panel { min-height: 58dvh; place-items: start stretch; padding: 26px 20px 112px; box-shadow: none; }
  .login-card { width: 100%; max-width: 520px; margin: 0 auto; }
  .login-card h2 { margin-top: 18px; margin-bottom: 8px; font-size: 29px; }
  .login-card > p { margin-bottom: 18px; line-height: 1.5; }
  .login-card .field { margin-bottom: 14px; }
  .login-card .machine-row { margin: 12px 0 14px; padding: 10px 0; }
  .app-nav { height: 62px; padding: 0 14px; }
  .brand-word { font-size: 15px; }
  .nav-session { gap: 6px; }
  .nav-session #session-label { display: none; }
  .app-shell { width: calc(100% - 24px); padding-bottom: 36px; }
  .app-intro { padding: 32px 2px 26px; }
  .app-intro h1 { font-size: 35px; }
  .source-panel, .settings-panel { padding: 19px; }
  .source-panel textarea { min-height: 280px; }
  .panel-head { margin-bottom: 18px; }
  .boot-inner { width: calc(100% - 40px); }
  .boot-word { font-size: 46px; }
  .music-player { left: 10px; bottom: 8px; width: min(330px, calc(100% - 20px)); min-height: 50px; grid-template-columns: 36px 28px minmax(58px, auto) 1fr 30px 16px; padding: 6px; gap: 6px; }
  .music-cover { width: 36px; height: 36px; }
  .music-cover::after { inset: 14px; }
  .music-toggle { width: 28px; height: 28px; }
  .music-drag-handle { width: 16px; }
  .app-page { padding-bottom: 76px; }
  .tool-switch { width: 100%; }
  .tool-tab { min-width: 0; flex: 1; }
  .copywriter-form, .copywriter-output { padding: 19px; }
  .copywriter-fields, .advanced-grid { grid-template-columns: 1fr; gap: 0; }
  .copywriter-empty, .copywriter-loading, .copywriter-result { min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .login-scene, .login-shell::after { animation: none !important; }
  .boot-word span, .boot-checks span { opacity: 1; transform: none; filter: none; animation: none !important; }
  .boot-progress::after { animation-duration: .55s; animation-delay: 0s; }
  .boot-sequence { animation-duration: .25s; animation-delay: .65s; }
  .type-cursor { animation: none; opacity: .7; }
  .music-player { animation: none; }
  .music-cover, .music-bars i, .login-submit.is-loading .button-sigil, .button-ripple, .tool-panel, .copywriter-loading i { animation: none !important; }
  .primary-button, .drop-zone { transition-duration: .01ms; }
}
