/* 小顺小物官网 — 大屏优先 */
:root {
  --c-brand: #2a9d72;
  --c-brand-light: #3eb889;
  --c-brand-dark: #1a5c45;
  --c-brand-soft: #e8f6f0;
  --c-gold: #c9a227;
  --c-gold-soft: #f5ecd4;
  --c-ink: #15202b;
  --c-ink-muted: #5c6b7a;
  --c-paper: #faf9f7;
  --c-white: #ffffff;
  --c-border: #e8e4de;
  --shadow-sm: 0 2px 8px rgba(21, 32, 43, 0.06);
  --shadow-md: 0 12px 40px rgba(21, 32, 43, 0.1);
  --shadow-lg: 0 24px 64px rgba(21, 32, 43, 0.14);
  --shadow-glow: 0 0 80px rgba(46, 157, 114, 0.25);
  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 72px;
  --footer-h: 40px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--c-ink);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.hidden { display: none !important; }

img { max-width: 100%; display: block; }

/* ========== 落地页 ========== */
.landing {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.landing-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 10% 20%, rgba(46, 157, 114, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 50% at 95% 80%, rgba(201, 162, 39, 0.12), transparent 50%),
    linear-gradient(165deg, #0f1a24 0%, #163528 42%, #1e4a3d 100%);
}

.landing-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.15;
}

.landing-deco--1 {
  width: 480px;
  height: 480px;
  right: -120px;
  top: -80px;
  background: radial-gradient(circle, rgba(62, 184, 137, 0.2) 0%, transparent 65%);
}

.landing-deco--2 {
  width: 400px;
  height: 400px;
  left: -100px;
  bottom: -80px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
}

.site-header {
  position: relative;
  z-index: 10;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 clamp(24px, 4vw, 80px);
  max-width: 1320px;
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.logo img {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  object-fit: contain;
}

.landing .logo img {
  background: transparent;
}

.hero {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr min(420px, 38vw);
  gap: clamp(32px, 4vw, 64px);
  align-items: center;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 80px) calc(var(--footer-h) + 48px);
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
}

.hero-intro {
  color: #fff;
  animation: fadeUp 0.8s var(--ease) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-brand-light);
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(62, 184, 137, 0.15);
  border: 1px solid rgba(62, 184, 137, 0.35);
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.title-accent {
  display: inline-block;
  margin-top: 0.15em;
  background: linear-gradient(90deg, #fff 0%, #a8e6cf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
  max-width: 32em;
  margin-bottom: 2.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 2rem;
  animation: fadeUp 0.8s var(--ease) 0.1s both;
}

.feature-card {
  padding: 1.25rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  transition: transform 0.25s var(--ease), border-color 0.25s;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(62, 184, 137, 0.4);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
  line-height: 1;
}

.feature-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.feature-card p {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
}

/* 安卓下载 */
.app-download {
  margin-bottom: 2rem;
  animation: fadeUp 0.8s var(--ease) 0.15s both;
}

.app-download-card {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.app-download-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 180px;
}

.app-download-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(62, 184, 137, 0.2);
  border: 1px solid rgba(62, 184, 137, 0.35);
  color: var(--c-brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-download-head h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.app-download-head p {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
}

.app-download-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.app-download-qr {
  display: block;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.app-download-qr:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.app-download-qr img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.app-download-link {
  font-size: 0.8125rem;
  color: var(--c-brand-light);
  text-decoration: none;
  border-bottom: 1px solid rgba(62, 184, 137, 0.4);
  transition: color 0.2s, border-color 0.2s;
}

.app-download-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.hero-figure {
  position: relative;
  margin-top: 1rem;
  animation: fadeUp 0.9s var(--ease) 0.2s both;
}

.hero-shun {
  width: min(320px, 42vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 48px rgba(0, 0, 0, 0.35)) drop-shadow(var(--shadow-glow));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* 登录卡片 */
.hero-login {
  animation: fadeUp 0.85s var(--ease) 0.15s both;
}

.login-card {
  background: var(--c-white);
  border-radius: 24px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.login-card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.wechat-badge {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #09bb07, #07a006);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(7, 160, 6, 0.35);
}

.login-card-head h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-ink);
  margin-bottom: 0.25rem;
}

.login-card-head p {
  font-size: 0.875rem;
  color: var(--c-ink-muted);
  line-height: 1.5;
}

.steps {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.step {
  flex: 1;
  text-align: center;
  font-size: 0.6875rem;
  color: var(--c-ink-muted);
  line-height: 1.3;
}

.step i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 auto 6px;
  border-radius: 50%;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f0f2f5;
  color: var(--c-ink-muted);
  transition: all 0.3s var(--ease);
}

.step.is-active i {
  background: var(--c-brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(42, 157, 114, 0.4);
}

.step.is-active { color: var(--c-brand-dark); font-weight: 500; }

.step.is-done i {
  background: var(--c-brand-soft);
  color: var(--c-brand);
}

.qr-box {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.qr-frame {
  position: relative;
  padding: 12px;
  background: linear-gradient(145deg, #f8f9fa, #fff);
  border-radius: 20px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.qr-frame--sm {
  max-width: 220px;
  margin: 0 auto 1.25rem;
}

.qr-corner::before,
.qr-corner::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid var(--c-brand);
  border-radius: 2px;
  pointer-events: none;
}

.qr-corner::before {
  top: 6px;
  left: 6px;
  border-right: none;
  border-bottom: none;
}

.qr-corner::after {
  bottom: 6px;
  right: 6px;
  border-left: none;
  border-top: none;
}

.qr-inner {
  position: relative;
  width: 248px;
  height: 248px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.qr-frame--sm .qr-inner {
  width: 196px;
  height: 196px;
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-image.hidden { display: none; }

.qr-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fafbfc;
  color: var(--c-ink-muted);
  font-size: 0.875rem;
}

.qr-loading.is-error {
  padding: 16px;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #c53030;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e8e4de;
  border-top-color: var(--c-brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.qr-shine {
  position: absolute;
  inset: 12px;
  border-radius: 12px;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 60%
  );
  background-size: 200% 100%;
  animation: shine 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.qr-hint {
  text-align: center;
  font-size: 0.875rem;
  min-height: 1.4em;
  color: var(--c-ink-muted);
}

.qr-hint.is-ok { color: var(--c-brand); font-weight: 500; }
.qr-hint.is-error { color: #c53030; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-paper);
  color: var(--c-ink);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-secondary:hover {
  border-color: var(--c-brand);
  background: var(--c-brand-soft);
  color: var(--c-brand-dark);
}

.login-faq {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--c-ink-muted);
}

.login-faq summary {
  cursor: pointer;
  user-select: none;
  color: var(--c-brand);
}

.login-faq p {
  margin-top: 0.5rem;
  line-height: 1.6;
}

.login-faq code {
  font-size: 0.75rem;
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ========== 对话页 ========== */
.chat-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-paper);
}

.chat-header {
  flex-shrink: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 3vw, 48px);
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.chat-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-brand img { border-radius: 10px; }

.chat-header-brand strong {
  display: block;
  font-size: 1rem;
  color: var(--c-brand-dark);
}

.chat-header-brand span {
  font-size: 0.75rem;
  color: var(--c-ink-muted);
}

.btn-ghost {
  padding: 0.5rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: transparent;
  color: var(--c-ink-muted);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover {
  border-color: var(--c-brand);
  color: var(--c-brand-dark);
}

.chat-body {
  flex: 1;
  display: flex;
  gap: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 32px) calc(var(--footer-h) + 24px);
  min-height: 0;
}

.chat-aside {
  width: 220px;
  flex-shrink: 0;
}

.aside-card {
  position: sticky;
  top: 24px;
  padding: 1.5rem;
  background: var(--c-white);
  border-radius: 20px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.aside-card img {
  width: 100px;
  margin: 0 auto 1rem;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(42, 157, 114, 0.2);
}

.aside-quote {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--c-ink-muted);
  margin-bottom: 1rem;
}

.aside-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--c-brand-soft);
  color: var(--c-brand-dark);
}

.chat-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-panel-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border-radius: 24px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-height: calc(100vh - var(--header-h) - var(--footer-h) - 80px);
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 1.5rem 1rem;
  scroll-behavior: smooth;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.msg-row {
  display: flex;
  gap: 12px;
  max-width: 100%;
  animation: msgIn 0.35s var(--ease) both;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-row.user {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
}

.msg-bubble {
  max-width: min(85%, 560px);
  padding: 1rem 1.15rem;
  border-radius: 18px;
  font-size: 0.9375rem;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-row.ai .msg-bubble {
  background: #f4f6f8;
  color: var(--c-ink);
  border-bottom-left-radius: 4px;
}

.msg-row.user .msg-bubble {
  background: linear-gradient(135deg, var(--c-brand-light), var(--c-brand));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 16px rgba(42, 157, 114, 0.25);
}

.msg-meta {
  font-size: 0.6875rem;
  color: var(--c-ink-muted);
  margin-top: 0.35rem;
  padding-left: 2px;
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.5rem 0;
  font-size: 0.8125rem;
  color: var(--c-ink-muted);
}

.chat-typing img {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.dot-pulse i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 2px;
  background: var(--c-brand);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.dot-pulse i:nth-child(2) { animation-delay: 0.15s; }
.dot-pulse i:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-footer {
  flex-shrink: 0;
  padding: 1rem 1.25rem 1.25rem;
  background: linear-gradient(to top, #faf9f7, var(--c-white));
  border-top: 1px solid var(--c-border);
}

.suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.suggest-chips button {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-white);
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--c-ink);
  cursor: pointer;
  transition: all 0.2s;
}

.suggest-chips button:hover {
  border-color: var(--c-brand);
  background: var(--c-brand-soft);
  color: var(--c-brand-dark);
}

.composer {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.composer textarea {
  flex: 1;
  min-height: 52px;
  max-height: 160px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: 16px;
  font-size: 0.9375rem;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  outline: none;
  background: var(--c-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.composer textarea:focus {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px rgba(42, 157, 114, 0.12);
}

.btn-primary {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--c-brand-light), var(--c-brand));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(42, 157, 114, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover:not(:disabled) {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(42, 157, 114, 0.45);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block { width: 100%; height: auto; padding: 0.9rem; border-radius: 12px; }

/* 弹层 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(21, 32, 43, 0.5);
  backdrop-filter: blur(4px);
}

.modal-sheet {
  position: relative;
  width: min(400px, 100%);
  padding: 2rem 1.75rem;
  background: var(--c-white);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.modal-sheet h3 {
  font-size: 1.25rem;
  color: var(--c-brand-dark);
  margin-bottom: 0.5rem;
}

.modal-sheet p {
  font-size: 0.875rem;
  color: var(--c-ink-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f0f2f5;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--c-ink-muted);
  cursor: pointer;
}

/* 页脚 */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  pointer-events: none;
}

body:not(.is-chat) .site-footer a {
  color: rgba(255, 255, 255, 0.45);
}

body.is-chat .site-footer a {
  color: var(--c-ink-muted);
}

.site-footer a {
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover { color: var(--c-brand); }

/* 响应式 */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    padding-bottom: calc(var(--footer-h) + 32px);
  }

  .hero-login { order: -1; }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero-figure {
    display: flex;
    justify-content: center;
  }

  .hero-shun { width: 200px; }

  .app-download-card {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .app-download-head {
    justify-content: center;
    text-align: left;
  }

  .chat-aside { display: none; }

  .chat-panel-inner {
    min-height: calc(100vh - var(--header-h) - var(--footer-h) - 48px);
  }
}

@media (max-width: 480px) {
  .qr-inner {
    width: 200px;
    height: 200px;
  }

  .login-card {
    padding: 1.5rem 1.25rem;
  }

  .steps span {
    display: none;
  }

  .step i { margin-bottom: 0; }
}

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