/* ============================================================================
   商家端（移动优先）—— 和顾客端同一套视觉语言：玻璃卡片、三色、统一间距
   结构：① 登录/开通  ② 工作台首页（助手宫格）  ③ 好评助手模块内页（底部导航）
   移动优先：单列、大按钮、可点区域 ≥44px；桌面端同样是居中的一列，不左右拉伸。
   ========================================================================== */

body { padding: 0; }

.screen {
  width: min(460px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--gap, 12px);
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
}
.screen--center { justify-content: center; align-items: stretch; }
.screen--module { padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
.screen[hidden] { display: none; }

/* ---------------------------------------------------------------- 顶栏 */
.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-lg);
  position: sticky;
  top: calc(6px + env(safe-area-inset-top));
  z-index: 30;
  flex: none;
}
.brand-mark {
  width: 40px; height: 40px; flex: none; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, #3d80ff, var(--blue));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 8px 18px -10px rgba(10, 92, 255, 0.9);
}
.brand-mark.sm { width: 36px; height: 36px; font-size: 16px; border-radius: 12px; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- 登录页 */
.auth-card { padding: 22px 18px; border-radius: var(--r-xl); box-shadow: var(--sh-2), var(--sh-inset); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.auth-brand h1 { font-size: 18px; font-weight: 650; letter-spacing: 0.2px; }
.auth-brand p { margin-top: 3px; }
.auth-form { margin-top: 16px; }
.center { text-align: center; }

/* 客服按钮（小，右上角） */
.support-btn {
  flex: none;
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 11px 0 9px;
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--blue);
  border: 1px solid rgba(10, 92, 255, 0.22);
  background: var(--blue-soft);
  border-radius: 99px; cursor: pointer;
  transition: transform var(--fast) var(--ease);
}
.support-btn:active { transform: scale(0.95); }
.support-btn svg { width: 16px; height: 16px; display: block; }

/* 演示账号：账号、密码分开写清楚，老花眼也不会填错 */
.demo-tip {
  margin-top: 14px; padding: 11px 12px;
  border-radius: var(--r-md);
  background: rgba(11, 18, 32, 0.04);
  border: 1px dashed var(--hair-strong);
}
.demo-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; line-height: 1.9; }
.demo-row .demo-k { color: var(--ink-2); flex: none; min-width: 58px; }
.demo-row .demo-v {
  font-weight: 700; color: var(--ink); letter-spacing: 0.4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  user-select: all;
}
.demo-tip .btn { margin-top: 9px; }

/* 客服弹层 */
.support-card { display: flex; flex-direction: column; gap: 10px; }
.support-card h3 { font-size: 16px; font-weight: 650; }
.support-card .note { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.support-line {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--hair);
}
.support-line .k { font-size: 12.5px; color: var(--ink-2); flex: none; }
.support-line .v {
  flex: 1; min-width: 0; font-weight: 650; letter-spacing: 0.3px; user-select: all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.support-line .btn { flex: none; white-space: nowrap; padding: 0 12px; }

/* 客服弹层里的「自助重置密码」 */
.reset-box {
  margin-top: 6px; padding: 13px 12px;
  border-radius: var(--r-md);
  background: var(--blue-soft);
  border: 1px solid rgba(10, 92, 255, 0.18);
}
.reset-box .reset-title { font-size: 14px; font-weight: 650; margin-bottom: 5px; }
.reset-box .reset-fields { display: flex; flex-direction: column; gap: 9px; margin-top: 11px; }
.reset-box .field { background: rgba(255, 255, 255, 0.85); }

/* NFC 写入失败的排查弹层 */
.nfc-reason {
  font-size: 13px; line-height: 1.75; color: var(--ink);
  white-space: pre-wrap;
  padding: 11px 12px; border-radius: var(--r-md);
  background: var(--amber-soft); border: 1px solid rgba(255, 106, 26, 0.22);
}
.nfc-steps { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.nfc-step {
  font-size: 12.5px; line-height: 1.6; color: var(--ink-2);
  padding: 10px 12px; border-radius: var(--r-md);
  background: rgba(11, 18, 32, 0.04);
}

/* ---------------------------------------------------------------- 工作台首页 */
.card { padding: 15px; }
.hero { padding: 14px; }
.hero-main { display: flex; align-items: center; gap: 14px; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.hero-actions .btn { padding: 0 8px; font-size: 13px; white-space: nowrap; }
.hero-actions .btn--wide { grid-column: 1 / -1; }
.hero-title { font-size: 16px; font-weight: 650; letter-spacing: 0.2px; }
.qr-mini {
  flex: none; padding: 7px; border-radius: 16px; cursor: pointer;
  background: #fff; border: 1px solid var(--hair); box-shadow: var(--sh-1);
  transition: transform var(--fast) var(--ease);
}
.qr-mini:active { transform: scale(0.95); }
#homeQr { width: 92px; height: 92px; display: block; }

.section-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 2px 4px; font-size: 13px; font-weight: 650; color: var(--ink);
}

/* 助手宫格：好评助手已开通，其余是留给后续助手的空位 */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 14px; border-radius: var(--r-lg); text-align: left;
  font: inherit; cursor: pointer; min-height: 116px;
  border: 1px solid var(--glass-edge);
  background: linear-gradient(180deg, var(--glass-1), var(--glass-2));
  box-shadow: var(--sh-1), var(--sh-inset);
  transition: transform var(--fast) var(--ease);
}
.tile-card:active { transform: scale(0.97); }
.tile-card .ti { font-size: 22px; line-height: 1; }
.tile-card .tname { font-size: 14.5px; font-weight: 650; }
.tile-card .tdesc { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; }
.tile-card .tstate {
  position: absolute; right: 10px; top: 10px;
  font-size: 10px; font-weight: 600; border-radius: 99px; padding: 2px 8px;
  color: var(--ink-3); background: rgba(11, 18, 32, 0.06);
}
.tile-card--on { border-color: rgba(10, 92, 255, 0.35); }
.tile-card--on .tstate { color: #fff; background: linear-gradient(180deg, #3d80ff, var(--blue)); }
.tile-card--on .ti {
  width: 40px; height: 40px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #3d80ff, var(--blue));
  box-shadow: 0 8px 18px -10px rgba(10, 92, 255, 0.9);
  font-size: 20px;
}
.tile-card--soon { background: rgba(255, 255, 255, 0.5); border-style: dashed; border-color: var(--hair-strong); box-shadow: none; }
.tile-card--soon .ti { opacity: 0.5; filter: saturate(0.2); }
.tile-card--soon .tname { color: var(--ink-2); }
.tile-card--add { align-items: center; justify-content: center; text-align: center; }
.tile-card--add .ti { font-size: 26px; color: var(--ink-3); }

/* ---------------------------------------------------------------- 模块内页 */
.panel { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.panel[hidden] { display: none; }
.row--between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.save-state.ok { color: var(--blue); }
.save-state.dirty { color: var(--amber); }
.plain-list { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.55; }

/* 底部导航（移动端主操作区） */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  width: min(460px, 100%);
  display: flex;
  gap: 2px;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-bottom: 0;
}
.tabbar .tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: var(--ink-2);
  border: 0; background: transparent; border-radius: 12px; padding: 5px 2px;
  cursor: pointer; font-family: inherit;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.tabbar .tab .ti { font-size: 17px; line-height: 1; }
.tabbar .tab[aria-selected="true"] { color: var(--blue); background: var(--blue-soft); }

/* ---------------------------------------------------------------- 组件（移动端加大） */
.btn { height: 44px; }
.btn--sm { height: 34px; }
.btn--lg { height: 48px; font-size: 15px; }
.btn--icon { width: 40px; height: 40px; padding: 0; font-size: 17px; }
.field { padding: 12px; font-size: 15px; }
textarea.field { min-height: 104px; }
.label { font-size: 12.5px; }
.form-row { margin-bottom: 14px; }

/* 文案模板 */
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; border-radius: var(--r-md);
  border: 1px solid var(--hair); background: rgba(255, 255, 255, 0.6);
}
.tpl[data-active="true"] { border-color: rgba(10, 92, 255, 0.5); background: var(--blue-soft); }
.tpl-body { flex: 1; min-width: 0; }
.tpl-title { font-size: 13px; font-weight: 650; margin-bottom: 2px; }
.tpl-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.tpl-actions { display: flex; flex-direction: row; gap: 6px; flex: none; align-self: flex-start; }

/* 图片网格 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.photo-item {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--hair); background: rgba(11, 18, 32, 0.05);
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item[data-on="false"] img { filter: saturate(0.35) opacity(0.55); }
.photo-item[data-on="true"] { border-color: rgba(10, 92, 255, 0.85); box-shadow: 0 0 0 2px rgba(10, 92, 255, 0.6); }
.photo-item .pick {
  position: absolute; left: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9); background: rgba(11, 18, 32, 0.4);
  color: #fff; font-size: 15px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.photo-item[data-on="true"] .pick { background: var(--blue); border-color: #fff; }
.photo-item .ops {
  position: absolute; right: 5px; bottom: 5px; display: flex; gap: 3px;
  padding: 3px; border-radius: 10px;
  background: rgba(11, 18, 32, 0.42);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.photo-item .ops button {
  min-width: 30px; height: 30px; border-radius: 8px; border: 0; cursor: pointer;
  font-size: 12px; line-height: 1; color: #fff; background: rgba(255, 255, 255, 0.14);
  font-family: inherit; padding: 0 5px;
}
.photo-item .ops button:active { transform: scale(0.92); }
.photo-item .ops button.danger { background: var(--amber); min-width: 56px; font-weight: 600; }

/* 直达链接 */
.link-list { display: flex; flex-direction: column; gap: 10px; }
.link-row { padding: 11px 12px; border-radius: var(--r-md); border: 1px solid var(--hair); background: rgba(255, 255, 255, 0.6); }
.link-row .top { display: flex; align-items: center; gap: 10px; }
.link-row .glyph { --tile-size: 34px; --tile-radius: 11px; flex: none; display: flex; }
.link-row .name { font-size: 14px; font-weight: 650; }
.link-row .tip { font-size: 11px; color: var(--ink-3); line-height: 1.4; }
.link-row .field { margin-top: 9px; font-size: 13px; padding: 10px; }

/* 二维码 */
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 12px; }
#qrCanvas {
  width: 190px; height: 190px;
  border-radius: 20px; background: #fff; padding: 10px;
  border: 1px solid var(--glass-edge); box-shadow: var(--sh-1);
}
.qr-side { width: 100%; }
.copyline { display: flex; gap: 8px; align-items: center; }
.copyline .field { font-size: 12.5px; }
.copyline .btn { flex: none; white-space: nowrap; }

/* 空状态 */
.empty-hint {
  padding: 18px 12px; text-align: center; font-size: 12.5px; color: var(--ink-3);
  border: 1px dashed var(--hair-strong); border-radius: var(--r-md);
}

/* 注册页：自动分配的店铺编号 */
.code-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--blue-soft); border: 1px solid rgba(10, 92, 255, 0.22);
}
.code-preview .code {
  font-size: 22px; font-weight: 800; letter-spacing: 1px;
  color: var(--blue); font-variant-numeric: tabular-nums;
}
#regRegion { appearance: none; background-image: none; }

/* 放大二维码（举给顾客扫） */
.qr-zoom { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr-zoom canvas { width: 260px; height: 260px; border-radius: 22px; background: #fff; padding: 12px; box-shadow: var(--sh-2); }
.qr-zoom .hint { font-size: 12.5px; color: var(--ink-2); }

/* 即将上线的助手说明 */
.soon-card { text-align: center; padding: 20px 16px; }
.soon-card .big { font-size: 34px; line-height: 1; margin-bottom: 10px; display: block; }
.soon-card h3 { font-size: 16px; font-weight: 650; margin-bottom: 6px; }
.soon-card p { font-size: 13px; color: var(--ink-2); line-height: 1.7; }

/* 移动端提示条放到底部（顶部是店铺信息，别被盖住） */
#toast {
  top: auto;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translate(-50%, 18px);
}
#toast.show { transform: translate(-50%, 0); }

/* 宽屏（电脑上打开）：同样一列，居中显示 */
@media (min-width: 560px) {
  .screen { padding-left: 0; padding-right: 0; }
}
/* 直达里「链接 / 口令」识别徽章 */
.link-kind { display: none; font-size: 11.5px; margin-top: 6px; color: var(--ink-3); }
.link-kind:not(:empty) { display: block; }
.link-kind.ok { color: var(--blue); }
.link-kind.code { color: var(--amber); }
/* 分段选择（轮换模式） */
.seg { display: flex; gap: 6px; padding: 4px; border-radius: var(--r-md); background: rgba(11, 18, 32, 0.05); }
.seg-btn {
  flex: 1; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: transparent; border: 0; border-radius: 10px; padding: 9px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.seg-btn span { font-size: 10.5px; font-weight: 600; color: var(--blue); }
.seg-btn.is-on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px -4px rgba(11, 18, 32, 0.35); }
.seg-btn:active { transform: scale(0.98); }
