* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --brand:#ff6e4a; --ink:#20242b; --sub:#7a8087; --bg:#f7f5f1; --card:#ffffff; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--bg); font-size: 15px;
}
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* topbar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid #ece7df; }
.topbar-in { display: flex; align-items: center; gap: 18px; height: 62px; }
.logo { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.logo-dot { color: var(--brand); }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: #f0ede7; border-radius: 20px; padding: 9px 16px; color: #9a958d; max-width: 360px; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; font: inherit; color: var(--ink); }
.topnav { display: flex; gap: 16px; font-size: 14px; color: var(--sub); }
.topnav a { cursor: pointer; padding: 4px 2px; }
.topnav a.on { color: var(--ink); font-weight: 700; }
.me { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.me-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.login-btn { border: 1.5px solid var(--brand); color: var(--brand); border-radius: 18px; padding: 6px 16px; font-size: 13.5px; font-weight: 600; }
.login-btn:hover { background: var(--brand); color: #fff; }

/* hero */
.hero { background: linear-gradient(120deg, #ffe8dd, #fff6ea 55%, #fdf3ff); border-bottom: 1px solid #f0e6da; }
.hero-in { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-top: 46px; padding-bottom: 46px; }
.hero-kicker { font-size: 12px; letter-spacing: 3px; color: var(--brand); font-weight: 700; margin-bottom: 12px; }
.hero-text h1 { font-size: 38px; line-height: 1.25; letter-spacing: -1px; margin-bottom: 14px; }
.hero-text p { color: var(--sub); margin-bottom: 22px; }
.hero-cta { background: var(--ink); color: #fff; border-radius: 24px; padding: 12px 26px; font-weight: 600; }
.hero-cta:hover { background: #000; }
#heroArt { border-radius: 18px; box-shadow: 0 16px 40px rgba(32,36,43,.14); }

/* products */
main { padding: 40px 20px 90px; }
.sec-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.sec-title h2 { font-size: 22px; letter-spacing: -.3px; }
.sec-sub { color: var(--sub); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.product { background: var(--card); border-radius: 16px; overflow: hidden; border: 1px solid #eee8df; transition: .18s; cursor: pointer; }
.product:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(32,36,43,.1); }
.product canvas { display: block; width: 100%; height: 170px; }
.p-body { padding: 12px 14px 14px; }
.p-name { font-weight: 700; margin-bottom: 4px; }
.p-desc { font-size: 12.5px; color: var(--sub); margin-bottom: 10px; min-height: 17px; }
.p-row { display: flex; align-items: center; justify-content: space-between; }
.p-price { color: var(--brand); font-weight: 800; font-size: 17px; }
.p-price::before { content: "¥"; font-size: 12px; margin-right: 1px; }
.p-tag { font-size: 11px; color: var(--sub); border: 1px solid #e5dfd5; padding: 3px 8px; border-radius: 10px; }
.foot { text-align: center; color: #a39d92; font-size: 12.5px; padding: 30px 0 110px; }

/* service fab */
.service-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff; border-radius: 26px;
  padding: 13px 20px; font-weight: 700; font-size: 14.5px;
  box-shadow: 0 12px 30px rgba(255,110,74,.4);
}
.service-fab:hover { filter: brightness(1.05); }
.fab-badge { background: #fff; color: var(--brand); font-size: 11px; font-weight: 800; border-radius: 9px; padding: 1px 7px; }

/* auth */
.overlay { position: fixed; inset: 0; background: rgba(32,36,43,.5); z-index: 50; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 360px; max-width: calc(100vw - 32px); background: #fff; border-radius: 18px; padding: 30px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.auth-brand { font-size: 20px; font-weight: 800; text-align: center; }
.auth-sub { font-size: 13px; color: var(--sub); text-align: center; margin: 6px 0 18px; }
.auth-tabs { display: flex; background: #f0ede7; border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.auth-tabs button { flex: 1; padding: 7px 0; border-radius: 8px; font-size: 13.5px; color: var(--sub); }
.auth-tabs button.active { background: #fff; font-weight: 700; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.auth-card input { width: 100%; border: 1px solid #e2dcd2; border-radius: 10px; padding: 11px 13px; outline: none; margin-bottom: 12px; font-size: 14px; }
.auth-card input:focus { border-color: var(--brand); }
.form-error { color: #e5484d; font-size: 13px; min-height: 18px; margin: -4px 0 8px; }
.btn-main { width: 100%; background: var(--brand); color: #fff; border-radius: 10px; padding: 12px 0; font-weight: 700; }
.btn-main:hover { filter: brightness(1.05); }

/* drawer */
.drawer-mask { position: fixed; inset: 0; background: rgba(32,36,43,.35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: 400px; max-width: 94vw; background: #fff;
  box-shadow: -16px 0 50px rgba(32,36,43,.18);
  display: flex; flex-direction: column;
  animation: slidein .22s ease;
}
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #f0ece4; }
.dw-title { font-weight: 800; font-size: 16px; }
.dw-close { color: #9a958d; font-size: 16px; padding: 4px 8px; border-radius: 8px; }
.dw-close:hover { background: #f4f0e9; }
.dw-pick { padding: 18px; overflow-y: auto; }
.dw-pick-tip { font-size: 13.5px; color: var(--sub); margin-bottom: 14px; }
.dw-pick-tip b { color: var(--brand); }
.agent-list { display: flex; flex-direction: column; gap: 10px; }
.agent-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1px solid #eee8df; border-radius: 14px; padding: 13px 14px; background: #fff;
}
.agent-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(255,110,74,.12); }
.agent-ava { width: 42px; height: 42px; border-radius: 50%; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; font-size: 16px; }
.agent-info { flex: 1; min-width: 0; }
.agent-name { font-weight: 700; }
.agent-meta { font-size: 12px; color: var(--sub); margin-top: 2px; }
.agent-on { color: #2fa96c; font-size: 12px; flex: none; }

.dw-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cs-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #f0ece4; }
.cs-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.cs-name { font-weight: 800; font-size: 15px; }
.cs-status { font-size: 12px; color: #2fa96c; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; background: #faf8f4; }
.msg-row { display: flex; gap: 9px; align-items: flex-end; }
.msg-row.me { justify-content: flex-end; }
.msg-ava { width: 30px; height: 30px; border-radius: 50%; flex: none; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.bubble { max-width: 74%; padding: 10px 14px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; border-radius: 4px 14px 14px 14px; background: #fff; border: 1px solid #efeae1; }
.msg-row.me .bubble { background: var(--brand); color: #fff; border: 0; border-radius: 14px 4px 14px 14px; }
.sys-line { text-align: center; font-size: 12px; color: #a39d92; }
.chips { display: flex; gap: 8px; padding: 10px 18px 0; flex-wrap: wrap; }
.chip { border: 1px solid #e5dfd5; color: var(--sub); font-size: 12.5px; border-radius: 14px; padding: 5px 12px; }
.chip:hover { color: var(--brand); border-color: var(--brand); }
.cs-input-row { display: flex; gap: 10px; padding: 12px 18px 16px; }
.cs-input-row input { flex: 1; border: 1px solid #e2dcd2; border-radius: 12px; padding: 11px 14px; outline: none; font-size: 14px; }
.cs-input-row input:focus { border-color: var(--brand); }
.cs-input-row button { background: var(--brand); color: #fff; border-radius: 12px; padding: 0 20px; font-weight: 700; }

#toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(16px); background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 18px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .search, .topnav { display: none; }
  .hero-in { flex-direction: column; align-items: flex-start; }
  #heroArt { width: 100%; height: auto; }
}
