/**
 * 供需物联APP - 全局样式
 * Material Design 风格 + 小红书瀑布流
 */

/* ===== 基础重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --danger: #EF4444;
  --success: #10B981;
  --bg: #F3F4F6;
  --bg-card: #FFFFFF;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --nav-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: #E5E7EB;
  overflow: hidden;
}

/* ===== App 容器 ===== */
#app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  max-height: 932px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}

@media (min-width: 431px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  #app {
    border-radius: 32px;
    height: 90vh;
    max-height: 900px;
    overflow: hidden;
  }
}

/* ===== 屏幕容器 ===== */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: var(--nav-height);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.screen.active {
  display: flex;
  animation: screenIn 0.3s ease;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ===== 顶部状态栏模拟 ===== */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px 4px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-primary);
}

.status-bar .status-time { font-weight: 700; }
.status-bar .status-icons { display: flex; gap: 4px; align-items: center; font-size: 12px; }

/* ===== 搜索栏 ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 12px;
  background: var(--bg-card);
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 20px;
  padding: 8px 14px;
}

.search-input-wrap svg {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-input-wrap input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: var(--text-primary);
}

.search-input-wrap input::placeholder { color: var(--text-tertiary); }

.app-logo {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: -0.5px;
}

/* ===== 广告轮播 ===== */
.ad-carousel {
  padding: 0 16px 8px;
  overflow: hidden;
}

.ad-slides {
  display: flex;
  gap: 0;
  transition: transform 0.4s ease;
  border-radius: var(--radius);
  overflow: hidden;
}

.ad-slide {
  min-width: 100%;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.ad-slide .ad-text { z-index: 1; }
.ad-slide .ad-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.ad-slide .ad-subtitle { font-size: 12px; opacity: 0.9; }
.ad-slide .ad-icon { font-size: 36px; opacity: 0.8; z-index: 1; }
.ad-slide .ad-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  background: rgba(255,255,255,0.3);
  padding: 2px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.ad-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
}

.ad-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--text-tertiary);
  opacity: 0.4;
  transition: all 0.3s;
}

.ad-dot.active {
  width: 16px;
  background: var(--primary);
  opacity: 1;
}

/* ===== 分类标签 ===== */
.category-tabs {
  display: flex;
  gap: 6px;
  padding: 4px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  white-space: nowrap;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.cat-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

.cat-tab .cat-icon { font-size: 13px; }

/* ===== 瀑布流布局 ===== */
.masonry {
  padding: 4px 12px 100px;
  column-count: 2;
  column-gap: 8px;
}

.demand-card {
  break-inside: avoid;
  margin-bottom: 8px;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.demand-card:active {
  transform: scale(0.97);
}

.demand-card .card-img {
  width: 100%;
  display: block;
  background: var(--bg);
  object-fit: cover;
}

.demand-card .card-body {
  padding: 8px 10px 10px;
}

.demand-card .card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.demand-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.demand-card .card-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
}

.demand-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demand-card .card-user {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.demand-card .card-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
}

.demand-card .card-username {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demand-card .card-stats {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.demand-card .card-price-tag {
  position: absolute;
  /* price badge styling if needed */
}

/* ===== 底部导航 ===== */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--nav-height);
  padding-bottom: var(--safe-bottom);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
  z-index: 100;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 20px;
  cursor: pointer;
  transition: color 0.2s;
  color: var(--text-tertiary);
  font-size: 10px;
}

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

.nav-item .nav-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-publish {
  position: relative;
  margin-top: -20px;
}

.nav-publish-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  transition: transform 0.2s;
}

.nav-publish-btn:active { transform: scale(0.9); }

.nav-publish .nav-label { margin-top: 2px; }

/* ===== 发布页 ===== */
.publish-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.publish-header .back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  font-size: 20px;
  color: var(--text-primary);
}

.publish-header .page-title {
  font-size: 16px;
  font-weight: 600;
}

.publish-header .submit-btn {
  padding: 6px 18px;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.publish-header .submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-section {
  background: var(--bg-card);
  margin: 8px;
  border-radius: var(--radius);
  padding: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-label .required { color: var(--danger); }

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--primary);
  background: #fff;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

/* 图片上传 */
.image-upload-area {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.image-upload-btn {
  aspect-ratio: 1;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-tertiary);
  background: var(--bg);
  transition: all 0.2s;
}

.image-upload-btn:active { border-color: var(--primary); }

.image-upload-btn .upload-icon { font-size: 28px; }
.image-upload-btn .upload-text { font-size: 11px; }

.image-preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}

/* 分类选择 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.category-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 11px;
  color: var(--text-secondary);
}

.category-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.category-option .cat-emoji { font-size: 20px; }

/* 标签输入 */
.tag-input-area {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  font-size: 12px;
}

.tag-chip .tag-remove {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
}

.tag-input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  min-width: 80px;
  flex: 1;
  padding: 4px 0;
}

/* 联系方式区域 */
.contact-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #FEF3C7;
  border-radius: 8px;
  font-size: 12px;
  color: var(--accent-dark);
  margin-bottom: 12px;
}

/* 平台统一定价提示（发布页） */
.platform-pricing-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border-radius: 10px;
  border: 1px solid #BFDBFE;
  margin-top: 4px;
}
.platform-pricing-notice .ppn-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.platform-pricing-notice .ppn-text { flex: 1; }
.platform-pricing-notice .ppn-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 2px;
}
.platform-pricing-notice .ppn-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.platform-pricing-notice .ppn-desc strong {
  color: var(--primary);
}

/* 支付弹窗 - 平台提示 */
.pay-platform-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  background: #F3F4F6;
  padding: 6px 12px;
  border-radius: 6px;
  margin: -8px 0 16px;
}

/* ===== 详情页 ===== */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.detail-header .back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
}

.detail-header .detail-title-bar {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-images {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  background: #000;
}

.detail-images::-webkit-scrollbar { display: none; }

.detail-images img {
  min-width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
}

.detail-image-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 8px 0;
  background: #000;
}

.detail-image-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.4);
  transition: all 0.3s;
}

.detail-image-dot.active {
  width: 16px;
  background: #fff;
}

.detail-body {
  background: var(--bg-card);
  padding: 16px;
}

.detail-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.detail-user .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
}

.detail-user .user-info {
  flex: 1;
  min-width: 0;
}

.detail-user .user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-user .user-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.detail-user .follow-btn {
  padding: 5px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
}

.detail-user .follow-btn:active { background: var(--primary-light); }

.detail-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.detail-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
}

.detail-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin-bottom: 16px;
}

.detail-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.detail-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 联系方式卡片 - 锁定状态 */
.contact-card {
  margin: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.contact-card-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.contact-card-header .lock-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #FEF3C7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.contact-card-header .lock-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}

.contact-card-header .lock-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.contact-locked {
  padding: 24px 16px;
  text-align: center;
}

.contact-locked .lock-illustration {
  font-size: 48px;
  margin-bottom: 12px;
}

.contact-locked .lock-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.contact-locked .lock-tip {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 10px;
}

.contact-locked .lock-tip-sec {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.contact-locked .lock-price-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  background: #FEF3C7;
  border-radius: 20px;
  margin-bottom: 12px;
}
.contact-locked .lock-price-tag .lpt-label {
  font-size: 11px;
  color: var(--accent-dark);
}
.contact-locked .lock-price-tag .lpt-amount {
  font-size: 14px;
  color: var(--accent-dark);
}
.contact-locked .lock-price-tag .lpt-amount strong {
  font-size: 22px;
  font-weight: 800;
}

.pay-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 36px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  transition: transform 0.2s;
}

.pay-btn:active { transform: scale(0.95); }

/* 联系方式卡片 - 已解锁 */
.contact-unlocked {
  padding: 4px 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.contact-item:last-child { border-bottom: none; }

.contact-item .ci-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.contact-item .ci-content { flex: 1; }
.contact-item .ci-label { font-size: 11px; color: var(--text-tertiary); margin-bottom: 2px; }
.contact-item .ci-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }

.contact-item .ci-copy {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 11px;
  color: var(--primary);
  cursor: pointer;
  border: 1px solid var(--border);
}

.contact-unlocked-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #ECFDF5;
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}
.contact-unlocked-badge.own {
  background: #EFF6FF;
  color: var(--primary-dark);
}
.contact-unlocked-badge.paid {
  background: #ECFDF5;
  color: var(--success);
}
.contact-unlocked-badge.free {
  background: #FEF3C7;
  color: var(--accent-dark);
}

/* 底部操作栏 */
.detail-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  padding-bottom: calc(8px + var(--safe-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 10;
  flex-shrink: 0;
}

.detail-action-bar .action-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
}

.detail-action-bar .action-icon-btn .ai-icon { font-size: 20px; }

.detail-action-bar .contact-btn {
  flex: 1;
  padding: 10px;
  border-radius: 22px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.2s;
}

.detail-action-bar .contact-btn:active { transform: scale(0.97); }

.contact-btn.locked {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.contact-btn.unlocked {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
}

.contact-btn.own {
  background: var(--bg);
  color: var(--text-secondary);
  cursor: default;
}

/* ===== 支付弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s ease;
}

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

.modal-sheet {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  animation: slideUp 0.3s ease;
}

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

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 16px;
}

.modal-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.modal-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.pay-amount {
  text-align: center;
  margin-bottom: 20px;
}

.pay-amount .currency { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.pay-amount .amount { font-size: 40px; font-weight: 800; color: var(--text-primary); }

.pay-demand-info {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 20px;
}

.pay-demand-info .pdi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pay-demand-info .pdi-meta {
  font-size: 11px;
  color: var(--text-tertiary);
}

.pay-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s;
}

.pay-method.selected { border-color: var(--primary); }

.pay-method .pm-icon { font-size: 24px; }
.pay-method .pm-name { flex: 1; font-size: 14px; font-weight: 500; }

.pay-method .pm-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pay-method.selected .pm-radio {
  border-color: var(--primary);
  background: var(--primary);
}

.pay-method.selected .pm-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.pay-confirm-btn {
  width: 100%;
  padding: 14px;
  border-radius: 24px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.pay-confirm-btn:active { opacity: 0.85; }
.pay-confirm-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 支付成功动画 */
.pay-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.pay-success-overlay.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.pay-success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  animation: popIn 0.4s ease;
}

@keyframes popIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.pay-success-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.pay-success-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== 个人中心 ===== */
.profile-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 20px 16px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.profile-header::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.profile-user {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,0.4);
}

.profile-user .profile-name {
  font-size: 18px;
  font-weight: 700;
}

.profile-user .profile-phone {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.profile-stats {
  display: flex;
  gap: 0;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.profile-stat {
  flex: 1;
  text-align: center;
}

.profile-stat .stat-num { font-size: 20px; font-weight: 800; }
.profile-stat .stat-label { font-size: 11px; opacity: 0.85; margin-top: 2px; }

.profile-stat.highlight .stat-num { color: #FDE68A; }
.profile-stat.highlight .stat-label { color: #FEF3C7; }

.profile-quota-tip {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
  backdrop-filter: blur(8px);
}
.profile-quota-tip strong { color: #FDE68A; font-size: 14px; }

.profile-tabs {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.profile-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.profile-tab.active {
  color: var(--primary);
}

.profile-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

.profile-list {
  padding: 8px;
  padding-bottom: 100px;
}

.profile-list-item {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

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

.profile-list-item .pli-img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.profile-list-item .pli-content { flex: 1; min-width: 0; }
.profile-list-item .pli-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.profile-list-item .pli-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.profile-list-item .pli-contact {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-state .empty-icon { font-size: 56px; margin-bottom: 12px; opacity: 0.5; }
.empty-state .empty-text { font-size: 14px; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 13px;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  white-space: nowrap;
  max-width: 90%;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 加载动画 ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== 工具类 ===== */
.hidden { display: none !important; }

/* 滚动条隐藏 */
.screen-scroll::-webkit-scrollbar { display: none; }
.screen-scroll { scrollbar-width: none; }
