:root {
  --ink: #17213c;
  --muted: #68718a;
  --line: #e7e9f1;
  --surface: #ffffff;
  --page: #f4f5f9;
  --accent: #635bff;
  --accent-dark: #4d45e6;
  --accent-soft: #efefff;
  --success: #17855b;
  --warning: #a46600;
  --danger: #b42318;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(99, 91, 255, .12), transparent 34rem),
    var(--page);
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15em;
}

h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.04em; }
.subtitle { margin: 10px 0 0; color: var(--muted); }

.status {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status.active { color: var(--success); border-color: #b8e1d0; background: #edfbf5; }
.hero-actions { display: flex; align-items: center; gap: 10px; }
.release { padding: 9px 13px; border: 1px solid #f1b7b2; border-radius: 999px; color: var(--danger); background: #fff6f5; font-weight: 700; }
.release:hover { background: #fff0ee; }

.start-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px 28px;
  padding: 28px;
  border: 1px solid rgba(99, 91, 255, .18);
  border-radius: 20px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 18px 60px rgba(29, 34, 70, .08);
}

.start-panel h2 { margin: 0 0 6px; }
.start-panel p { margin: 0; color: var(--muted); }
.notice { grid-column: 1 / -1; min-height: 20px; color: var(--danger) !important; }

.primary, .send, .confirm-button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  transition: transform .15s ease, background .15s ease;
}

.primary { padding: 13px 22px; }
.send { padding: 11px 20px; }
.confirm-button { padding: 10px 16px; margin-top: 12px; }
.primary:hover, .send:hover, .confirm-button:hover { background: var(--accent-dark); transform: translateY(-1px); }

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 650px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(29, 34, 70, .10);
}

.sidebar { padding: 24px; border-right: 1px solid var(--line); background: #fafaff; }
.sidebar-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; font-weight: 800; }
.sidebar-title small { color: var(--muted); font-size: 11px; font-weight: 500; }
.orders { display: grid; gap: 9px; }

.order-card {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.order-card strong { display: block; font-size: 13px; }
.order-card code { color: var(--muted); font-size: 12px; }
.try-title { margin: 28px 0 10px; font-size: 13px; font-weight: 800; }
.suggestions { display: grid; gap: 8px; }

.suggestions button {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
  color: #464f69;
  background: white;
}

.suggestions button:hover { border-color: #b9b5ff; color: var(--accent); }

.chat-card { display: flex; min-width: 0; flex-direction: column; }
.messages { flex: 1; min-height: 480px; max-height: 590px; overflow-y: auto; padding: 26px; }

.message { display: flex; gap: 10px; margin-bottom: 18px; align-items: flex-start; }
.message.user { flex-direction: row-reverse; }
.avatar {
  display: grid;
  flex: 0 0 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.user .avatar { background: #17213c; color: white; }
.bubble {
  max-width: min(620px, 82%);
  padding: 12px 14px;
  border-radius: 6px 16px 16px 16px;
  background: #f2f3f8;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.user .bubble { border-radius: 16px 6px 16px 16px; background: var(--accent); color: white; }
.handoff .bubble { border: 1px solid #f4c7c3; background: #fff2f0; color: var(--danger); }

.action-card {
  margin: 0 26px 18px 68px;
  padding: 16px;
  border: 1px solid #c9c6ff;
  border-radius: 14px;
  background: #f7f6ff;
}

.action-card h3 { margin: 0 0 8px; font-size: 15px; }
.action-card p { margin: 4px 0; color: #505a73; font-size: 13px; }
.action-result { margin-top: 10px !important; color: var(--success) !important; font-weight: 700; }

.progress { display: flex; align-items: center; gap: 9px; padding: 0 26px 14px; color: var(--muted); font-size: 13px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.78); } }

.composer { display: flex; gap: 10px; padding: 18px 20px 8px; border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; padding: 11px 13px; border: 1px solid #d8dbe6; border-radius: 12px; outline: none; }
.composer input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 91, 255, .12); }
.limit { margin: 0; padding: 0 22px 15px; color: #9298aa; font-size: 11px; }

.hidden { display: none !important; }
.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; }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 1120px); padding-top: 24px; }
  .hero { display: block; }
  .status { display: inline-block; margin-top: 16px; }
  .hero-actions { justify-content: space-between; }
  .start-panel { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .orders { grid-template-columns: 1fr 1fr; }
  .suggestions { grid-template-columns: 1fr 1fr; }
  .messages { min-height: 360px; }
}
