:root {
  --accent: #8b5cf6;
  --accent-2: #3b82f6;
  --accent-3: #22d3ee;
  --accent-hover: #a78bfa;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-muted: rgba(139, 92, 246, 0.35);
  --bg: #0c0c10;
  --bg-elevated: rgba(22, 22, 28, 0.92);
  --bg-card: rgba(28, 28, 36, 0.75);
  --ink: #f4f4f5;
  --ink-secondary: #a1a1aa;
  --muted: #71717a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --panel: rgba(22, 22, 28, 0.95);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 60px rgba(139, 92, 246, 0.15);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --danger: #f87171;
  --success: #4ade80;
  --warn-bg: rgba(250, 204, 21, 0.12);
  --warn-ink: #facc15;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 工作台：整页不滚，仅对话 log 区滚动 */
body.studio-mode {
  height: 100vh;
  overflow: hidden;
}

body.studio-mode .stage {
  height: 100vh;
  max-height: 100vh;
  max-width: 1360px;
  overflow: hidden;
  padding-bottom: 12px;
  gap: 8px;
}

body.studio-mode .brand {
  padding: 10px 4px;
}

body.studio-mode .site-foot {
  display: none;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(139, 92, 246, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(59, 130, 246, 0.18), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(34, 211, 238, 0.08), transparent 45%);
}

button,
textarea,
input,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 4px;
  background: rgba(12, 12, 16, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.45);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  transform: rotate(45deg);
}

.brand-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand-ai {
  font-weight: 500;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.ready {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 55%;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  font-size: 11px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  white-space: nowrap;
}

.status-pill.ok {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.35);
  color: #86efac;
}

.status-pill.warn {
  background: var(--warn-bg);
  border-color: rgba(250, 204, 21, 0.35);
  color: var(--warn-ink);
}

.catalog {
  padding-top: 8px;
}

.hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 36px 28px 32px;
  margin-bottom: 28px;
  background: linear-gradient(145deg, rgba(28, 28, 36, 0.95) 0%, rgba(18, 18, 24, 0.98) 100%);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25), transparent 70%);
  pointer-events: none;
}

.hero-kicker {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-3);
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  background: linear-gradient(180deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 0 20px;
  max-width: 40em;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.75;
}

.hero-skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-muted);
  font-size: 13px;
  color: #ddd6fe;
}

.hero-skill-pill .pill-icon {
  color: var(--accent-3);
  font-size: 10px;
}

.hero-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.hero-steps li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.hero-steps .step-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.hero-steps strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.hero-steps li > span:last-child {
  font-size: 12px;
  color: var(--muted);
}

.section-label {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.skill-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 172px;
  padding: 20px 18px 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: inherit;
  text-align: left;
  backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.skill-card:hover {
  border-color: var(--accent-muted);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.skill-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.skill-card .name {
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}

.skill-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-soft), rgba(59, 130, 246, 0.15));
  border: 1px solid var(--accent-muted);
  color: #c4b5fd;
}

.skill-card .desc {
  color: var(--ink-secondary);
  flex: 1;
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skill-card .use {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.skill-card .use-cta {
  font-size: 14px;
  font-weight: 500;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.skill-card .use-cta::after {
  content: " →";
  -webkit-text-fill-color: var(--accent-2);
}

.skill-card .tag {
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
}

.docs-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.docs-bar h2 {
  flex: 1;
}

.docs-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  min-height: 60vh;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
}

.docs-nav button {
  text-align: left;
  background: transparent;
  color: var(--ink-secondary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
}

.docs-nav button:hover {
  background: rgba(255, 255, 255, 0.04);
}

.docs-nav button.on {
  color: var(--accent-3);
  background: var(--accent-soft);
  font-weight: 500;
}

.docs-body {
  overflow: auto;
  max-height: 72vh;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.docs-body .path {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.docs-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--ink);
}

.docs-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.docs-pick a {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--ink-secondary);
}

.docs-pick a.on {
  border-color: var(--accent-muted);
  color: var(--accent-3);
  background: var(--accent-soft);
}

@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.work {
  flex: 1;
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr) 248px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px 12px;
  min-height: 0;
  overflow: hidden;
}

body.studio-mode .work {
  flex: 1;
  min-height: 0;
}

.studio-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.studio-bar h2 {
  flex: 1;
  font-size: 16px;
}

.sessions {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  gap: 10px;
}

.sessions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sessions-head h2 {
  font-size: 13px;
  color: var(--ink-secondary);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.sessions-new {
  padding: 4px 10px;
  font-size: 12px;
}

.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.session-open {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 10px 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.12s, border-color 0.12s;
}

.session-open:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.session-open.on {
  border-color: var(--accent-muted);
  background: var(--accent-soft);
}

.session-del {
  flex-shrink: 0;
  width: 32px;
  align-self: stretch;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}

.session-row:hover .session-del,
.session-del:focus {
  opacity: 1;
  border-color: var(--line);
  background: rgba(248, 113, 113, 0.08);
  color: #f87171;
}

.session-list .stitle {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.session-list .smeta {
  color: var(--muted);
  font-size: 11px;
}

.thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.thread-head {
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.flow-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.flow-panel {
  flex-shrink: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.flow-caption {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--ink-secondary);
}

.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
}

.flow-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.flow-step.current {
  border-color: var(--accent-muted);
  color: #c4b5fd;
  background: var(--accent-soft);
}

.flow-step.done {
  border-color: rgba(74, 222, 128, 0.35);
  color: var(--success);
}

.flow-dot {
  font-size: 10px;
  width: 12px;
  text-align: center;
}

.flow-sep {
  color: var(--muted);
  font-size: 11px;
  padding: 0 2px;
  list-style: none;
}

.skill-gate {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 12px;
  line-height: 1.5;
}

.skill-gate[hidden] {
  display: none;
}

.composer-dock {
  margin-bottom: 8px;
  padding: 0;
}

.composer-dock[hidden] {
  display: none !important;
}

.composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.composer-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.voice-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.voice-picker-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.voice-picker-box {
  position: relative;
  width: 118px;
  max-width: 34vw;
}

.voice-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

#voice-picker-current {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.voice-picker-trigger:hover,
.voice-picker-box.open .voice-picker-trigger {
  border-color: var(--accent-muted);
}

.voice-picker-trigger:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.voice-picker-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.voice-picker-box.open .voice-picker-chevron {
  transform: rotate(-135deg) translateY(2px);
}

.voice-picker-menu {
  position: absolute;
  z-index: 40;
  bottom: calc(100% + 6px);
  left: 0;
  width: 168px;
  max-height: min(280px, 38vh);
  margin: 0;
  padding: 4px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #18181f;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  opacity: 1;
}

.voice-picker-menu .voice-picker-item.on {
  background: #2a2438;
}

.voice-picker-menu .voice-picker-item-name:hover {
  background: #252530;
}

.voice-picker-menu .voice-picker-play {
  background: #101014;
}

.voice-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 2px 2px 2px 4px;
  border-radius: var(--radius-md);
  font-size: 12px;
}

.voice-picker-item.on {
  background: rgba(139, 92, 246, 0.12);
}

.voice-picker-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 4px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-md);
}

.voice-picker-item-name:hover {
  background: rgba(255, 255, 255, 0.06);
}

.voice-picker-item.on .voice-picker-item-name {
  color: #c4b5fd;
  font-weight: 600;
}

.voice-picker-item-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.voice-picker-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  color: #a5f3fc;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.voice-picker-item.pending {
  opacity: 0.92;
}

.voice-picker-item.pending .voice-picker-tag {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
}

.voice-picker-play:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.voice-picker-play {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 8px;
  color: var(--accent-3);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.voice-picker-play:hover {
  border-color: var(--accent-muted);
  background: rgba(139, 92, 246, 0.18);
}

.voice-picker-play.is-playing {
  border-color: var(--accent-muted);
  background: var(--accent-soft);
  animation: voice-preview-pulse 0.9s ease-in-out infinite;
}

@keyframes voice-preview-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.composer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.composer-chip:hover {
  border-color: var(--accent-muted);
}

.composer-chip.open,
.composer-chip.has-file {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.1);
}

.composer-chip-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.composer-chip-value {
  font-size: 12px;
  font-weight: 600;
  max-width: 5.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-chip-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 9px;
  color: var(--accent-3);
  flex-shrink: 0;
}

.composer-chip-play.is-playing {
  border-color: var(--accent-muted);
  background: var(--accent-soft);
}

.composer-chip-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.composer-chip-thumb img,
.composer-chip-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-chip-plus {
  font-size: 16px;
  color: var(--muted);
  line-height: 1;
}

.composer-voice-panel {
  margin-top: 6px;
  max-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.composer-voice-panel[hidden] {
  display: none !important;
}

.voice-list-compact {
  max-height: none;
}

.session-uploads {
  margin-top: 8px;
}

.composer.locked .form-row {
  opacity: 0.45;
  pointer-events: none;
}

.session-slot {
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  margin-bottom: 10px;
}

.session-slot-head {
  margin-bottom: 8px;
}

.session-slot-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.session-slot-sub {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.voice-slot-hint {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--muted);
}

.voice-slot-err {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--danger);
}

.voice-slot-err[hidden] {
  display: none;
}

.voice-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-muted);
  background: var(--accent-soft);
}

.voice-current-cap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.voice-current-cap strong {
  font-size: 14px;
}

.voice-current-desc {
  font-size: 11px;
  color: var(--ink-secondary);
}

.voice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.voice-list-compact .voice-option {
  padding: 5px 8px;
}

.voice-list-compact .voice-option-desc {
  display: none;
}

.voice-list-compact .voice-bar {
  height: 28px;
  min-width: 56px;
}

.voice-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}

.voice-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.voice-option.on {
  border-color: var(--accent-muted);
  background: rgba(139, 92, 246, 0.12);
}

.voice-option-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.voice-option-name {
  font-size: 13px;
  font-weight: 500;
}

.voice-option-desc {
  font-size: 11px;
  color: var(--muted);
}

.voice-play-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.voice-bar {
  display: flex;
  align-items: center;
  height: 36px;
  min-width: 72px;
  max-width: 220px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px 16px 16px 16px;
  background: rgba(18, 16, 22, 0.85);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.voice-bar:active {
  filter: brightness(1.08);
}

.voice-ico {
  display: flex;
}

.voice-ico .vw2,
.voice-ico .vw3 {
  opacity: 0.35;
}

.voice-play-row.is-playing .vw2 {
  animation: voice-arc 1s ease-in-out infinite;
}

.voice-play-row.is-playing .vw3 {
  animation: voice-arc 1s ease-in-out 0.2s infinite;
}

@keyframes voice-arc {
  0%,
  100% {
    opacity: 0.2;
  }
  45% {
    opacity: 1;
  }
}

.voice-sec {
  font-size: 12px;
  color: var(--ink-secondary);
  min-width: 2.5em;
}

.session-media-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-media-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.session-media-item.has-file {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.08);
}

.session-media-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.session-media-label {
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.session-media-state {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-media-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.session-media-btn {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-secondary);
  cursor: pointer;
}

.session-media-btn:hover {
  border-color: var(--accent-muted);
  color: var(--accent-3);
}

.back,
.studio-bar button,
.chip,
.file,
.sessions-new {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.studio-bar button#create-video {
  color: var(--accent-3);
  border-color: var(--accent-muted);
  background: var(--accent-soft);
  font-weight: 600;
}

.back:hover,
button:hover,
.file:hover {
  border-color: var(--accent-muted);
  color: var(--accent-3);
}

.chip {
  background: var(--accent-soft);
  border-color: transparent;
  color: #c4b5fd;
  font-weight: 500;
}

.chip:hover {
  background: rgba(139, 92, 246, 0.22);
  color: #e9d5ff;
}

.log {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
}

.msg {
  max-width: 88%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg.assistant {
  align-self: flex-start;
}

.msg.user {
  align-self: flex-end;
}

.msg-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 4px;
}

.msg.user .msg-label {
  text-align: right;
}

.msg p {
  margin: 0;
  padding: 12px 16px;
  white-space: pre-wrap;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.6;
}

.msg.assistant p {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
}

.msg.user p {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
}

.msg .tool {
  color: var(--muted);
  font-size: 12px;
  padding: 0 4px;
}

.msg.error p {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: var(--danger);
}

.composer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding: 8px 12px 10px;
  background: rgba(12, 12, 16, 0.5);
}

.chips,
.attach {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.attach span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-secondary);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

#form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-zone-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-skill {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.06);
}

.file-session {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(139, 92, 246, 0.08);
}

.session-zone {
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.15);
}

.voice-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.voice-pick-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.voice-pick select {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-size: 12px;
}

.file::before {
  content: "↑";
  font-weight: 600;
  color: var(--accent-3);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: flex-end;
}

textarea {
  resize: none;
  min-height: 48px;
  max-height: 120px;
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

textarea:focus {
  outline: none;
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea::placeholder {
  color: var(--muted);
}

#form button[type="submit"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  min-width: 80px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.35);
  transition: transform 0.1s, box-shadow 0.12s;
}

#form button[type="submit"]:hover {
  box-shadow: 0 6px 28px rgba(139, 92, 246, 0.45);
}

#form button[type="submit"]:active {
  transform: scale(0.98);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.skill-dock {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 12px;
}

.skill-dock {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

body.studio-mode .side-panel {
  max-height: 100%;
}

body.studio-mode .skill-dock {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.skill-dock-body {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  padding-right: 2px;
}

.skill-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.18);
}

.skill-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.skill-block-head h3 {
  margin: 0;
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.skill-block-tag {
  font-size: 10px;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
}

.file-add {
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--accent-3);
  background: rgba(34, 211, 238, 0.08);
}

.file-add:hover {
  border-color: rgba(34, 211, 238, 0.55);
}

.skill-block-empty {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.skill-block-empty[hidden] {
  display: none;
}

.thumb-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thumb-grid:not(:empty) + .skill-block-empty {
  display: none;
}

.thumb-tile {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.thumb-tile img,
.thumb-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-video {
  position: relative;
  width: 100%;
  height: 100%;
}

.thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.thumb-grid-video .thumb-tile {
  border-color: rgba(139, 92, 246, 0.35);
}

.thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}

.thumb-tile:hover .thumb-del,
.thumb-del:focus {
  opacity: 1;
}

.skill-block-info textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  max-height: 160px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
}

.skill-info-hint {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.skill-info-save {
  margin-top: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.skill-info-save:hover {
  background: rgba(34, 211, 238, 0.16);
}

.skill-dock-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.skill-dock-note {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.msg-media {
  margin-top: 8px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  max-width: min(100%, 320px);
}

.msg.user .msg-media {
  margin-left: auto;
}

.msg-media img,
.msg-media video {
  width: 100%;
  max-height: min(48vh, 380px);
  object-fit: contain;
  display: block;
  background: #000;
}

.msg-media audio {
  width: 100%;
  display: block;
  padding: 8px;
  box-sizing: border-box;
}

.msg-media-cap {
  display: block;
  font-size: 11px;
  color: var(--muted);
  padding: 6px 8px;
  border-top: 1px solid var(--line);
}

.choice-prompts {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.1);
}

.choice-prompts-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: #c4b5fd;
  line-height: 1.45;
}

.choice-prompts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-btn {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(139, 92, 246, 0.45);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  cursor: pointer;
}

.choice-btn:hover {
  border-color: var(--accent-muted);
  background: rgba(139, 92, 246, 0.22);
  color: #e9d5ff;
}

.empty {
  color: var(--muted);
  font-size: 12px;
  padding: 8px 10px;
  line-height: 1.45;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}

.site-foot {
  margin-top: auto;
  padding-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.site-foot .dot {
  opacity: 0.5;
  margin: 0 6px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .work {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  body.studio-mode {
    overflow: hidden;
  }

  body.studio-mode .work {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .thread {
    min-height: min(56vh, 480px);
    height: auto;
    max-height: none;
  }

  .sessions {
    max-height: 160px;
  }

  .ready {
    max-width: 100%;
    justify-content: flex-start;
  }

  .brand {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  #form button[type="submit"] {
    width: 100%;
  }

  .hero {
    padding: 28px 20px;
  }
}
