/* ============ 甲胄工坊 · 工作台设计系统 ============ */

:root {
  --bg: #f5f1fa;
  --bg-soft: #ece5f6;
  --surface: #fffaff;
  --surface-2: #faf5ff;
  --text: #241b35;
  --text-2: #655a78;
  --text-3: #9589a8;
  --border: #e5dcef;
  --border-2: #cbbde0;

  --primary: #7655a6;
  --primary-soft: #eee5fa;
  --primary-dark: #513779;
  --ink: #211833;
  --plum: #3b2858;
  --lavender: #b9a4d8;
  --mist: #e9b8d2;
  --gold: #e8c777;

  --danger: #d33f38;
  --danger-soft: #fdeceb;
  --warn: #c47611;
  --warn-soft: #fdf3e3;
  --ok: #12805c;
  --ok-soft: #e6f5ef;
  --info: #1f6fbf;
  --info-soft: #e9f2fb;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(59, 40, 88, .07), 0 8px 22px rgba(59, 40, 88, .04);
  --shadow-lg: 0 16px 38px rgba(59, 40, 88, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(circle at 8% 0%, rgba(233, 184, 210, .18), transparent 25%), radial-gradient(circle at 92% 14%, rgba(185, 164, 216, .14), transparent 30%);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.35; }
h1 { font-size: 20px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 14px; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd4dc; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(33, 24, 51, .97);
  border-bottom: 1px solid rgba(185, 164, 216, .24);
  box-shadow: 0 8px 26px rgba(33, 24, 51, .16);
  height: 58px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fffaff; font-weight: 600; font-size: 15px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--gold); color: var(--ink);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  flex: none;
}
.navlinks { display: flex; gap: 2px; }
.navlink {
  padding: 7px 13px; border-radius: var(--r-sm);
  color: #d8cde8; font-size: 14px; cursor: pointer;
  border: none; background: transparent; white-space: nowrap;
}
.navlink:hover { background: rgba(185, 164, 216, .14); color: #fffaff; }
.navlink.active { background: rgba(185, 164, 216, .22); color: var(--gold); font-weight: 600; }
.navlink .dot {
  display: inline-block; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; line-height: 17px; text-align: center; margin-left: 6px;
  font-weight: 600; vertical-align: 1px;
}
.sync-status {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 4px 9px; border: 1px solid rgba(232, 199, 119, .4); border-radius: 999px;
  color: var(--gold); background: rgba(232, 199, 119, .1); font-size: 12px; white-space: nowrap;
}
.sync-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(232, 199, 119, .12); }
.sync-status[data-state="polling"] { color: var(--lavender); border-color: rgba(185, 164, 216, .38); background: rgba(185, 164, 216, .1); }
.sync-status[data-state="offline"] { color: #f2a9b2; border-color: rgba(242, 169, 178, .4); background: rgba(242, 169, 178, .1); }

/* ---------- 容器 ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 22px 20px 80px; }
.page.wide { max-width: 1600px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); font-size: 13px; margin-top: 3px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  border-color: var(--border);
}
.card-pad { padding: 18px; }
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-body { padding: 18px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--r-sm);
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: background .16s, border-color .16s, opacity .16s, transform .16s, box-shadow .16s;
}
.btn:hover { background: var(--bg-soft); border-color: var(--lavender); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fffaff; box-shadow: 0 7px 18px rgba(118, 85, 166, .22); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 10px 22px rgba(81, 55, 121, .25); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; background: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px 8px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--border-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%235b6270' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 680px) { .form-grid { grid-template-columns: 1fr; } }

/* 选项按钮组（规格选择） */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  padding: 7px 13px; border: 1px solid var(--border-2); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; font-size: 13px; line-height: 1.4;
  text-align: left; transition: all .12s;
}
.opt:hover { border-color: var(--primary); }
.opt.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.opt .delta { font-size: 12px; color: var(--text-3); margin-left: 5px; font-weight: 400; }
.opt.on .delta { color: var(--primary); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 18px;
  background: var(--bg-soft); color: var(--text-2); white-space: nowrap;
}
.tag-primary { background: var(--primary-soft); color: var(--primary); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-info { background: var(--info-soft); color: var(--info); }
.tag-line { background: transparent; border: 1px solid var(--border-2); color: var(--text-2); }

/* ---------- 商品网格 ---------- */
.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr)); gap: 16px; }
.goods {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s;
  display: flex; flex-direction: column;
}
.goods:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--border-2); }
.goods-img { aspect-ratio: 4 / 3; background: var(--plum); position: relative; overflow: hidden; }
.goods-img img { width: 100%; height: 100%; object-fit: cover; }
.goods-img .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-3); font-size: 12px; }
.goods-img .badge { position: absolute; left: 8px; top: 8px; }
.goods-info { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.goods-name { font-weight: 600; font-size: 14px; }
.goods-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; }
.price { color: var(--danger); font-weight: 700; font-size: 17px; }
.price .unit { font-size: 12px; font-weight: 500; }
.price-from { font-size: 12px; color: var(--text-3); font-weight: 400; }

/* ---------- 图集 ---------- */
.gallery-main { aspect-ratio: 4 / 3; background: var(--bg-soft); border-radius: var(--r); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-3); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs .th {
  width: 60px; height: 60px; border-radius: var(--r-sm); overflow: hidden;
  border: 2px solid transparent; cursor: pointer; background: var(--bg-soft); flex: none;
}
.gallery-thumbs .th.on { border-color: var(--primary); }
.gallery-thumbs .th img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 上传区 ---------- */
.uploader {
  border: 1.5px dashed var(--border-2); border-radius: var(--r);
  padding: 18px; text-align: center; cursor: pointer; color: var(--text-2);
  background: var(--surface-2); transition: all .12s;
}
.uploader:hover, .uploader.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 74px; height: 74px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--bg-soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .del {
  position: absolute; right: 2px; top: 2px; width: 19px; height: 19px; border-radius: 50%;
  background: rgba(0,0,0,.62); color: #fff; border: none; cursor: pointer;
  font-size: 13px; line-height: 19px; padding: 0; display: grid; place-items: center;
}
.thumb .cover-flag { position: absolute; left: 0; bottom: 0; right: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; text-align: center; line-height: 15px; }

/* ---------- 排单看板 ---------- */
.queue-head {
  display: grid; grid-template-columns: 44px 1fr 132px 118px 106px 130px 96px;
  gap: 12px; padding: 9px 14px; font-size: 12px; color: var(--text-3); font-weight: 500;
}
.queue-list { display: flex; flex-direction: column; gap: 9px; }
.qrow {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border-2);
  border-radius: var(--r); padding: 12px 14px;
  display: grid; grid-template-columns: 44px 1fr 132px 118px 106px 130px 96px;
  gap: 12px; align-items: center;
  transition: box-shadow .12s, opacity .12s;
}
.qrow:hover { box-shadow: var(--shadow-lg); }
.qrow.lv-over { border-left-color: var(--danger); background: #fffafa; }
.qrow.lv-tight { border-left-color: var(--warn); }
.qrow.lv-ok { border-left-color: var(--ok); }
.qrow.lv-done { border-left-color: var(--border-2); opacity: .62; }
.qrow.dragging { opacity: .35; }
.qrow.drag-over { box-shadow: inset 0 3px 0 var(--primary); }
.qrow .handle {
  cursor: grab; color: var(--text-3); display: flex; align-items: center; gap: 7px;
  user-select: none; font-variant-numeric: tabular-nums;
}
.qrow .handle:active { cursor: grabbing; }
.qrow .handle .grip { width: 11px; height: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 3px; align-content: center; flex: none; }
.qrow .handle .grip i { width: 3px; height: 3px; border-radius: 50%; background: var(--border-2); display: block; }
.qrow .seq { font-weight: 700; font-size: 14px; color: var(--text-2); }
.qrow .title { font-weight: 600; }
.qrow .reqline { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.qrow .taglist { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.date-block { font-size: 12px; line-height: 1.5; }
.date-block .big { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stage-pick { font-size: 12px; padding: 5px 8px; }

.stage-bar { display: flex; gap: 3px; margin-top: 6px; }
.stage-bar i { height: 4px; flex: 1; border-radius: 2px; background: var(--bg-soft); display: block; }
.stage-bar i.on { background: var(--primary); }

/* ---------- 聊天 ---------- */
.chat-wrap { display: grid; grid-template-columns: 288px 1fr; gap: 0; height: calc(100vh - 58px - 44px); min-height: 460px; }
.chat-side { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface-2); }
.thread {
  padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; gap: 10px;
}
.thread:hover { background: var(--bg-soft); }
.thread.on { background: var(--primary-soft); }
.thread .avt { width: 38px; height: 38px; border-radius: 8px; background: var(--bg-soft); overflow: hidden; flex: none; display: grid; place-items: center; font-size: 11px; color: var(--text-3); }
.thread .avt img { width: 100%; height: 100%; object-fit: cover; }
.thread .unread { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; align-self: center; }
.chat-main { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.chat-head { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); }
.chat-foot { border-top: 1px solid var(--border); padding: 12px 14px; background: var(--surface); }
.msg { display: flex; gap: 9px; max-width: 76%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 13px; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow);
}
.msg.me .bubble { background: var(--primary); border-color: var(--primary); color: #fff; }
.msg .who { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.msg.me .who { text-align: right; }
.msg .imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.msg .imgs img { width: 108px; height: 108px; object-fit: cover; border-radius: 8px; cursor: pointer; }
.msg .time { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.msg.me .time { text-align: right; }
.quick-replies { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.quick-replies .qr { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; color: var(--text-2); }
.quick-replies .qr:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 500; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }

/* ---------- 指标卡 ---------- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
.metric .lb { font-size: 12px; color: var(--text-2); }
.metric .vl { font-size: 25px; font-weight: 700; line-height: 1.25; margin-top: 3px; font-variant-numeric: tabular-nums; }
.metric.danger .vl { color: var(--danger); }
.metric.warn .vl { color: var(--warn); }
.metric.ok .vl { color: var(--ok); }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 620px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: pop .16s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(.99); opacity: 0 } to { transform: none; opacity: 1 } }
.modal.lg { max-width: 880px; }
.modal.sm { max-width: 420px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.x { border: none; background: transparent; font-size: 21px; line-height: 1; color: var(--text-3); cursor: pointer; padding: 2px 6px; border-radius: 5px; }
.x:hover { background: var(--bg-soft); color: var(--text); }

/* ---------- 提示 ---------- */
#toast { position: fixed; left: 50%; top: 22px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #24272e; color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 13px; box-shadow: var(--shadow-lg); animation: drop .18s ease;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }
.toast.warn { background: #b7791f; }
@keyframes drop { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

.notice {
  padding: 11px 14px; border-radius: var(--r); font-size: 13px;
  background: #f3ecfb; color: #5b3d7f; border: 1px solid rgba(118, 85, 166, .2);
}
.notice.warn { background: var(--warn-soft); color: #8a5109; border-color: rgba(196, 118, 17, .2); }
.notice.danger { background: var(--danger-soft); color: #9c2b25; border-color: rgba(211, 63, 56, .2); }
.notice.ok { background: var(--ok-soft); color: #0c5c42; border-color: rgba(18, 128, 92, .2); }

.empty { padding: 52px 20px; text-align: center; color: var(--text-3); }
.empty .big { font-size: 15px; color: var(--text-2); margin-bottom: 5px; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 7px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }

.spec-editor { border: 1px solid var(--border); border-radius: var(--r); padding: 13px; background: var(--surface-2); }
.spec-opt-row { display: grid; grid-template-columns: 1fr 96px 96px 32px; gap: 8px; align-items: center; }
@media (max-width: 560px) { .spec-opt-row { grid-template-columns: 1fr 1fr; } }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 400; display: grid; place-items: center; padding: 30px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.gate .box { width: 100%; max-width: 380px; }
.gate .brand-mark { background: var(--plum) !important; color: var(--gold) !important; }

.sticky-bar {
  position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 18px; display: flex; align-items: center; gap: 14px; justify-content: space-between;
  margin: 0 -18px -18px; border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap;
}

@media (max-width: 1180px) {
  .queue-head { display: none; }
  .qrow { grid-template-columns: 40px 1fr; grid-auto-rows: min-content; row-gap: 10px; }
  .qrow > .cell-wide { grid-column: 2 / -1; }
}
@media (max-width: 860px) {
  .topbar { padding: 0 13px; gap: 10px; height: 54px; min-width: 0; overflow: hidden; }
  .topbar .brand span.name { display: none; }
  .topbar .navlinks { min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .topbar .navlinks::-webkit-scrollbar { display: none; }
  .navlink { padding: 6px 10px; font-size: 13px; }
  .page { padding: 16px 13px 70px; }
  .page-head > .row { flex-wrap: wrap; }
  .chat-wrap { grid-template-columns: 1fr; height: auto; }
  .chat-side { display: none; border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; }
  .chat-side.show { display: block; }
  .chat-body { min-height: 320px; }
  .detail-grid { grid-template-columns: 1fr !important; }
}

/* ============ 顾客端店铺头图 hero ============ */
.shop-hero {
  position: relative; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px;
  background: var(--plum);
  background-size: cover; background-position: center; color: #fff;
  box-shadow: 0 18px 38px rgba(59, 40, 88, .18);
}
.shop-hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(33, 24, 51, .12), rgba(33, 24, 51, .66));
}
.shop-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .8;
  background-image: radial-gradient(circle, rgba(232, 199, 119, .9) 0 1px, transparent 1.6px), radial-gradient(circle, rgba(233, 184, 210, .8) 0 1px, transparent 1.8px);
  background-size: 86px 74px, 131px 113px; background-position: 18px 12px, 56px 42px;
  mix-blend-mode: screen;
}
.shop-hero-inner {
  position: relative; display: flex; align-items: center; gap: 18px;
  padding: 30px 24px 32px; min-height: 218px; flex-wrap: wrap;
}
.shop-logo {
  width: 76px; height: 76px; border-radius: 18px; object-fit: cover; flex: none;
  background: rgba(185, 164, 216, .28); border: 2px solid rgba(232, 199, 119, .8);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.shop-logo.ph { display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff; }
.shop-hero-txt { flex: 1; min-width: 200px; }
.shop-hero-txt h1 { font-size: 26px; margin: 0; line-height: 1.15; }
.shop-hero-txt .slogan { margin: 5px 0 0; opacity: .92; font-size: 14px; }
.shop-hero-txt .bio { margin: 8px 0 0; opacity: .85; font-size: 13px; line-height: 1.55; max-width: 620px; white-space: pre-wrap; }
.shop-hero-txt .contact { margin: 8px 0 0; font-size: 13px; opacity: .95; }
.shop-hero .btn-light { background: #fff; color: var(--primary); border-color: #fff; font-weight: 600; flex: none; }
.shop-hero .btn-light:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============ 设置页上传区 / 主题色板 ============ */
.upzone {
  border: 1px dashed var(--border-2); border-radius: var(--r); min-height: 84px;
  display: grid; place-items: center; cursor: pointer; color: var(--text-3);
  font-size: 13px; padding: 8px; text-align: center; overflow: hidden;
}
.upzone:hover { border-color: var(--primary); color: var(--primary); }
.upzone .up-prev { max-width: 100%; max-height: 150px; border-radius: 8px; }
.swatch {
  width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; cursor: pointer;
  padding: 0; transition: transform .1s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }

/* ============ 评价系统 ============ */
.avt { width: 38px; height: 38px; border-radius: 10px; background: var(--bg-soft); overflow: hidden; flex: none; display: grid; place-items: center; font-size: 15px; font-weight: 600; color: var(--text-2); }
.avt img { width: 100%; height: 100%; object-fit: cover; }
.avt.sm { width: 34px; height: 34px; border-radius: 9px; font-size: 14px; }

.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.review-card { display: flex; flex-direction: column; }
.review-card .stars { letter-spacing: 2px; font-size: 16px; color: var(--warn); }
.reply-box { background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; font-size: 13px; color: var(--text-2); border-left: 3px solid var(--primary); }

.stars { letter-spacing: 2px; }
.star-btn { font-size: 26px; line-height: 1; background: none; border: none; cursor: pointer; color: #d7d7e0; padding: 0 2px; transition: color .12s; }
.star-btn.on { color: var(--warn); }

/* ============ 付款 / 收款码 ============ */
.qr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; text-align: center; width: 220px; box-shadow: var(--shadow); }
.qr-img { width: 188px; height: 188px; margin: 0 auto 10px; border-radius: var(--r); overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; }
.qr-img img { width: 100%; height: 100%; object-fit: contain; }
.qr-name { font-weight: 700; font-size: 16px; margin-top: 2px; }

/* ============ 本地文件提醒条 ============ */
.local-note { display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: #fff6e6; color: #8a5a00; border-bottom: 1px solid #f0d9a8;
  padding: 8px 14px; font-size: 13px; line-height: 1.5; }
.local-note span { flex: 1; }
.local-note button { flex: none; border: none; background: transparent; color: #8a5a00; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }

/* 顾客专用链接（带云端配置） */
.between { justify-content: space-between; }
.share-link { background: #f2fbf9; border: 1px solid #bfe8e1; border-radius: 10px; padding: 12px 14px; }
.share-link .input { font-size: 12px; background: #fff; }
.share-link p { margin-bottom: 0; }

/* 云端厂商切换 */
.seg { display: inline-flex; background: var(--bg-soft, #f1f3f5); border: 1px solid var(--line, #e3e6ea); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-btn { border: none; background: transparent; padding: 7px 18px; border-radius: 8px; cursor: pointer;
  font-size: 14px; color: var(--muted, #6b7280); font-weight: 500; transition: all .15s; }
.seg-btn:hover { color: var(--text, #222); }
.seg-btn.on { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.prov-pane[hidden] { display: none; }
