/* ═══════════════════════════════════════════
   实体店获客与降本增效专家
   务实商务风：深蓝 + 浅灰，暖橙只用于按钮和重点
   ═══════════════════════════════════════════ */

:root {
  --navy: #143A5A;
  --navy-deep: #0E2A44;
  --navy-soft: #EEF2F6;
  --gray-bg: #F4F6F8;
  --gray-line: #E1E7ED;
  --gray-line-2: #CFD8E0;
  --white: #FFFFFF;
  --orange: #D9772B;
  --orange-dark: #B9601E;
  --orange-bg: #FFF5EA;
  --orange-line: #F5D9BC;
  --ink: #1F2933;
  --ink-2: #566370;
  --ink-3: #8A949F;
  --green: #3F7A5E;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(20, 58, 90, .08);
  --shadow-lg: 0 6px 24px rgba(20, 58, 90, .14);
}

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

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--gray-bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Heiti SC", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.45; }
p { margin: 0; }

/* ── 按钮 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: transparent;
  font-size: 16px; font-weight: 600; line-height: 1.4;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:active { opacity: .85; }
.btn-primary { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--gray-line-2); }
.btn-outline:hover { border-color: var(--navy); }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-text { color: var(--ink-2); padding: 8px 12px; font-weight: 500; }
.btn-text:hover { color: var(--navy); }
.btn-sm { padding: 7px 14px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-close {
  width: 40px; height: 40px; flex: none;
  border: none; background: transparent;
  font-size: 20px; color: var(--ink-3); cursor: pointer; border-radius: 6px;
}
.btn-close:hover { background: var(--gray-bg); color: var(--ink); }

/* ══════ 顶栏 ══════ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: 68px;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 0 24px;
  background: var(--navy);
  border-bottom: 1px solid var(--navy-deep);
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; flex: 1; }
.brand-mark {
  width: 40px; height: 40px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--orange); color: #fff;
  font-size: 21px; font-weight: 700; border-radius: 6px;
}
.brand-text { min-width: 0; flex: 1; }
.brand-title {
  color: #fff; font-size: 18px; font-weight: 700; line-height: 1.3;
  margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub { color: rgba(255,255,255,.68); font-size: 13.5px; line-height: 1.4; margin-top: 1px; }
.ico { font-size: 15px; }

/* ══════ 功能操作栏 ══════ */
.action-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--gray-line);
  flex: none;
}
.action-bar .btn-ghost {
  color: var(--ink-2); border-color: var(--gray-line-2);
  margin-left: auto;
}
.action-bar .btn-ghost:hover { background: var(--gray-bg); color: var(--navy); }

/* ══════ 布局 ══════ */
.layout {
  display: flex;
  height: 100vh;
  padding-top: 68px;
}

.side {
  width: 340px; flex: none;
  border-right: 1px solid var(--gray-line);
  background: #fff;
  overflow-y: auto;
}
.side-inner { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  height: 100%;
}

/* ── 卡片 ── */
.card {
  background: #fff;
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 18px;
}
.card-title { font-size: 17px; color: var(--navy); margin-bottom: 4px; }
.card-hint { font-size: 14.5px; color: var(--ink-3); margin-bottom: 14px; line-height: 1.6; }

/* ── 情况登记 ── */
.card-profile { border-top: 3px solid var(--navy); }
.field { margin-bottom: 16px; }
.field > label {
  display: block; font-size: 15px; font-weight: 600; color: var(--ink-2);
  margin-bottom: 8px;
}
.multi { font-weight: 400; color: var(--ink-3); font-size: 13px; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 13px;
  border: 1px solid var(--gray-line-2); border-radius: 16px;
  background: #fff; color: var(--ink-2);
  font-size: 14.5px; line-height: 1.3; cursor: pointer;
  transition: all .12s;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.on {
  background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600;
}
.chip.on-warn { background: var(--orange); border-color: var(--orange); }

.profile-actions { margin-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.profile-state { font-size: 14px; color: var(--green); text-align: center; min-height: 20px; margin-top: 6px; }

/* ── 我的店况（门店信息表单） ── */
.shop-form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.shop-row { display: flex; flex-direction: column; gap: 6px; }
.shop-row-block { padding-top: 4px; border-top: 1px dashed var(--gray-line); margin-top: 4px; }
.shop-row-block:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.shop-lbl {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 600; color: var(--ink-2);
  line-height: 1.4;
}
.shop-val { display: flex; flex-direction: column; gap: 6px; }
.shop-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-line-2); border-radius: 8px;
  background: #fff; color: var(--ink);
  font-size: 15px; line-height: 1.4;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.shop-input:focus { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(20,58,90,.12); }
.shop-input::placeholder { color: #A9B0BA; }
.shop-input-readonly {
  background: var(--gray-bg); color: var(--ink-2); cursor: not-allowed;
  border-style: dashed;
}
.shop-input-other { font-size: 14.5px; }
.shop-hint { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.shop-sub { font-size: 13px; color: var(--ink-3); line-height: 1.6; padding: 2px 0 4px; }
.shop-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 2px 0;
}
.shop-chips .chip { padding: 7px 13px; font-size: 14.5px; }
.shop-actions { margin-top: 6px; }
.shop-state {
  margin-top: 8px; font-size: 14px; line-height: 1.5;
  color: var(--ink-3); text-align: center;
  min-height: 18px;
}
.shop-state:empty { display: none; }

@media (max-width: 860px) {
  .shop-form { gap: 12px; }
  .shop-input { font-size: 16px; }   /* 16px 防 iOS 弹键盘放大 */
}

/* ── 热门问题 ── */
.hot-list { display: flex; flex-direction: column; gap: 2px; }
.hot-item {
  padding: 10px 10px 10px 0; text-align: left;
  border: none; background: transparent; cursor: pointer;
  font-size: 15.5px; color: var(--ink); line-height: 1.55;
  border-bottom: 1px solid var(--gray-line);
  display: flex; gap: 9px; align-items: flex-start;
}
.hot-item:last-child { border-bottom: none; }
.hot-item:hover { color: var(--navy); }
.hot-item .n { color: var(--orange); font-weight: 700; flex: none; }

/* ── 算账工具 ── */
.calc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.calc-tab {
  padding: 6px 11px; border: 1px solid var(--gray-line-2); border-radius: 14px;
  background: #fff; font-size: 13.5px; color: var(--ink-2); cursor: pointer;
}
.calc-tab.on { background: var(--navy-soft); border-color: var(--navy); color: var(--navy); font-weight: 600; }
.calc-row { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.calc-row label { flex: 1; font-size: 15px; color: var(--ink-2); }
.calc-row input {
  width: 108px; flex: none; padding: 7px 10px;
  border: 1px solid var(--gray-line-2); border-radius: 6px;
  font-size: 15px; text-align: right; background: #fff;
}
.calc-row input:focus { outline: none; border-color: var(--navy); }
.calc-out {
  margin-top: 12px; padding: 13px 15px;
  background: var(--orange-bg); border: 1px solid var(--orange-line); border-radius: 6px;
}
.calc-out .lbl { font-size: 14px; color: var(--ink-2); }
.calc-out .val { font-size: 22px; font-weight: 700; color: var(--orange-dark); line-height: 1.35; margin-top: 2px; }
.calc-out .tip { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.6; }

/* ══════ 对话区 ══════ */
.chat {
  flex: 1; overflow-y: auto;
  padding: 26px 24px 20px;
  scroll-behavior: smooth;
}
.chat-inner { max-width: 860px; margin: 0 auto; }

.msg { margin-bottom: 22px; }
.msg-user { display: flex; justify-content: flex-end; }
.bubble-user {
  background: var(--navy); color: #fff;
  padding: 12px 17px; border-radius: 10px 10px 2px 10px;
  max-width: 80%; font-size: 16.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}

/* 助手消息 */
.bot { display: flex; gap: 12px; }
.bot-avatar {
  width: 38px; height: 38px; flex: none;
  background: var(--navy); color: #fff;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
}
.bot-body { flex: 1; min-width: 0; }
.bot-name { font-size: 14px; color: var(--ink-3); margin-bottom: 6px; font-weight: 600; }
.bot-text { font-size: 17px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.bot-text.markdown-body { white-space: normal; }
.markdown-body h3 { font-size: 17.5px; color: var(--navy); margin: 18px 0 10px; font-weight: 700; }
.markdown-body h3:first-child { margin-top: 0; }
.markdown-body h4 { font-size: 16px; color: var(--navy); margin: 14px 0 8px; font-weight: 700; }
.markdown-body p { font-size: 16.5px; line-height: 1.85; margin: 0 0 12px; color: var(--ink); }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { margin: 0 0 12px; padding-left: 22px; }
.markdown-body li { font-size: 16px; line-height: 1.85; margin-bottom: 8px; color: var(--ink); }
.markdown-body b { color: var(--navy); font-weight: 700; }
.markdown-body i { color: var(--ink-2); }

/* 开场白卡 */
.welcome {
  background: #fff; border: 1px solid var(--gray-line);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 8px;
}
.welcome h2 { font-size: 20px; color: var(--navy); margin-bottom: 8px; }
.welcome p { font-size: 17px; line-height: 1.85; color: var(--ink); }
.welcome .sign { margin-top: 12px; font-size: 14.5px; color: var(--ink-3); }

/* 追问卡 */
.ask-card {
  background: var(--orange-bg); border: 1px solid var(--orange-line);
  border-radius: var(--radius); padding: 18px 20px; margin: 14px 0;
}
.ask-card h4 { font-size: 17px; color: var(--orange-dark); margin-bottom: 6px; }
.ask-card .desc { font-size: 15.5px; color: var(--ink-2); margin-bottom: 14px; line-height: 1.7; }
.ask-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.ask-item { font-size: 15px; }
.ask-item .k { font-weight: 700; color: var(--navy); }
.ask-item .v { color: var(--ink-2); }
.ask-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 方案卡 ── */
.plan {
  background: #fff; border: 1px solid var(--gray-line);
  border-radius: var(--radius); margin: 14px 0; overflow: hidden;
}
.plan-head {
  padding: 16px 20px; background: var(--navy-soft);
  border-bottom: 1px solid var(--gray-line);
}
.plan-tag { font-size: 13px; color: var(--orange-dark); font-weight: 700; letter-spacing: .5px; }
.plan-title { font-size: 19px; color: var(--navy); font-weight: 700; margin-top: 3px; line-height: 1.5; }
.plan-sub { font-size: 15px; color: var(--ink-2); margin-top: 6px; line-height: 1.65; }

/* 方案卡 · 一键收藏 */
.plan-fav {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--gray-line);
}
.btn-fav {
  border-color: var(--gray-line-2); color: var(--navy); background: #fff;
  padding: 7px 14px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-fav:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-soft); }
.btn-fav .star { font-size: 16px; line-height: 1; color: var(--ink-3); }
.btn-fav.on { border-color: var(--orange-line); background: var(--orange-bg); color: var(--orange-dark); }
.btn-fav.on .star { color: var(--orange); }
.btn-fav.on:hover { background: var(--orange-bg); border-color: var(--orange); }
.btn-fav[disabled] { opacity: .6; cursor: default; }
.fav-hint { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }

/* ── 方案卡 · 语音朗读 ── */
.tts-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 20px; background: var(--navy-soft);
  border-bottom: 1px solid var(--gray-line);
}
.tts-main {
  border-color: var(--navy); color: var(--navy); background: #fff;
  padding: 7px 14px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.tts-main:hover { border-color: var(--orange); color: var(--orange-dark); background: #fff; }
.tts-ico { font-size: 15px; line-height: 1; }
.tts-halt {
  border-color: var(--gray-line-2); color: var(--ink-2); background: #fff;
  padding: 7px 12px; font-size: 14.5px;
}
.tts-halt:hover { border-color: var(--navy); color: var(--navy); }
/* .btn 显式设了 display:flex，会盖掉 UA 自带的 [hidden]{display:none}，
   所以这里必须显式再压一次，否则「停止」按钮始终可见 */
.tts-halt[hidden] { display: none !important; }
.tts-auto {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13.5px; color: var(--ink-2); cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.tts-auto input { margin: 0; cursor: pointer; }
.tts-state { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.tts-state.on { color: var(--navy); font-weight: 600; }
.tts-state.warn { color: var(--orange-dark); font-weight: 600; }
.plan.tts-reading { box-shadow: 0 0 0 2px var(--orange-line); }
.tts-unsupported {
  padding: 11px 20px; background: var(--navy-soft);
  border-bottom: 1px solid var(--gray-line);
  font-size: 13.5px; color: var(--ink-3); line-height: 1.65;
}

.plan-section { padding: 16px 20px; border-bottom: 1px solid var(--gray-line); }
.plan-section:last-child { border-bottom: none; }
.plan-h {
  font-size: 16px; font-weight: 700; color: var(--navy);
  margin-bottom: 10px; display: flex; align-items: center; gap: 7px;
}
.plan-h::before {
  content: ''; width: 4px; height: 16px; background: var(--orange); border-radius: 2px; flex: none;
}
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li {
  counter-increment: s; position: relative;
  padding-left: 32px; margin-bottom: 11px;
  font-size: 16.5px; line-height: 1.75;
}
.steps li:last-child { margin-bottom: 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.money-box {
  background: var(--orange-bg); border: 1px solid var(--orange-line);
  border-radius: 6px; padding: 14px 16px;
}
.money-box ul { margin: 0; padding-left: 20px; }
.money-box li { font-size: 16px; line-height: 1.8; margin-bottom: 5px; color: var(--ink); }
.money-box li:last-child { margin-bottom: 0; }
.risk-box ul { margin: 0; padding-left: 20px; }
.risk-box li { font-size: 16px; line-height: 1.8; margin-bottom: 6px; color: var(--ink); }
.risk-box li:last-child { margin-bottom: 0; }
.plain-list { margin: 0; padding-left: 20px; }
.plain-list li { font-size: 16.5px; line-height: 1.8; margin-bottom: 6px; }

/* 依据 / 出处 */
.src { background: #FAFBFC; }
.src-item { margin-bottom: 12px; }
.src-item:last-child { margin-bottom: 0; }
.src-name { font-size: 15.5px; font-weight: 600; color: var(--navy); }
.src-quote {
  font-size: 15.5px; line-height: 1.8; color: var(--ink-2);
  background: #fff; border: 1px solid var(--gray-line); border-left: 3px solid var(--gray-line-2);
  border-radius: 4px; padding: 11px 14px; margin-top: 6px;
  white-space: pre-wrap; word-break: break-word;
}
.src-toggle {
  margin-top: 7px; font-size: 14.5px; color: var(--orange-dark);
  background: none; border: none; padding: 0; cursor: pointer; font-weight: 600;
}
.src-toggle:hover { text-decoration: underline; }

/* 未覆盖卡 */
.nocover {
  background: #fff; border: 1px solid var(--gray-line-2);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius); padding: 20px 22px; margin: 14px 0;
}
.nocover h4 { font-size: 18px; color: var(--navy); margin-bottom: 8px; }
.nocover p { font-size: 16.5px; line-height: 1.8; color: var(--ink); margin-bottom: 10px; }
.nocover ul { margin: 0 0 14px; padding-left: 20px; }
.nocover li { font-size: 16px; line-height: 1.8; color: var(--ink-2); }
.nocover-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* 相关方案 */
.related { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rel-chip {
  padding: 8px 14px; border: 1px solid var(--gray-line-2); border-radius: 6px;
  background: #fff; font-size: 15px; color: var(--navy); cursor: pointer; text-align: left;
  line-height: 1.5;
}
.rel-chip:hover { border-color: var(--navy); background: var(--navy-soft); }

/* 免责 */
.disclaimer { font-size: 13.5px; color: var(--ink-3); line-height: 1.7; margin-top: 10px; }

/* 打字指示 */
.typing { display: flex; gap: 5px; padding: 6px 0; }
.typing i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gray-line-2);
  animation: blink 1.1s infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

/* ── 提问框 ── */
.composer {
  flex: none;
  border-top: 1px solid var(--gray-line);
  background: #fff;
  padding: 14px 24px 18px;
}
.composer-inner { max-width: 860px; margin: 0 auto; display: flex; gap: 12px; align-items: flex-end; }
#input {
  flex: 1; resize: none; overflow-y: auto;
  max-height: 160px; min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--gray-line-2); border-radius: var(--radius);
  font-size: 16.5px; line-height: 1.65; background: #fff;
}
#input:focus { outline: none; border-color: var(--navy); }
#input::placeholder { color: var(--ink-3); }
.btn-send { height: 52px; padding: 0 26px; font-size: 16.5px; }

/* ══════ 抽屉（知识库） ══════ */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: 480px; max-width: 92vw;
  background: #fff; border-left: 1px solid var(--gray-line);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .22s ease;
  box-shadow: -4px 0 20px rgba(20,58,90,.08);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--gray-line); background: var(--navy);
}
.drawer-title { color: #fff; font-size: 18px; font-weight: 700; line-height: 1.4; }
.drawer-sub { color: rgba(255,255,255,.66); font-size: 13.5px; margin-top: 3px; }
.drawer-head .btn-close { color: rgba(255,255,255,.75); }
.drawer-head .btn-close:hover { background: rgba(255,255,255,.15); color: #fff; }
.drawer-search { flex: none; padding: 14px 20px; border-bottom: 1px solid var(--gray-line); }
.drawer-search input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--gray-line-2); border-radius: 6px; font-size: 16px; background: #fff;
}
.drawer-search input:focus { outline: none; border-color: var(--navy); }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 20px 30px; }

.kb-item {
  border: 1px solid var(--gray-line); border-radius: var(--radius);
  padding: 15px 16px; margin-bottom: 11px; background: #fff;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.kb-item:hover { border-color: var(--navy); background: #FAFBFC; }
.kb-item h4 { font-size: 16.5px; color: var(--navy); line-height: 1.55; margin-bottom: 5px; }
.kb-item p { font-size: 14.5px; color: var(--ink-2); line-height: 1.7; }
.kb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.kb-tag {
  font-size: 12.5px; padding: 3px 9px; border-radius: 3px;
  background: var(--navy-soft); color: var(--navy);
}
.kb-tag.warn { background: var(--orange-bg); color: var(--orange-dark); }
.kb-empty { text-align: center; color: var(--ink-3); padding: 40px 0; font-size: 16px; }

/* ══════ 弹层 ══════ */
/* 管理面板必须压在「已暂停」遮罩之上，否则关掉后管理员自己都开不回来 */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 32, 44, .5);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 10px;
  width: 100%; max-width: 720px; max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-narrow { max-width: 480px; }
.modal-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--gray-line);
}
.modal-title { font-size: 18px; color: var(--navy); font-weight: 700; line-height: 1.45; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 22px 26px; }

.doc-sec { margin-bottom: 20px; }
.doc-sec h4 { font-size: 16.5px; color: var(--navy); margin-bottom: 8px; line-height: 1.5; }
.doc-sec p { font-size: 16px; line-height: 1.9; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.doc-meta {
  background: var(--navy-soft); border-radius: 6px; padding: 14px 16px; margin-bottom: 20px; font-size: 15.5px; line-height: 1.8; color: var(--ink-2);
}
.doc-meta b { color: var(--navy); }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: block; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.form input, .form textarea {
  display: block; width: 100%; margin-top: 6px;
  padding: 11px 13px; font-weight: 400;
  border: 1px solid var(--gray-line-2); border-radius: 6px; font-size: 16px; background: #fff;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--navy); }
.form textarea { resize: vertical; line-height: 1.7; }
.req { color: var(--orange); margin-left: 3px; }
.form-note { font-size: 13.5px; color: var(--ink-3); margin: 14px 0 12px; line-height: 1.7; }
.lead-tip {
  font-size: 15.5px; color: var(--ink-2); background: var(--orange-bg);
  border: 1px solid var(--orange-line); border-radius: 6px;
  padding: 12px 14px; margin-bottom: 16px; line-height: 1.7;
}

/* 管理面板 */
.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 0; border-bottom: 1px solid var(--gray-line);
}
.admin-row:last-of-type { border-bottom: none; }
.admin-label { font-size: 16px; font-weight: 600; color: var(--ink); }
.admin-desc { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.6; }
.switch {
  position: relative; width: 54px; height: 30px; flex: none;
  background: var(--gray-line-2); border-radius: 15px; border: none; cursor: pointer;
  transition: background .15s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(24px); }
.admin-input {
  width: 100%; padding: 10px 12px; margin-top: 8px;
  border: 1px solid var(--gray-line-2); border-radius: 6px; font-size: 15px;
}
.admin-note {
  background: var(--navy-soft); border-radius: 6px; padding: 13px 15px;
  font-size: 14.5px; color: var(--ink-2); line-height: 1.8; margin-top: 16px;
}
.admin-note b { color: var(--navy); }
.lead-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
.lead-table th, .lead-table td {
  border: 1px solid var(--gray-line); padding: 8px 10px; text-align: left; vertical-align: top;
}
.lead-table th { background: var(--navy-soft); color: var(--navy); font-weight: 600; white-space: nowrap; }

/* 客户来源标签 */
.lead-src { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; }
.lead-src-owner   { background: var(--orange-bg); color: var(--orange-dark); }
.lead-src-visitor { background: var(--navy-soft); color: var(--navy); }
.lead-table .btn-del-lead { color: var(--orange-dark); padding: 4px 10px; font-size: 13px; }
.lead-table .btn-del-lead:hover { color: #fff; background: var(--orange); }
.lead-table .btn-edit-lead { color: var(--navy); padding: 4px 10px; font-size: 13px; }
.lead-table .btn-edit-lead:hover { color: #fff; background: var(--navy); }

/* 我的客户列表 · 搜索框 */
.lead-search { padding: 0 22px 4px; }
.lead-search input {
  width: 100%; box-sizing: border-box;
  padding: 9px 14px; border: 1px solid var(--gray-line-2); border-radius: var(--radius);
  font-size: 14px; color: var(--ink); background: var(--white);
  transition: border-color .15s;
}
.lead-search input:focus { outline: none; border-color: var(--navy); }

/* ══════ 我收藏的方案 ══════ */
.fav-list { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.fav-item {
  border: 1px solid var(--gray-line); border-radius: var(--radius);
  background: #fff; padding: 14px 16px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.fav-item:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.fav-item-t { font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.5; }
.fav-item-sub { font-size: 14.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.6; }
.fav-item-sum {
  font-size: 15px; color: var(--ink-2); margin-top: 8px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fav-item-meta {
  font-size: 13px; color: var(--ink-3); margin-top: 8px; line-height: 1.6;
  padding-top: 8px; border-top: 1px dashed var(--gray-line);
}
.fav-item-ops { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.fav-item-ops .btn-fav-del { color: var(--orange-dark); padding: 6px 10px; font-size: 14px; }
.fav-item-ops .btn-fav-del:hover { color: #fff; background: var(--orange); }

/* 收藏详情底部操作条 */
.fav-detail-foot {
  flex: none; display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--gray-line); background: var(--gray-bg);
  border-radius: 0 0 10px 10px;
}

/* 关闭遮罩 */
.closed-mask {
  position: fixed; inset: 0; z-index: 150;
  background: var(--navy-deep);
  display: none; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 30px;
}
.closed-mask.open { display: flex; }
.closed-ico { font-size: 48px; margin-bottom: 18px; }
.closed-title { color: #fff; font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.closed-text { color: rgba(255,255,255,.7); font-size: 16.5px; line-height: 1.8; }
.closed-mask .btn-text { color: rgba(255,255,255,.55); margin-top: 20px; }

/* 遮罩 */
.scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 32, 44, .4);
  display: none;
}
.scrim.open { display: block; }

/* 手机底部栏 */
.tabbar { display: none; }

/* ══════ 自适应 ══════ */
@media (max-width: 1080px) {
  .side { width: 300px; }
}

@media (max-width: 860px) {
  body { font-size: 16.5px; }
  .topbar { height: auto; min-height: 52px; padding: 10px 14px; justify-content: center; }
  .brand { justify-content: center; flex: 0 1 auto; }
  .brand-mark { display: none; }
  .brand-title { font-size: 17px; text-align: center; white-space: normal; }
  .brand-sub { display: none; }

  .action-bar {
    padding: 10px 14px;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--navy-soft);
    border-bottom-color: var(--gray-line-2);
  }
  .action-bar .btn { flex: 1 1 auto; min-width: 0; padding: 9px 14px; font-size: 15px; }
  .action-bar .btn-ghost { margin-left: 0; color: var(--ink-2); border-color: var(--gray-line-2); background: #fff; }

  .layout { padding-top: 52px; }
  .side {
    position: fixed; top: 52px; bottom: 56px; left: 0; z-index: 70;
    width: 88vw; max-width: 340px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 4px 0 20px rgba(20,58,90,.12);
  }
  .side.open { transform: translateX(0); }
  .side-inner { padding: 16px 16px 30px; }

  .chat { padding: 18px 14px 14px; }
  .composer { padding: 10px 14px 14px; }
  .bubble-user { max-width: 88%; font-size: 16px; }
  .bot-avatar { width: 32px; height: 32px; font-size: 15px; }
  .welcome { padding: 16px 17px; }
  .welcome h2 { font-size: 18.5px; }
  .plan-head, .plan-section { padding: 14px 16px; }
  .plan-title { font-size: 17.5px; }
  .plan-fav { padding: 12px 16px; gap: 10px; }
  .fav-hint { display: none; }        /* 手机上只留按钮，说明文字省掉 */
  .tts-bar { padding: 10px 16px; gap: 8px; }
  .tts-main { padding: 7px 12px; font-size: 14.5px; }
  .tts-state { font-size: 12.5px; flex-basis: 100%; }
  .tts-unsupported { padding: 10px 16px; }
  .ask-grid { grid-template-columns: 1fr; gap: 8px; }
  .btn-send { padding: 0 18px; font-size: 15.5px; }

  .modal { padding: 14px; }
  .modal-box { max-height: 90vh; }
  .modal-head { padding: 15px 16px; }
  .modal-title { font-size: 16.5px; }
  .modal-body { padding: 16px; }

  /* 我收藏的方案 · 手机端 */
  .fav-item { padding: 13px 14px; }
  .fav-item-t { font-size: 16px; }
  .fav-item-ops .btn { flex: 1 1 auto; }
  .fav-detail-foot { padding: 12px 16px; }
  .fav-detail-foot .btn { flex: 1 1 auto; padding: 10px 14px; }

  .drawer { width: 100%; max-width: 100%; }

  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 75;
    background: #fff; border-top: 1px solid var(--gray-line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar button {
    flex: 1; padding: 9px 0 8px; border: none; background: none; cursor: pointer;
    font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column;
    align-items: center; gap: 2px; line-height: 1.3;
  }
  .tabbar button span { font-size: 19px; }
  .tabbar button.on { color: var(--navy); font-weight: 700; }
  .layout { padding-bottom: 56px; }
}

@media (max-width: 400px) {
  .chips .chip { font-size: 14px; padding: 6px 11px; }
  .calc-row input { width: 92px; }
}

/* ═══════════════════════════════════════════
   多租户：登录注册 / 管理后台
   ═══════════════════════════════════════════ */

.view[hidden] { display: none; }

/* ── 登录 / 注册 ── */
.view-auth {
  min-height: 100vh;
  background: var(--gray-bg);
  display: flex; align-items: center; justify-content: center;
  padding: 96px 16px 40px;
}

/* 登录页顶栏固定，移动端同步避让 */
@media (max-width: 860px) {
  .view-auth { padding: 76px 16px 32px; }
}
.auth-wrap { width: 100%; max-width: 440px; }
.auth-card {
  background: #fff; border: 1px solid var(--gray-line); border-radius: 10px;
  padding: 28px 26px 22px; box-shadow: var(--shadow);
}
.auth-head { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.auth-logo {
  width: 44px; height: 44px; flex: none;
  background: var(--navy); color: #fff; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}
.auth-logo.warn { background: var(--orange); }
.auth-title { font-size: 18px; font-weight: 700; color: var(--navy); line-height: 1.4; }
.auth-sub { font-size: 14px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab {
  flex: 1; padding: 10px; border: 1px solid var(--gray-line-2); border-radius: 6px;
  background: #fff; font-size: 15.5px; color: var(--ink-2); cursor: pointer; font-weight: 600;
}
.auth-tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }

.auth-tenant {
  background: var(--orange-bg); border: 1px solid var(--orange-line);
  border-radius: 6px; padding: 10px 13px; font-size: 15px; color: var(--ink);
  margin-bottom: 14px; line-height: 1.6;
}
.auth-msg {
  border-radius: 6px; padding: 11px 14px; font-size: 15.5px; line-height: 1.7; margin-bottom: 16px;
}
.auth-msg.err { background: #FDEDED; border: 1px solid #F3C9C9; color: #9E3333; }
.auth-msg.ok { background: #EAF4EF; border: 1px solid #BEDCCB; color: #2F6B50; }

.auth-card .form label { display: block; margin-bottom: 13px; }
.auth-card .form input,
.auth-card .form select {
  width: 100%; margin-top: 6px; padding: 11px 13px;
  border: 1px solid var(--gray-line-2); border-radius: 6px;
  font-size: 16px; font-weight: 400; background: #fff;
}
.auth-card .form select { height: 46px; }
.auth-card .form input:focus,
.auth-card .form select:focus { outline: none; border-color: var(--navy); }

.auth-foot { margin-top: 18px; border-top: 1px solid var(--gray-line); padding-top: 12px; }
.auth-contact { text-align: center; font-size: 13.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }

/* ── 登录页：店主店铺资料入口（未登录即见；点击后直达资料表单） ── */
.owner-entry {
  margin: 0 0 16px; padding: 16px 18px 14px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFD 100%);
  border: 1px solid var(--gray-line); border-radius: 10px;
  box-shadow: var(--shadow);
}
.owner-entry .oe-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.owner-entry .oe-ico { font-size: 19px; line-height: 1; }
.owner-entry .oe-title { font-size: 16px; font-weight: 700; color: var(--navy); }
.owner-entry .oe-desc { font-size: 13.5px; color: var(--ink-2, #4A5560); line-height: 1.7; margin: 0 0 10px; }
.owner-entry .oe-list { margin: 0 0 14px; padding-left: 18px; }
.owner-entry .oe-list li { font-size: 13px; color: var(--ink-3); line-height: 1.85; }
.owner-entry .oe-hint { font-size: 12.5px; color: var(--ink-3); text-align: center; margin-top: 10px; line-height: 1.6; }

/* 从登录页入口进来时，资料卡高亮闪一下，帮店主一眼找到 */
.card-profile.flash { animation: qkbCardFlash 1.9s ease; }
@keyframes qkbCardFlash {
  0%, 100% { box-shadow: var(--shadow); }
  20%, 70% { box-shadow: 0 0 0 3px rgba(185, 96, 30, .45), var(--shadow); }
}
/* 推广弹窗：二维码与页面一致性的说明行 */
.promo-tip-line { font-size: 12.5px; color: var(--ink-3); text-align: center; margin: 10px 0 0; line-height: 1.6; }

/* ── 管理后台 ── */
.admin-wrap { padding: 68px 0 0; min-height: 100vh; }

/* 操作栏（顶栏正下方，与店主端一致；加微阴影形成层次） */
.admin-wrap > .action-bar {
  box-shadow: 0 2px 5px rgba(20, 58, 90, .06);
  position: relative; z-index: 1;
}

.admin-tabs {
  display: flex; gap: 4px; padding: 0 24px;
  max-width: 1240px; margin: 0 auto;
  background: #fff; border-bottom: 1px solid var(--gray-line);
}
.admin-tab {
  padding: 14px 20px; border: none; background: none; cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--ink-2);
  border-bottom: 3px solid transparent;
  transition: background-color .12s, color .12s;
}
.admin-tab:hover { background: var(--navy-soft); }
.admin-tab.on { color: var(--navy); border-bottom-color: var(--orange); }
.admin-body { padding: 26px 24px 48px; max-width: 1240px; margin: 0 auto; }

.admin-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.admin-bar .admin-input { max-width: 260px; margin: 0; }
.admin-select {
  padding: 10px 12px; border: 1px solid var(--gray-line-2); border-radius: 6px;
  font-size: 15px; background: #fff; height: 42px;
}
.admin-count { font-size: 15px; color: var(--ink-3); margin-left: auto; }

.user-table {
  width: 100%; border-collapse: collapse; font-size: 15px; background: #fff;
  border: 1px solid var(--gray-line); border-radius: var(--radius); overflow: hidden;
}
.user-table th, .user-table td {
  border-bottom: 1px solid var(--gray-line); padding: 12px 13px;
  text-align: left; vertical-align: top; line-height: 1.6;
}
.user-table th { background: var(--navy-soft); color: var(--navy); font-weight: 600; white-space: nowrap; }
.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: #FAFBFC; }
.user-table .sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }
.user-table .acts { white-space: nowrap; }

/* ── 用户列表（列多，整体横向可滚，避免各列被挤成豆腐块） ── */
.user-table-wide { display: block; overflow-x: auto; }
.user-table-wide th, .user-table-wide td { white-space: nowrap; }
.user-table-wide td.rmk-cell { white-space: normal; }   /* 备注是唯一的可折行列 */

/* ── 管理员备注（列表单元格） ──
   宽度给足但设上限，长文本折行后最多显示 3 行，鼠标悬停看全文 */
.user-table td.rmk-cell { min-width: 190px; max-width: 280px; }
.rmk-text {
  font-size: 14px; color: var(--ink-2); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── 备注编辑区（弹窗计数行 + 输入框） ── */
.rmk-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 13.5px; color: var(--ink-3);
}
.rmk-meta .err-text { margin: 0; text-align: right; }
.rmk-input, .modal-box textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; line-height: 1.7;
  border: 1px solid var(--gray-line-2); border-radius: 6px; font-family: inherit;
  font-size: 15px; color: var(--ink); background: #fff; resize: vertical;
}
.rmk-input:focus, .modal-box textarea:focus { outline: none; border-color: var(--navy); }

/* 门店信息弹窗底部的备注块 */
.shop-rmk {
  margin-top: 18px; padding: 16px 18px;
  background: var(--gray-bg); border: 1px solid var(--gray-line); border-radius: var(--radius);
}
.shop-rmk-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 10px;
}
.shop-rmk-head .sub { font-size: 13px; font-weight: 400; color: var(--ink-3); }

/* 管理员「查看门店信息」弹层里的键值表 */
.shop-info-table td.k { width: 116px; white-space: nowrap; color: var(--ink-2); background: var(--gray-bg); font-weight: 600; }
.shop-info-table td.v { color: var(--ink); word-break: break-word; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 3px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.badge.active { background: #EAF4EF; color: #2F6B50; }
.badge.pending { background: var(--orange-bg); color: var(--orange-dark); }
.badge.disabled { background: #EEF0F2; color: #6B7480; }
.badge.deleted { background: #FDEDED; color: #9E3333; }

.abtn {
  padding: 6px 12px; margin: 0 4px 4px 0;
  border: 1px solid var(--gray-line-2); border-radius: 5px;
  background: #fff; font-size: 14px; color: var(--navy); cursor: pointer; white-space: nowrap;
}
.abtn:hover { border-color: var(--navy); background: var(--navy-soft); }
.abtn.ok { color: #2F6B50; border-color: #BEDCCB; }
.abtn.ok:hover { background: #EAF4EF; }
.abtn.warn { color: var(--orange-dark); border-color: var(--orange-line); }
.abtn.warn:hover { background: var(--orange-bg); }
.abtn.danger { color: #9E3333; border-color: #F3C9C9; }
.abtn.danger:hover { background: #FDEDED; }

.pager { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 18px; font-size: 15px; color: var(--ink-2); }

.set-list { background: #fff; border: 1px solid var(--gray-line); border-radius: var(--radius); }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border-bottom: 1px solid var(--gray-line);
}
.set-row:last-child { border-bottom: none; }
.set-label { font-size: 16px; font-weight: 600; color: var(--ink); }
.set-desc { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.6; }

.empty { text-align: center; color: var(--ink-3); padding: 46px 0; font-size: 16px; }
.loading { text-align: center; color: var(--ink-3); padding: 40px 0; font-size: 16px; }

.err-text { color: #9E3333; font-size: 14.5px; min-height: 20px; margin: 10px 0 4px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
/* .modal-actions 默认横排（给「取消 / 确认」用）。整宽的 btn-block 按钮若也放进横排，
   会被 flex 挤成半宽、文字截断（「下载二维码图片（印招牌 / 发朋友圈）」踩过），必须竖排。 */
.modal-actions.stack { flex-direction: column; }

/* ══════════ 经营小锦囊（轻量弹窗） ══════════
   不遮罩、不抢焦点、不阻塞主内容：卡片本身才可点，卡片以外照常操作 */
.tip-card {
  position: fixed; right: 18px; bottom: 18px; z-index: 120;
  width: 312px; max-width: calc(100vw - 24px);
  padding: 12px 14px 10px;
  background: #fff;
  border: 1px solid var(--gray-line);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(14px) scale(.98);
  transition: opacity .24s ease, transform .24s ease;
  pointer-events: none;
}
.tip-card.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.tip-head { display: flex; align-items: center; gap: 8px; }
.tip-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; color: var(--orange-dark);
  white-space: nowrap;
}
.tip-badge i { font-style: normal; font-size: 13px; }
.tip-tag {
  flex: 1;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--navy-soft); border-radius: 3px;
  padding: 1px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tip-x {
  flex: none; width: 22px; height: 22px; line-height: 1;
  border: none; background: transparent; cursor: pointer;
  color: var(--ink-3); font-size: 14px; border-radius: 4px; padding: 0;
}
.tip-x:hover { background: var(--gray-bg); color: var(--ink); }

.tip-text {
  margin: 7px 0 4px;
  font-size: 15.5px; line-height: 1.7; color: var(--ink);
  letter-spacing: .2px;
}

.tip-foot { display: flex; align-items: center; gap: 14px; }
.tip-link {
  border: none; background: transparent; padding: 2px 0; cursor: pointer;
  font-size: 13px; color: var(--navy); opacity: .85;
}
.tip-link:hover { opacity: 1; text-decoration: underline; }
.tip-more { font-weight: 600; }
.tip-next { color: var(--ink-2); margin-left: auto; }

@media (max-width: 860px) {
  /* 手机上贴底，且要避开底部导航栏（56px） */
  .tip-card { right: 10px; left: 10px; bottom: 66px; width: auto; padding: 11px 12px 8px; }
  .tip-text { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .tip-card { transition: opacity .15s linear; transform: none; }
  .tip-card.open { transform: none; }
}

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(12px);
  background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 6px;
  font-size: 15.5px; z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s; max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .admin-wrap { padding-top: 60px; }
  .admin-tabs { padding: 0 10px; overflow-x: auto; }
  .admin-tab { padding: 12px 14px; font-size: 15px; white-space: nowrap; }
  .admin-body { padding: 16px 12px 40px; }
  .admin-count { margin-left: 0; width: 100%; }
  .user-table { font-size: 14px; display: block; overflow-x: auto; white-space: nowrap; }
  .set-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .auth-card { padding: 22px 18px 18px; }
}

/* ── 我的推广（专属链接 + 获客二维码） ── */
.promo-qr-wrap { display: flex; justify-content: center; margin: 14px 0 12px; }
#promoCanvas {
  width: 268px; height: auto; display: block;
  border: 1px solid var(--gray-line); border-radius: 10px;
  box-shadow: var(--shadow);
}
.promo-link-row { display: flex; gap: 8px; align-items: stretch; }
.promo-link {
  flex: 1; min-width: 0;
  font-size: 13px; color: var(--ink-2); line-height: 1.5;
  padding: 9px 10px;
  border: 1px solid var(--gray-line); border-radius: var(--radius);
  background: var(--navy-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 860px) {
  /* 390×844 真机实测：QR 越大，「商品管理 / 优惠管理」越容易被挤出首屏。
     180px 是「码仍清晰可扫（码区约 135px）+ 全部按钮一屏可见」的平衡点 */
  #promoCanvas { width: 180px; }
  .promo-qr-wrap { margin: 8px 0 6px; }
  .promo-manage-row { margin-top: 8px; }
  .promo-link-row { flex-direction: column; }
  .promo-link-row .btn { width: 100%; }
}

/* ── 商品 / 优惠 管理（「我的推广」弹窗内的录入列表 + 表单） ── */
.promo-manage-row { display: flex; gap: 10px; margin-top: 12px; }
.promo-manage-row .btn { flex: 1; }

/* 列表视图 / 表单视图都要撑满弹窗高度，里面的 .modal-body 才能正常滚动 */
#sdListView, #sdFormView { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#sdListView[hidden], #sdFormView[hidden] { display: none; }

.sd-tabs { display: flex; gap: 8px; padding: 12px 22px 0; }
.sd-tab {
  flex: 1; padding: 9px 10px; font-size: 15px; font-weight: 600;
  color: var(--ink-2); background: var(--navy-soft);
  border: 1px solid var(--gray-line); border-radius: var(--radius); cursor: pointer;
}
.sd-tab.is-on { color: #fff; background: var(--navy); border-color: var(--navy); }

.sd-list { display: flex; flex-direction: column; gap: 10px; }
.sd-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--gray-line); border-radius: var(--radius); background: #fff;
}
.sd-item.is-off { background: #F6F7F9; }
.sd-thumb {
  width: 56px; height: 56px; flex: none; border-radius: 6px; overflow: hidden;
  background: var(--navy-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--ink-3);
}
.sd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 商品表单：本地图上传预览 */
.sd-preview { max-width: 120px; max-height: 120px; border-radius: 6px; margin-top: 6px; display: block; border: 1px solid var(--gray-line); }
.sd-img-clear { margin-top: 6px; align-self: flex-start; background: none; border: 1px solid var(--gray-line); color: var(--ink-3); border-radius: 6px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.sd-img-tip { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.sd-main { flex: 1; min-width: 0; }
.sd-name { font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 1.5; word-break: break-word; }
.sd-desc { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; margin-top: 3px; word-break: break-word; }
.sd-meta { font-size: 13.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.6; }
.sd-price { color: var(--orange); font-weight: 700; font-size: 15.5px; }
.sd-price s { color: var(--ink-3); font-weight: 400; font-size: 12.5px; margin-left: 6px; }
.sd-unit { color: var(--ink-3); font-weight: 400; font-size: 12.5px; margin-left: 4px; }
.p-unit { color: var(--ink-3); font-weight: 400; font-size: 12.5px; margin-left: 4px; }
.sd-badge {
  display: inline-block; font-size: 11.5px; line-height: 1.6; padding: 1px 7px;
  border-radius: 9px; margin-right: 6px; vertical-align: 1px;
}
.sd-badge.on   { color: #1B6B3A; background: #E3F3E8; }
.sd-badge.off  { color: #7A828C; background: #EDEFF2; }
.sd-badge.type { color: #8A4B12; background: #FBEEE0; }
.sd-ops { display: flex; flex-direction: column; gap: 6px; flex: none; }
.sd-op {
  font-size: 13px; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--gray-line-2); background: #fff; color: var(--ink-2); white-space: nowrap;
}
.sd-op.danger { color: #9E3333; border-color: #E7C9C9; }
.sd-empty { text-align: center; font-size: 14.5px; color: var(--ink-3); padding: 26px 0 18px; }
.sd-tip { font-size: 12.5px; color: var(--ink-3); text-align: center; margin: 12px 0 0; line-height: 1.6; }

/* 关键：.form 的 display:flex 是作者样式，会盖掉 UA 的 [hidden]{display:none}。
   两个表单块靠 hidden 属性切换，不显式声明的话会「商品+优惠」两个表单同时显示。 */
.form[hidden] { display: none; }

/* 「上架」勾选行：.form label 默认 display:block，这里要覆盖成一行 */
.form label.sd-check { display: flex; align-items: center; gap: 8px; }
.form label.sd-check input { width: auto; margin: 0; }
/* .form 原本只给了 input/textarea，下拉框补上同样式 */
.form select {
  display: block; width: 100%; margin-top: 6px;
  padding: 11px 13px; font-weight: 400;
  border: 1px solid var(--gray-line-2); border-radius: 6px; font-size: 16px; background: #fff;
}
.form select:focus { outline: none; border-color: var(--navy); }

@media (max-width: 860px) {
  .sd-tabs { padding: 10px 16px 0; }
  .sd-item { gap: 10px; padding: 10px; }
  .sd-thumb { width: 48px; height: 48px; }
}
