:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --bg: #f4f5f7;
  --card: #fff;
  --text: #222;
  --muted: #999;
  --line: #eee;
  --red: #fa5151;
  --orange: #ff976a;
  --blue: #10aeff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #dfe0e2;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 15px;
}
.page {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 62px;
}
a { color: inherit; text-decoration: none; }

/* 顶部 */
.topbar {
  background: var(--green);
  color: #fff;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .back { color: #fff; font-size: 20px; line-height: 1; }
.searchbar {
  background: var(--green);
  padding: 0 12px 12px;
}
.searchbar form { display: flex; gap: 8px; }
.searchbar input {
  flex: 1;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}
.searchbar button {
  border: 0;
  border-radius: 8px;
  background: #059045;
  color: #fff;
  padding: 0 16px;
  font-size: 14px;
}

/* 分类 */
.cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
}
.cat {
  background: var(--card);
  border-radius: 10px;
  text-align: center;
  padding: 12px 4px;
  font-size: 13px;
  color: #333;
}
.cat.active { background: var(--green); color: #fff; }
.cat span { display: block; font-size: 22px; margin-bottom: 4px; }
/* 抢单大厅：横向滑动类别条 */
.cats-scroll {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 10px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cats-scroll::-webkit-scrollbar { display: none; }
.cats-scroll .cat {
  flex: none;
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 14px;
  white-space: nowrap;
  background: var(--card);
  border: 1px solid #eee;
}
.cats-scroll .cat span { display: inline; font-size: 14px; margin: 0 2px 0 0; }
.cats-scroll .cat.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* 服务卡片 */
.list { padding: 0 12px 12px; }
.card {
  background: var(--card);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
}
.thumb {
  width: 76px; height: 76px;
  border-radius: 8px;
  background: #e8f8ef;
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.card .info { flex: 1; min-width: 0; }
.card h3 { font-size: 15px; margin-bottom: 4px; }
.card .desc {
  color: var(--muted); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 6px;
}
.card .meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.card .bottom { display: flex; align-items: baseline; gap: 6px; }
.price { color: var(--red); font-weight: 700; font-size: 17px; }
.price small { font-size: 12px; }
.unit { color: var(--muted); font-size: 12px; }
.sales { color: var(--muted); font-size: 12px; margin-left: auto; }
.shop { color: var(--blue); font-size: 12px; }

/* 按钮 */
.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
}
.btn.small { display: inline-block; width: auto; padding: 6px 14px; font-size: 13px; border-radius: 6px; }
.fav-btn { background: #fff8e1; color: #b8860b; border: 1px solid #ffd54f; }
.fav-btn.faved { background: #ffe082; color: #7a5c00; border-color: #ffca28; font-weight: 600; }
.btn.gray { background: #e5e5e5; color: #555; }
.btn.red { background: var(--red); }
.btn.blue { background: var(--blue); }
.btn:active { opacity: .85; }

/* 表单 */
.panel { background: var(--card); border-radius: 10px; margin: 12px; padding: 14px; }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.fitem { display: flex; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.fitem:last-child { border-bottom: 0; }
.fitem label { width: 76px; color: #666; font-size: 14px; flex-shrink: 0; }
.fitem input, .fitem select, .fitem textarea {
  flex: 1; border: 0; outline: none; font-size: 15px;
  font-family: inherit; background: transparent;
}
.fitem textarea { min-height: 60px; resize: vertical; }
/* 定位按钮、地图确认卡片独占整行 */
.fitem .loc-btn, .fitem .loc-preview { flex: 1 1 100%; }

/* 详情页 */
.hero { background: var(--card); padding: 16px 14px; margin-bottom: 10px; }
.hero h1 { font-size: 18px; margin-bottom: 8px; }
.hero .big { font-size: 24px; }
.sec {
  background: var(--card); border-radius: 10px;
  margin: 0 12px 10px; padding: 14px;
}
.sec h3 { font-size: 15px; margin-bottom: 10px; }
.sec p { font-size: 14px; color: #444; line-height: 1.7; }
.footbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 520px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 10px 12px; gap: 8px; z-index: 9;
}
.footbar .fprice { font-size: 18px; flex: none; }
.footbar .tag { flex: none; white-space: nowrap; font-size: 11px; }
/* 底栏按钮收窄字号/内边距，保证 375px 窄屏多按钮仍能一行横排不竖排 */
.footbar .btn { flex: 1; width: auto; white-space: nowrap; font-size: 14px; padding: 10px; }
/* form 包裹的底栏按钮：form 作为 flex 项参与平分，按钮绝不竖排 */
.footbar form { flex: 1; min-width: 0; display: flex; }
.footbar form .btn { width: 100%; }
/* 工人端"我的单"底栏多按钮包裹层 */
.footbar .foot-actions { flex: 1; min-width: 0; }
/* 详情页同时存在底部标签栏时，操作栏上抬避免遮挡 */
.footbar.raised {
  bottom: calc(57px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
  z-index: 10;
}
/* 锚点跳转时避开固定底栏 */
#quoteSec { scroll-margin-bottom: 140px; }
.footbar a.btn { text-align:center; text-decoration:none; display:flex; align-items:center; justify-content:center; }
/* 报价协商提示徽标（列表卡片上） */
.quote-pill {
  display:inline-block; margin-top:6px;
  background:linear-gradient(90deg,#ff9800,#ff6d00);
  color:#fff; font-size:12px; font-weight:600;
  padding:4px 12px; border-radius:20px;
  animation: quotePulse 1.6s ease-in-out infinite;
}
.quote-pill::after { content:" ›"; font-weight:700; }
.quote-pill.mine { background:linear-gradient(90deg,#2196f3,#1976d2); animation:none; }
.quote-pill.gray { background:#eef1f5; color:#888; animation:none; }
.quote-pill.gray::after { content:""; }
@keyframes quotePulse {
  0%,100% { box-shadow:0 0 0 0 rgba(255,109,0,.45); }
  50% { box-shadow:0 0 0 7px rgba(255,109,0,0); }
}
@keyframes bbgPulse {
  0% { transform:scale(0.85); opacity:0.5; }
  60% { transform:scale(1.05); opacity:1; }
  100% { transform:scale(1); opacity:1; }
}

/* 订单 */
.ostatus { font-weight: 600; }
.st-unpaid { color: var(--orange); }
.st-paid { color: var(--blue); }
.st-accepted { color: var(--green); }
.st-done { color: #666; }
.st-reviewed { color: var(--green-dark); }
.st-canceled, .st-refunded { color: var(--muted); }
.st-refund_req { color: var(--red); }
/* 工单未读消息红点 */
.unread-dot {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff;
  font-size: 11px; font-weight: bold; text-align: center;
  box-shadow: 0 0 0 2px #fff; vertical-align: middle; margin-left: 4px;
  animation: bbgPulse 1.2s infinite;
}
.dl { font-size: 14px; line-height: 2; }
.dl b { color: #888; font-weight: 400; display: inline-block; width: 78px; }
.tag {
  display: inline-block; font-size: 12px; padding: 2px 8px;
  border-radius: 4px; background: #f0f1f2; color: #666;
}

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 520px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; z-index: 9;
}
.tabbar a {
  flex: 1; text-align: center; padding: 8px 0 9px;
  font-size: 12px; color: #888;
}
.tabbar a span { display: block; font-size: 20px; }
.tabbar a.active { color: var(--green); }

/* 消息 */
.msg { margin: 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.msg.ok { background: #e8f8ef; color: var(--green-dark); }
.msg.err { background: #fdecec; color: var(--red); }

/* 统计格 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; }
.stat { background: var(--card); border-radius: 10px; padding: 12px 8px; text-align: center; }
.stat b { font-size: 19px; display: block; margin-bottom: 2px; }
.stat span { font-size: 12px; color: var(--muted); }

/* 星级 */
.stars { font-size: 22px; color: #ddd; cursor: pointer; }
.stars .on { color: #ffb800; }

h4.sechead { margin: 4px 16px 8px; font-size: 13px; color: var(--muted); }
.chiprow { display: flex; gap: 8px; padding: 0 12px 12px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px; border-radius: 15px; background: var(--card);
  font-size: 13px; color: #555;
}
.chip.active { background: var(--green); color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 50px 0; font-size: 14px; }
.empty span { display: block; font-size: 40px; margin-bottom: 8px; }

/* 新手指南 FAQ 折叠条目 */
.faq { border-bottom: 1px solid #f0f0f0; }
.faq:last-child { border-bottom: none; }
.faq summary {
  padding: 12px 2px; font-size: 14px; font-weight: 600; color: #333;
  cursor: pointer; list-style: none; position: relative; padding-right: 24px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: #999; font-weight: 400;
}
.faq[open] summary::after { content: '−'; }
.faq[open] summary { color: var(--green); }
.faq p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.8; color: #555; }

/* === 帮帮工新增样式 === */

/* 首页 hero banner */
.hero-banner {
  background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
  color: #fff;
  padding: 30px 16px 24px;
  text-align: center;
}
.hero-banner h2 { font-size: 22px; line-height: 1.4; margin-bottom: 6px; }
.hero-banner p { font-size: 13px; opacity: 0.92; margin-bottom: 18px; }
.hero-banner .btn.big {
  display: inline-block;
  width: auto;
  padding: 12px 32px;
  font-size: 17px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 大号按钮 */
.btn.big { display: block; width: auto; padding: 14px; font-size: 17px; font-weight: 600; }

/* 橙色按钮（抢单用） */
.btn.orange { background: var(--orange); color: #fff; }
.btn.orange:active { opacity: .85; }

/* 彩色 tag */
.tag.orange { background: #fff3ea; color: var(--orange); }
.tag.green { background: #e8f8ef; color: var(--green-dark); }
button.tag { border: 0; font-family: inherit; cursor: pointer; }

/* 抢单卡片高亮 */
.grab-card {
  border-left: 3px solid var(--orange);
  position: relative;
}
.grab-card .price.big { font-size: 22px; }

/* 大号价格 */
.price.big { font-size: 22px; }

/* 居中卡片链接 */
.card.center {
  justify-content: center;
  color: var(--green);
  font-size: 14px;
  padding: 14px;
}

/* 顶部加搜索栏时统一颜色 */
.topbar + .searchbar { background: var(--green); }

/* iOS standalone 模式安全距离 */
@supports (padding: env(safe-area-inset-bottom)) {
  .tabbar, .footbar { padding-bottom: env(safe-area-inset-bottom); }
  .page { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
}

/* ================= 图片上传与展示 ================= */
/* 上传按钮 */
.uploader { width: 100%; }
.upload-btn {
  display: inline-block; padding: 10px 16px;
  background: #f0faf4; color: var(--green);
  border: 1px dashed var(--green); border-radius: 8px;
  font-size: 14px; cursor: pointer;
}
.upload-btn:active { background: #e0f5e9; }
.img-preview {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.img-preview img {
  width: 76px; height: 76px; object-fit: cover;
  border-radius: 8px; cursor: zoom-in;
  display: block;
}
.img-thumb-wrap { position: relative; width: 76px; height: 76px; }
.img-del {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #ee0a24; color: #fff; border: 2px solid #fff;
  font-size: 15px; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.img-count { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* 地图选择面板（底部弹出） */
.nav-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 998;
  align-items: flex-end;
  justify-content: center;
}
.nav-sheet {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 14px 16px 20px;
}
.nav-title {
  text-align: center; font-size: 16px; font-weight: 600;
  padding: 6px 0 12px;
}
.nav-sub {
  display: block; font-size: 12px; font-weight: normal;
  color: var(--muted); margin-top: 4px;
}
.nav-opt {
  display: block;
  padding: 14px;
  text-align: center;
  font-size: 16px;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.nav-opt:active { background: #f5f5f5; }
.nav-cancel {
  display: block; width: 100%;
  margin-top: 10px;
  padding: 13px;
  background: #f7f8fa;
  border: 0; border-radius: 10px;
  font-size: 16px; color: #666;
}
.avatar-preview-img {
  width: 76px !important; height: 76px !important;
  border-radius: 50% !important; object-fit: cover;
}

/* 工单详情图片网格 */
.img-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 10px;
}
.img-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 8px; cursor: zoom-in; background: #f5f5f5;
}

/* 卡片内缩略图行（工人端我的单） */
.card-thumbs {
  display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap;
}
.card-thumbs img {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: 6px; cursor: zoom-in; background: #f5f5f5;
}

/* 抢单大厅卡片：左图右文 */
.grab-card { display: flex; gap: 12px; align-items: flex-start; }
.grab-thumb {
  width: 88px; height: 88px; object-fit: cover;
  border-radius: 8px; flex: none; cursor: zoom-in; background: #f5f5f5;
}
.grab-card .info { flex: 1; min-width: 0; }

/* 头像 */
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  object-fit: cover; background: #eee; flex: none;
}
.avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; background: #eee;
}
.avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; background: #f0faf4;
}

/* 工人中心资料卡 */
.worker-card {
  display: flex; gap: 14px; align-items: center; margin: 12px;
}
.worker-meta { flex: 1; min-width: 0; }

/* 全屏图片查看器 */
#imgViewer {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.92); z-index: 999;
  align-items: center; justify-content: center;
}
#imgViewer img {
  max-width: 100%; max-height: 100%; object-fit: contain;
}


/* ============================================================
   平台留言（聊天）
   ============================================================ */
.chat-sec { padding-bottom: 12px; }
.chat-box {
  background: #f2f6f3;
  border-radius: 10px;
  padding: 12px 10px;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-box .bubble {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
}
.chat-me { display: flex; align-self: flex-end; max-width: 85%; }
.chat-me .bubble {
  background: var(--green);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-me .chat-time { color: rgba(255,255,255,.75); text-align: right; }
.chat-them { display: flex; align-self: flex-start; max-width: 85%; }
.chat-them .bubble {
  background: #fff;
  color: #333;
  border: 1px solid #eee;
  border-bottom-left-radius: 4px;
}
.chat-them .chat-time { text-align: left; }
.chat-admin { display: flex; align-self: flex-start; max-width: 85%; }
.chat-admin .bubble {
  background: #f3e5f5;
  color: #4a148c;
  border: 1px solid #ce93d8;
  border-bottom-left-radius: 4px;
}
.chat-admin .chat-time { text-align: left; }
.admin-tag {
  display: inline-block;
  background: #7b1fa2;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 4px;
  font-weight: bold;
}
/* 三方留言：气泡顶部发送者姓名标签（客户蓝 / 师傅橙） */
.bubble-name { font-size: 11px; font-weight: 600; margin-bottom: 3px; line-height: 1.3; }
.tag-cust { color: #1565c0; }
.tag-worker { color: #e65100; }
/* 客服自己绿色气泡内的可见范围标注（仅平台端自己看到） */
.bubble-tg {
  font-size: 10px; line-height: 1.3; opacity: .92;
  padding-bottom: 3px; margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,.3);
}
/* 平台端输入框上方的定向提示条 */
.target-hint {
  font-size: 12px; font-weight: 600; margin: 8px 2px 0;
  padding: 5px 10px; border-radius: 6px; background: #f5f5f5;
}
.target-hint.tg-all { color: #666; background: #f5f5f5; }
.target-hint.tg-customer { color: #1565c0; background: #e3f2fd; }
.target-hint.tg-worker { color: #e65100; background: #fff3e0; }
.chat-time { font-size: 10px; margin-top: 4px; opacity: .7; white-space: nowrap; text-align: right; }
.chat-sys {
  align-self: center;
  text-align: center;
  font-size: 12px;
  color: #888;
  background: rgba(0,0,0,.05);
  border-radius: 10px;
  padding: 6px 12px;
  max-width: 88%;
  white-space: pre-wrap;
}
.chat-sys .chat-time { color: #aaa; }
.chat-empty { text-align: center; color: #aaa; font-size: 13px; padding: 18px 0; }
.chat-form {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  align-items: flex-end;   /* 多行输入时，麦克风/发送按钮贴底对齐 */
}
.chat-form input,
.chat-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}
/* 留言输入框：随内容 1~4 行自动增高，长文本发送前可完整核对，超出后框内滚动 */
.chat-form textarea {
  font-family: inherit;
  line-height: 1.45;
  height: 40px;
  max-height: 96px;
  padding-top: 9px;
  padding-bottom: 9px;
  resize: none;
  overflow-y: auto;
  display: block;
}
.chat-form .mic-btn,
.chat-form select { align-self: flex-end; }
.chat-form input:focus { border-color: var(--green); outline: none; }
.chat-form .btn {
  flex: 0 0 auto; border-radius: 20px; height: 40px;
  padding: 0 16px; font-size: 14px; white-space: nowrap;
}
/* 联系客服小按钮：压缩左右内边距，尽量把宽度让给输入框 */
.chat-form .btn.cs-btn { padding: 0 6px; font-size: 12px; }
.chat-form select { flex: 0 0 auto; }
/* 悬浮通知铃铛（fixed 右下角）存在时，留言栏右侧让出空间，
   避免"发送"按钮被铃铛遮挡（客户/工人工单详情的沟通区）。
   铃铛垂直位置低于留言行，48px 留白带即可，把宽度让给输入框 */
.has-bell-fab .chat-form { padding-right: 48px; }

/* 呼叫按钮（绿色实底，与默认 btn 一致，显式声明防止覆盖） */
.btn.green { background: var(--green); color: #fff; }

/* ============================================================
   发单页 - 发送位置按钮
   ============================================================ */
.loc-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--green);
  background: #f0fbf5;
  color: var(--green-dark);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.loc-btn:active { opacity: .8; }
.loc-btn.loc-ok {
  border-style: solid;
  background: var(--green);
  color: #fff;
}

/* 定位确认卡片（百度地图内嵌） */
.loc-preview {
  margin-top: 10px;
  border: 1px solid #bfe6d0;
  border-radius: 10px;
  overflow: hidden;
  background: #f0fbf5;
}
/* 内嵌瓦片地图（免密钥道路图，点击跳百度） */
.tile-map {
  position: relative;
  display: block;
  width: 100%;
  height: 220px;
  background: #e8eaed;
  overflow: hidden;
  border-bottom: 1px solid #bfe6d0;
}
.tile-inner { position: absolute; }
.tile-inner img {
  position: absolute;
  width: 256px;
  height: 256px;
}
.tile-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -92%);
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.4));
  pointer-events: none;
}
.tile-map:active .tile-pin { transform: translate(-50%, -92%) scale(.92); }
.loc-info { padding: 10px 12px; }
.loc-info .acc {
  color: #06a050;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.loc-info .loc-tip {
  color: #666;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 10px;
}
.loc-retry {
  background: #fff;
  border: 1px solid var(--green);
  color: var(--green);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  margin-right: 10px;
}
.loc-retry:active { opacity: .7; }
.loc-open {
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
}


/* ===== 语音留言（微信式） ===== */
.mic-btn{
  flex:0 0 auto;width:38px;height:38px;border-radius:50%;border:1px solid #ddd;
  background:#f5f6f8;font-size:17px;line-height:1;cursor:pointer;padding:0;
  -webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;
  touch-action:none;display:flex;align-items:center;justify-content:center;
}
.mic-btn:active{background:#e3e6ea;transform:scale(0.94);}
.mic-btn:disabled{opacity:.5;}
.chat-form{display:flex;gap:8px;align-items:flex-end;min-width:0;}
.chat-form input{flex:1;min-width:0;}

/* 语音气泡 */
.voice-msg{
  display:inline-flex;align-items:center;gap:8px;cursor:pointer;
  padding:8px 12px;border-radius:14px;user-select:none;
  background:rgba(255,255,255,.25);
}
.chat-them .voice-msg,.chat-admin .voice-msg{background:#f0f2f5;}
.voice-msg .voice-ico{font-size:18px;line-height:1;}
.voice-msg .voice-sec{font-size:13px;opacity:.85;min-width:32px;text-align:right;}
.voice-msg.playing .voice-ico{animation:voicePulse 0.9s ease-in-out infinite;}
@keyframes voicePulse{0%,100%{transform:scale(1);}50%{transform:scale(1.25);}}

/* 录音遮罩 */
.rec-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:99999;
  display:flex;align-items:center;justify-content:center;
}
.rec-card{
  background:rgba(30,30,30,.92);color:#fff;border-radius:18px;padding:28px 36px;
  text-align:center;min-width:180px;
}
.rec-card.cancel{background:rgba(200,40,40,.92);}
.rec-mic{font-size:46px;line-height:1;margin-bottom:10px;animation:voicePulse 1s infinite;}
.rec-card.cancel .rec-mic{animation:none;}
.rec-time{font-size:30px;font-weight:700;margin-bottom:8px;font-variant-numeric:tabular-nums;}
.rec-tip{font-size:13px;opacity:.85;}

/* ===== 管理端表格/搜索/分页 ===== */
.searchbar{padding:12px;}
.searchbar form{display:flex;gap:8px;}
.searchbar input[type=text]{flex:1;border:1px solid #ddd;border-radius:8px;padding:8px 10px;font-size:14px;}
.searchbar input[type=date]{border:1px solid #ddd;border-radius:8px;padding:7px 8px;font-size:14px;}
.tbl-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;padding:0 12px 12px;}
.tbl{width:100%;min-width:560px;border-collapse:collapse;background:var(--card);border-radius:10px;overflow:hidden;font-size:13px;}
.tbl th,.tbl td{padding:8px 10px;text-align:left;border-bottom:1px solid #f0f0f0;white-space:nowrap;}
.tbl th{background:#fafafa;color:var(--muted);font-weight:600;position:sticky;top:0;z-index:1;}
.tbl td.actions{display:flex;gap:6px;align-items:center;}
.tbl tr:last-child td{border-bottom:0;}
.pager{display:flex;gap:10px;align-items:center;justify-content:center;padding:8px 12px 24px;}
.pager .meta{color:var(--muted);font-size:13px;}
.panel canvas{max-width:100%;}
.stat-range{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:0 12px 8px;}
.stat-range input[type=date]{border:1px solid #ddd;border-radius:8px;padding:6px 8px;font-size:13px;}

/* ===== 桌面端管理页加宽 ===== */
@media (min-width: 768px){
  .page.page-admin{max-width:1200px;}
  .page.page-admin .tbl-wrap{padding:0 12px 12px;}
  .page.page-admin .tbl{min-width:720px;}
}

/* ===== 管理首页紧凑布局 ===== */
.ad-stats{padding:10px 10px 6px;gap:6px;}
.ad-stats .stat{padding:8px 4px;border-radius:8px;}
.ad-stats .stat b{font-size:16px;}
.ad-stats .stat span{font-size:11px;}
/* 功能入口：带色长方形，一行按顺序排开（窄屏自动换行） */
.ad-menu{display:flex;flex-wrap:wrap;gap:8px;padding:6px 10px 10px;}
.ad-item{
  display:inline-flex;align-items:center;gap:5px;
  padding:9px 14px;border-radius:8px;
  font-size:13.5px;color:#fff;text-decoration:none;font-weight:500;
  white-space:nowrap;
}
.ad-item:active{opacity:.85;}
.ad-alert{
  display:flex;align-items:center;gap:6px;
  margin:0 10px 6px;padding:8px 12px;
  background:#fff3cd;color:#b8860b;border:1px solid #ffe2a8;border-radius:8px;
  font-size:13px;text-decoration:none;font-weight:500;
}
.ad-alert.red{background:#fdecea;color:#c0392b;border-color:#f5c6cb;}
.ad-alert.orange{background:#fff1e6;color:#d35400;border-color:#ffd9b8;}
.ad-alert.yellow{background:#fff3cd;color:#b8860b;border-color:#ffe2a8;}
@media (min-width: 768px){
  .ad-menu{gap:10px;padding:8px 12px 12px;}
  .ad-item{padding:10px 18px;font-size:14px;}
  .ad-alert{margin:0 12px 6px;}
}

/* touch */

/* ===== 操作提示（flash 消息） ===== */
.flashes{padding:10px 12px 0;}
.flash{
  padding:9px 12px;border-radius:8px;font-size:13.5px;margin-bottom:8px;
  background:#e7f8ee;color:#067a3e;border:1px solid #bfe9d1;
}
.flash.warn{background:#fff3cd;color:#b8860b;border-color:#ffe2a8;}
