:root {
  --bg: #eaedf6;
  --bg-soft: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f3f5fb;
  --surface-3: #eef1f8;
  --text: #121829;
  --text-soft: #434c63;
  --muted: #828ba3;
  --line: #e7eaf3;
  --line-strong: #d8ddec;
  --primary: #5a5cf0;
  --primary-2: #8a5cff;
  --primary-ink: #3b34cc;
  --accent: #12b886;
  --accent-ink: #0b8a66;
  --warning: #f59f00;
  --danger: #ef476f;
  --ring: rgba(90, 92, 240, 0.20);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 2px 6px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 10px 30px rgba(25, 35, 75, 0.10);
  --shadow-lg: 0 30px 70px rgba(25, 35, 75, 0.18);
  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Decorative, contained background */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, #f7f9ff 0%, var(--bg) 100%); }
.bg-decor::before,
.bg-decor::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
.bg-decor::before { width: 520px; height: 520px; top: -160px; left: -120px; background: radial-gradient(circle, rgba(90, 92, 240, 0.55), transparent 70%); }
.bg-decor::after { width: 480px; height: 480px; top: -120px; right: -120px; background: radial-gradient(circle, rgba(18, 184, 134, 0.45), transparent 70%); }

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

::selection { background: rgba(90, 92, 240, 0.18); }

.page {
  width: min(1200px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px 12px 14px;
  margin-bottom: 26px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px) saturate(150%);
}

.brand { display: flex; align-items: center; gap: 14px; }

.logo {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 26px rgba(90, 92, 240, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.logo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(160deg, rgba(255, 255, 255, 0.5), transparent 45%); }

.brand h1 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-weight: 800;
}

.subtitle {
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 8px 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.pill b { color: var(--primary-ink); }
button.pill:hover { transform: translateY(-1px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(18, 184, 134, 0.18); }
.pill.good { color: var(--accent-ink); background: rgba(18, 184, 134, 0.10); border-color: rgba(18, 184, 134, 0.22); }
.pill.warn { color: #9a5a12; background: rgba(245, 159, 0, 0.12); border-color: rgba(245, 159, 0, 0.24); }

/* ---------- Hero layout ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(360px, 412px) 1fr;
  gap: 22px;
  align-items: start;
}

.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.profile-card { overflow: visible; position: sticky; top: 96px; display: flex; flex-direction: column; }
.hero.profile-collapsed {
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
}
.hero.profile-collapsed .profile-card {
  overflow: hidden;
}
.hero.profile-collapsed .card-head {
  min-height: calc(100vh - 124px);
  padding: 18px 10px;
  border-bottom: 0;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 18px;
}
.hero.profile-collapsed .card-head h2 {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 15px;
  gap: 8px;
}
.hero.profile-collapsed .card-head h2::before {
  width: 18px;
  height: 6px;
}
.hero.profile-collapsed .mini-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  box-shadow: 0 8px 20px rgba(121, 87, 255, 0.10);
}
.hero.profile-collapsed .mini-btn i {
  font-size: 18px;
  line-height: 1;
  transform: none;
}
.hero.profile-collapsed .mini-btn {
  font-size: 0;
}

.card-head, .chat-title {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 9px;
}
.card-head h2::before {
  content: "";
  width: 6px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(var(--primary), var(--primary-2));
}

.mini-btn {
  border: 1px solid var(--line);
  color: var(--primary-ink);
  background: var(--surface-2);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  touch-action: manipulation;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.mini-btn:hover { background: rgba(90, 92, 240, 0.10); border-color: rgba(90, 92, 240, 0.25); }

.form {
  min-height: 0;
  flex: 1;
  max-height: 2400px;
  opacity: 1;
  overflow: hidden;
  padding: 16px 20px 20px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 12px;
  transform: translateY(0);
  transition: max-height .28s ease, opacity .2s ease, padding .24s ease, transform .24s ease;
}
.profile-card.form-collapsed .form {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
  transform: translateY(-8px);
}
.profile-card:not(.form-collapsed) .form {
  overflow: visible;
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 700;
}

.hint { color: var(--muted); font-weight: 500; font-size: 11.5px; line-height: 1.6; }
.form-primary,
.form-advanced {
  display: grid;
  gap: 12px;
}
.advanced-toggle-wrap {
  display: flex;
  justify-content: stretch;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.advanced-toggle-wrap .advanced-toggle {
  flex: 1;
  justify-content: center;
}
.profile-action-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.profile-action-wrap .advanced-toggle {
  justify-content: center;
}
.advanced-toggle {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(121, 87, 255, 0.18);
  border-radius: 999px;
  background: rgba(121, 87, 255, 0.06);
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
}
.advanced-toggle:hover {
  background: rgba(121, 87, 255, 0.10);
  border-color: rgba(121, 87, 255, 0.28);
  transform: translateY(-1px);
}
.advanced-toggle i {
  font-size: 14px;
  line-height: 1;
  transition: transform .18s ease;
}
/* 折叠时彻底移出布局，避免与底部按钮之间出现双倍间距、把 PC 端表单高度撑高 */
.form-advanced {
  display: none;
}
.form-advanced.show {
  display: grid;
  overflow: visible;
}
.advanced-toggle.expanded i {
  transform: rotate(180deg);
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  outline: none;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
input::placeholder, textarea::placeholder { color: #aab2c6; }
textarea { min-height: 64px; resize: vertical; }
select { appearance: none; padding-right: 28px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--ring);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-soft);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.16s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary-ink); }
.chip.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 18px rgba(90, 92, 240, 0.30);
}

.actions { align-self: end; display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: auto; }

.btn {
  border: 0;
  border-radius: 13px;
  padding: 13px 16px;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); border-color: var(--muted); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 12px 26px rgba(90, 92, 240, 0.32); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(90, 92, 240, 0.40); }
.btn-accent { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-ink)); }

.skill-box {
  margin-top: 2px;
  padding: 13px 14px;
  border: 1px solid rgba(18, 184, 134, 0.22);
  border-radius: 14px;
  background: rgba(18, 184, 134, 0.07);
  color: var(--accent-ink);
  font-size: 12.5px;
  line-height: 1.7;
  display: flex;
  gap: 9px;
}
.skill-box::before { content: "✦"; font-size: 14px; line-height: 1.4; }

/* ---------- Chat ---------- */
.chat-card { min-height: 740px; overflow: hidden; display: flex; flex-direction: column; position: relative; }

.chat-intro {
  position: relative;
  padding: 26px 28px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 200px at 0% 0%, rgba(90, 92, 240, 0.10), transparent 60%),
    radial-gradient(700px 200px at 100% 0%, rgba(18, 184, 134, 0.10), transparent 60%),
    var(--surface);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(90, 92, 240, 0.10);
  border: 1px solid rgba(90, 92, 240, 0.18);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px rgba(90, 92, 240, 0.20); }

.chat-intro h2 {
  margin: 16px 0 8px;
  max-width: 680px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.03em;
  line-height: 1.18;
  font-weight: 800;
}

.chat-intro p { margin: 0; color: var(--text-soft); line-height: 1.7; max-width: 680px; font-size: 14px; }
.chat-intro p b { color: var(--primary-ink); }

.suggestions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }

.suggestions button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.16s ease;
}
.suggestions button:hover { border-color: var(--primary); color: var(--primary-ink); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.messages {
  flex: 1;
  padding: 22px 22px 132px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) center / 100% 100%;
  scroll-padding-bottom: 132px;
}
.messages::-webkit-scrollbar { width: 9px; }
.messages::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--surface-2); }
.messages::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.row { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; animation: pop 0.25s ease; }
.row.me { flex-direction: row-reverse; }
.row.system { justify-content: center; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.avatar.ai { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.avatar.me { background: linear-gradient(135deg, #2b3552, #4a5673); }
.avatar.system { background: linear-gradient(135deg, var(--warning), #f76707); }
.row.system .avatar { display: none; }

.msg {
  max-width: min(660px, calc(100% - 50px));
  padding: 13px 16px;
  border-radius: 16px;
  line-height: 1.7;
  font-size: 14.5px;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}
.msg.ai { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 5px; color: var(--text); white-space: normal; }
.msg.me { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-ink)); border-top-right-radius: 5px; }
.msg.system { max-width: 100%; color: #8a5a12; background: rgba(245, 159, 0, 0.12); border: 1px solid rgba(245, 159, 0, 0.24); text-align: center; }

/* Markdown rendering inside AI bubbles */
.msg.ai > :first-child { margin-top: 0; }
.msg.ai > :last-child { margin-bottom: 0; }
.msg.ai p { margin: 0 0 9px; }
.msg.ai h3, .msg.ai h4, .msg.ai h5, .msg.ai h6 { margin: 13px 0 6px; font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.msg.ai ul, .msg.ai ol { margin: 6px 0 10px; padding-left: 22px; }
.msg.ai li { margin: 4px 0; }
.msg.ai li::marker { color: var(--primary); }
.msg.ai strong { font-weight: 800; }
.msg.ai em { font-style: italic; color: var(--text-soft); }
.msg.ai code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.msg.ai a { color: var(--primary-ink); text-decoration: underline; word-break: break-all; }
.msg.ai hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

.chat-input {
  position: fixed;
  left: calc(320px + 14px + 24px);
  right: 24px;
  bottom: 16px;
  z-index: 24;
  padding: 14px;
  border: 1px solid rgba(223, 228, 239, 0.92);
  border-top: 1px solid rgba(223, 228, 239, 0.92);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(36, 48, 86, 0.12);
  backdrop-filter: blur(14px) saturate(150%);
}
.hero.profile-collapsed .chat-input {
  left: calc(88px + 16px + 24px);
}
.chat-input input { border-radius: 13px; }
.icon-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  border-radius: 13px;
  padding: 0 15px;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 13px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.icon-btn:hover { background: var(--surface-3); border-color: var(--muted); }
.icon-btn.toggle.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 18px rgba(90, 92, 240, 0.28);
}

/* ---------- Footer ---------- */
.footer {
  margin: 30px auto 0;
  width: min(1200px, calc(100% - 36px));
  padding: 16px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.footer b { color: var(--text-soft); }

/* ---------- Modals ---------- */
.modal-mask { position: fixed; inset: 0; display: none; place-items: center; padding: 20px; background: rgba(10, 14, 28, 0.50); backdrop-filter: blur(4px); z-index: 30; }
.modal-mask.show { display: grid; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(460px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: 24px; background: var(--surface); padding: 26px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop 0.25s ease; }
.modal.wide { width: min(720px, 100%); }
.modal h3 { margin: 0 0 10px; font-size: 22px; letter-spacing: -0.02em; font-weight: 800; }
.price { display: flex; align-items: end; gap: 6px; margin: 18px 0; color: var(--primary-ink); }
.price strong { font-size: 42px; line-height: 1; font-weight: 800; }
.benefits { display: grid; gap: 11px; margin: 16px 0 22px; color: var(--text-soft); font-size: 14px; }
.benefits div { display: flex; align-items: center; gap: 9px; }
.benefits div i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(18, 184, 134, 0.14); color: var(--accent-ink); font-size: 13px; font-weight: 800; flex: 0 0 auto; }
.qr { height: 168px; border-radius: 18px; display: grid; place-items: center; color: var(--muted); font-size: 13px; background: linear-gradient(90deg, rgba(23,32,51,.05) 10px, transparent 1%) center / 22px 22px, linear-gradient(rgba(23,32,51,.05) 10px, transparent 1%) center / 22px 22px, var(--surface-2); border: 1px dashed var(--line-strong); }
.qr img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
#supportModal .modal-actions { grid-template-columns: 1fr; }
.modal .hint { display: block; margin-top: 2px; }
.modal input { margin-top: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .top-actions { justify-content: flex-start; }
  .hero,
  .hero.profile-collapsed { grid-template-columns: 1fr; }
  .profile-card { position: relative; top: 0; }
  .chat-card { min-height: 640px; }
  .hero.profile-collapsed .card-head {
    min-height: auto;
    padding: 18px 20px 8px;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .hero.profile-collapsed .card-head h2 {
    writing-mode: horizontal-tb;
    font-size: 16px;
  }
  .hero.profile-collapsed .card-head h2::before {
    width: 6px;
    height: 18px;
  }
  .hero.profile-collapsed .mini-btn {
    min-width: auto;
    padding: 7px 12px;
    border-radius: 999px;
    flex-direction: row;
    gap: 2px;
  }
  .hero.profile-collapsed .mini-btn i {
    transform: none;
  }
}

@media (max-width: 560px) {
  .page { width: calc(100% - 22px); padding-top: 14px; }
  .grid-2, .actions, .modal-actions { grid-template-columns: 1fr; }
  .chat-input { grid-template-columns: auto auto auto minmax(0, 1fr) auto; }
  .chat-input #exportChat { display: inline-flex; }
  .chat-input .cselect { display: block; width: 112px; }
  .chat-input .cselect-trigger { display: inline-flex; }
  .anchor-panel { display: none; }
  .chat-intro { padding: 20px; }
  .footer { width: calc(100% - 22px); }
}

/* ---------- Screenshot match skin ---------- */
:root {
  --bg: #f5f7fc;
  --surface: #ffffff;
  --surface-2: #fbfcff;
  --surface-3: #f6f7fb;
  --text: #151a2d;
  --text-soft: #4d5874;
  --muted: #9aa4bb;
  --line: #edf0f7;
  --line-strong: #dfe4ef;
  --primary: #7957ff;
  --primary-2: #6d45f5;
  --primary-ink: #6d45f5;
  --accent: #3dd4a5;
  --accent-ink: #17a77e;
  --ring: rgba(121, 87, 255, 0.13);
  --shadow-sm: 0 4px 14px rgba(38, 50, 86, 0.05);
  --shadow-md: 0 18px 45px rgba(42, 54, 94, 0.08);
  --shadow-lg: 0 30px 80px rgba(33, 42, 74, 0.17);
  --radius: 13px;
  --radius-sm: 10px;
}

body {
  background: #f5f7fc;
  color: var(--text);
  font-size: 14px;
}

.bg-decor {
  background:
    radial-gradient(760px 360px at 100% 0%, rgba(120, 112, 255, 0.08), transparent 62%),
    linear-gradient(180deg, #fafbff 0%, #f4f6fb 100%);
}
.bg-decor::before,
.bg-decor::after { display: none; }

.page {
  width: min(1210px, calc(100% - 48px));
  padding: 0 0 0;
}

.topbar {
  position: static;
  min-height: 70px;
  margin: 0 calc((1210px - min(1210px, 100vw - 48px)) / -2) 22px;
  padding: 14px max(30px, calc((100vw - 1210px) / 2 + 30px));
  border: 0;
  border-bottom: 1px solid #eef1f7;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(32, 43, 77, 0.04);
  backdrop-filter: blur(16px);
}

.brand { gap: 13px; }
.logo {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  font-size: 0;
  background: linear-gradient(145deg, #7156ff, #8d65ff);
  box-shadow: 0 10px 22px rgba(111, 76, 244, 0.26);
}
.logo::before {
  content: "";
  width: 20px;
  height: 20px;
  background: #fff;
  clip-path: polygon(50% 8%, 93% 30%, 93% 69%, 50% 92%, 7% 69%, 7% 30%);
  opacity: 0.96;
}
.logo::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 8px;
  border: 2px solid #7657ff;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: transparent;
  inset: 18px auto auto 14px;
}
.brand h1 {
  font-size: 20px;
  letter-spacing: -0.02em;
}
.subtitle {
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #9aa3b7;
}

.top-actions {
  gap: 14px;
  flex-wrap: nowrap;
}
.pill {
  min-height: 34px;
  padding: 8px 14px;
  border-color: #eaedf5;
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
  color: #46506a;
  font-size: 12px;
  font-weight: 700;
}
.pill:first-child::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 1.8px solid var(--primary);
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(121, 87, 255, 0.12);
}
.user-pill {
  gap: 9px;
  border-left: 1px solid #eceff6;
  padding-left: 19px;
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
}
.user-pill { display: none !important; }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #8da4ff, #6d7af5);
  font-size: 12px;
  font-weight: 800;
}

.hero {
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.card {
  border: 1px solid #edf0f7;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
}

.profile-card {
  position: sticky;
  top: 16px;
  min-height: calc(100vh - 110px);
}

.card-head {
  padding: 22px 24px 9px;
  border-bottom: 0;
}
.card-head h2 {
  font-size: 17px;
  letter-spacing: -0.01em;
}
.card-head h2::before {
  width: 4px;
  height: 17px;
  border-radius: 4px;
  background: var(--primary);
}
.mini-btn {
  padding: 5px 10px;
  border: 0;
  background: #f6f4ff;
  color: var(--primary-ink);
  font-size: 12px;
  box-shadow: none;
}

.form {
  padding: 4px 24px 22px;
  gap: 17px;
}
.grid-2 { gap: 18px; }
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.field label {
  margin-bottom: 8px;
  color: #424c66;
  font-size: 12px;
  font-weight: 800;
}
.hint {
  color: #a2aabd;
  font-size: 11px;
  font-weight: 600;
}
input,
select,
textarea {
  height: 36px;
  border-color: #dfe4ef;
  border-radius: 7px;
  background: #fff;
  padding: 8px 11px;
  color: #27314d;
  font-size: 12.5px;
  box-shadow: none;
}
input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: #9a83ff;
  box-shadow: 0 0 0 4px var(--ring);
}
select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 34px;
  border-color: #dfe4ef;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,255,0.98));
  color: #27314d;
  font-weight: 750;
  box-shadow: 0 6px 16px rgba(42, 54, 92, 0.04);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .12s ease;
}
select:hover {
  border-color: rgba(121, 87, 255, 0.42);
  box-shadow: 0 9px 20px rgba(90, 92, 240, 0.08);
  transform: translateY(-1px);
}
select:focus {
  background: #fff;
  border-color: #9a83ff;
  box-shadow: 0 0 0 4px var(--ring), 0 9px 20px rgba(90, 92, 240, 0.10);
  transform: none;
}
.field:has(> select) {
  position: relative;
}
select option {
  color: #27314d;
  background: #fff;
  font-weight: 600;
}
select option[value=""] {
  color: #9aa4bb;
}
.form-select {
  position: relative;
  width: 100%;
  z-index: 1;
}
.form-select.open {
  z-index: 60;
}
.form-select .native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.form-select-trigger {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px 0 13px;
  border: 1px solid rgba(126, 102, 255, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(121, 87, 255, 0.10), rgba(18, 184, 134, 0.05)),
    linear-gradient(180deg, #ffffff, #f7f8ff);
  color: #27314d;
  font-size: 12.5px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(42, 54, 92, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .12s ease;
}
.form-select-trigger::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity .18s ease;
  z-index: -1;
}
.form-select-trigger:hover {
  border-color: rgba(121, 87, 255, 0.42);
  box-shadow: 0 12px 24px rgba(90, 92, 240, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}
.form-select.open .form-select-trigger {
  border-color: rgba(121, 87, 255, 0.58);
  background: #fff;
  box-shadow: 0 0 0 4px var(--ring), 0 16px 30px rgba(90, 92, 240, 0.14);
  transform: none;
}
.form-select.open .form-select-trigger::before {
  opacity: 1;
}
.form-select-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-select.placeholder .form-select-label {
  color: #9aa4bb;
  font-weight: 700;
}
.form-select-caret {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(121, 87, 255, 0.10);
  color: var(--primary);
  margin-top: 0;
  box-shadow: inset 0 0 0 1px rgba(121, 87, 255, 0.08);
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.form-select-caret::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.form-select.open .form-select-caret {
  background: rgba(121, 87, 255, 0.16);
  color: var(--primary-ink);
  transform: rotate(180deg);
}
.form-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid rgba(121, 87, 255, 0.20);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 52px rgba(35, 45, 82, 0.18), 0 4px 14px rgba(90, 92, 240, 0.08);
  backdrop-filter: blur(16px) saturate(140%);
  max-height: 240px;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  pointer-events: none;
  transform-origin: top center;
  transition: opacity .16s ease, transform .16s ease;
}
.form-select-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.form-select.open .form-select-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.form-select-search {
  width: calc(100% - 12px);
  height: 34px;
  margin: 6px;
  border: 1px solid rgba(121, 87, 255, 0.16);
  border-radius: 11px;
  background: linear-gradient(180deg, #fbfcff, #f4f6ff);
  color: #27314d;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}
.form-select-search:focus {
  border-color: rgba(121, 87, 255, 0.46);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(121, 87, 255, 0.12);
}
.form-select-empty {
  display: none;
  padding: 10px;
  color: #9aa4bb;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.form-select.no-results .form-select-empty {
  display: block;
}
.form-select-option {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 11px;
  color: #46506a;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, transform .12s ease, box-shadow .14s ease;
}
.form-select-option:hover {
  background: linear-gradient(135deg, rgba(121, 87, 255, 0.12), rgba(18, 184, 134, 0.06));
  color: var(--primary-ink);
  transform: translateX(1px);
}
.form-select-option.selected {
  background: linear-gradient(135deg, rgba(121, 87, 255, 0.18), rgba(18, 184, 134, 0.08));
  color: var(--primary-ink);
  box-shadow: inset 0 0 0 1px rgba(121, 87, 255, 0.10);
}
.form-select-option.selected::after {
  content: "\2713";
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(90, 92, 240, 0.24);
}
.form-select-option.placeholder-option {
  color: #9aa4bb;
}
textarea {
  min-height: 76px;
  height: 76px;
  line-height: 1.6;
}
.input-with-unit {
  position: relative;
}
.input-with-unit input {
  padding-right: 30px;
}
.input-with-unit span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #66708b;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.count-hint {
  float: right;
  color: #a6afc3;
  font-size: 10px;
  font-weight: 700;
}

.chips {
  gap: 10px;
}
.chip {
  min-width: 52px;
  padding: 7px 12px;
  border-color: #e1e6f1;
  border-radius: 9px;
  background: #fff;
  color: #66708b;
  font-size: 12px;
  box-shadow: none;
}
.chip.active {
  color: var(--primary-ink);
  border-color: rgba(121, 87, 255, 0.35);
  background: #f3efff;
  box-shadow: 0 5px 12px rgba(121, 87, 255, 0.10);
}

.preference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}
.check-tile {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 13px 10px 38px;
  border: 1px solid #e3e8f4;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,255,0.96));
  color: #56617c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 16px rgba(42, 54, 92, 0.04);
  overflow: hidden;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease, transform .12s ease;
}
.check-tile::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #d7def0;
  background: #fff;
  box-shadow: inset 0 0 0 4px #fff;
  transform: translateY(-50%);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.check-tile::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  opacity: 0;
  transform: scale(.7);
  transition: opacity .18s ease, transform .18s ease;
}
.check-tile:hover {
  border-color: rgba(121, 87, 255, 0.45);
  color: var(--primary-ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(90, 92, 240, 0.10);
}
.check-tile:has(input:checked) {
  border-color: rgba(121, 87, 255, 0.62);
  background:
    linear-gradient(180deg, rgba(248,245,255,0.98), rgba(242,238,255,0.98));
  color: var(--primary-ink);
  box-shadow: 0 10px 24px rgba(121, 87, 255, 0.15);
}
.check-tile:has(input:checked)::before {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: inset 0 0 0 4px #fff, 0 4px 10px rgba(90, 92, 240, 0.28);
}
.check-tile:has(input:checked)::after {
  opacity: 1;
  transform: scale(1);
}
.check-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.check-tile:focus-within {
  outline: 2px solid rgba(90, 92, 240, 0.38);
  outline-offset: 2px;
}

.skill-box {
  display: none;
}
.actions {
  grid-template-columns: 112px 1fr;
  gap: 14px;
  margin-top: auto;
  padding-top: 46px;
}
.btn {
  min-height: 42px;
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 800;
}
.btn-secondary {
  background: #fff;
  border-color: #e1e6f1;
  color: #5e6880;
}
.btn-primary {
  background: linear-gradient(135deg, #8362ff, #6f4df4);
  box-shadow: 0 13px 26px rgba(110, 75, 240, 0.28);
}

.chat-card {
  min-height: calc(100vh - 110px);
  overflow: hidden;
  background: #fff;
}
.chat-intro {
  padding: 24px 28px 18px;
  border-bottom-color: #edf0f7;
  background: #fff;
}
.eyebrow {
  display: none;
}
.chat-intro h2 {
  margin: 0 0 10px;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.chat-intro p {
  max-width: 720px;
  color: #5b647c;
  font-size: 13px;
  line-height: 1.75;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.suggestions button {
  position: relative;
  min-height: 58px;
  padding: 10px 15px 10px 57px;
  border-color: #e6e9f2;
  border-radius: 10px;
  background: #fff;
  color: #1f2942;
  text-align: left;
  box-shadow: 0 6px 18px rgba(40, 52, 88, 0.03);
}
.suggestions button::before {
  content: attr(data-icon);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--primary-ink);
  background: #f1edff;
  font-size: 14px;
  font-weight: 800;
}
.suggestions strong {
  display: block;
  color: #27314d;
  font-size: 13px;
  line-height: 1.2;
}
.suggestions span {
  display: block;
  margin-top: 5px;
  color: #8b94aa;
  font-size: 11px;
  font-weight: 600;
}

.messages {
  gap: 14px;
  padding: 20px 28px;
  background: #fff;
}
.row {
  gap: 10px;
}
.avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  font-size: 11px;
}
.avatar.ai {
  background: linear-gradient(145deg, #785cff, #6f4cf3);
}
.avatar.me {
  background: linear-gradient(145deg, #90a9ff, #6f82e9);
}
.msg {
  max-width: min(650px, calc(100% - 50px));
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.7;
  box-shadow: 0 8px 22px rgba(34, 44, 78, 0.05);
}
.msg.ai {
  border-color: #e9edf5;
  border-top-left-radius: 10px;
  color: #303a55;
  background: #fff;
}
.msg.me {
  color: #7060a8;
  border: 1px solid #ddd4ff;
  border-top-right-radius: 10px;
  background: #f0ebff;
  box-shadow: none;
}
.msg.loading-note {
  color: #3f4962;
  background: #fff;
}
.plan-card {
  width: min(540px, 100%);
  padding: 0;
  overflow: hidden;
  border: 1px solid #e5e9f2;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(36, 48, 86, 0.08);
}
.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid #edf0f7;
  color: #222c46;
  font-size: 13px;
  font-weight: 900;
}
.plan-head small {
  color: #8b94aa;
  font-weight: 700;
}
.plan-row {
  display: grid;
  grid-template-columns: 70px 1fr 72px;
  gap: 14px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid #edf0f7;
}
.plan-row:last-child {
  border-bottom: 0;
}
.plan-tag {
  border-radius: 9px;
  padding: 10px 5px;
  text-align: center;
  font-weight: 900;
  line-height: 1.35;
}
.plan-tag b {
  display: block;
  font-size: 15px;
}
.plan-tag span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
}
.plan-tag.rush { color: #6952ff; background: #f1edff; }
.plan-tag.steady { color: #2a90ff; background: #eaf4ff; }
.plan-tag.safe { color: #16a66f; background: #eafff4; }
.plan-body strong {
  display: block;
  margin-bottom: 5px;
  color: #3149d7;
  font-size: 12.5px;
}
.plan-body p {
  margin: 0;
  color: #4e5871;
  font-size: 11.5px;
  line-height: 1.65;
}
.plan-link {
  color: #59637d;
  text-align: right;
  font-size: 11px;
  font-weight: 800;
}
.plan-foot {
  padding: 10px 18px 13px;
  color: #8b94aa;
  font-size: 11px;
  line-height: 1.6;
}
.shuffle-btn {
  width: fit-content;
  margin: -5px 0 0 48px;
  padding: 7px 14px;
  border: 1px solid #bdafff;
  border-radius: 999px;
  background: #fff;
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 800;
}

.chat-input {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 12px 18px 14px;
  gap: 12px;
  border-top-color: #edf0f7;
  background: #fff;
}
.chat-input input {
  height: 46px;
  border-radius: 14px;
  background: #fff;
}
.icon-btn {
  height: 48px;
  padding: 0 14px;
  border-radius: 11px;
  background: #fff;
  font-size: 12px;
}
#sendQuestion {
  width: 40px;
  min-height: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
}
#sendQuestion::before {
  content: "";
  width: 17px;
  height: 17px;
  background: #fff;
  clip-path: polygon(0 6%, 100% 50%, 0 94%, 20% 55%, 55% 50%, 20% 45%);
}
.input-wrap {
  position: relative;
}
.input-wrap input {
  padding-right: 58px;
}
.input-limit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #a6afc3;
  font-size: 11px;
  font-weight: 700;
}

.footer {
  display: none;
  margin: 16px auto 0;
  padding: 12px 20px 20px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #a3abbc;
}

@media (max-width: 900px) {
  .page {
    width: min(100% - 22px, 640px);
    padding-top: 0;
  }
  .topbar {
    margin: 0 -11px 14px;
    padding: 12px 14px;
    align-items: center;
    flex-direction: row;
  }
  .top-actions {
    gap: 8px;
  }
  .top-actions .pill:nth-child(4) {
    display: none;
  }
  .user-pill {
    padding-left: 8px;
  }
  .user-pill b {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .profile-card {
    position: relative;
    top: 0;
    min-height: 0;
  }
  .chat-card {
    min-height: 680px;
  }
  .suggestions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand h1 {
    font-size: 17px;
  }
  .subtitle {
    font-size: 8px;
  }
  .grid-2,
  .grid-3,
  .preference-grid {
    grid-template-columns: 1fr;
  }
  .actions {
    grid-template-columns: 1fr 1fr;
    padding-top: 12px;
  }
  .chat-intro,
  .messages {
    padding-left: 16px;
    padding-right: 16px;
  }
  .plan-row {
    grid-template-columns: 62px 1fr;
  }
  .plan-link {
    display: none;
  }
  .chat-input {
    grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  }
  .chat-input #exportChat {
    display: inline-flex;
  }
  .chat-input .cselect {
    display: block;
  }
}

/* ---------- Realism pass ---------- */
.page {
  width: calc(100vw - 48px);
  max-width: none;
}

.topbar {
  width: 100vw;
  min-height: 56px;
  margin: 0 0 18px calc(50% - 50vw);
  padding: 10px 30px;
  box-shadow: 0 2px 14px rgba(42, 54, 94, 0.04);
}

.brand { gap: 10px; }
.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(111, 76, 244, 0.22);
}
.brand h1 { font-size: 17px; }
.subtitle {
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.24em;
}

.top-actions { gap: 10px; }
.pill {
  min-height: 32px;
  padding: 7px 12px;
  white-space: nowrap;
  font-size: 11.5px;
  box-shadow: 0 2px 8px rgba(34, 44, 78, 0.03);
}
.user-pill { padding-left: 14px; }
.user-avatar {
  width: 25px;
  height: 25px;
  font-size: 11px;
}

.hero {
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.card {
  border-color: #edf1f8;
  border-radius: 11px;
  box-shadow: 0 16px 42px rgba(36, 48, 86, 0.06);
}

.profile-card,
.chat-card {
  min-height: calc(100vh - 92px);
}

.card-head { padding: 18px 20px 8px; }
.form {
  min-height: 0;
  flex: 1;
  max-height: 2400px;
  opacity: 1;
  overflow: hidden;
  padding: 3px 20px 18px;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 13px;
  transform: translateY(0);
  transition: max-height .28s ease, opacity .2s ease, padding .24s ease, transform .24s ease;
}
.grid-2 { gap: 14px; }
.grid-3 { gap: 9px; }
.field label {
  margin-bottom: 6px;
  font-size: 11px;
}
input,
select,
textarea {
  height: 34px;
  border-radius: 6px;
  font-size: 12px;
}
select {
  height: 36px;
  border-radius: 9px;
  padding: 7px 32px 7px 11px;
  font-size: 11.5px;
}
.form-select-trigger {
  height: 36px;
  border-radius: 9px;
  padding: 0 11px;
  font-size: 11.5px;
}
.form-select-option {
  min-height: 32px;
  padding: 7px 9px;
  font-size: 11.5px;
}
textarea {
  min-height: 70px;
  height: 70px;
}
.chip {
  min-width: 48px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
}
.preference-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
.check-tile {
  min-height: 38px;
  padding: 9px 11px 9px 34px;
  border-radius: 10px;
  font-size: 11px;
}
.check-tile::before {
  left: 11px;
  width: 14px;
  height: 14px;
}
.check-tile::after {
  right: -19px;
  top: -19px;
}
.actions {
  align-self: end;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  margin-top: auto;
  padding-top: 34px;
}
.btn {
  min-height: 39px;
  border-radius: 8px;
  font-size: 12px;
}

.chat-intro {
  padding: 22px 26px 17px;
}
.chat-intro h2 {
  font-size: 18px;
  margin-bottom: 9px;
}
.chat-intro p {
  max-width: 780px;
  font-size: 12px;
  line-height: 1.72;
}
.suggestions {
  gap: 12px;
  margin-top: 16px;
}
.suggestions button {
  min-height: 52px;
  padding: 9px 14px 9px 52px;
  border-radius: 9px;
  box-shadow: 0 7px 18px rgba(40, 52, 88, 0.025);
}
.suggestions button::before {
  content: "";
  width: 28px;
  height: 28px;
  background:
    linear-gradient(135deg, rgba(120, 92, 255, 0.22), rgba(120, 92, 255, 0.05)),
    #f3efff;
  box-shadow: inset 0 0 0 1px rgba(121, 87, 255, 0.16);
}
.suggestions button::after {
  content: "";
  position: absolute;
  left: 25px;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid var(--primary);
  border-radius: 3px;
  transform: translate(-50%, -50%) rotate(45deg);
}
.suggestions button:nth-child(2)::after {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.suggestions button:nth-child(3)::after {
  width: 10px;
  height: 6px;
  border-top: 0;
  border-right: 0;
  border-radius: 0;
  transform: translate(-50%, -60%) rotate(-45deg);
}
.suggestions strong { font-size: 12px; }
.suggestions span { font-size: 10.5px; }

.messages {
  max-height: 800px;
  overflow: auto;
  padding: 18px 26px 128px;
  gap: 13px;
  transition: opacity 0.22s ease, transform 0.22s ease;
  scroll-padding-bottom: 128px;
}
.messages.switching {
  opacity: 0;
  transform: translateY(8px);
}
.avatar {
  width: 29px;
  height: 29px;
}
.msg {
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 12px;
}
.plan-card {
  width: min(535px, 100%);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(36, 48, 86, 0.07);
}
.plan-head {
  padding: 13px 16px 9px;
  font-size: 12.5px;
}
.plan-row {
  grid-template-columns: 64px 1fr 64px;
  gap: 12px;
  padding: 12px 16px;
}
.plan-tag {
  padding: 9px 4px;
  border-radius: 8px;
}
.plan-tag b { font-size: 14px; }
.plan-tag span,
.plan-body p,
.plan-link,
.plan-foot {
  font-size: 10.5px;
}
.plan-body strong { font-size: 11.5px; }

.chat-input {
  position: fixed;
  left: calc(320px + 14px + 24px);
  right: 24px;
  bottom: 16px;
  z-index: 24;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(237, 240, 247, 0.96);
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(36, 48, 86, 0.12);
  backdrop-filter: blur(14px) saturate(150%);
}
.hero.profile-collapsed .chat-input {
  left: calc(88px + 16px + 24px);
}
.icon-btn {
  height: 44px;
  border-radius: 10px;
}
.chat-input input {
  height: 44px;
  border-radius: 12px;
}
#sendQuestion {
  width: 38px;
  height: 38px;
  min-height: 38px;
}

@media (max-width: 900px) {
  .page {
    width: calc(100vw - 22px);
  }
  .topbar {
    margin-left: -11px;
    padding: 10px 14px;
  }
  .hero { grid-template-columns: 1fr; }
  .profile-card,
  .chat-card {
    min-height: auto;
  }
  .chat-card { min-height: 680px; }
  .chat-input,
  .hero.profile-collapsed .chat-input {
    left: 11px;
    right: 11px;
    bottom: 12px;
  }
}

.logo::before,
.logo::after,
.pill:first-child::before,
.suggestions button::before,
.suggestions button::after,
#sendQuestion::before {
  display: none;
}
.logo i {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 19px;
  line-height: 1;
}
.pill i {
  color: var(--primary);
  font-size: 15px;
  line-height: 1;
}
.user-avatar i {
  color: #fff;
  font-size: 15px;
}
.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.mini-btn i {
  font-size: 14px;
}
.btn i,
.icon-btn i {
  font-size: 15px;
  line-height: 1;
}
.suggestions button i {
  position: static;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--primary);
  background:
    linear-gradient(135deg, rgba(120, 92, 255, 0.22), rgba(120, 92, 255, 0.05)),
    #f3efff;
  box-shadow: inset 0 0 0 1px rgba(121, 87, 255, 0.16);
  font-size: 15px;
}
.avatar i {
  font-size: 15px;
  line-height: 1;
}
#sendQuestion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
#sendQuestion i {
  color: #fff;
  font-size: 17px;
  line-height: 1;
}
.suggestions button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  padding: 10px 16px;
}
.suggestions button i {
  grid-row: 1 / span 2;
  grid-column: 1;
  align-self: center;
}
.suggestions strong,
.suggestions span {
  grid-column: 2;
  min-width: 0;
}
.suggestions strong {
  align-self: end;
}
.suggestions span {
  align-self: start;
}
#sendQuestion {
  flex: 0 0 38px;
  padding: 0;
  line-height: 1;
}
#sendQuestion i {
  margin: 0;
  display: block;
}
.check-tile input,
.check-tile input:focus {
  flex: 0 0 auto;
  margin: 0;
}
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
.page {
  width: calc(100% - 48px);
  max-width: none;
}
.topbar {
  width: auto;
  margin: 0 -24px 18px;
  padding: 10px 30px;
}
.chat-input {
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  align-items: center;
}
/* 自定义主播下拉框 */
.cselect {
  position: relative;
  width: 142px;
  z-index: 6;
}
.cselect .host-select {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.cselect-trigger {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 11px;
  border: 1px solid rgba(121, 87, 255, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(121, 87, 255, 0.12), rgba(18, 184, 134, 0.06)),
    linear-gradient(180deg, #ffffff, #f8f9ff);
  color: #37415f;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(42, 54, 92, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.12s ease;
}
.cselect-trigger::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: -1;
}
.cselect-trigger:hover {
  border-color: rgba(121, 87, 255, 0.48);
  background:
    linear-gradient(135deg, rgba(121, 87, 255, 0.16), rgba(18, 184, 134, 0.08)),
    #fff;
  box-shadow: 0 12px 24px rgba(90, 92, 240, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}
.cselect.open .cselect-trigger {
  border-color: rgba(121, 87, 255, 0.62);
  box-shadow: 0 0 0 4px var(--ring), 0 16px 30px rgba(90, 92, 240, 0.14);
  transform: none;
}
.cselect.open .cselect-trigger::before {
  opacity: 1;
}
.cselect-lead {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--primary);
  background: rgba(121, 87, 255, 0.12);
  font-size: 14px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(121, 87, 255, 0.08);
}
.cselect-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cselect-caret {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: rgba(121, 87, 255, 0.10);
  font-size: 17px;
  line-height: 1;
  transition: transform 0.2s ease, color 0.18s ease, background 0.18s ease;
}
.cselect.open .cselect-caret {
  transform: rotate(180deg);
  color: var(--primary-ink);
  background: rgba(121, 87, 255, 0.16);
}
.cselect-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  margin: 0;
  padding: 8px;
  list-style: none;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(121, 87, 255, 0.20);
  border-radius: 16px;
  box-shadow: 0 22px 52px rgba(25, 35, 75, 0.20), 0 4px 14px rgba(90, 92, 240, 0.08);
  backdrop-filter: blur(16px) saturate(140%);
  max-height: 264px;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 40;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.cselect-menu::-webkit-scrollbar { width: 0; height: 0; display: none; }
.cselect.open .cselect-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.cselect-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
  color: #46506a;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, transform 0.12s ease, box-shadow 0.14s ease;
}
.cselect-option:hover {
  background: linear-gradient(135deg, rgba(121, 87, 255, 0.12), rgba(18, 184, 134, 0.06));
  color: var(--primary-ink);
  transform: translateX(1px);
}
.cselect-option.selected {
  color: var(--primary-ink);
  background: linear-gradient(135deg, rgba(121, 87, 255, 0.18), rgba(18, 184, 134, 0.08));
  box-shadow: inset 0 0 0 1px rgba(121, 87, 255, 0.10);
}
.cselect-option.selected::after {
  content: "\2713";
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(90, 92, 240, 0.24);
}
.ai-bubble {
  max-width: min(650px, calc(100% - 50px));
  display: grid;
  gap: 6px;
}
.ai-bubble .msg {
  max-width: 100%;
}
.host-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid rgba(121, 87, 255, 0.16);
  border-radius: 999px;
  background: #f7f4ff;
  color: var(--primary-ink);
  font-size: 10.5px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(121, 87, 255, 0.06);
}
.host-badge i {
  font-size: 12px;
  line-height: 1;
}
.anchor-panel {
  margin-top: 16px;
  padding: 13px;
  border: 1px solid #edf0f7;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}
.anchor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}
.anchor-head-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.anchor-toggle {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(121, 87, 255, 0.18);
  border-radius: 999px;
  background: rgba(121, 87, 255, 0.06);
  color: var(--primary-ink);
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .12s ease;
}
.anchor-toggle:hover {
  background: rgba(121, 87, 255, 0.10);
  border-color: rgba(121, 87, 255, 0.28);
  transform: translateY(-1px);
}
.anchor-toggle i {
  font-size: 13px;
  line-height: 1;
  transition: transform .18s ease;
}
.anchor-panel.collapsed .anchor-toggle i {
  transform: rotate(180deg);
}
.anchor-body {
  overflow: hidden;
  max-height: 520px;
  opacity: 1;
  transition: max-height .24s ease, opacity .18s ease;
}
.anchor-panel.collapsed .anchor-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.anchor-panel.collapsed .anchor-head {
  margin-bottom: 0;
}
.anchor-head span {
  color: #202944;
  font-size: 13px;
  font-weight: 900;
}
.anchor-head small {
  color: #98a2b8;
  font-size: 11px;
  font-weight: 700;
}
.anchor-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 9px;
}
.anchor-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  border: 1px solid #e7ebf4;
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
  color: #4f5a73;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.anchor-card:hover {
  border-color: rgba(121, 87, 255, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(42, 54, 94, 0.05);
}
.anchor-card.active {
  border-color: rgba(121, 87, 255, 0.42);
  background: #f7f4ff;
  box-shadow: 0 8px 18px rgba(121, 87, 255, 0.08);
}
.anchor-card i {
  width: 26px;
  height: 26px;
  grid-row: 1 / span 2;
  grid-column: 1;
  align-self: center;
  margin: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #f1edff;
  font-size: 15px;
}
.anchor-card b {
  display: block;
  grid-column: 2;
  color: #26314d;
  font-size: 12px;
  line-height: 1.2;
}
.anchor-card span {
  display: block;
  grid-column: 2;
  margin-top: 3px;
  color: #8f98ad;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 700;
}
.anchor-preview {
  margin-top: 11px;
  padding: 12px 14px;
  border: 1px solid rgba(121, 87, 255, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(121, 87, 255, 0.08), rgba(255, 255, 255, 0.92)),
    #fff;
  color: #4b5570;
  transition: opacity 0.22s ease, transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}
.anchor-preview.switching {
  opacity: 0;
  transform: translateY(6px);
}
.anchor-preview strong {
  display: block;
  color: #27314d;
  font-size: 12px;
  line-height: 1.5;
}
.anchor-preview p {
  margin: 5px 0 0;
  color: #7e879d;
  font-size: 11px;
  line-height: 1.65;
  font-weight: 700;
}
@media (max-width: 900px) {
  .page {
    width: calc(100% - 22px);
  }
  .topbar {
    margin: 0 -11px 14px;
    position: static;
    top: auto;
  }
  .chat-input {
    grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  }
  .chat-input #exportChat {
    display: inline-flex;
  }
  .chat-input .cselect {
    display: block;
  }
  .anchor-list {
    grid-template-columns: 1fr;
  }
  .anchor-head {
    display: block;
  }
  .anchor-head-main {
    margin-bottom: 8px;
  }
  .anchor-toggle {
    width: 100%;
    justify-content: center;
  }
  .anchor-head small {
    display: block;
    margin-top: 4px;
  }
}

@media (max-width: 900px) {
  .profile-card {
    position: relative;
    top: 0;
    bottom: auto;
    left: auto;
    z-index: auto;
    width: 100%;
    max-width: none;
    min-height: 0;
    border-radius: 18px;
    overflow: visible;
    transform: none;
    box-shadow: var(--shadow-sm);
    transition: none;
  }
  .profile-card.form-collapsed {
    transform: none;
    box-shadow: var(--shadow-sm);
    pointer-events: auto;
  }
  .profile-card.form-collapsed .card-head {
    min-height: auto;
  }
  .profile-card.form-collapsed .card-head h2 {
    writing-mode: horizontal-tb;
  }
  .profile-card:not(.form-collapsed) .card-head {
    position: sticky;
    top: 0;
    min-height: auto;
    padding: 9px 12px 8px;
    background: #fff;
  }
  .profile-card:not(.form-collapsed) .card-head h2 {
    font-size: 13px;
  }
  .profile-card:not(.form-collapsed) .mini-btn {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 11px;
  }
  .profile-card:not(.form-collapsed) .form {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .chat-input {
    grid-template-columns: auto auto minmax(0, 1fr) 42px;
    grid-template-areas:
      "input input input input"
      "history clear host send";
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
  }
  .chat-input .input-wrap {
    grid-area: input;
    min-width: 0;
  }
  .chat-input input {
    height: 42px;
    padding-right: 52px;
  }
  .chat-input #exportChat {
    grid-area: history;
    display: inline-flex;
    height: 42px;
    padding: 0 12px;
  }
  .chat-input #clearChat {
    grid-area: clear;
    display: inline-flex;
    height: 42px;
    padding: 0 12px;
  }
  .chat-input .cselect {
    grid-area: host;
    display: block;
    width: auto;
    min-width: 0;
  }
  .chat-input .cselect-trigger {
    height: 42px;
  }
  .chat-input #sendQuestion {
    grid-area: send;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    justify-self: end;
  }
  .chat-input #sendQuestion i {
    display: block;
    margin: 0;
    font-size: 19px;
    line-height: 1;
    transform: translate(1px, -1px);
  }
  .input-limit {
    right: 12px;
  }
  .anchor-panel {
    display: none;
  }
}

/* ---------- Radius cleanup ---------- */
:root {
  --radius: 6px;
  --radius-sm: 4px;
}
.topbar,
.card,
.footer {
  border-radius: 0;
}
.chat-input,
.modal,
.qr,
.anchor-panel,
.anchor-card,
.anchor-preview,
.suggestions button {
  border-radius: 8px;
}
input,
select,
textarea,
.btn,
.icon-btn,
.mini-btn,
.pill,
.chip,
.advanced-toggle,
.anchor-toggle,
.host-badge {
  border-radius: 6px;
}
#sendQuestion,
.avatar,
.benefits div i,
.eyebrow::before,
.pill .dot {
  border-radius: 50%;
}
@media (max-width: 900px) {
  .profile-card,
  .profile-card.form-collapsed {
    border-radius: 18px;
  }
}
@media (max-width: 560px) {
  .chat-input {
    border-radius: 8px;
  }
}

.chat-input #exportChat,
.chat-input #clearChat,
.chat-input #sendQuestion {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  font-size: 0;
  line-height: 1;
}
.chat-input #exportChat i,
.chat-input #clearChat i,
.chat-input #sendQuestion i {
  display: block;
  margin: 0;
  font-size: 18px;
  line-height: 1;
}
.chat-input #sendQuestion i {
  transform: translate(1px, -1px);
}
.chat-hint {
  position: fixed;
  left: var(--chat-hint-left, calc(320px + 14px + 24px));
  right: auto;
  bottom: var(--chat-hint-bottom, 84px);
  z-index: 19;
  width: fit-content;
  max-width: var(--chat-hint-width, min(520px, calc(100vw - 48px)));
  padding: 10px 12px;
  border: 1px solid rgba(121, 87, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: #5a55d8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
  box-shadow: 0 10px 24px rgba(36, 48, 86, 0.08);
  backdrop-filter: blur(12px) saturate(140%);
}
.chat-hint.ready {
  border-color: rgba(18, 184, 134, 0.18);
  background: rgba(240, 255, 248, 0.96);
  color: #0b8f66;
}
.chat-hint.err {
  border-color: rgba(224, 49, 49, 0.20);
  background: rgba(255, 245, 245, 0.96);
  color: #c92a2a;
}
.hero.profile-collapsed .chat-hint {
  left: var(--chat-hint-left, calc(88px + 16px + 24px));
}
.quick-prompts {
  position: fixed;
  left: var(--quick-prompts-left, calc(320px + 14px + 24px));
  right: auto;
  bottom: var(--quick-prompts-bottom, 84px);
  z-index: 21;
  display: none;
  width: var(--quick-prompts-width, min(520px, calc(100vw - 48px)));
  padding: 12px;
  border: 1px solid rgba(225, 229, 240, 0.96);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(32, 42, 76, 0.14);
  backdrop-filter: blur(14px) saturate(145%);
  pointer-events: none;
}
.quick-prompts.show {
  display: grid;
  gap: 10px;
  pointer-events: auto;
  animation: fade 0.16s ease;
}
.quick-prompts::after {
  content: "";
  position: absolute;
  left: 20px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-right: 1px solid rgba(225, 229, 240, 0.96);
  border-bottom: 1px solid rgba(225, 229, 240, 0.96);
  background: rgba(255, 255, 255, 0.98);
  transform: rotate(45deg);
}
.quick-prompts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #30384f;
  font-size: 13px;
  font-weight: 900;
}
.quick-prompts-close {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f677a;
  cursor: pointer;
}
.quick-prompts-close:hover {
  background: #f2f4fa;
  color: #202944;
}
.quick-prompts button:not(.quick-prompts-close) {
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: #f2f2f3;
  color: #202944;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
  text-align: left;
  cursor: pointer;
}
.quick-prompts button[data-q]:hover {
  background: #ebe8ff;
  color: #4b48c8;
}
@media (max-width: 900px) {
  .chat-hint,
  .hero.profile-collapsed .chat-hint {
    left: var(--chat-hint-left, 11px);
    right: auto;
    bottom: var(--chat-hint-bottom, 88px);
    max-width: var(--chat-hint-width, calc(100vw - 22px));
  }
}

@media (max-width: 560px) {
  .chat-hint {
    padding: 8px 10px;
    font-size: 11.5px;
    line-height: 1.45;
  }
  .quick-prompts {
    max-height: calc(100vh - 190px);
    overflow: auto;
    padding: 10px;
    border-radius: 12px;
  }
  .quick-prompts-head {
    font-size: 12.5px;
  }
  .quick-prompts-close {
    width: 28px;
    height: 28px;
  }
  .quick-prompts button:not(.quick-prompts-close) {
    min-height: 0;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.5;
  }
  .advanced-toggle-wrap {
    justify-content: stretch;
  }
  .advanced-toggle-wrap .advanced-toggle,
  .profile-action-wrap .advanced-toggle {
    flex: 1 1 calc(50% - 8px);
    min-width: 118px;
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }
}
/* 卡密激活区 */
.redeem-box { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line, #e5e7eb); }
.redeem-title { font-size: 13px; font-weight: 800; color: var(--text-soft, #555); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.redeem-row { display: flex; gap: 8px; }
.redeem-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong, #cfd3dc); border-radius: 10px; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; outline: none; }
.redeem-row input:focus { border-color: var(--primary, #5a5cf0); }
.redeem-row .btn { white-space: nowrap; }
.redeem-msg { min-height: 18px; margin-top: 8px; font-size: 12px; }
.redeem-msg.ok { color: #12b886; }
.redeem-msg.err { color: #e03131; }

/* ---------- Topbar 头部排版修复：防止品牌标题被右侧 pill 挤成竖排 ---------- */
.topbar { flex-wrap: wrap; }
.brand { flex: 0 0 auto; min-width: 0; }
.brand h1,
.brand .subtitle { white-space: nowrap; }
.top-actions { flex-wrap: wrap; min-width: 0; }

.topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  margin: 0 !important;
  z-index: 35;
}
.page {
  padding-top: calc(var(--mobile-topbar-offset, 72px) + 12px) !important;
}

@media (max-width: 900px) {
  .topbar {
    border-radius: 0 0 14px 14px;
  }
}

/* ---------- 左侧表单下拉悬浮修复 ---------- */
/* .profile-card 是 sticky，会自成层叠上下文，其内部下拉浮层无法超过 sticky 头部(topbar z-index:20)；
   因此在表单内有下拉展开时，把卡片层级临时提到 topbar 之上，让下拉悬浮显示而不被头部盖住。 */
.profile-card:has(.form-select.open) { z-index: 40; }
.form-select.open { z-index: 60; }
.form-select-menu { z-index: 61; }

/* ---------- 支付二维码图片大小限制 ---------- */
/* 百分比 max-height 在 grid 容器里不可靠（大图会溢出撑爆弹窗），改用像素限制并让容器自适应 */
#payQrBox { height: auto; min-height: 180px; padding: 12px; box-sizing: border-box; }
#payQrBox img { max-width: 100%; max-height: 240px; width: auto; height: auto; object-fit: contain; }

/* ---------- 表单窄宽度防溢出 ---------- */
.profile-card,
.profile-card .field,
.profile-card input,
.profile-card textarea,
.profile-card .form-select {
  min-width: 0;
}
.profile-card .grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.profile-card .grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}

