/* =====================================================
   生意通 — Design System
   Dark theme + Orange-Gold accent
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  --bg-primary:    #0d0f1a;
  --bg-secondary:  #141728;
  --bg-card:       rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.08);
  --border:        rgba(255,255,255,0.1);
  --border-glow:   rgba(255,180,50,0.35);

  --accent:        #f5a623;
  --accent-deep:   #e06c00;
  --accent-light:  #ffd080;
  --accent-glow:   rgba(245,166,35,0.18);

  --text-primary:  #f0f0f8;
  --text-secondary:#a0a8c0;
  --text-muted:    #606880;

  --success:  #34d399;
  --danger:   #f87171;
  --info:     #60a5fa;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --shadow-card: 0 4px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(245,166,35,0.2);

  --font: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Typography ── */
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { line-height: 1.7; color: var(--text-secondary); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #1a0a00;
  box-shadow: 0 4px 18px rgba(245,166,35,0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(245,166,35,0.5);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: rgba(248,113,113,0.12);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.25);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(248,113,113,0.2);
}

.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card-glow {
  box-shadow: var(--shadow-card), var(--shadow-glow);
  border-color: var(--border-glow);
}

/* ── Input / Textarea ── */
.input, .textarea {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 12px 16px;
  outline: none;
  transition: var(--transition);
  resize: none;
}
.input:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.15);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-accent { background: var(--accent-glow); color: var(--accent-light); border: 1px solid rgba(245,166,35,0.3); }
.badge-success { background: rgba(52,211,153,0.12); color: var(--success); border: 1px solid rgba(52,211,153,0.25); }
.badge-info    { background: rgba(96,165,250,0.12); color: var(--info);    border: 1px solid rgba(96,165,250,0.25); }

/* ── Divider ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Gradient Text ── */
.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Background decoration ── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
}

/* ── Chat Bubbles ── */
.bubble {
  max-width: 78%;
  padding: 13px 17px;
  border-radius: 18px;
  line-height: 1.65;
  font-size: 0.95rem;
  word-break: break-word;
  white-space: pre-wrap;
}
.bubble-ai {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}
.bubble-user {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #1a0800;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

/* ── Typing indicator ── */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}
.typing-dots span {
  width: 7px; height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: dot-bounce 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Product Card (mini) ── */
.product-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  gap: 12px;
}
.product-chip .name { font-weight: 600; font-size: 0.95rem; }
.product-chip .price { color: var(--accent); font-weight: 700; font-size: 1.05rem; }
.product-chip .desc { font-size: 0.8rem; color: var(--text-muted); }

/* ── QR Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.25s ease;
}
.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), var(--shadow-glow);
  animation: slide-up 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-qr-img {
  width: 100%;
  max-width: 230px;
  border-radius: var(--radius);
  background: white;
  padding: 8px;
  margin: 20px auto;
  display: block;
}
.modal-amount {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 12px 0 4px;
}
.modal-label { font-size: 0.85rem; color: var(--text-muted); }

/* ── Animations ── */
@keyframes fade-in  { from { opacity:0 } to { opacity:1 } }
@keyframes slide-up { from { opacity:0; transform:translateY(30px) scale(0.95) } to { opacity:1; transform:none } }
@keyframes fade-in-up { from { opacity:0; transform:translateY(12px) } to { opacity:1; transform:none } }
.animate-in { animation: fade-in-up 0.35s ease forwards; }

/* ── Utility ── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }
