:root {
  --bg: #ebe3d6;
  --surface: rgba(255, 251, 246, 0.76);
  --surface-strong: rgba(255, 251, 246, 0.92);
  --ink: #18201e;
  --muted: #66726d;
  --line: rgba(24, 32, 30, 0.1);
  --accent: #166b61;
  --accent-strong: #0f4f48;
  --accent-soft: rgba(22, 107, 97, 0.12);
  --danger-soft: rgba(165, 83, 67, 0.12);
  --warning-soft: rgba(177, 113, 42, 0.12);
  --radius-xl: 30px;
  --shadow-soft: 0 26px 80px rgba(53, 44, 37, 0.12);
  --shadow-strong: 0 26px 80px rgba(11, 24, 22, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(22, 107, 97, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(122, 92, 67, 0.16), transparent 24%),
    linear-gradient(180deg, #f2eadf 0%, #e6dbce 100%);
  color: var(--ink);
  font-family: "Sora", "Noto Sans SC", "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(24, 32, 30, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 32, 30, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 80%);
}

body[data-lang="zh"] {
  font-family: "Noto Sans SC", "Sora", "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
}

button,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1280px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 140px;
}

.topbar,
.brand-strip,
.topbar-actions,
.hero-status-head,
.panel-head,
.queue-head,
.detail-header,
.store-row,
.chatbot-head,
.chatbot-head-actions,
.copilot-answer-head,
.copilot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.workspace,
.workspace-grid,
.queue-list,
.store-list,
.mini-list,
.metric-strip,
.sales-cards,
.detail-metrics,
.hero-prompts,
.quick-asks,
.store-workspace,
.hero-facts {
  display: grid;
  gap: 14px;
}

.topbar {
  margin-bottom: 16px;
}

.brand-strip {
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #f8f5ef;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  box-shadow: 0 16px 30px rgba(22, 107, 97, 0.22);
}

.brand-copy h1,
.hero-copy h2,
.hero-status-card h3,
.panel h2,
.store-detail h3,
.chatbot-head h3 {
  margin: 0;
  font-family: "Fraunces", "Noto Sans SC", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.03em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.brand-copy h1 {
  font-size: clamp(0.95rem, 1.5vw, 1.14rem);
  line-height: 1.1;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-chip,
.panel,
.hero-status-card,
.metric-tile {
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
}

.meta-chip {
  min-width: 142px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.46);
}

.chip-label,
.micro-copy,
.section-kicker,
.metric-tile span,
.sales-card span,
.detail-metrics span,
.queue-head span,
.fact-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.micro-copy {
  margin: 0 0 4px;
}

.meta-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 0.84rem;
  font-weight: 600;
}

.lang-switch,
.pitch-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.72);
  border: 1px solid var(--line);
}

.lang-button,
.pitch-button,
.prompt-chip,
.store-row,
.chat-launcher,
.primary-button,
.ghost-button,
.icon-button {
  cursor: pointer;
}

.lang-button,
.pitch-button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
}

.lang-button.is-active,
.pitch-button.is-active {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #f8f5ef;
}

.toolbar-button {
  padding-inline: 16px;
}

.workspace {
  gap: 16px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(320px, 0.76fr);
  gap: 16px;
  padding: 24px;
  border-radius: 34px;
  color: #f7f4ee;
  background:
    radial-gradient(circle at top right, rgba(24, 185, 165, 0.3), transparent 28%),
    radial-gradient(circle at bottom left, rgba(114, 139, 130, 0.18), transparent 28%),
    linear-gradient(135deg, #111917 0%, #192423 54%, #162f2d 100%);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% 42%;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 60%);
  pointer-events: none;
}

.hero-copy,
.hero-status-card,
.chatbot-panel,
.panel,
.store-detail,
.copilot-form {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: grid;
  align-content: start;
  gap: 16px;
}

.hero-copy h2 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.02;
  max-width: 14ch;
}

.hero-subtitle,
.support-copy,
.sales-card p,
.queue-card p,
.queue-card small,
.store-row span,
.store-row small,
.store-detail p,
.copilot-note,
.copilot-meta,
.chatbot-subcopy {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.hero-subtitle,
.hero-card .section-kicker,
.hero-card .support-copy,
.hero-card .chatbot-subcopy {
  color: rgba(247, 244, 238, 0.74);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-prompts,
.quick-asks {
  grid-template-columns: repeat(auto-fit, minmax(160px, max-content));
  align-items: start;
}

.prompt-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fbfaf7;
  text-align: left;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.prompt-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.16);
}

.hero-status-card {
  padding: 18px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-ping,
.launcher-signal {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #43dbc0;
  box-shadow: 0 0 0 0 rgba(67, 219, 192, 0.48);
  animation: pulse 2.6s infinite;
}

.hero-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 2px;
}

.fact-card,
.metric-tile,
.sales-card,
.queue-card,
.store-row,
.detail-metrics article,
.mini-list-item,
.pitch-message,
.pill {
  border-radius: 20px;
  border: 1px solid var(--line);
  min-width: 0;
}

.fact-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.fact-card span,
.fact-card strong {
  color: #f7f4ee;
}

.fact-value {
  display: block;
  margin-top: 7px;
  font-size: 0.98rem;
  font-weight: 600;
}

.signal-good {
  color: #7ef0d7;
}

.signal-alert {
  color: #ffc0ae;
}

.metric-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-tile {
  padding: 16px;
  background: rgba(255, 251, 246, 0.72);
}

.metric-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.workspace-grid {
  grid-template-columns: minmax(320px, 0.84fr) minmax(0, 1.16fr);
  align-items: start;
}

.commercial-panel {
  grid-column: 1 / -1;
}

.panel {
  padding: 20px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.46);
}

.panel h2,
.hero-status-card h3,
.chatbot-head h3 {
  font-size: clamp(1.06rem, 1.7vw, 1.32rem);
}

.sales-cards,
.detail-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sales-card {
  padding: 14px;
  background: var(--surface-strong);
}

.sales-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.04rem;
  overflow-wrap: anywhere;
}

.mini-list {
  margin-top: 12px;
}

.mini-list-item {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.pitch-switch {
  margin-top: 14px;
}

.pitch-message {
  margin-top: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  white-space: pre-wrap;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill,
.detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  background: var(--accent-soft);
  color: var(--ink);
}

.queue-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.queue-head {
  align-items: flex-start;
  margin-bottom: 8px;
}

.queue-card.critical {
  background: linear-gradient(180deg, var(--danger-soft), rgba(255, 255, 255, 0.86));
}

.queue-card.high {
  background: linear-gradient(180deg, var(--warning-soft), rgba(255, 255, 255, 0.86));
}

.store-workspace {
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
}

.store-list,
.chat-thread {
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.store-list::-webkit-scrollbar,
.chat-thread::-webkit-scrollbar {
  width: 8px;
}

.store-list::-webkit-scrollbar-thumb,
.chat-thread::-webkit-scrollbar-thumb {
  background: rgba(24, 32, 30, 0.12);
  border-radius: 999px;
}

.store-row {
  width: 100%;
  padding: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.store-row:hover,
.store-row.is-selected {
  transform: translateY(-1px);
  border-color: rgba(22, 107, 97, 0.26);
  background: linear-gradient(180deg, var(--accent-soft), rgba(255, 255, 255, 0.88));
}

.store-row strong,
.store-row span,
.store-row small,
.queue-card strong,
.detail-copy a,
.detail-copy strong,
.fact-card strong {
  overflow-wrap: anywhere;
}

.store-row-copy,
.store-row-metrics,
.store-detail,
.copilot-form {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.store-row-metrics {
  justify-items: end;
}

.detail-metrics article {
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.detail-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 1.04rem;
}

.detail-copy {
  display: grid;
  gap: 8px;
}

.empty-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 26px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(24, 32, 30, 0.16);
}

.chatbot-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: block;
}

.chat-launcher,
.primary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 999px;
  font-weight: 600;
}

.chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #f8f5ef;
  box-shadow: 0 20px 50px rgba(15, 79, 72, 0.34);
  position: relative;
  z-index: 2;
}

.chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(420px, calc(100vw - 24px));
  height: min(72vh, 690px);
  padding: 18px;
  border-radius: 28px;
  color: #f8f5ef;
  background:
    radial-gradient(circle at top right, rgba(24, 185, 165, 0.18), transparent 24%),
    linear-gradient(180deg, #101816 0%, #162221 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-strong);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.chatbot-panel[hidden] {
  display: none;
}

.chatbot-widget.is-open .chatbot-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.chatbot-head {
  align-items: flex-start;
}

.chatbot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1cb29f, var(--accent-strong));
  color: #f8f5ef;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.icon-button {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8f5ef;
}

.chat-thread {
  display: grid;
  gap: 12px;
}

.chat-message {
  display: flex;
}

.chat-message.is-user {
  justify-content: flex-end;
}

.chat-bubble {
  width: min(100%, 94%);
  padding: 15px 16px;
  border-radius: 20px;
  overflow-wrap: anywhere;
}

.chat-message.is-user .chat-bubble {
  background: linear-gradient(135deg, rgba(28, 178, 159, 0.22), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(28, 178, 159, 0.24);
}

.chat-message.is-assistant .chat-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-bubble p {
  margin: 0;
  line-height: 1.7;
}

.copilot-note,
.copilot-meta {
  margin-top: 10px;
  color: rgba(248, 245, 239, 0.72);
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 245, 239, 0.82);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mode-chip.gemini {
  background: rgba(28, 178, 159, 0.16);
  color: #8df2de;
}

.mode-chip.error {
  background: rgba(165, 83, 67, 0.18);
  color: #ffbcae;
}

.copilot-label,
.chatbot-subcopy {
  color: rgba(248, 245, 239, 0.74);
}

textarea {
  width: 100%;
  min-height: 110px;
  padding: 16px;
  border-radius: 20px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fbfaf7;
  outline: none;
}

textarea::placeholder {
  color: rgba(248, 245, 239, 0.46);
}

textarea:focus {
  border-color: rgba(28, 178, 159, 0.48);
  box-shadow: 0 0 0 4px rgba(28, 178, 159, 0.12);
}

.primary-button,
.ghost-button {
  padding: 11px 16px;
}

.primary-button {
  background: linear-gradient(135deg, #24ad98, var(--accent-strong));
  color: #f8f5ef;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(24, 32, 30, 0.08);
  color: var(--ink);
}

.primary-button:disabled {
  opacity: 0.72;
  cursor: progress;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(67, 219, 192, 0.42);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(67, 219, 192, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(67, 219, 192, 0);
  }
}

@media (max-width: 1140px) {
  .hero-card,
  .workspace-grid,
  .store-workspace,
  .hero-facts,
  .sales-cards,
  .detail-metrics {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 16px, 1280px);
    padding-top: 12px;
    padding-bottom: 124px;
  }

  .hero-card,
  .panel {
    padding: 16px;
    border-radius: 24px;
  }

  .chatbot-widget {
    right: 8px;
    left: 8px;
    bottom: 8px;
  }

  .chat-launcher,
  .chatbot-panel {
    width: 100%;
  }

  .chatbot-panel {
    right: 0;
    left: 0;
    bottom: 72px;
    height: min(76vh, 640px);
    padding: 16px;
  }

  .hero-actions,
  .topbar-actions {
    width: 100%;
  }

  .toolbar-button,
  .hero-actions .primary-button,
  .hero-actions .ghost-button {
    flex: 1 1 0;
    justify-content: center;
  }

  .hero-prompts,
  .quick-asks {
    grid-template-columns: 1fr;
  }
}
