/**
 * ============================================
 * 公共样式表 - common.css
 * 包含全局变量、基础样式、通用组件
 * ============================================
 */

/* ===== 设计系统变量 ===== */
:root {
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  --bg: #f8f9fc;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --border: #e8eaf0;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-dark: #1d4ed8;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; height: 100%; overflow-y: auto; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  overflow-y: visible;
}

/* ===== 页面容器 ===== */
.page {
  display: none;
  min-height: 100dvh;
  height: auto;
  flex-direction: column;
  flex: 1;
  padding-top: 56px;
}
.page.active { display: flex; }

/* SPA 内部 tab 切换时触发动画（用 class 方式，不用直接写在 .page 上避免首次加载闪） */
.page.tab-enter {
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== 顶部导航栏 ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  flex-shrink: 0;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
}
.topbar-brand svg { color: var(--accent); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.topbar-avatar:hover { border-color: var(--accent-dark); }
.topbar-avatar.activated {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
}
.topbar-avatar.unlogin {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}
.topbar-avatar {
  margin-right: 8px;
}

/* ===== 顶部城市筛选按钮 ===== */
.topbar-city-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  margin-left: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.topbar-city-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.topbar-city-btn svg {
  color: var(--accent);
}

/* ===== 搜索按钮（顶部导航栏右侧） ===== */
.topbar-search-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent);
  transition: var(--transition);
  flex-shrink: 0;
}
.topbar-search-btn:hover { background: var(--accent); color: #fff; }

/* ===== 顶部搜索框（首页专用） ===== */
.topbar-search-input {
  flex: 1;
  margin: 0 12px;
  height: 38px;
  padding: 0 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  min-width: 0;
}
.topbar-search-input:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.topbar-search-input svg { color: var(--text-tertiary); margin-right: 8px; }
.topbar-search-input span { color: var(--text-tertiary); }

/* ===== 返回按钮 ===== */
.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition);
  flex-shrink: 0;
}
.back-btn:hover { background: var(--border); }

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 14px;
  background: var(--surface);
  scrollbar-width: none;
  flex-shrink: 0;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}
.filter-chip svg { width: 14px; height: 14px; }
.filter-chip .badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 600;
}

/* ===== 结果列表区域 ===== */
.results-section {
  flex: 1;
  padding: 0 20px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
}
.results-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}
.results-count span { color: var(--accent); }
.results-count .tag-activated {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success-light);
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ===== 岗位卡片 ===== */
.job-list { display: flex; flex-direction: column; gap: 12px; }
.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.job-card:hover {
  border-color: rgba(37,99,235,0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.job-card:active { transform: scale(0.99); }
.job-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.job-company-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-light) 0%, #dbeafe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid rgba(37,99,235,0.12);
}
.job-info { flex: 1; min-width: 0; }
.job-company {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.job-company-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.job-update-date {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.job-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}
.tag-type {
  font-size: 11px;
  font-weight: 600;
  color: #7c3aed;
  background: #f5f3ff;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-type.type-央企 { color: #dc2626; background: #fef2f2; }
.tag-type.type-国企 { color: #2563eb; background: #eff6ff; }
/* H5首页央国企标签改为橙色 */
#page-home .tag-type.type-央国企 { color: #f97316; background: #fff7ed; }
.tag-type.type-民企 { color: #7c3aed; background: #f5f3ff; }
.tag-type.type-外企 { color: #0d9488; background: #f0fdfa; }
.tag-type.type-合资 { color: #d97706; background: #fffbeb; }
.tag-type.type-银行 { color: #4f46e5; background: #eef2ff; }
.tag-type.type-事业单位 { color: #059669; background: #ecfdf5; }
.tag-type.type-科技互联网 { color: #0891b2; background: #ecfeff; }
.tag-type.type-制造业 { color: #6b7280; background: #f3f4f6; }
.tag-type.type-金融 { color: #9333ea; background: #faf5ff; }
.tag-type.type-其他 { color: #6b7280; background: #f3f4f6; }
.edu-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.edu-tag.edu-博士 { color: #b91c1c; background: #fef2f2; }
.edu-tag.edu-硕士 { color: #ea580c; background: #fff7ed; }
.edu-tag.edu-本科 { color: #2563eb; background: #eff6ff; }
.edu-tag.edu-大专 { color: #6b7280; background: #f3f4f6; }
.edu-tag.edu-高中 { color: #78716c; background: #f5f5f4; }
.edu-tag.edu-其他 { color: #6b7280; background: #f3f4f6; }
.tag-industry {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  max-width: 200px;
}
.tag-urgent {
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-light);
  padding: 2px 7px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.tag-major-match {
  font-size: 11px;
  font-weight: 600;
  color: #16a34a;
  background: #f0fdf4;
  padding: 2px 7px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.job-positions {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.job-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.job-meta-item svg { width: 13px; height: 13px; flex-shrink: 0; }

/* 城市位置信息 - 最多显示三行 */
.job-meta-item.location {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}
.job-meta-item.location svg {
  margin-top: 2px;
  flex-shrink: 0;
}
.meta-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* ===== 弹窗通用样式 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: overlayIn 0.25s ease;
}
.modal-overlay.active { display: flex; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  width: 100%;
  max-width: 500px;
  max-height: 90dvh;
  overflow-y: auto;
  animation: sheetIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 20px; }

/* ===== 弹窗分隔线 ===== */
.modal-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-tertiary);
  font-size: 12px;
}
.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.modal-divider span {
  padding: 0 12px;
}

/* ===== 微信登录按钮 ===== */
.modal-wechat-btn {
  width: 100%;
  height: 48px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}
.modal-wechat-btn:hover { background: #06ad56; }

/* ===== 弹窗底部文字 ===== */
.modal-footer-text {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ===== 表单元素 ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-input {
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  width: 100%;
}
.form-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-row { display: flex; gap: 10px; }
.form-row .form-input { flex: 1; }
.btn-sms {
  height: 48px;
  padding: 0 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}
.btn-sms:hover { background: var(--accent-light); border-color: var(--accent); }
.btn-sms:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block {
  width: 100%;
  height: 48px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  margin-top: 6px;
}
.btn-block:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-block:active { transform: scale(0.98); }
.btn-block:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary {
  height: 48px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
  letter-spacing: 0.2px;
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(17,24,39,0.9);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  display: none;
  animation: toastIn 0.3s ease forwards;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.toast.show { display: block; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 空状态 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}
.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.empty-icon svg { width: 28px; height: 28px; color: var(--text-tertiary); }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.empty-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; max-width: 280px; margin-bottom: 16px; }
.suggest-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.suggest-tag {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.suggest-tag:hover { background: #dbeafe; }

/* ===== 底部安全区 ===== */
.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ===== 固定顶部搜索栏 ===== */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.fixed-header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fixed-header .search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  color: var(--text-tertiary);
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  min-width: 0;
}

.fixed-header .search-box:hover {
  background: var(--border);
}

.fixed-header .search-box svg {
  color: var(--text-tertiary);
}

/* ===== 学历筛选按钮 ===== */
.education-filter {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
}

.education-filter:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.education-filter.active {
  background: var(--accent);
  color: #fff;
}

.education-filter svg {
  flex-shrink: 0;
}

/* ===== 学历筛选面板 ===== */
.education-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.education-panel.active {
  display: flex;
}

.education-panel-content {
  background: var(--surface);
  width: 100%;
  max-height: 60vh;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.education-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.education-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.education-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.education-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.education-option {
  padding: 10px 18px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.education-option:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.education-option.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* 半高亮：比选中项层级更高的，提示该学历会被"包含层级"纳入结果 */
.education-option.included {
  background: rgba(14, 165, 233, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

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

/* ===== 底部固定导航栏 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0));
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item svg {
  stroke-width: 1.5;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item:active {
  opacity: 0.7;
}

/* ===== 通用隐藏类 ===== */
.hidden { display: none !important; }

/* ===== 页面内容区（适配固定头部和底部） ===== */
.page {
  padding-bottom: 70px;  /* 底部导航栏高度 */
  min-height: 100vh;
}

/* 个人中心页面不需要顶部padding */
#page-profile {
  padding-top: 0;
}

/* ===== 客服弹窗二维码 ===== */
.service-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}
.service-qr {
  width: 200px;
  height: 200px;
  border-radius: var(--radius);
  object-fit: contain;
}
.service-qr-badge {
  width: 40px;
  height: 40px;
  background: #07c160;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-top: -20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
}
.service-tip {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 4px;
}
.service-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

/* ===== 开发中占位页 ===== */
.dev-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}

.dev-placeholder svg {
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.dev-placeholder h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.dev-placeholder p {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ===== 链接选择弹窗（Action Sheet） ===== */
.link-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: linkOverlayIn 0.2s ease;
}
.link-sheet-overlay.active { display: flex; }
@keyframes linkOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.link-sheet {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 0 16px 24px;
  width: 100%;
  max-width: 500px;
  animation: linkSheetIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes linkSheetIn { from { transform: translateY(100%); } to { transform: none; } }

.link-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 20px;
}

.link-sheet-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 8px;
}

.link-sheet-url {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 0 20px;
  margin-bottom: 24px;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-sheet-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.link-sheet-btn.primary {
  background: var(--accent);
  color: #fff;
}
.link-sheet-btn.primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}

.link-sheet-btn.secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.link-sheet-btn.secondary:hover {
  background: var(--border);
}

.link-sheet-btn.cancel {
  background: transparent;
  color: var(--text-tertiary);
  margin-top: 8px;
}
.link-sheet-btn.cancel:hover {
  color: var(--text-secondary);
}

.link-sheet-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== 激活弹窗 ===== */
#activationModal .modal-sheet {
  display: flex;
  flex-direction: column;
}

#activationModal .modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

#activationModal .activation-pay-panel,
#activationModal .activation-code-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#activationModal .link-code-activate {
  margin-top: auto;
  padding: 14px 0 4px;
}

#activationModal #qrcodeArea {
  margin-bottom: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#activationModal #qrcodeArea #qrcodeImg {
  margin: 0 auto;
}

#activationModal #qrcodeArea img {
  max-width: 100%;
}

.activation-benefits {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.05) 0%, rgba(71, 85, 105, 0.02) 100%);
  border-radius: 12px;
  border: 1px dashed rgba(100, 116, 139, 0.15);
}

.activation-benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
}

.activation-benefit-item svg {
  color: #07C160;
  flex-shrink: 0;
}

.activation-price-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(59, 130, 246, 0.02) 100%);
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.pay-amount-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pay-amount-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pay-amount-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.pay-amount-value #payAmount {
  font-size: 28px;
  font-weight: 800;
}

.pay-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.btn-wxpay {
  background: #07C160;
  margin-top: 8px;
}

.btn-wxpay:hover {
  background: #06ad56;
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.btn-h5-wxpay {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.btn-h5-wxpay:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-h5-wxpay:active {
  transform: translateY(0);
}

.btn-h5-wxpay:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.link-code-activate {
  display: block;
  text-align: center;
  margin-top: 16px;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.link-code-activate:hover {
  color: var(--accent-dark);
  transform: translateY(-1px);
}

.activation-code-panel {
  padding: 20px;
}

.back-to-pay {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.back-to-pay:hover {
  color: var(--accent);
}

.invite-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 12px 0;
  text-align: center;
}

.invite-input-wrap {
  margin-bottom: 16px;
}

.invite-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}

.invite-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.invite-service-hint-wrap {
  text-align: center;
  margin-bottom: 12px;
}

.invite-service-hint {
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
}

.invite-service-hint:hover {
  text-decoration: underline;
}

/* ===== 推送通知弹窗 ===== */
.push-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  animation: pushFadeIn 200ms ease;
}

@keyframes pushFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.push-modal-container {
  position: relative;
  width: 85%;
  max-width: 360px;
  max-height: 80vh;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  animation: pushScaleIn 200ms ease;
}

/* H5 推送弹窗固定尺寸 330×495：container 定尺寸，viewport 满高内部滚动，圆点/按钮锚定容器底部 */
.push-modal-h5 .push-modal-container {
  width: 330px;
  max-width: none;
  height: 495px;
  max-height: none;
}
.push-modal-h5 .push-viewport {
  max-height: none;
  height: 100%;
}

@keyframes pushScaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.push-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 18px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.push-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #374151;
}

.push-modal-h5 .push-close {
  color: #ef4444;
}

.push-modal-h5 .push-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.push-viewport {
  position: relative;
  max-height: 80vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.push-track {
  display: flex;
  align-items: flex-start;
  transition: transform 200ms ease;
}

.push-card {
  min-width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.push-card-image {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f3f4f6;
}

.push-card-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* 图文/纯图片统一：按钮直接悬浮弹窗大div底部（无外层包裹盒子）；双按钮左右并排、单按钮通栏 */
.push-modal-container > .push-btn {
  position: absolute;
  bottom: 14px;
  z-index: 4;
  height: 40px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms;
  font-family: var(--font);
}
.push-modal-container > .push-btn-secondary {
  left: 16px;
  right: calc(50% + 4px);
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
}
.push-modal-container > .push-btn-secondary:hover {
  background: #f9fafb;
}
.push-modal-container > .push-btn-primary {
  left: calc(50% + 4px);
  right: 16px;
  background: #3b82f6;
  color: #fff;
}
.push-modal-container > .push-btn-primary:hover {
  background: #2563eb;
}
.push-modal-container > .push-btn-full {
  left: 16px;
  right: 16px;
  background: #3b82f6;
  color: #fff;
}
.push-modal-container > .push-btn-full:hover {
  background: #2563eb;
}

/* 正文区底部预留悬浮圆点+按钮的空间（纯图片卡片无 body，不受影响） */
.push-card-body {
  padding: 16px 16px 96px;
  flex: 1;
}

.push-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.push-card-text {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
  max-height: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 轮播圆点：无外层包裹div，圆点span直接作为弹窗大div的子元素，
   悬浮底部、按钮正上方；--i 为序号、--n 为总数，通过 calc 实现整体居中（间距14px） */
.push-modal-container > .push-dot {
  position: absolute;
  bottom: 66px;
  z-index: 3;
  left: calc(50% + (var(--i) - (var(--n) - 1) / 2) * 14px);
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d1d5db;
  cursor: pointer;
  transition: all 150ms;
}

.push-dot.active {
  background: #3b82f6;
  width: 16px;
  border-radius: 3px;
}

/* ===== 推送弹窗左右切换按钮：弹窗大div级一对，相对内容区（viewport 与容器同高）垂直居中，H5/PC 通用 ===== */
.push-modal-container > .push-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background 150ms, transform 150ms;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.push-modal-container > .push-arrow:hover {
  background: rgba(0, 0, 0, 0.65);
}
.push-modal-container > .push-arrow:active {
  background: rgba(0, 0, 0, 0.65);
  transform: translateY(-50%) scale(0.95);
}
.push-modal-container > .push-arrow svg {
  width: 20px;
  height: 20px;
}
.push-modal-container > .push-arrow-prev {
  left: 8px;
}
.push-modal-container > .push-arrow-next {
  right: 8px;
}

/* ===== PC 端推送弹窗图片：等比缩放不裁切，圆角由外层 container 的 border-radius+overflow:hidden 保留 ===== */
.push-modal-pc .push-card-image {
  height: 60vh;
  max-height: 560px;
  background: #f3f4f6;
}
.push-modal-pc .push-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
