:root {
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --blue: #13a873;
  --blue-deep: #07865d;
  --blue-soft: #edf8f3;
  --yellow: #e9c96f;
  --yellow-soft: #fff5d3;
  --red: #d9535d;
  --cream: #f2f4f3;
  --cream-deep: #e9edeb;
  --paper: #ffffff;
  --ink: #17201d;
  --ink-light: #53615c;
  --ink-faint: #85908b;
  --line: rgba(23, 32, 29, .09);
  --line-strong: rgba(23, 32, 29, .15);
  --shadow-sm: 0 2px 12px rgba(32, 36, 48, .05);
  --shadow-md: 0 14px 40px rgba(32, 36, 48, .09);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--cream);
  font: 14px/1.55 var(--font-ui);
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--yellow); color: var(--ink); }

button, input, textarea { font: inherit; }

button {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-light);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

button:hover { border-color: rgba(19, 168, 115, .35); color: var(--blue-deep); background: var(--blue-soft); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(19, 168, 115, .16); outline-offset: 1px; }

.primary, .send {
  background: var(--blue);
  color: #fffef8;
  border-color: var(--blue);
  box-shadow: 0 6px 16px rgba(19, 168, 115, .2);
}

.primary:hover, .send:hover { background: var(--blue-deep); color: #fffef8; border-color: var(--blue-deep); }
.hidden { display: none !important; }

.app {
  height: 100vh;
  display: grid;
  grid-template-columns: clamp(206px, 16vw, 238px) minmax(500px, 1fr) minmax(330px, 34vw);
  background: var(--cream);
}

.sidebar {
  min-height: 0;
  padding: clamp(18px, 2vw, 26px) 14px 16px;
  display: flex;
  flex-direction: column;
  color: #f4f7f5;
  background: #101b17;
  border-right: 1px solid #26332e;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border: 2px solid var(--blue);
  border-radius: 14px 11px 14px 10px;
  background: var(--yellow);
  color: var(--ink);
  display: grid;
  place-items: center;
  font: 750 20px/1 var(--font-display);
  transform: rotate(-1.5deg);
  box-shadow: 3px 3px 0 rgba(19, 168, 115, .18);
}
.brand b { display: block; font: 700 17px/1.25 var(--font-display); letter-spacing: -.01em; color:#fff; }
.brand small { display: block; margin-top: 3px; color: #8ca098; font-size: 9px; font-weight: 700; letter-spacing: 2px; }

.skills { display: grid; gap: 5px; overflow: auto; padding-right: 2px; }
.skill {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #b8c3be;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  text-align: left;
  padding: 8px;
  border-radius: 12px;
}
.skill:hover { background: #192823; border-color: #2b3a34; transform: none; }
.skill.active { background: #20352e; border-color: #315046; color: #fff; box-shadow: none; }
.skill i {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #24322d;
  color: #d5ded9;
  display: grid;
  place-items: center;
  font-style: normal;
}
.skill.active i { background: var(--blue); color: #fffef8; }
.skill:nth-child(3n+2).active i { background: var(--yellow); color: var(--ink); }
.skill:nth-child(3n).active i { background: var(--red); color: #fffef8; }
.skill b, .skill small { display: block; }
.skill b { font-size: 12px; font-weight: 700; }
.skill small { margin-top: 1px; color: #7f9189; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-actions { margin-top: auto; padding-top: 13px; border-top: 1px solid #293630; display: grid; gap: 7px; }
.side-actions button { background: #17241f; border-color: #2d3c36; color: #b8c2bd; text-align: left; }
.side-actions button:hover { background: #20352e; border-color: #3a5047; color:#fff; }
.side-actions .shop { color: #f0d48a; background: #17241f; border-color: #4a4430; }

.chat {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px 1fr auto;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.topbar, .preview > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 clamp(18px, 2vw, 26px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, .96);
}
.topbar h1 { margin: 0; font: 680 16px/1.2 var(--font-display); letter-spacing: -.015em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(19, 168, 115, .12); }
.user { max-width: 180px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.messages { overflow: auto; padding: clamp(22px, 4vw, 48px) clamp(24px, 5vw, 64px); scroll-behavior: smooth; }
.intro { max-width: 640px; }
.intro h2 { margin: 6px 0 8px; font: 720 clamp(1.45rem, 2.3vw, 2rem)/1.28 var(--font-display); letter-spacing: -.035em; }
.intro p { margin: 0; color: var(--ink-light); font-size: 13px; }
.eyebrow { display: inline-block; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0 15px;
  padding: 12px;
  background: var(--cream-deep);
  border: 1px dashed rgba(19, 168, 115, .22);
  border-radius: 12px;
}
.steps span { padding: 5px 9px; background: var(--paper); border-radius: 8px; color: var(--ink-light); font-size: 11px; box-shadow: 0 1px 3px rgba(26, 26, 46, .04); }
.steps span:first-child { background: var(--yellow-soft); color: var(--ink); }

.prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; max-width: 720px; }
.prompt { min-height: 64px; padding: 12px 14px; text-align: left; background: var(--paper); border-color: var(--line); border-radius: 12px; }
.prompt:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.prompt small { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 10px; }

.msg { display: flex; margin: 16px 0; }
.msg.user { justify-content: flex-end; }
.bubble { max-width: 84%; padding: 12px 15px; background: var(--cream-deep); color: var(--ink); border-radius: 5px 15px 15px 15px; white-space: pre-wrap; }
.user .bubble { background: var(--yellow); color: var(--ink); border-radius: 15px 5px 15px 15px; }

.composer { padding: 9px clamp(20px, 3vw, 34px) 18px; background: linear-gradient(to top, var(--paper) 78%, rgba(255,254,250,0)); }
.compose-box { border: 1.5px solid var(--line-strong); border-radius: 15px; padding: 10px 11px; background: var(--paper); box-shadow: 0 10px 30px rgba(26, 26, 46, .07); transition: border-color .2s, box-shadow .2s, background .2s; }
.compose-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(19,168,115,.09), 0 12px 32px rgba(23,32,29,.08); }
.compose-box.dragging { border-color: var(--blue); background: var(--blue-soft); }
.compose-box textarea { width: 100%; height: 58px; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); }
.compose-box textarea::placeholder { color: var(--ink-faint); }
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.compose-foot > div { display: flex; gap: 6px; }
.compose-foot button:not(.send) { padding: 6px 9px; border-color: transparent; background: transparent; font-size: 11px; }
.send { width: 38px; height: 38px; padding: 0; border-radius: 11px; font-size: 18px; }
.drop-hint { display: none; padding: 8px; text-align: center; color: var(--blue-deep); font-weight: 700; }
.dragging .drop-hint { display: block; }
.attachments { display: flex; gap: 6px; flex-wrap: wrap; }
.attachment { background: var(--blue-soft); color: var(--blue-deep); border-radius: 7px; padding: 4px 7px; font-size: 10px; }

.preview { min-width: 0; min-height: 0; display: grid; grid-template-rows: 64px 1fr; background: var(--cream-deep); }
.preview > header { padding: 0 clamp(14px, 1.6vw, 22px); background: var(--cream-deep); }
.preview h3 { margin: 0; font: 680 13px/1.2 var(--font-display); letter-spacing: -.01em; }
.preview > header > div { display: flex; gap: 6px; }
.preview > header button { padding: 7px 9px; font-size: 10px; }
.stage {
  overflow: auto;
  padding: clamp(16px, 2.2vw, 28px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  background-image: radial-gradient(circle, rgba(19,168,115,.1) 1px, transparent 1px);
  background-size: 24px 24px;
}
.document {
  width: min(560px, 100%);
  min-height: 500px;
  padding: clamp(22px, 2.5vw, 32px);
  position: relative;
  background: var(--paper);
  border: 1px solid rgba(26, 26, 46, .06);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}
.doc-head { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.doc-head small { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: 1.3px; }
.doc-head h2 { margin: 5px 0 0; font: 720 clamp(1.2rem, 2vw, 1.65rem)/1.3 var(--font-display); letter-spacing: -.025em; }
.doc-head span { height: max-content; padding: 5px 9px; border-radius: 999px; background: var(--yellow-soft); color: #735f0b; font-size: 10px; white-space: nowrap; }
.document > footer { position: absolute; right: 20px; bottom: 13px; color: var(--ink-faint); font-size: 9px; }
.placeholder { min-height: 310px; margin-top: 18px; border: 1px dashed rgba(19,168,115,.24); border-radius: 12px; display: grid; place-items: center; text-align: center; color: var(--ink-faint); background: rgba(237,248,243,.65); }
.placeholder b { display: block; color: var(--ink); font-family: var(--font-display); font-weight: 680; }
.result-card { margin: 12px 0; padding: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.xhs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xhs-card { aspect-ratio: 3/4; padding: 14%; display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); background: var(--yellow-soft); border: 1px solid rgba(244,215,88,.65); border-radius: 10px; }
.xhs-card:nth-child(even) { background: var(--blue-soft); border-color: rgba(19,168,115,.2); }

.modal { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(26, 26, 46, .58); backdrop-filter: blur(5px); }
.modal.open { display: flex; }
.modal > section { width: min(520px, 96vw); max-height: 90vh; overflow: auto; background: var(--cream); border-radius: 16px; box-shadow: 0 24px 80px rgba(20,20,35,.22); }
.modal > section.wide { width: min(850px, 96vw); }
.modal header, .modal footer { padding: 17px 21px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal footer { border: 0; border-top: 1px solid var(--line); justify-content: flex-end; }
.modal h2 { margin: 0; font: 720 18px/1.3 var(--font-display); letter-spacing: -.02em; }
.modal h3 { font-family: var(--font-display); font-weight: 680; letter-spacing: -.015em; }
.modal p { margin: 0; color: var(--ink-light); }
.modal-body { padding: 20px; }
.modal label { display: grid; gap: 5px; margin-bottom: 11px; color: var(--ink-light); font-size: 12px; }
.modal input { width: 100%; border: 1.5px solid var(--line-strong); border-radius: 9px; padding: 10px 12px; outline: 0; background: var(--paper); color: var(--ink); }
.modal input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(19,168,115,.1); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan { position: relative; overflow: hidden; padding: 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.plan::before { content: attr(data-plan); position: absolute; top: -16px; right: 8px; font: 800 4.8rem/1 var(--font-display); color: rgba(19,168,115,.055); text-transform: uppercase; pointer-events: none; }
.plan.recommended { border: 2px solid var(--blue); box-shadow: var(--shadow-sm); }
.price { margin: 9px 0; font: 760 25px/1.2 var(--font-display); letter-spacing: -.025em; }
.plan ul { min-height: 90px; padding-left: 18px; color: var(--ink-light); }
.plan button { width: 100%; }
.note { margin-top: 14px; padding: 12px 14px; background: var(--yellow-soft); border-radius: 10px; color: var(--ink-light); }
.code { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.full { width: 100%; }
.mode-choice { display: grid; gap: 9px; }
.mode-choice label { margin: 0; display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--paper); cursor: pointer; }
.mode-choice label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(19,168,115,.08); }
.mode-choice input { width: auto; margin-top: 3px; accent-color: var(--blue); }
.mode-choice span { display: grid; gap: 3px; }
.mode-choice small { color: var(--ink-light); line-height: 1.5; }
.member-card { display: grid; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.member-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.member-badge { padding: 4px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: 11px; font-weight: 800; }
.member-badge.warn { background: var(--yellow-soft); color: #735f0b; }
.usage-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--line); }
.usage-track span { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.member-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1180px) {
  .app { grid-template-columns: 210px minmax(480px, 1fr) minmax(300px, 31vw); }
  .preview > header button:not(.primary) { display: none; }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 205px 1fr; }
  .preview { display: none; }
}

@media (max-width: 700px) {
  body { overflow: auto; }
  .app { min-height: 100vh; height: auto; grid-template-columns: 66px 1fr; }
  .sidebar { position: sticky; top: 0; height: 100vh; padding-inline: 8px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand-mark { width: 40px; height: 40px; }
  .brand > div, .skill span { display: none; }
  .skill { display: block; padding: 6px; }
  .skill i { margin: auto; }
  .side-actions button { font-size: 0; text-align: center; }
  .side-actions button::first-letter { font-size: 15px; }
  .chat { min-height: 100vh; border-right: 0; }
  .topbar { padding-inline: 14px; }
  .status { display: none; }
  .messages { padding: 22px 18px; }
  .prompts, .plans { grid-template-columns: 1fr; }
  .composer { padding-inline: 14px; }
  .modal { padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
