/* 服务人员手机端 H5 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  background: #f4f6f9;
  color: #1a2332;
  font-size: 14px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }
input, textarea { font-family: inherit; font-size: 16px; }

#app { min-height: 100%; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }

/* 登录 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  background: linear-gradient(160deg, #0d6b4e 0%, #1a9b6c 45%, #f4f6f9 45%);
}
.login-brand { color: #fff; margin-bottom: 32px; }
.login-brand h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.login-brand p { font-size: 14px; opacity: 0.88; }
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 12px 40px rgba(13, 107, 78, 0.12);
}
.login-card h2 { font-size: 18px; margin-bottom: 20px; color: #0d6b4e; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: #8e96a3; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #eef1f6;
  border-radius: 10px;
  background: #f8f9fb;
}
.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(135deg, #0d6b4e, #1a9b6c);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(13, 107, 78, 0.25);
}
.btn-primary:disabled { opacity: 0.6; }
.login-tip { margin-top: 16px; font-size: 12px; color: #8e96a3; text-align: center; }

/* 顶栏 */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: linear-gradient(135deg, #0d6b4e, #1a9b6c);
  color: #fff;
}
.top-bar h1 { font-size: 17px; font-weight: 600; }
.top-back { font-size: 22px; padding: 4px 8px 4px 0; color: #fff; }

/* 内容区 */
.page-body { padding: 12px 16px 24px; }

/* 横幅 */
.banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0d6b4e, #1a9b6c);
  color: #fff;
}
.banner-title { font-size: 18px; font-weight: 700; }
.banner-desc { font-size: 12px; opacity: 0.85; margin-top: 4px; }
.banner-num { text-align: center; min-width: 56px; }
.banner-num strong { display: block; font-size: 28px; line-height: 1.1; }
.banner-num span { font-size: 11px; opacity: 0.8; }

.tip-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: #fff8e8;
  border: 1px solid #f5dfa8;
  color: #8a6d1d;
  font-size: 13px;
}
.tip-bar button {
  padding: 6px 12px;
  border-radius: 16px;
  background: #c9a962;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* Tabs */
.tabs {
  display: flex;
  padding: 4px;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #eef1f6;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  border-radius: 10px;
  font-size: 13px;
  color: #8e96a3;
}
.tab.active {
  background: linear-gradient(135deg, #0d6b4e, #1a9b6c);
  color: #fff;
  font-weight: 600;
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid #eef1f6;
  box-shadow: 0 4px 16px rgba(15, 40, 71, 0.04);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.card-title { font-size: 16px; font-weight: 700; }
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(13, 107, 78, 0.1);
  color: #0d6b4e;
  font-weight: 600;
}
.badge.gold { background: rgba(201, 169, 98, 0.15); color: #8a6d1d; }
.badge.orange { background: #fff3e0; color: #e65100; }
.meta { font-size: 13px; color: #5a6474; margin-top: 6px; }
.meta-row { display: flex; margin-top: 6px; font-size: 13px; color: #5a6474; }
.meta-label { width: 48px; color: #8e96a3; flex-shrink: 0; }
.price { color: #e85d4c; font-weight: 700; font-size: 16px; }
.card-actions {
  display: flex;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0f2f6;
}
.card-actions .btn-sm { flex: 1; margin: 0 4px; }
.card-actions .btn-sm:first-child { margin-left: 0; }
.card-actions .btn-sm:last-child { margin-right: 0; }

.btn-sm {
  padding: 10px 8px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}
.btn-outline { border: 1px solid #1b3a5c; color: #1b3a5c; background: #fff; }
.btn-accent { background: linear-gradient(135deg, #0d6b4e, #1a9b6c); color: #fff; }
.btn-gold { background: linear-gradient(135deg, #c9a962, #d4af37); color: #1b3a5c; font-weight: 600; }
.btn-sm.disabled { opacity: 0.45; pointer-events: none; }

.empty {
  text-align: center;
  padding: 48px 24px;
  color: #b0b8c4;
  font-size: 14px;
}
.empty-icon { display: block; font-size: 40px; margin-bottom: 12px; opacity: 0.5; }

/* 详情 */
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid #1a9b6c;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f6;
  font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: #8e96a3; flex-shrink: 0; margin-right: 12px; }
.phone-link { color: #1a9b6c; font-weight: 500; }
.nav-row { display: flex; margin-top: 12px; }
.nav-row .btn-sm { flex: 1; margin: 0 4px; }

.checkin-photo, .photo-thumb {
  width: 100%;
  border-radius: 10px;
  margin-top: 10px;
  background: #f0f2f6;
}
.checkin-photo { height: 180px; object-fit: cover; }

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  margin: 8px -4px 0;
}
.photo-item {
  position: relative;
  width: 33.33%;
  padding: 4px;
}
.photo-item img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.photo-del {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  text-align: center;
}
.photo-add {
  width: 33.33%;
  padding: 4px;
}
.photo-add-inner {
  height: 88px;
  border: 1px dashed #c8ebd9;
  border-radius: 8px;
  background: #f7fbf9;
  color: #0d6b4e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.photo-add-inner span { font-size: 11px; margin-top: 4px; }
.photo-head { display: flex; justify-content: space-between; font-size: 13px; margin-top: 12px; }
.photo-head strong { font-weight: 600; }

.log-input {
  width: 100%;
  min-height: 88px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #eef1f6;
  border-radius: 10px;
  background: #f8f9fb;
  resize: vertical;
}

.action-block { margin-top: 16px; }
.action-block .btn-primary { margin-top: 10px; }

/* 我的 */
.profile-head {
  display: flex;
  align-items: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, #0d6b4e, #1a9b6c);
  color: #fff;
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  margin-right: 14px;
}
.profile-name { font-size: 18px; font-weight: 700; }
.profile-sub { font-size: 12px; opacity: 0.85; margin-top: 4px; }
.online-tag {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: rgba(255,255,255,0.15);
}
.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  background: #52c41a;
}
.online-tag.offline .online-dot { background: #999; }

.stats {
  display: flex;
  background: #fff;
  margin: -20px 16px 12px;
  border-radius: 14px;
  padding: 16px 8px;
  box-shadow: 0 8px 24px rgba(13, 107, 78, 0.1);
  position: relative;
  z-index: 1;
}
.stat { flex: 1; text-align: center; border-right: 1px solid #eef1f6; }
.stat:last-child { border-right: none; }
.stat-num { display: block; font-size: 20px; font-weight: 700; color: #0d6b4e; }
.stat-num.gold { color: #c9a962; }
.stat-num.orange { color: #e85d4c; }
.stat-label { font-size: 11px; color: #8e96a3; margin-top: 4px; }

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.switch-row p { font-size: 12px; color: #8e96a3; margin-top: 4px; }
.switch {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: #dde3ea;
  position: relative;
  transition: background 0.2s;
}
.switch.on { background: #1a9b6c; }
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.switch.on::after { transform: translateX(20px); }

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f0f2f6;
  font-size: 14px;
}
.menu-item:last-child { border-bottom: none; }
.logout-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 20px 16px;
  padding: 14px;
  text-align: center;
  border-radius: 24px;
  border: 1px solid #ffccc7;
  color: #cf1322;
  background: #fff;
  font-size: 15px;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  background: rgba(255,255,255,0.98);
  border-top: 1px solid #eef1f6;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(15, 40, 71, 0.06);
}
.nav-item {
  flex: 1;
  text-align: center;
  padding: 8px 0 6px;
  color: #8e96a3;
  font-size: 11px;
}
.nav-item.active { color: #0d6b4e; font-weight: 600; }
.nav-icon { display: block; font-size: 20px; line-height: 1.2; margin-bottom: 2px; }
.nav-item { position: relative; }
.nav-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  margin-right: -28px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e85d4c;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}
.tab-unread-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 8px;
  background: #e85d4c;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}
.contact-card.unread { border: 1px solid rgba(232, 93, 76, 0.25); background: rgba(232, 93, 76, 0.04); }
.badge.unread { background: rgba(232, 93, 76, 0.15); color: #e85d4c; font-weight: 600; }
.msg-tabs { display: flex; padding: 4px; margin-bottom: 12px; gap: 4px; }
.msg-tab { flex: 1; text-align: center; padding: 10px 0; font-size: 14px; color: #8e96a3; border-radius: 8px; border: none; background: transparent; }
.msg-tab.active { background: rgba(13, 107, 78, 0.12); color: #0d6b4e; font-weight: 600; }
.contact-preview { font-size: 13px; color: #5a6474; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.msg-time { font-size: 12px; color: #8e96a3; }
.msg-row { margin-bottom: 12px; }
.msg-row.self { text-align: right; }
.msg-meta { font-size: 11px; color: #8e96a3; margin-bottom: 4px; }
.msg-bubble { display: inline-block; max-width: 85%; padding: 10px 12px; border-radius: 12px; background: #f0f2f6; text-align: left; word-break: break-word; }
.msg-row.self .msg-bubble { background: rgba(13, 107, 78, 0.12); color: #0d6b4e; }
.reply-bar { padding: 12px 0 24px; }
.reply-bar .log-input { min-height: 80px; margin-bottom: 12px; }
.phone-link { color: #1677ff; text-decoration: underline; }
.contact-detail-page .contact-chat { max-height: 50vh; overflow-y: auto; }

/* 签字弹层 */
.modal-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-panel {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  padding: 20px 16px 16px;
}
.modal-panel h3 { font-size: 17px; margin-bottom: 6px; }
.modal-panel p { font-size: 12px; color: #8e96a3; margin-bottom: 12px; }
.sign-canvas {
  width: 100%;
  height: 200px;
  border: 1px dashed #c8ebd9;
  border-radius: 10px;
  touch-action: none;
  background: #fff;
}
.sign-btns { display: flex; margin-top: 12px; }
.sign-btns button { flex: 1; margin: 0 4px; padding: 10px; border-radius: 20px; font-size: 14px; }
.btn-cancel { border: 1px solid #dde3ea; color: #5a6474; }
.btn-clear { border: 1px solid #dde3ea; color: #5a6474; }

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 300;
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  max-width: 80%;
  text-align: center;
}

.loading-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 250;
  background: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #0d6b4e;
}

.signature-preview {
  max-height: 120px;
  margin-top: 8px;
  border: 1px solid #eef1f6;
  border-radius: 8px;
  background: #f8f9fb;
}
