/* ===== 全局重置与基础 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #FF6B81;
  --primary-dark: #e8556b;
  --primary-light: #fff0f2;
  --secondary: #FFA502;
  --success: #2ed573;
  --danger: #ff4757;
  --info: #1e90ff;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #2f3542;
  --text-light: #64707d;
  --text-lighter: #94a0ac;
  --border: #e0e4e8;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --header-h: 60px;
  --tabbar-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; /* 禁止页面过度滚动触发刷新/后退 */
  overflow: hidden; /* 防止 body 滚动，所有滚动交给 #app 内部 */
}

body { overflow-x: hidden; }

input, button, textarea, select { font-family: inherit; font-size: inherit; }

/* 输入框允许正常选中文本，防止拖动选中时触发异常；提升为独立合成层避免 iOS 键盘弹出时重绘丢失内容 */
input, textarea {
  -webkit-user-select: text; user-select: text; touch-action: manipulation;
  transform: translateZ(0);
  will-change: transform;
}

a { text-decoration: none; color: inherit; }

ul { list-style: none; }

/* ===== APP 容器 ===== */
#app {
  max-width: 500px;
  margin: 0 auto;
  height: 100vh; /* 使用布局视口高度 */
  height: 100dvh; /* 动态视口高度，兼容 iOS Safari 键盘弹出 */
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== 登录页 ===== */
.login-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FF6B81 0%, #FF9F8A 50%, #FFA502 100%);
  padding: 40px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-logo {
  width: 88px; height: 88px;
  background: rgba(255,255,255,0.95);
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.login-title { color: #fff; font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.login-subtitle { color: rgba(255,255,255,0.85); font-size: 16px; margin-bottom: 36px; }

.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.login-hint {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.9;
}

.install-btn {
  margin-top: 16px;
  padding: 14px 20px;
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
}
.install-btn:active { background: var(--primary-light); }

.install-guide-btn {
  margin-top: 10px;
  padding: 12px 20px;
  background: transparent;
  color: var(--text-light);
  border: none;
  font-size: 15px;
  width: 100%;
  cursor: pointer;
  text-decoration: underline;
}

.install-steps { display: flex; flex-direction: column; gap: 14px; }
.install-step { display: flex; gap: 12px; align-items: flex-start; }
.install-step-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.install-step-text { font-size: 15px; line-height: 1.7; padding-top: 2px; }

/* ===== 顶部导航栏 ===== */
.app-header {
  height: var(--header-h);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: relative;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(255,107,129,0.3);
}

.app-header .header-title { font-size: 19px; font-weight: 600; }
.app-header .header-left, .app-header .header-right { width: 36px; display: flex; align-items: center; }
.app-header .header-right { justify-content: flex-end; }

.icon-btn {
  background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; padding: 4px 8px;
}

.ai-title-icon {
  width: 26px; height: 26px; border-radius: 50%; vertical-align: middle;
  margin-right: 6px; object-fit: cover;
}

/* ===== 底部 Tab 栏 ===== */
.tabbar {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 500px;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding-bottom: var(--safe-bottom);
}

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-lighter);
  cursor: pointer;
  transition: color 0.2s;
  gap: 3px;
}

.tabbar-item .tab-icon { font-size: 24px; line-height: 1; }
.tabbar-item .tab-icon img { width: 24px; height: 24px; object-fit: contain; border-radius: 6px; }
.tabbar-item.active .tab-icon img { box-shadow: 0 0 0 2px var(--primary-light); }
.tabbar-item.active { color: var(--primary); font-weight: 600; }

/* ===== 安装引导横幅（自签名证书时） ===== */
.install-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: linear-gradient(90deg, #FFF3CD, #FFE69C);
  color: #7a5b00; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.install-banner-inner { max-width: 720px; margin: 0 auto; padding: 10px 14px; position: relative; }
.install-banner-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.install-banner-text { font-size: 12.5px; line-height: 1.6; }
.install-banner-text b { color: #b35900; }
.install-banner-close {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.06); border: none; color: #7a5b00;
  border-radius: 14px; padding: 3px 12px; font-size: 12px; cursor: pointer;
}

/* ===== 页面内容区 ===== */
.page-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 16px;
  padding-bottom: calc(var(--tabbar-h) + 28px);
}

.page-content.no-tabbar { padding-bottom: 16px; }

/* 表单页面额外底部间距，避免保存按钮被遮挡 */
.page-content.form-page { padding-bottom: 24px; }

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
}

.card-body { padding: 16px; }

/* ===== 统计卡片 (首页) ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 14px; color: var(--text-light); margin-top: 2px; }

/* ===== 会员列表项 ===== */
.member-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
}

/* 公共池会员卡片：右上角倒计时徽标需要空间，认领按钮移到底部右侧 */
.pool-member .member-info { padding-right: 54px; padding-bottom: 34px; }
.pool-claim-btn { position: absolute; right: 14px; bottom: 12px; z-index: 3; }

.member-item:active { transform: scale(0.98); }

.member-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
}

.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.member-phone { font-size: 15px; color: var(--text-light); margin-top: 3px; }
.member-baby { font-size: 14px; color: var(--text-lighter); margin-top: 2px; }
.member-arrow { color: var(--text-lighter); font-size: 20px; }

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}
.tag-pink { background: var(--primary-light); color: var(--primary); }
.tag-blue { background: #e8f4fd; color: var(--info); }
.tag-green { background: #e6f9ee; color: var(--success); }
.tag-orange { background: #fff5e6; color: var(--secondary); }
.tag-gray { background: #f1f2f6; color: var(--text-light); }
.tag-purple { background: #f3f0ff; color: #a55eea; }

/* 快捷选项 */
.quick-chip {
  display: inline-block;
  padding: 7px 12px;
  font-size: 14px;
  background: #f0f5ff;
  color: var(--info);
  border: 1px solid #d0e0ff;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.quick-chip:active {
  background: var(--info);
  color: #fff;
}

/* ===== 会员标签选择器 ===== */
.tag-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-chip {
  display: inline-block;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.tag-chip:hover { border-color: var(--primary); color: var(--primary); }
.tag-chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ===== 段落标题 ===== */
.section-title {
  font-size: 17px;
  font-weight: 600;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title .more { font-size: 14px; color: var(--text-light); cursor: pointer; font-weight: 400; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; overflow-anchor: none; }
.form-label { font-size: 15px; color: var(--text-light); margin-bottom: 7px; display: block; }
.form-label .req { color: var(--danger); }
.form-input, .form-textarea, .form-select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 16px;
  line-height: 1.4;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,129,0.12);
}
.form-textarea { resize: vertical; min-height: 80px; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-outline { background: #fff; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-gray { background: #f1f2f6; color: var(--text-light); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 17px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }

/* ===== 提醒列表项 ===== */
.reminder-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--secondary);
}
.reminder-item.overdue { border-left-color: var(--danger); }
.reminder-item.done { border-left-color: var(--text-lighter); opacity: 0.6; }
.reminder-item.pending-soon { border-left-color: var(--secondary); }

.reminder-title { font-size: 16px; font-weight: 600; margin-bottom: 5px; }
.reminder-date { font-size: 14px; color: var(--text-light); }
.reminder-notes { font-size: 14px; color: var(--text-light); margin-top: 6px; line-height: 1.6; }
.reminder-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ===== 回访提醒倒计时徽章（醒目） ===== */
.reminder-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.reminder-countdown {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.reminder-countdown .cd-num { font-size: 26px; font-weight: 800; line-height: 1; }
.reminder-countdown .cd-label { font-size: 11px; margin-top: 3px; opacity: 0.95; }
.cd-normal { background: linear-gradient(135deg, #4facfe 0%, #1e90ff 100%); }
.cd-soon { background: linear-gradient(135deg, #ffb347 0%, #ffa502 100%); }
.cd-today { background: linear-gradient(135deg, #ff7eb3 0%, #ff6b81 100%); }
.cd-overdue {
  background: linear-gradient(135deg, #ff5f6d 0%, #ff2d4b 100%);
  animation: cdPulse 1.2s ease-in-out infinite;
}
.cd-done { background: linear-gradient(135deg, #43e97b 0%, #2ed573 100%); }
@keyframes cdPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(255,45,75,0.3); }
  50% { transform: scale(1.08); box-shadow: 0 6px 18px rgba(255,45,75,0.55); }
}
.purchase-list-modal { margin-top: 4px; }

/* ===== 购买记录项 ===== */
.purchase-item {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 14px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.purchase-top { display: flex; justify-content: space-between; align-items: flex-start; }
.purchase-name { font-size: 16px; font-weight: 600; flex: 1; }
.purchase-price { font-size: 16px; font-weight: 600; color: var(--primary); }
.purchase-meta { font-size: 14px; color: var(--text-light); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 8px; }
.purchase-time { font-size: 14px; color: var(--text-lighter); margin-top: 4px; }

/* ===== 浮动按钮 ===== */
.fab {
  position: fixed;
  bottom: calc(var(--tabbar-h) + 20px + var(--safe-bottom));
  right: 20px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,107,129,0.4);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab:active { transform: scale(0.92); }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  overscroll-behavior: contain;
}

.modal-overlay.show { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-title { font-size: 19px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-light); cursor: pointer; }

/* ===== 会员信息核对条（表单顶部） ===== */
.member-info-bar {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-left: 3px solid var(--primary);
}
.mib-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mib-row:last-child { margin-bottom: 0; }
.mib-label {
  font-size: 12px;
  color: var(--text-lighter);
  min-width: 36px;
  flex-shrink: 0;
}
.mib-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== 智能识别框 ===== */
.ai-recognize-box {
  background: linear-gradient(135deg, #fff0f3 0%, #fff5e6 100%);
  border: 1.5px solid var(--primary-light);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}
.ai-recognize-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}
.ai-recognize-header .ai-icon { font-size: 20px; }
.ai-recognize-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  background: #fff;
  outline: none;
  resize: none;
  min-height: 60px;
  font-family: inherit;
  line-height: 1.5;
}
.ai-recognize-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.ai-recognize-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.ai-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-btn-voice {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.ai-btn-voice.recording {
  background: #ff5252;
  color: #fff;
  border-color: #ff5252;
  animation: ai-pulse 1s ease-in-out infinite;
}
.ai-btn-camera {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.ai-btn-submit {
  flex: 1;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
}
.ai-btn-submit:active { transform: scale(0.97); }
.ai-btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@keyframes ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.ai-recognize-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  font-size: 14px;
  color: var(--text-light);
}
.ai-recognize-loading .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ai-spin 0.7s linear infinite;
}
@keyframes ai-spin {
  to { transform: rotate(360deg); }
}
.ai-recognize-result {
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 14px;
  border: 1px solid var(--border);
}
.ai-result-type {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.ai-result-type.member { background: #e8f4fd; color: var(--info); }
.ai-result-type.purchase { background: #e6f9ee; color: var(--success); }
.ai-result-type.order { background: #fff5e6; color: var(--secondary); }
.ai-result-type.reminder { background: #fef0f3; color: var(--primary); }
.ai-result-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.ai-result-field {
  font-size: 13px;
  color: var(--text-light);
}
.ai-result-field span {
  color: var(--text);
  font-weight: 500;
}
.ai-preview-img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 8px;
}
.ai-recognize-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fff0f3 0%, #fff5e6 100%);
  border: 1.5px solid var(--primary-light);
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

/* ===== 搜索栏 ===== */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.search-input {
  flex: 1;
  border: none;
  border-radius: 20px;
  padding: 12px 16px;
  font-size: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  outline: none;
}
.search-input:focus { box-shadow: 0 0 0 2px var(--primary); }

/* ===== 筛选条 ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-chip {
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 14px;
  background: #fff;
  color: var(--text-light);
  border: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 会员详情 ===== */
.detail-header {
  background: linear-gradient(135deg, var(--primary) 0%, #FF9F8A 100%);
  padding: 22px 16px;
  color: #fff;
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.detail-name { font-size: 22px; font-weight: 700; }
.detail-phone { font-size: 16px; opacity: 0.9; margin-top: 5px; }
.detail-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.info-row { display: flex; padding: 9px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-label { width: 88px; color: var(--text-light); font-size: 15px; flex-shrink: 0; }
.info-value { font-size: 15px; flex: 1; word-break: break-all; }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-lighter);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 16px; }

/* ===== 我的页面 ===== */
.profile-header {
  background: linear-gradient(135deg, var(--primary) 0%, #FF9F8A 100%);
  padding: 24px 20px;
  text-align: center;
  color: #fff;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.profile-avatar {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 10px;
}
.profile-name { font-size: 20px; font-weight: 600; }
.profile-role { font-size: 15px; opacity: 0.85; margin-top: 4px; }

.menu-item {
  background: #fff;
  display: flex;
  align-items: center;
  padding: 16px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 12px;
}
.menu-item:last-child { border-bottom: none; border-radius: var(--radius); }
.menu-item:active { background: #f8f9fa; }
.menu-icon { font-size: 22px; width: 30px; text-align: center; }
.menu-text { flex: 1; font-size: 16px; }
.menu-arrow { color: var(--text-lighter); font-size: 16px; }

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.toast.show { opacity: 1; }

/* ===== 工具类 ===== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-light { color: var(--text-light); }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.font-bold { font-weight: 600; }
.hidden { display: none !important; }

/* ===== 日期分组标题 ===== */
.date-group-title {
  font-size: 14px;
  color: var(--text-lighter);
  margin: 16px 0 8px;
  font-weight: 500;
}

/* ===== 员工管理列表 ===== */
.emp-item {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 16px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.emp-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #e8f4fd;
  color: var(--info);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600;
}
.emp-info { flex: 1; }
.emp-name { font-size: 16px; font-weight: 600; }
.emp-meta { font-size: 14px; color: var(--text-light); margin-top: 2px; }

/* 首页 - 员工会员数 */
.emp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 4px; border-bottom: 1px solid #f0f0f0; cursor: pointer;
}
.emp-row:last-child { border-bottom: none; }
.emp-row-name { font-size: 15px; font-weight: 600; }
.emp-row-stat { font-size: 13px; color: var(--text-light); }


/* ===== 查询结果汇总 ===== */
.query-summary {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--primary-dark);
  line-height: 1.8;
}

/* ===== 页面切换动画 ===== */
.page-enter { animation: fadeIn 0.2s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== 危险操作确认框 ===== */
.confirm-bar {
  background: #fff5f5;
  border: 1px solid #ffd5d5;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--danger);
  margin-bottom: 12px;
  line-height: 1.7;
}

/* ===== 图片上传区域 ===== */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 8px;
}
.image-upload-area:active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.image-upload-area .upload-icon { font-size: 28px; margin-bottom: 6px; }
.image-upload-area .upload-text { font-size: 15px; color: var(--text-light); }

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.image-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f1f2f6;
}
.image-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.image-thumb .remove-btn {
  position: absolute;
  top: 4px; right: 4px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* 图片预览大图弹窗 */
.image-preview-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.image-preview-overlay.show { display: flex; }
.image-preview-overlay img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}
.image-preview-overlay .close-btn {
  position: absolute;
  top: 16px; right: 16px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

/* 会员详情中的图片缩略图行 */
.purchase-images {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.purchase-images::-webkit-scrollbar { display: none; }
.purchase-images .img-mini {
  width: 64px; height: 64px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}
.purchase-images .img-mini img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ===== 订货记录样式 ===== */
.order-item {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 14px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--info);
}
.order-item.delivered { border-left-color: var(--success); opacity: 0.75; }
.order-item.cancelled { border-left-color: var(--text-lighter); opacity: 0.5; }

.order-top { display: flex; justify-content: space-between; align-items: flex-start; }
.order-name { font-size: 16px; font-weight: 600; flex: 1; }
.order-price { font-size: 16px; font-weight: 600; color: var(--primary); }
.order-meta {
  font-size: 14px; color: var(--text-light);
  margin-top: 5px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.order-time { font-size: 14px; color: var(--text-lighter); margin-top: 4px; }
.order-actions { display: flex; gap: 8px; margin-top: 10px; }

/* 付款状态标签 */
.tag-pay-full { background: #e6f9ee; color: var(--success); }
.tag-pay-deposit { background: #fff5e6; color: var(--secondary); }
.tag-pay-verbal { background: #f1f2f6; color: var(--text-light); }

/* 订单状态标签 */
.tag-order-pending { background: #e8f4fd; color: var(--info); }
.tag-order-delivered { background: #e6f9ee; color: var(--success); }
.tag-order-cancelled { background: #fff5f5; color: var(--danger); }

/* 回访结果展示 */
.reminder-result {
  margin-top: 6px;
  padding: 10px 12px;
  background: #f0fbf4;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  border-left: 3px solid var(--success);
}
.reminder-result-label {
  font-size: 13px;
  color: var(--success);
  font-weight: 600;
  margin-bottom: 3px;
}

/* 模态框内图片上传区在可滚动区域中 */
.modal .image-upload-area {
  padding: 16px;
}

/* ===== AI 助手对话界面 ===== */
.ai-chat-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f5f6fa;
}
.ai-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-chat-welcome {
  margin: 20px 8px;
  padding: 16px;
  background: #fff;
  border-radius: 14px;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.9;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.ai-msg { display: flex; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-assistant { justify-content: flex-start; }
.ai-msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}
.ai-msg-user .ai-msg-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg-assistant .ai-msg-bubble {
  background: #fff;
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.ai-typing { opacity: 0.6; }

.ai-action-card {
  align-self: flex-start;
  width: 88%;
  margin: 2px 0 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.ai-action-card.addPurchase { border-left-color: #ff9800; }
.ai-action-card.addOrder { border-left-color: #2196f3; }
.ai-action-card.addReminder { border-left-color: #e91e63; }
.ai-action-card.suggestFollowUp { border-left-color: #4caf50; }
.ai-action-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}
.ai-action-lines { font-size: 13.5px; color: var(--text); line-height: 1.7; }
.ai-action-foot { margin-top: 8px; display: flex; justify-content: flex-end; }

.ai-chat-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border-top: 1px solid var(--border);
  padding-bottom: calc(8px + var(--safe-bottom));
}
.ai-chat-icon-btn {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: #f0f1f5;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ai-chat-icon-btn.recording {
  background: var(--danger, #ff5252);
  color: #fff;
  animation: aiPulse 1s infinite;
}
@keyframes aiPulse { 0%,100%{ transform: scale(1);} 50%{ transform: scale(1.12);} }
.ai-msg-bubble { position: relative; }
.ai-msg-assistant .ai-msg-bubble { padding-right: 40px; }
.ai-speak-btn {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; padding: 0;
  border: none; border-radius: 50%;
  background: rgba(255,107,129,0.14); color: #FF6B81;
  font-size: 15px; line-height: 1; cursor: pointer;
}
.ai-speak-btn:active { background: rgba(255,107,129,0.3); }
.ai-chat-input-wrap { flex: 1; position: relative; }
.ai-chat-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
}
.ai-chat-input:focus { border-color: var(--primary); }
.ai-chat-img-preview {
  margin-top: 6px;
  position: relative;
  display: inline-block;
}
.ai-chat-img-preview img {
  max-width: 120px; max-height: 80px;
  border-radius: 8px; border: 1px solid var(--border);
}
.ai-chat-img-preview button {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #333; color: #fff; cursor: pointer; font-size: 12px;
}
.ai-chat-send {
  flex-shrink: 0;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  padding: 0 16px;
  height: 40px;
  font-size: 15px;
  cursor: pointer;
}
.ai-chat-send:disabled { opacity: 0.6; }

/* ===== 公共池倒计时 / 提示 ===== */
.pool-notice {
  background: #fff7e6;
  border: 1px solid #ffe0a3;
  color: #8a5a00;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.pool-notice b { color: #e8556b; }
.pool-countdown {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 40px;
  padding: 3px 2px;
  background: linear-gradient(135deg, #ffa94d, #ff7a00);
  color: #fff;
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(255, 122, 0, 0.4);
  line-height: 1.1;
  text-align: center;
}
.pool-countdown .cd-num { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.pool-countdown .cd-unit { font-size: 9px; font-weight: 600; margin-top: 1px; }
.pool-countdown.overdue {
  background: linear-gradient(135deg, #ff6b81, #e0202f);
  box-shadow: 0 3px 9px rgba(224, 32, 47, 0.4);
  animation: poolOverduePulse 1.4s ease-in-out infinite;
}
@keyframes poolOverduePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ===== 网站备案信息 footer ===== */
.site-footer {
  text-align: center;
  padding: 14px 16px 18px;
  font-size: 12px;
  color: var(--text-lighter, #888);
  background: var(--bg-color, #f7f8fa);
  line-height: 1.5;
}
.site-footer a {
  color: var(--text-lighter, #888);
  text-decoration: none;
}
.site-footer a:hover,
.site-footer a:active {
  color: var(--primary-color, #ff6b81);
  text-decoration: underline;
}
