/* 慧成商家宝 H5 · M1 静态原型
   风格参考旧小程序演示稿：绿色主操作、白色卡片、对话气泡、圆角。
   移动优先；390 为主，兼容 375/430；不使用 hover 才能完成的操作。 */

:root {
  --g900: #064e3b;
  --g800: #065f46;
  --g700: #047857;
  --g600: #059669;
  --g500: #10b981;
  --g100: #d1fae5;
  --g50: #ecfdf5;
  --ink: #0f172a;
  --ink2: #334155;
  --mut: #64748b;
  --mut2: #94a3b8;
  --line: #e7eaee;
  --line2: #eef3f0;
  --bg: #f5f7f6;
  --card: #fff;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --amber-line: #fde68a;
  --red: #b91c1c;
  --red-bg: #fef2f2;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .03);
  --shadow-lg: 0 18px 40px -24px rgba(4, 120, 87, .45);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
}

body {
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 72% 6%, #14263d 0%, #0b1320 46%, #070b12 100%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: 16px;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

body.modal-open { overflow: hidden; }

/* ---------- 外壳 ---------- */

.app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.boot-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--mut);
  font-size: 13px;
}

.boot-mark {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--g500), var(--g700));
  color: #fff;
  font-size: 23px;
  font-weight: 800;
  box-shadow: 0 14px 30px -14px rgba(4, 120, 87, .8);
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 99;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-top);
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  background: linear-gradient(145deg, var(--g500), var(--g700));
  box-shadow: 0 8px 18px -10px rgba(4, 120, 87, .8);
}

.brand-text { min-width: 0; }
.brand-name {
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: .15px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  color: var(--mut2);
  font-size: 9.5px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--ink2);
}
.icon-btn:active { background: #f1f5f4; }
.icon-btn .ic { width: 21px; height: 21px; }

.demo-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #bbf7d0;
  background: var(--g50);
  color: var(--g800);
  font-size: 9.5px;
  font-weight: 650;
  white-space: nowrap;
}
.demo-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--g500);
  display: block;
}

.view {
  flex: 1;
  padding: 16px 16px calc(26px + var(--safe-bottom));
  animation: viewIn .22s ease both;
}
/* 底部停靠区（动作条 + Tab）在文档流里，页面留白只做视觉缓冲 */
.view.has-actionbar { padding-bottom: calc(34px + var(--safe-bottom)); }
.view.chat-page.has-actionbar { padding-bottom: calc(26px + var(--safe-bottom)); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 底部停靠区：主操作 + Tab ---------- */

.dock {
  position: sticky;
  bottom: 0;
  z-index: 27;
  flex: 0 0 auto;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 30px -26px rgba(15, 23, 42, .55);
  padding-bottom: var(--safe-bottom);
}

.dock .actionbar {
  position: static;
  z-index: auto;
  background: none;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line2);
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}

.dock-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  color: var(--mut2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
}
.dock-tab .ic { width: 21px; height: 21px; }
.dock-tab:active { background: #f6faf8; }
.dock-tab.on { color: var(--g700); }
.dock-tab.on .ic { stroke-width: 2.1; }

.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: flex;
  gap: 9px;
  padding: 10px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(245, 247, 246, 0) 0%, var(--bg) 30%);
}
.actionbar .btn { flex: 1; }
.actionbar .btn-ghost { flex: 0 0 96px; }

.composer-bar {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px 12px calc(9px + var(--safe-bottom));
  gap: 8px;
}
.composer {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.composer input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  background: #f7f9f8;
  border-radius: 999px;
  padding: 0 15px;
  outline: none;
  font-size: 16px;
}
.composer input:focus {
  background: #fff;
  border-color: #a7f3d0;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .1);
}
.send-btn {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--g600);
  color: #fff;
  box-shadow: 0 8px 16px -10px rgba(4, 120, 87, .8);
}
.send-btn:active { background: var(--g700); }
.send-btn .ic { width: 19px; height: 19px; }

/* ---------- 通用 ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 10px; }

.section { margin-top: 22px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 10px;
}
.section-head h2 {
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .2px;
}
.section-head span {
  color: var(--mut2);
  font-size: 10.5px;
  white-space: nowrap;
}

.eyebrow {
  color: var(--g700);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.muted { color: var(--mut); }
.nowrap { white-space: nowrap; }
.tiny { font-size: 11px; line-height: 1.55; color: var(--mut); }
.fine {
  margin: 12px 2px 0;
  color: var(--mut2);
  font-size: 10.5px;
  line-height: 1.6;
}
.text-green { color: var(--g700); }
.text-red { color: var(--red); }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}
.pill.green { background: var(--g50); color: var(--g800); }
.pill.gray { background: #f1f5f9; color: #64748b; }
.pill.amber { background: #fff7ed; color: #c2410c; }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.white { background: rgba(255, 255, 255, .15); color: #fff; border: 1px solid rgba(255, 255, 255, .2); }
.pill.dark { background: #0f172a; color: #fff; }

.btn {
  min-height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  transition: transform .12s ease, background .12s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary {
  background: linear-gradient(145deg, var(--g600), var(--g700));
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(4, 120, 87, .8);
}
.btn-primary:active { background: var(--g800); }
.btn-ghost {
  background: #fff;
  color: var(--ink2);
  border: 1px solid var(--line);
}
.btn-soft {
  background: var(--g50);
  color: var(--g800);
  border: 1px solid #bbf7d0;
}
.btn-white { background: #fff; color: var(--g800); }
.btn-ghost-light {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
}
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { min-height: 40px; font-size: 13px; border-radius: 12px; padding: 0 12px; }
.btn-block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }

.icon { width: 20px; height: 20px; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin .7s linear infinite;
  opacity: .8;
}
@keyframes spin { to { transform: rotate(360deg); } }

.note-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--g50);
  border: 1px solid #bbf7d0;
  color: var(--g800);
  font-size: 11.5px;
  line-height: 1.55;
}
.note-box.warn {
  background: var(--amber-bg);
  border-color: var(--amber-line);
  color: #92400e;
}
.note-box .ic { width: 15px; height: 15px; margin-top: 1px; }
.note-box b { font-weight: 750; }

.autosave {
  margin: 18px 0 0;
  text-align: center;
  color: var(--mut2);
  font-size: 10px;
}

.empty-state {
  text-align: center;
  padding: 30px 20px;
}
.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--g50);
  color: var(--g700);
}
.empty-icon .ic { width: 26px; height: 26px; }
.empty-state h2 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { color: var(--mut); font-size: 12.5px; line-height: 1.65; margin-bottom: 14px; }

/* ---------- 首页 ---------- */

.view-home {
  display: flex;
  flex-direction: column;
}

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  border-radius: 24px;
  padding: 22px 18px 18px;
  background: linear-gradient(140deg, #064e3b 0%, #047857 52%, #059669 100%);
  box-shadow: 0 20px 38px -22px rgba(4, 120, 87, .7);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: 190px;
  height: 190px;
  right: -70px;
  top: -80px;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 68%);
}
.hero::after {
  width: 130px;
  height: 130px;
  left: -50px;
  bottom: -70px;
  border: 1px solid rgba(255, 255, 255, .12);
}
.hero > * { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
}
.hero-badge .ic { width: 12px; height: 12px; }
.hero h1 {
  margin: 14px 0 9px;
  font-size: clamp(28px, 7.5vw, 34px);
  line-height: 1.2;
  letter-spacing: -.8px;
  font-weight: 800;
}
.hero .hero-sub {
  color: rgba(255, 255, 255, .82);
  font-size: 12.5px;
  line-height: 1.7;
  max-width: 22em;
}
.hero-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.hero-foot {
  margin-top: 12px;
  color: rgba(255, 255, 255, .58);
  font-size: 9.5px;
  line-height: 1.5;
}
.home-caps {
  margin-top: 18px;
  padding: 4px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.home-cap {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0;
}
.home-cap + .home-cap { border-top: 1px solid var(--line2); }
.home-cap-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--g50);
  color: var(--g700);
}
.home-cap-icon .ic { width: 17px; height: 17px; }
.home-cap b {
  display: block;
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.3;
}
.home-cap span {
  display: block;
  color: var(--mut);
  font-size: 10.5px;
  line-height: 1.5;
  margin-top: 2px;
}

.home-foot {
  margin: 0 2px;
  padding-top: 28px;
  text-align: center;
  color: var(--mut2);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .1px;
}
.view-home .home-foot { margin-top: auto; }

.continue-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.continue-card .continue-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--g50);
  color: var(--g700);
}
.continue-card .continue-main { flex: 1; min-width: 0; }
.continue-card b { display: block; font-size: 13.5px; }
.continue-card span { display: block; color: var(--mut); font-size: 10.5px; margin-top: 2px; }
.continue-card .btn { flex: 0 0 auto; }

.store-list { display: grid; gap: 9px; }
.store-card {
  display: flex;
  gap: 11px;
  padding: 13px;
  border-radius: 17px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.store-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--g500), var(--g700));
}
.store-avatar.amber { background: linear-gradient(145deg, #f59e0b, #b45309); }
.store-avatar.terracotta { background: linear-gradient(145deg, #fb923c, #c2410c); }
.store-main { flex: 1; min-width: 0; }
.store-name {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.store-meta {
  color: var(--mut);
  font-size: 10.5px;
  line-height: 1.5;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}
.store-actions .btn { flex: 1; min-width: 120px; }

.flow-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  padding: 12px 8px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.flow-item { text-align: center; min-width: 0; }
.flow-item b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 auto 5px;
  border-radius: 50%;
  background: var(--g50);
  color: var(--g700);
  font-size: 10px;
}
.flow-item span {
  display: block;
  font-size: 8.5px;
  color: var(--mut);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-dir {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 13px;
}
.demo-dir summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink2);
}
.demo-dir summary::-webkit-details-marker { display: none; }
.demo-dir summary::after {
  content: "+";
  color: var(--mut2);
  font-size: 16px;
  font-weight: 400;
}
.demo-dir[open] summary::after { content: "−"; }
.dir-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}
.dir-link {
  display: block;
  padding: 9px 10px;
  border-radius: 11px;
  background: #f8faf9;
  border: 1px solid var(--line2);
  min-width: 0;
}
.dir-link b { display: block; font-size: 12px; }
.dir-link span { display: block; color: var(--mut2); font-size: 9.5px; margin-top: 1px; }

/* ---------- 页面标题 ---------- */

.page-head { margin: 0 2px 14px; }
.page-head .eyebrow { margin-bottom: 5px; }
.page-head h1 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -.4px;
  font-weight: 800;
}
.page-head p {
  color: var(--mut);
  font-size: 12px;
  line-height: 1.65;
  margin-top: 6px;
}

/* ---------- 门店信息：自由描述 ---------- */

.view-store-brief { display: flex; flex-direction: column; }

.freeform-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 0 16px;
}
.freeform-page:focus-within {
  justify-content: flex-start;
  padding-top: 4px;
}
.freeform-head { margin-bottom: 20px; }

.store-brief {
  display: block;
  width: 100%;
  min-height: 220px;
  max-height: 40dvh;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
  resize: none;
  outline: none;
  overflow-y: auto;
  box-shadow: 0 12px 30px -26px rgba(4, 120, 87, .55);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.store-brief::placeholder { color: var(--mut2); }
.store-brief:focus {
  border-color: #a7f3d0;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .1), 0 12px 30px -26px rgba(4, 120, 87, .55);
}

.freeform-hint {
  margin-top: 10px;
  color: var(--mut);
  font-size: 11px;
  line-height: 1.6;
}
.freeform-submit { margin-top: 20px; scroll-margin-bottom: 16px; }

/* ---------- 对话建档 ---------- */

.chat-page { padding-bottom: 8px; }
.chat-list { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg.user { justify-content: flex-end; }
.avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(145deg, var(--g500), var(--g700));
  box-shadow: 0 5px 12px -7px rgba(4, 120, 87, .8);
}
.bubble {
  max-width: 84%;
  padding: 11px 13px;
  border-radius: 16px 16px 16px 5px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 14.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.bubble small {
  display: block;
  color: var(--mut2);
  font-size: 10px;
  margin-top: 4px;
}
.msg.user .bubble {
  background: linear-gradient(150deg, var(--g600), var(--g700));
  color: #fff;
  border: 0;
  border-radius: 16px 16px 5px 16px;
  box-shadow: 0 8px 18px -12px rgba(4, 120, 87, .8);
}
.msg.user .bubble small { color: rgba(255, 255, 255, .7); }
.chat-options { margin: -4px 0 0 38px; }
.chat-options .chips { margin-top: 2px; }
.chat-summary { margin-top: 14px; }
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 9px;
}
.summary-item {
  padding: 9px 10px;
  border-radius: 11px;
  background: #f8faf9;
  border: 1px solid var(--line2);
  min-width: 0;
}
.summary-item span { display: block; color: var(--mut2); font-size: 9.5px; }
.summary-item b {
  display: block;
  font-size: 12.5px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.chat-edit-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.chat-edit-row .btn { flex: 1; }

/* ---------- chips / forms ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #bfe9d8;
  background: #f4fdf9;
  color: var(--g800);
  font-size: 12.5px;
  font-weight: 600;
}
.chip:active { transform: scale(.98); background: var(--g50); }
.chip.selected { background: var(--g600); border-color: var(--g600); color: #fff; }
.chip.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--mut);
}
.chip .ic { width: 14px; height: 14px; }

.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--ink2);
  font-size: 11.5px;
  font-weight: 700;
}
.field > label span { color: var(--mut2); font-weight: 500; }
.input, .textarea, .select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  outline: none;
  font-size: 16px;
  color: var(--ink);
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus, .select:focus {
  border-color: #a7f3d0;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .1);
}
.input::placeholder, .textarea::placeholder { color: #b3bfca; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-help { color: var(--mut2); font-size: 10px; margin-top: 5px; line-height: 1.5; }
.form-error { color: var(--red); font-size: 11px; margin-top: 5px; line-height: 1.5; }
.form-actions { display: flex; gap: 8px; margin-top: 13px; }
.form-actions .btn { flex: 1; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line2);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink2);
}
.check-row:last-child { border-bottom: 0; }
.check-row input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--g600);
}

/* ---------- 确认门店 ---------- */

.candidate-list {
  display: grid;
  gap: 9px;
  margin-top: 4px;
}
.candidate {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 15px;
  border: 1.5px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
  width: 100%;
}
.candidate.selected {
  border-color: var(--g500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .1);
}
.candidate .radio {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  display: grid;
  place-items: center;
}
.candidate.selected .radio { border-color: var(--g600); }
.candidate.selected .radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--g600);
}
.candidate-main { flex: 1; min-width: 0; }
.candidate-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 750;
}
.candidate-meta {
  color: var(--mut);
  font-size: 10.5px;
  line-height: 1.55;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.candidate-back { margin-top: 12px; }

/* ---------- 正在分析 ---------- */

.analyzing-page { padding: 26px 2px 0; }
.analyzing-page h1 {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.6px;
  font-weight: 800;
}
.analyzing-sub {
  margin-top: 8px;
  color: var(--mut);
  font-size: 12.5px;
  line-height: 1.7;
}
.analyzing-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--mut);
  font-size: 11px;
  font-weight: 700;
}
.progress-head b {
  color: var(--g700);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.progress-track {
  height: 9px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e8efec;
  overflow: hidden;
}
.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--g500), var(--g700));
  transition: width .18s ease;
}
.analyzing-steps {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}
.analyzing-step {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--mut2);
  font-size: 12px;
}
.analyzing-step .dot {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  display: grid;
  place-items: center;
  transition: background .2s ease, border-color .2s ease;
}
.analyzing-step.done { color: var(--ink2); }
.analyzing-step.done .dot {
  background: var(--g600);
  border-color: var(--g600);
}
.analyzing-step.done .dot::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

/* ---------- 分析报告 ---------- */

.report-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  border-radius: 22px;
  padding: 17px;
  background: linear-gradient(140deg, #064e3b 0%, #047857 55%, #059669 100%);
  box-shadow: 0 18px 34px -20px rgba(4, 120, 87, .7);
}
.report-hero::after {
  content: "";
  position: absolute;
  right: -55px;
  top: -65px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 70%);
}
.report-hero > * { position: relative; z-index: 1; }
.report-hero h1 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -.4px;
  margin: 8px 0 5px;
}
.report-hero h2 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -.3px;
  margin: 8px 0 5px;
}
.report-hero p { color: rgba(255, 255, 255, .8); font-size: 11.5px; line-height: 1.6; }
.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}
.report-body { margin-top: 12px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-tile {
  padding: 10px 11px;
  border-radius: 12px;
  background: #f8faf9;
  border: 1px solid var(--line2);
  min-width: 0;
}
.info-tile span { color: var(--mut2); font-size: 9.5px; display: block; }
.info-tile b { font-size: 12.5px; display: block; margin-top: 2px; overflow-wrap: anywhere; }
.check-list { display: grid; gap: 7px; }
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink2);
}
.check-list li .ic { width: 14px; height: 14px; margin-top: 2px; color: var(--g600); flex: 0 0 auto; }
.risk-list li .ic { color: var(--amber); }
.product-row {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line2);
}
.product-row:last-child { border-bottom: 0; }
.product-rank {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--g50);
  color: var(--g700);
  font-size: 10px;
  font-weight: 800;
}
.product-main { flex: 1; min-width: 0; }
.product-main b { display: block; font-size: 12.5px; }
.product-main span { display: block; color: var(--mut); font-size: 10.5px; line-height: 1.5; margin-top: 2px; }
.angle-card {
  padding: 10px 11px;
  border-radius: 12px;
  background: #f8faf9;
  border: 1px solid var(--line2);
}
.angle-card + .angle-card { margin-top: 7px; }
.angle-card .angle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.angle-card b { font-size: 12px; }
.angle-card p { color: var(--mut); font-size: 10.5px; line-height: 1.55; margin-top: 4px; }
.angle-offer { color: var(--g700); font-weight: 750; font-size: 11px; margin-top: 4px; }
.report-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.report-tools .btn { flex: 1; min-width: 120px; }

/* ---------- 方案 ---------- */

.plan-options { display: grid; gap: 8px; }
.plan-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
}
.plan-option.selected {
  border-color: var(--g500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .1);
}
.plan-radio {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  display: grid;
  place-items: center;
}
.plan-option.selected .plan-radio { border-color: var(--g600); }
.plan-option.selected .plan-radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--g600);
}
.plan-option-main { flex: 1; min-width: 0; }
.plan-option-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.4;
}
.plan-option-meta {
  display: block;
  margin-top: 3px;
  color: var(--mut);
  font-size: 10.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.plan-note {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.plan-note label {
  display: block;
  color: var(--ink2);
  font-size: 11.5px;
  font-weight: 700;
}
.plan-content { margin-top: 8px; min-height: 120px; }
.plan-content:disabled { background: #f7f9f8; color: var(--mut2); }

.asset-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8faf9;
  color: var(--g700);
  font-size: 12px;
  font-weight: 700;
}
.asset-upload .ic { width: 16px; height: 16px; }
.asset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.asset-empty {
  grid-column: 1 / -1;
  color: var(--mut2);
  font-size: 11px;
  padding: 8px 2px 0;
}
.asset-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: #fff;
}
.asset-thumb {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: cover;
  background: #eef3f0;
}
.asset-item video.asset-thumb { background: #0f172a; }
.asset-meta { padding: 7px 8px; }
.asset-meta b {
  display: block;
  overflow: hidden;
  color: var(--ink2);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.asset-meta span {
  display: block;
  margin-top: 2px;
  color: var(--mut2);
  font-size: 9.5px;
}
.asset-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15, 23, 42, .62);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}

/* ---------- 内容确认 ---------- */

.copy-list { display: grid; gap: 10px; margin-top: 14px; }
.copy-card {
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.copy-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.copy-num {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--g50);
  color: var(--g700);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.copy-card h2 { font-size: 14px; font-weight: 750; }
.copy-card .field { margin-bottom: 10px; }
.copy-card .field:last-child { margin-bottom: 0; }
.copy-card .textarea { min-height: 96px; }
.copy-credit {
  margin: 14px 2px 0;
  color: var(--mut2);
  font-size: 10.5px;
  line-height: 1.6;
}

/* ---------- 物料 ---------- */

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #eef3f0;
}
.tab {
  min-height: 40px;
  border-radius: 11px;
  color: var(--mut);
  font-size: 12.5px;
  font-weight: 700;
}
.tab.active {
  background: #fff;
  color: var(--g800);
  box-shadow: 0 2px 6px rgba(15, 23, 42, .06);
}
.material-panel { margin-top: 12px; }
.material-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.material-actions .btn { flex: 1; min-width: 120px; }

.poster {
  position: relative;
  width: 100%;
  max-width: 330px;
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  padding: 15px;
  border-radius: 18px;
  overflow: hidden;
  color: #fff;
  display: flex;
  flex-direction: column;
  background: linear-gradient(150deg, #064e3b 0%, #047857 55%, #10b981 100%);
  box-shadow: 0 20px 34px -22px rgba(4, 120, 87, .7);
}
.poster.theme-amber { background: linear-gradient(150deg, #7c2d12 0%, #b45309 55%, #f59e0b 100%); }
.poster.theme-terracotta { background: linear-gradient(150deg, #7f1d1d 0%, #9a3412 55%, #ea580c 100%); }
.poster.theme-warm { background: linear-gradient(150deg, #78350f 0%, #b45309 55%, #fbbf24 100%); }
.poster-glow {
  position: absolute;
  right: -50px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.poster-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.poster-brand { font-size: 10px; font-weight: 750; letter-spacing: .06em; }
.poster-demo {
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .18);
}
.poster-main { position: relative; z-index: 1; margin-top: 16px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.poster-kicker { color: rgba(255, 255, 255, .65); font-size: 9px; letter-spacing: .1em; }
.poster h3 {
  font-size: clamp(20px, 5.8vw, 26px);
  line-height: 1.28;
  letter-spacing: -.4px;
  margin: 6px 0 8px;
  font-weight: 800;
}
.poster-offer {
  display: inline-block;
  font-size: clamp(24px, 7vw, 32px);
  font-weight: 850;
  letter-spacing: -.6px;
  line-height: 1.15;
  color: #fff;
  padding: 2px 0 5px;
}
.poster-bullets { display: grid; gap: 3px; margin-top: 6px; }
.poster-bullets li {
  font-size: 9.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, .82);
  padding-left: 10px;
  position: relative;
}
.poster-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .65);
}
.poster-bottom {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .16);
}
.poster-meta { min-width: 0; }
.poster-meta b { display: block; font-size: 10px; line-height: 1.3; }
.poster-meta span {
  display: block;
  color: rgba(255, 255, 255, .68);
  font-size: 7.8px;
  line-height: 1.45;
  margin-top: 1px;
  overflow-wrap: anywhere;
}
.poster-qr { text-align: center; }
.poster-qr .qr-grid { width: 42px; }
.poster-qr span { display: block; color: rgba(255, 255, 255, .6); font-size: 6.5px; margin-top: 2px; }
.poster-note {
  position: relative;
  z-index: 1;
  margin-top: 7px;
  color: rgba(255, 255, 255, .45);
  font-size: 6.8px;
  line-height: 1.4;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(var(--qr), 1fr);
  gap: 1px;
  width: 100%;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 6px;
  background: #fff;
}
.qr-grid i { display: block; background: #fff; border-radius: .5px; }
.qr-grid i.on { background: #0f172a; }

.voice-card { padding: 14px; }
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 54px;
  margin: 4px 0 12px;
}
.waveform i {
  display: block;
  width: 3px;
  border-radius: 3px;
  background: #a7f3d0;
}
.waveform i:nth-child(3n) { background: var(--g500); }
.waveform.playing i { animation: wave .8s ease-in-out infinite alternate; }
.waveform i:nth-child(2n) { animation-delay: .15s; }
.waveform i:nth-child(3n) { animation-delay: .3s; }
@keyframes wave { from { transform: scaleY(.5); } to { transform: scaleY(1.15); } }
.script-box {
  padding: 11px 12px;
  border-radius: 12px;
  background: #f8faf9;
  border: 1px solid var(--line2);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink2);
}
.moments-copy { white-space: pre-wrap; }
.material-script { margin-top: 10px; }
.voice-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--mut2);
  font-size: 10px;
  margin-top: 8px;
}

.video-frame {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  color: #fff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(150deg, #064e3b 0%, #047857 58%, #10b981 100%);
  box-shadow: 0 20px 36px -24px rgba(4, 120, 87, .8);
}
.video-frame.visual-product { background: linear-gradient(150deg, #78350f 0%, #b45309 58%, #f59e0b 100%); }
.video-frame.visual-offer { background: linear-gradient(150deg, #4c1d95 0%, #6d28d9 58%, #a78bfa 100%); }
.video-frame.visual-cta { background: linear-gradient(150deg, #0f172a 0%, #334155 58%, #64748b 100%); }
.video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, .45) 100%);
  pointer-events: none;
}
.video-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.video-demo {
  font-size: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .18);
}
.video-scene-no { font-size: 9px; color: rgba(255, 255, 255, .65); }
.video-body { position: relative; z-index: 2; }
.video-kicker { font-size: 9px; color: rgba(255, 255, 255, .7); letter-spacing: .1em; }
.video-body h3 {
  font-size: clamp(24px, 7vw, 31px);
  line-height: 1.2;
  letter-spacing: -.6px;
  margin: 6px 0 7px;
  font-weight: 850;
}
.video-body p { font-size: 11px; line-height: 1.55; color: rgba(255, 255, 255, .82); }
.video-play {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .92);
  color: var(--g800);
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .45);
}
.video-play .ic { width: 24px; height: 24px; }
.video-progress {
  position: relative;
  z-index: 2;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .24);
  margin-top: 12px;
  overflow: hidden;
}
.video-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: #fff;
  transition: width .1s linear;
}
.video-time {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: rgba(255, 255, 255, .62);
  font-size: 8.5px;
}
.scene-list { display: grid; gap: 7px; margin-top: 12px; }
.scene-item {
  display: flex;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #f8faf9;
  border: 1px solid var(--line2);
}
.scene-item b { font-size: 11px; display: block; }
.scene-item span { font-size: 10px; color: var(--mut); line-height: 1.45; display: block; margin-top: 1px; }
.scene-no {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--g50);
  color: var(--g700);
  font-size: 9px;
  font-weight: 800;
}

/* ---------- 优惠券 ---------- */

.coupon {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px 10px;
  padding: 13px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ecfdf5 0%, #fff 72%);
  border: 1px solid #bbf7d0;
  overflow: hidden;
}
.coupon::before,
.coupon::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid #bbf7d0;
  top: 50%;
  transform: translateY(-50%);
}
.coupon::before { left: -9px; }
.coupon::after { right: -9px; }
.coupon-main { min-width: 0; }
.coupon-brand { color: var(--g700); font-size: 9.5px; font-weight: 750; letter-spacing: .05em; }
.coupon-amount {
  color: var(--g800);
  font-size: 27px;
  font-weight: 850;
  letter-spacing: -.8px;
  line-height: 1.15;
  margin: 3px 0 1px;
}
.coupon-cond { color: var(--ink2); font-size: 11px; font-weight: 650; }
.coupon-meta { color: var(--mut); font-size: 9.5px; margin-top: 4px; line-height: 1.45; }
.coupon-side { text-align: center; align-self: center; }
.coupon-side .qr-grid { width: 74px; margin: 0 auto; }
.coupon-side span { display: block; color: var(--mut2); font-size: 7.5px; margin-top: 2px; }
.coupon-code {
  grid-column: 1 / -1;
  padding-top: 7px;
  border-top: 1px dashed #bbf7d0;
  color: var(--mut2);
  font-size: 9px;
  letter-spacing: .12em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.coupon-compact .coupon-amount { font-size: 22px; }
.coupon-compact { grid-template-columns: minmax(0, 1fr) 64px; }
.coupon-compact .coupon-side .qr-grid { width: 58px; }

.coupon-form { margin-top: 12px; }

/* ---------- 发布 ---------- */

.platform-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.platform-tab {
  min-height: 62px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--mut);
  font-size: 10.5px;
  font-weight: 700;
}
.platform-tab.active {
  border-color: var(--g500);
  background: var(--g50);
  color: var(--g800);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, .1);
}
.platform-mark {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  background: #0f172a;
}
.platform-mark.shipinhao { background: #059669; }
.platform-mark.pengyouquan { background: #0f766e; }
.guide-card { margin-top: 12px; }
.guide-lead { color: var(--mut); font-size: 11.5px; line-height: 1.6; margin-bottom: 10px; }
.guide-steps { display: grid; gap: 0; }
.guide-step {
  display: flex;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line2);
}
.guide-step:last-child { border-bottom: 0; }
.guide-num {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--g50);
  color: var(--g700);
  font-size: 10px;
  font-weight: 800;
}
.guide-main { flex: 1; min-width: 0; }
.guide-main b { display: block; font-size: 12px; }
.guide-main p { color: var(--mut); font-size: 10.5px; line-height: 1.55; margin-top: 2px; }
.guide-notes { display: grid; gap: 5px; margin-top: 10px; }
.guide-notes li {
  display: flex;
  gap: 6px;
  color: var(--mut);
  font-size: 10px;
  line-height: 1.5;
}
.guide-notes li::before { content: "·"; color: var(--g600); font-weight: 800; }
.copy-box {
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: 11px;
  background: #f8faf9;
  border: 1px solid var(--line2);
  color: var(--ink2);
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.checklist-card { margin-top: 12px; }
.checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.checklist-head b { font-size: 12.5px; }
.checklist-head span { color: var(--mut2); font-size: 10px; }
.publish-assets { display: grid; gap: 6px; margin-top: 8px; }
.asset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line2);
  font-size: 11px;
  color: var(--ink2);
}
.asset-row:last-child { border-bottom: 0; }
.asset-row .pill { margin-left: auto; }

/* ---------- 结果包 ---------- */

.result-hero {
  color: #fff;
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(140deg, #064e3b 0%, #047857 55%, #059669 100%);
  box-shadow: 0 18px 34px -20px rgba(4, 120, 87, .7);
  position: relative;
  overflow: hidden;
}
.result-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 70%);
}
.result-hero > * { position: relative; z-index: 1; }
.result-hero h1 { font-size: 23px; line-height: 1.3; margin: 8px 0 5px; letter-spacing: -.4px; }
.result-hero p { color: rgba(255, 255, 255, .8); font-size: 11.5px; line-height: 1.6; }
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 13px;
}
.result-stat {
  padding: 9px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .15);
  min-width: 0;
}
.result-stat b { display: block; font-size: 16px; line-height: 1.2; }
.result-stat span { display: block; color: rgba(255, 255, 255, .7); font-size: 8.5px; margin-top: 2px; }
.result-actions { display: grid; gap: 8px; margin-top: 12px; }
.result-actions .btn { width: 100%; }
.result-section { margin-top: 14px; }
.result-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.result-section-head h2 { font-size: 13.5px; font-weight: 750; }
.result-section-head span { font-size: 10px; color: var(--mut2); }
.result-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line2);
}
.result-item:last-child { border-bottom: 0; }
.result-item .ic { color: var(--g700); width: 17px; height: 17px; margin-top: 2px; }
.result-item-main { flex: 1; min-width: 0; }
.result-item-main b { display: block; font-size: 12px; }
.result-item-main span { display: block; color: var(--mut); font-size: 10.5px; line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; }
.result-thumb {
  width: 92px;
  flex: 0 0 auto;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  padding: 8px;
  color: #fff;
  background: linear-gradient(150deg, #064e3b, #059669);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.result-thumb.amber { background: linear-gradient(150deg, #7c2d12, #f59e0b); }
.result-thumb.terracotta { background: linear-gradient(150deg, #7f1d1d, #ea580c); }
.result-thumb b { font-size: 8px; line-height: 1.3; }
.result-thumb span { font-size: 11px; font-weight: 800; line-height: 1.2; }
.result-thumb small { font-size: 6px; opacity: .65; }
.manifest {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.manifest summary {
  list-style: none;
  padding: 11px 12px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.manifest summary::-webkit-details-marker { display: none; }
.manifest summary::after { content: "+"; color: var(--mut2); font-size: 15px; font-weight: 400; }
.manifest[open] summary::after { content: "−"; }
.manifest pre {
  margin: 0;
  padding: 10px 12px 13px;
  max-height: 280px;
  overflow: auto;
  background: #f8faf9;
  border-top: 1px solid var(--line2);
  color: #475569;
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- 工作台 ---------- */

.wb-list { display: grid; gap: 9px; }
.wb-card {
  padding: 13px;
  border-radius: 17px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.wb-head { display: flex; align-items: flex-start; gap: 10px; }
.wb-main { flex: 1; min-width: 0; }
.wb-name { font-size: 14px; font-weight: 750; line-height: 1.3; }
.wb-meta { color: var(--mut); font-size: 10.5px; line-height: 1.5; margin-top: 3px; overflow-wrap: anywhere; }
.wb-dots { display: flex; gap: 4px; margin-top: 9px; }
.wb-dots i {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: #e5eae7;
}
.wb-dots i.on { background: var(--g500); }
.wb-foot {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 10px;
}
.wb-foot .btn { flex: 1; }
.wb-date { color: var(--mut2); font-size: 9.5px; white-space: nowrap; }
.wb-empty { margin-top: 12px; }

/* ---------- 弹层 / 提示 ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(6, 20, 15, .48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal {
  width: 100%;
  max-width: 420px;
  max-height: 82dvh;
  overflow: auto;
  border-radius: 22px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .4);
  animation: modalIn .18s ease both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.modal-head h2 { font-size: 18px; line-height: 1.3; }
.modal-body { color: var(--mut); font-size: 12px; line-height: 1.65; margin-top: 7px; }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.modal-actions .btn { flex: 1; }
.modal .dir-grid { margin-top: 12px; }
.modal .fine { margin-top: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(140px + var(--safe-bottom));
  z-index: 100;
  max-width: calc(100vw - 40px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .92);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: rgba(180, 83, 9, .96); }

/* ---------- 桌面 ---------- */

@media (min-width: 640px) {
  body { padding: 24px 16px; }
  .app {
    max-width: 460px;
    min-height: calc(100dvh - 48px);
    border-radius: 30px;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
    overflow: hidden;
  }
  .header { border-radius: 30px 30px 0 0; }
}

@media (max-width: 360px) {
  .view { padding-left: 13px; padding-right: 13px; }
  .form-row { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .dir-grid { grid-template-columns: 1fr; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 27px; }
  .brand-sub { display: none; }
}

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

/* ---------- 工作台（Tab 首页） ---------- */

.view-workspace { padding-top: 12px; }

.ws-store {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 13px 13px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ws-store-main { flex: 1; min-width: 0; }
.ws-store-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.2px;
  line-height: 1.3;
}
.ws-store-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--mut);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-switch { flex: 0 0 auto; min-height: 32px; padding: 0 11px; font-size: 12px; }

.ws-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 13px;
}

.ws-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-height: 116px;
  padding: 14px 13px 13px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.ws-tile:active { transform: scale(.985); }
.ws-tile-ic {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--g50);
  color: var(--g700);
}
.ws-tile-ic .ic { width: 20px; height: 20px; }
.ws-tile-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14.5px;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.25;
}
.ws-tile-desc {
  font-size: 11px;
  line-height: 1.45;
  color: var(--mut);
}
.ws-tile-desc.is-done { color: var(--g700); font-weight: 650; }

.ws-tile.is-soon { background: #fbfcfc; border-color: var(--line2); }
.ws-tile.is-soon .ws-tile-ic { background: #f1f5f9; color: var(--mut2); }
.ws-tile.is-soon .ws-tile-title { color: var(--mut); }

.soon-tag {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  color: var(--mut2);
  background: #f1f5f9;
  border-radius: 999px;
  padding: 1px 5px;
  white-space: nowrap;
}

.ws-fine { margin-top: 16px; }

/* ---------- 门店信息（可编辑） ---------- */

.form-card { padding: 15px 14px; }
.chips-inline { margin-top: 9px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 7px; min-height: 24px; align-items: center; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 4px 4px 10px;
  border-radius: 999px;
  border: 1px solid #d4f3e6;
  background: var(--g50);
  color: var(--g800);
  font-size: 12px;
  font-weight: 600;
}
.tag-x {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: var(--g700);
  background: rgba(255, 255, 255, .8);
}
.tag-x .ic { width: 11px; height: 11px; }
.tag-add { display: flex; gap: 8px; margin-top: 9px; }
.tag-add .input { flex: 1; min-width: 0; }
.tag-add .btn { flex: 0 0 auto; min-height: 46px; }

/* ---------- 我的 ---------- */

.mine-row { display: flex; align-items: center; gap: 10px; }
.mine-row-main { flex: 1; min-width: 0; }
.mine-row-title { font-size: 14px; font-weight: 750; }
.mine-row-desc { margin-top: 2px; font-size: 11px; color: var(--mut); line-height: 1.5; }
.mine-link {
  margin-top: 10px;
  padding: 4px 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--g700);
}

/* ---------- 切换门店浮层 ---------- */

.switch-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 46vh;
  overflow: auto;
}
.switch-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}
.switch-row.on { border-color: var(--g500); background: var(--g50); }
.switch-name { display: flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 700; }
.switch-meta { font-size: 11px; color: var(--mut); }
.switch-sub { margin: 8px 0 0; font-size: 11px; font-weight: 700; color: var(--mut2); }
