:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #172033;
  --muted: #667085;
  --line: #dfe5ee;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --ok: #0f766e;
  --danger: #dc2626;
  --shadow: 0 18px 50px rgba(21, 31, 55, 0.10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, #e0ecff 0, transparent 34%), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, textarea { font: inherit; }
button {
  border: 0;
  border-radius: 14px;
  background: #e8eef8;
  color: var(--text);
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
button:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-dark); }
.app-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
}
.hero > div, .panel, .side-panel, .chat-panel, .artifact-panel {
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(214, 222, 235, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.hero > div { border-radius: 28px; padding: 30px; }
.hero h1 { margin: 8px 0 12px; font-size: clamp(30px, 4vw, 52px); line-height: 1.05; letter-spacing: 0; }
.hero-text { max-width: 720px; color: var(--muted); font-size: 17px; line-height: 1.8; }
.eyebrow { margin: 0; color: var(--primary); font-size: 12px; font-weight: 900; letter-spacing: .18em; }
.status-card { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.status-card span, .status-card small { color: var(--muted); }
.status-card strong { font-size: 26px; }
.panel { border-radius: 24px; padding: 24px; margin-top: 18px; }
.panel-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.badge { display: inline-flex; border-radius: 999px; padding: 8px 12px; background: #eef4ff; color: var(--primary); font-weight: 800; white-space: nowrap; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 18px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: #fff;
  color: var(--text);
  padding: 13px 14px;
}
textarea { resize: vertical; min-height: 110px; line-height: 1.7; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.side-panel, .chat-panel, .artifact-panel { border-radius: 24px; padding: 18px; }
.side-panel dl { display: grid; gap: 14px; margin: 20px 0 0; }
.side-panel div { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 5px 0 0; font-weight: 800; }
.progress-list { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.progress-list li {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}
.progress-list li.active { border-color: rgba(37, 99, 235, .35); background: #eef4ff; color: var(--primary); }
.progress-list li.done { border-color: rgba(15, 118, 110, .22); background: #ecfdf5; color: var(--ok); }
.hint { margin-top: 18px; border-radius: 16px; padding: 12px; background: #fff7ed; color: #9a3412; line-height: 1.6; font-size: 13px; }
.messages { height: 520px; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 6px; }
.msg { max-width: 86%; border-radius: 18px; padding: 13px 15px; line-height: 1.7; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--panel-soft); border: 1px solid var(--line); }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; }
.msg.system { align-self: center; background: #ecfdf5; color: var(--ok); }
.composer { margin-top: 14px; display: grid; gap: 10px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-actions button {
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 800;
}
.artifact-panel { display: grid; gap: 14px; }
.artifact-section { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: var(--panel-soft); }
.artifact-section h3 { margin: 0 0 10px; }
.artifact-section p, .artifact-section pre { margin: 0; color: var(--muted); line-height: 1.7; white-space: pre-wrap; word-break: break-word; font-family: inherit; }
.action-row { display: grid; gap: 10px; }
.result-card { margin-top: 18px; border: 1px solid var(--line); border-radius: 20px; padding: 18px; background: var(--panel-soft); }
audio { width: 100%; margin: 12px 0; }
.download { color: var(--primary); font-weight: 800; text-decoration: none; }
.cover {
  width: min(280px, 100%);
  aspect-ratio: 1;
  display: block;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 18px 36px rgba(23, 32, 51, .14);
  margin: 14px 0;
}
.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 6px 0 18px;
}
.copy-row button {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 13px;
}
.readonly-note {
  margin-top: 18px;
  border: 1px solid rgba(15, 118, 110, .22);
  border-radius: 18px;
  background: #ecfdf5;
  color: var(--ok);
  padding: 14px;
  line-height: 1.7;
  font-weight: 700;
}
.hidden { display: none !important; }

@media (max-width: 980px) {
  .hero, .workspace { grid-template-columns: 1fr; }
  .messages { height: 420px; }
}
