/* ========== 三端共用样式 ========== */
:root {
  --primary: #6d5efc;
  --primary-2: #8b7bff;
  --bg: #f4f5f8;
  --card: #fff;
  --line: #e6e8ee;
  --text: #1b1f2a;
  --muted: #7b8496;
  --green: #17b26a;
  --amber: #f79009;
  --red: #f04438;
  --blue: #2e90fa;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* 表单 */
.field { display: block; margin-bottom: 13px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=tel],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfbfd; font-size: 14px; color: var(--text); font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(109,94,252,.12);
}
textarea { resize: vertical; min-height: 66px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid transparent; background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 9px; font-size: 13px; font-family: inherit;
  cursor: pointer; transition: all .15s; white-space: nowrap; font-weight: 500;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 6px 16px -6px rgba(109,94,252,.8); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { border-color: #c9cdd8; color: var(--text); }
.btn-line { background: #fff; border-color: var(--line); }
.btn-line:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff; border-color: #ffd7d3; color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; border-radius: 11px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid rgba(230,232,238,.6); margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 14.5px; }
.card-head .hint { font-size: 11.5px; color: var(--muted); }

/* 徽标 */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; line-height: 1.6; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.pending, .badge.review, .badge.draft { background: #fff6e5; color: #b54708; }
.badge.accepted, .badge.confirmed { background: #e8f2ff; color: #175cd3; }
.badge.approved, .badge.paid, .badge.active, .badge.solved { background: #e7f8ef; color: #067647; }
.badge.rejected, .badge.void, .badge.disabled { background: #f2f3f7; color: #667085; }
.badge.unpaid { background: #feeceb; color: #b42318; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px; background: #f1f2f7; color: #5b6472; }
.tag.on { background: #e7f8ef; color: #067647; }
.tag.off { background: #f2f3f7; color: #8a94a6; }

/* 列表条目 */
.item { background: var(--card); border-radius: var(--radius); border: 1px solid rgba(230,232,238,.8); padding: 14px 16px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: flex-start; }
.item-main { flex: 1; min-width: 0; }
.item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.item-no { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item-title { font-size: 15px; font-weight: 600; }
.item-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 3px; }
.item-meta b { color: var(--text); font-weight: 600; }
.item-amount { text-align: right; flex: 0 0 auto; }
.item-amount .num { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.item-amount .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 46px 20px; font-size: 13px; }
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: .5; }

/* 提示 */
.toast-root { position: fixed; left: 50%; transform: translateX(-50%); top: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1b1f2a; color: #fff; padding: 9px 18px; border-radius: 10px; font-size: 13px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.5); animation: tin .2s ease; }
.toast.err { background: #b42318; } .toast.ok { background: #067647; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px) } to { opacity: 1; transform: none } }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,18,24,.5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 480px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98) } to { opacity: 1; transform: none } }
.modal.wide { max-width: 640px; }
.modal-head { padding: 18px 20px 12px; display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: 0; background: #f3f4f8; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 16px; }
.modal-body { padding: 4px 20px 8px; overflow-y: auto; }
.modal-foot { padding: 12px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; }
.summary-box { background: #f7f7fc; border: 1px dashed #d9d6ff; border-radius: 11px; padding: 11px 14px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.summary-box b { font-size: 18px; color: var(--primary); }

/* 登录页 */
.login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(900px 600px at 15% 10%, rgba(109,94,252,.30), transparent 60%), radial-gradient(700px 500px at 90% 95%, rgba(46,144,250,.22), transparent 60%), #0e1118; }
.login-card { width: 100%; max-width: 380px; background: rgba(255,255,255,.97); border-radius: 20px; padding: 30px 26px 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-logo { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; background: linear-gradient(140deg, var(--primary), #b39cff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; box-shadow: 0 8px 20px -6px rgba(109,94,252,.7); }
.brand h1 { margin: 0; font-size: 18px; }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.login-error { color: var(--red); font-size: 12px; min-height: 18px; margin-bottom: 6px; }
.login-tip { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted); line-height: 1.9; }
.login-tip b { color: var(--text); }

/* ===== H5 外壳（陪玩端 / 老板端共用） ===== */
.h5-app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; padding-bottom: 76px; }
.h5-top { padding: 16px 18px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 20; background: rgba(244,245,248,.9); backdrop-filter: blur(8px); }
.h5-top h1 { margin: 0; font-size: 17px; letter-spacing: .3px; }
.h5-top .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.h5-page { padding: 0 14px 10px; }
.h5-tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
.h5-tabbar a { flex: 1; text-align: center; text-decoration: none; color: #98a1b3; font-size: 10.5px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; }
.h5-tabbar a .ico { font-size: 19px; line-height: 1; }
.h5-tabbar a.on { color: var(--primary); font-weight: 600; }
.h5-tabbar a { position: relative; }
.tab-dot {
  position: absolute; top: 1px; left: 50%; margin-left: 5px;
  width: 8px; height: 8px; border-radius: 50%; background: #f04438;
  border: 2px solid #fff; box-sizing: content-box;
}
.tab-dot[hidden] { display: none; }

/* 余额大卡 */
.balance-card { border-radius: 18px; padding: 20px; color: #fff; position: relative; overflow: hidden; background: linear-gradient(135deg, #6d5efc, #9b7bff 60%, #b39cff); box-shadow: 0 14px 30px -14px rgba(109,94,252,.9); margin-bottom: 14px; }
.balance-card::after { content: ''; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.13); right: -50px; top: -60px; }
.balance-card .lb { font-size: 12px; opacity: .85; }
.balance-card .big { font-size: 32px; font-weight: 700; letter-spacing: -1px; margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.balance-card .row { display: flex; gap: 18px; position: relative; z-index: 1; }
.balance-card .row div { flex: 1; }
.balance-card .row span { display: block; font-size: 11px; opacity: .8; }
.balance-card .row b { font-size: 15px; font-variant-numeric: tabular-nums; }

/* 统计小卡 */
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.mini-stats .ms { background: #fff; border-radius: 12px; padding: 11px 6px; text-align: center; box-shadow: var(--shadow); }
.mini-stats .ms .v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-stats .ms .k { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.quick { background: #fff; border-radius: 14px; padding: 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; cursor: pointer; border: 1px solid rgba(230,232,238,.6); }
.quick .qi { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 19px; background: #f3f2ff; }
.quick .qt { font-size: 13.5px; font-weight: 600; }
.quick .qd { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* 头像 / 键值行 / 工具栏 */
.avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: linear-gradient(135deg, #8b7bff, #2e90fa); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; letter-spacing: 0; }
.avatar-img { border-radius: 12px; object-fit: cover; background: #eef0f5; display: block; }

/* 照片墙 */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.photo-cell { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: #f2f3f8; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.photo-cell .del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(15,18,24,.6); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.photo-add { aspect-ratio: 1 / 1; border-radius: 10px; border: 1px dashed #c8cbd6; background: #fafbff; color: #98a1b3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; cursor: pointer; }
.photo-add b { font-size: 20px; font-weight: 400; line-height: 1; }
.photo-list { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; }
.photo-list img { width: 84px; height: 84px; flex: 0 0 84px; border-radius: 10px; object-fit: cover; cursor: pointer; background: #eef0f5; }
.photo-list.big img { width: 104px; height: 104px; flex-basis: 104px; }
.img-preview { position: fixed; inset: 0; background: rgba(10,12,18,.92); z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; cursor: zoom-out; }
.img-preview img { max-width: 100%; max-height: 82vh; border-radius: 12px; }
.img-preview .tip { color: rgba(255,255,255,.65); font-size: 12px; }

/* 价格表分类按钮 */
.price-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.price-cat { border: 1px solid rgba(230,232,238,.9); background: linear-gradient(135deg, #f8f7ff, #fff); border-radius: 14px; padding: 14px 12px; text-align: left; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: 3px; transition: .15s; }
.price-cat:active { transform: scale(.985); }
.price-cat .pc-name { font-size: 14px; font-weight: 600; color: var(--text); }
.price-cat .pc-sub { font-size: 11px; color: #98a1b3; }
.price-imgs { display: flex; flex-direction: column; gap: 10px; }
.price-imgs img { width: 100%; border-radius: 12px; display: block; cursor: zoom-in; background: #f3f4f8; }

.kv { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 分段 tab */
.seg { display: flex; gap: 4px; background: #eceef3; padding: 3px; border-radius: 11px; margin-bottom: 12px; overflow-x: auto; }
.seg button { position: relative; flex: 1; border: 0; background: transparent; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; color: var(--muted); cursor: pointer; font-family: inherit; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.cat-dot { position: absolute; top: 2px; right: 5px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: #f04438; color: #fff; font-size: 9px; line-height: 14px; font-style: normal; font-weight: 600; text-align: center; }

@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; }
  .modal { max-height: 92vh; }
}/* 老板端：大厅"看主页"、陪玩个人主页 */
.hall-more { flex: 0 0 auto; font-size: 12px; color: #98a1b3; white-space: nowrap; }
.profile-head { display: flex; gap: 14px; align-items: center; padding: 2px 0 12px; border-bottom: 1px solid var(--line); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: center; }
.stat-row b { display: block; font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 11px; color: #98a1b3; }
.profile-sec { padding: 12px 0 0; }
.profile-sec h4 { margin: 0 0 8px; font-size: 13px; color: var(--text); display: flex; align-items: baseline; gap: 8px; }
/* 个人主页照片墙：大图两列 */
.photo-list.photo-wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.photo-list.photo-wall img { width: 100%; height: auto; flex: none; border-radius: 12px; display: block; cursor: zoom-in; background: #f3f4f8; aspect-ratio: 3 / 4; object-fit: cover; }

/* 表单页顶部的下单规则提示 */
.order-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 9px 12px;
  background: #fff8e6;
  border: 1px solid #ffe0a3;
  border-radius: 10px;
  font-size: 12.5px;
  color: #a15c00;
  line-height: 1.5;
}
.order-tip strong { color: #d97400; }


/* 登录页「7 天内免登录」 */
.remember-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 12px;
  font-size: 12.5px;
  color: #5b6472;
  cursor: pointer;
  user-select: none;
}
.remember-row input { width: 15px; height: 15px; accent-color: #6d5efc; margin: 0; }

/* 报单：新客户自动建档 */
.new-boss-wrap { margin-bottom: 2px; }
.tag-warn { background: #fff3e0; color: #b25b00; border: 1px solid #ffd9a8; }

/* 报单：客户搜索建议 */
.boss-sug {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  background: #fff; border: 1px solid #e3e8f0; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20, 30, 60, .12); margin-top: 4px;
  max-height: 216px; overflow-y: auto; padding: 4px;
}
.boss-sug[hidden] { display: none; }
.bs-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: #1f2733;
}
.bs-item b { font-weight: 600; }
.bs-item em { font-style: normal; font-size: 11.5px; color: #8a93a5; background: #f2f5fa; border-radius: 6px; padding: 1px 6px; }
.bs-item:hover, .bs-item.on { background: #f3f6ff; }
.bs-item.bs-new { color: #b25b00; background: #fff8ef; font-weight: 600; }
.bs-item.bs-new:hover, .bs-item.bs-new.on { background: #ffefdc; }

/* ================= 聊天悬浮组件 ================= */
.chat-widget { position: fixed; right: 24px; bottom: 24px; z-index: 60; }
.chat-widget.chat-boss { right: 14px; bottom: 82px; }
.chat-fab {
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #6d5efc, #2e90fa); color: #fff; font-size: 22px;
  box-shadow: 0 10px 26px rgba(109, 94, 252, .42);
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: transform .15s;
}
.chat-fab:hover { transform: translateY(-1px); }
.chat-fab.on { transform: scale(.95); }
.chat-dot {
  position: absolute; top: 3px; right: 3px; width: 10px; height: 10px;
  border-radius: 50%; background: #f04438; border: 2px solid #fff; box-sizing: content-box;
}
.chat-panel {
  position: absolute; right: 0; bottom: 64px;
  width: 340px; height: 480px; max-width: calc(100vw - 28px); max-height: calc(100vh - 130px);
  background: #fff; border: 1px solid rgba(230, 232, 238, .9); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(20, 24, 36, .24);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 4px; padding: 12px 10px 10px 12px; border-bottom: 1px solid #e6e8ee; }
.chat-title { flex: 1; font-size: 14px; font-weight: 700; color: #1b1f2a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back, .chat-close { border: none; background: none; cursor: pointer; color: #7b8496; font-size: 21px; line-height: 1; padding: 0 6px; }
.chat-back:hover, .chat-close:hover { color: #1b1f2a; }
.chat-body { flex: 1; overflow-y: auto; background: #f7f8fb; padding: 10px 12px; }
.chat-search { padding-bottom: 8px; }
.chat-search input {
  width: 100%; box-sizing: border-box; border: 1px solid #e6e8ee; background: #fff;
  border-radius: 10px; padding: 8px 10px; font-size: 13px; outline: none;
}
.chat-search input:focus { border-color: #b9b2ff; }
.chat-list { display: flex; flex-direction: column; gap: 2px; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; cursor: pointer; }
.chat-item:hover { background: #eef0f6; }
.ci-main { flex: 1; min-width: 0; }
.ci-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ci-top b { font-size: 13.5px; color: #1b1f2a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-time { font-size: 10.5px; color: #9aa3b5; flex: 0 0 auto; }
.ci-sub { font-size: 12px; color: #8a93a6; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-tag {
  display: inline-block; font-size: 10px; color: #6d5efc; background: rgba(109, 94, 252, .1);
  border-radius: 6px; padding: 1px 5px; margin-right: 5px;
}
.ci-badge {
  flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  border-radius: 9px; background: #f04438; color: #fff; font-size: 10.5px; font-style: normal;
  display: flex; align-items: center; justify-content: center;
}
.chat-empty { text-align: center; color: #9aa3b5; font-size: 12.5px; padding: 36px 10px; }
.chat-msgs { display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-msg.other { align-self: flex-start; align-items: flex-start; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg .bubble {
  padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.other .bubble { background: #fff; color: #1b1f2a; border: 1px solid rgba(230, 232, 238, .9); border-bottom-left-radius: 5px; }
.chat-msg.mine .bubble { background: linear-gradient(135deg, #6d5efc, #8b7bff); color: #fff; border-bottom-right-radius: 5px; }
.chat-msg .meta { font-size: 10px; color: #a4acbc; margin-top: 3px; padding: 0 3px; }
.chat-sys { align-self: center; max-width: 90%; text-align: center; font-size: 11.5px; line-height: 1.6; color: #8a6d3b; background: #fdf6e7; border: 1px solid #f3e2bf; border-radius: 8px; padding: 6px 10px; }
.chat-foot { display: flex; align-items: flex-end; gap: 8px; padding: 9px 10px; border-top: 1px solid #e6e8ee; background: #fff; }
.chat-foot textarea {
  flex: 1; resize: none; border: 1px solid #e6e8ee; border-radius: 10px; padding: 8px 10px;
  font-size: 13.5px; line-height: 1.45; max-height: 80px; outline: none; font-family: inherit;
}
.chat-foot textarea:focus { border-color: #b9b2ff; }
.chat-send { border: none; background: #6d5efc; color: #fff; border-radius: 10px; padding: 9px 14px; font-size: 13px; cursor: pointer; }
.chat-send:hover { background: #5b4cf0; }
/* display:flex 会覆盖 hidden 属性，这里强制隐藏 */
.chat-panel[hidden], .chat-foot[hidden], .chat-widget[hidden] { display: none; }

/* 老板端「消息」页：聊天面板整页铺满，不再是悬浮窗 */
.h5-page.chat-page-host { padding: 0; }
.chat-widget.page-mode .chat-fab { display: none; }
/* 老板端聊天入口已固定在底部「消息」Tab，所有页面都不再显示悬浮气泡；管理端保持原样 */
.chat-widget.chat-boss .chat-fab { display: none; }
/* 打手端同样使用底部「消息」Tab，不显示悬浮气泡 */
.chat-widget.chat-player .chat-fab { display: none; }
.chat-panel.inline {
  position: static; right: auto; bottom: auto;
  width: 100%; height: calc(100vh - 132px - env(safe-area-inset-bottom));
  max-width: none; max-height: none;
  border: none; border-radius: 0; box-shadow: none;
}
.chat-panel.inline .chat-close { display: none; }

/* ========== 设置页 / 右上角设置按钮 ========== */
.icon-btn { width: 32px; height: 32px; padding: 0; font-size: 15px; line-height: 1; flex: 0 0 32px; text-decoration: none; }
.settings-page { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: 0 14px 30px; }
.settings-top {
  display: flex; align-items: center; gap: 10px; padding: 16px 2px 12px;
  position: sticky; top: 0; z-index: 20; background: var(--bg);
}
.settings-top h1 { flex: 1; margin: 0; text-align: center; font-size: 17px; }
.settings-top .btn { min-width: 58px; }
.settings-top-pad { width: 58px; flex: 0 0 58px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.settings-tip { font-size: 12px; color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--primary); margin: 4px 0 2px; }

/* 主题切换图标（跟随系统 / 浅色 / 深色） */
.theme-ico { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#theme-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }

/* ========== 深色模式 ========== */
html[data-theme="dark"] {
  --bg: #12141b;
  --card: #1b1f2a;
  --line: #2b3040;
  --text: #e8ebf2;
  --muted: #98a1b3;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
}
html[data-theme="dark"] .h5-top { background: rgba(18,20,27,.9); }
html[data-theme="dark"] .h5-tabbar { background: rgba(27,31,42,.96); }
html[data-theme="dark"] .item,
html[data-theme="dark"] .card,
html[data-theme="dark"] .quick,
html[data-theme="dark"] .mini-stats .ms { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] input[type=text],
html[data-theme="dark"] input[type=password],
html[data-theme="dark"] input[type=number],
html[data-theme="dark"] input[type=date],
html[data-theme="dark"] input[type=tel],
html[data-theme="dark"] input[type=datetime-local],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: #232735; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { background: #262b3a; }
html[data-theme="dark"] .btn-line { background: #232735; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .btn-line:hover { border-color: var(--primary); color: var(--primary); }
html[data-theme="dark"] .tag { background: #2a2f3f; color: #b9c1d1; }
html[data-theme="dark"] .tag.off { background: #2a2f3f; color: #98a1b3; }
html[data-theme="dark"] .seg { background: #232735; }
html[data-theme="dark"] .seg button.on { background: #2f3547; color: var(--text); }
html[data-theme="dark"] .modal { background: #1b1f2a; }
html[data-theme="dark"] .modal-close { background: #2a2f3f; }
html[data-theme="dark"] .summary-box { background: #232735; border-color: #3a3f52; }
html[data-theme="dark"] .order-tip { background: #2a2517; border-color: #4a3f22; color: #d8b878; }
html[data-theme="dark"] .boss-sug { background: #1b1f2a; border-color: var(--line); }
html[data-theme="dark"] .bs-item { color: var(--text); }
html[data-theme="dark"] .bs-item:hover,
html[data-theme="dark"] .bs-item.on { background: #262b3a; }
html[data-theme="dark"] .bs-item em { background: #2a2f3f; color: #98a1b3; }
html[data-theme="dark"] .bs-item.bs-new { background: #2a2517; color: #d8b878; }
html[data-theme="dark"] .photo-add { background: #232735; border-color: #3a3f52; }
html[data-theme="dark"] .price-cat { background: linear-gradient(135deg,#232735,#1b1f2a); border-color: var(--line); }
html[data-theme="dark"] .login-card { background: rgba(27,31,42,.98); }
html[data-theme="dark"] .login-card .brand p,
html[data-theme="dark"] .remember-row { color: var(--muted); }
html[data-theme="dark"] .chat-panel,
html[data-theme="dark"] .chat-foot { background: #1b1f2a; border-color: var(--line); }
html[data-theme="dark"] .chat-body { background: #171a22; }
html[data-theme="dark"] .chat-head { border-bottom-color: var(--line); }
html[data-theme="dark"] .chat-title,
html[data-theme="dark"] .ci-top b { color: var(--text); }
html[data-theme="dark"] .chat-search input { background: #232735; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .chat-item:hover { background: #262b3a; }
html[data-theme="dark"] .chat-msg.other .bubble { background: #262b3a; color: var(--text); border-color: var(--line); }
html[data-theme="dark"] .chat-sys { background: #2a2517; border-color: #4a3f22; color: #d8b878; }
html[data-theme="dark"] .chat-foot textarea { background: #232735; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] #q-new { background: linear-gradient(135deg,#252240,#1b1f2a) !important; border-color: #3a3550 !important; }
html[data-theme="dark"] #q-new .qi { background: #2f2a52 !important; }
html[data-theme="dark"] .card[style*="#fff6f5"] { background: #2a1d1f !important; }
html[data-theme="dark"] .card[style*="#fffcf5"] { background: #2a2517 !important; }
