/**
 * 召集人 · 主样式表
 * 基于Tailwind CSS + 自定义样式
 */

/* ========== 基础样式 ========== */
:root {
  --primary: #FF6B35;
  --primary-dark: #E55A2B;
  --primary-light: #FFF3EE;
  --bg-page: #F5F6FA;
  --bg-white: #FFFFFF;
  --text-main: #222222;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #EEEEEE;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
  min-height: 100vh;
}

/* ========== 通用组件 ========== */
.card-white {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-hover {
  transition: all 0.2s ease;
}

.card-hover:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-md);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #FF8C42);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 24px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(255,107,53,0.2);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 8px 20px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:active {
  background: var(--primary-light);
  transform: scale(0.97);
}

.publish-btn {
  background: linear-gradient(135deg, var(--primary), #FF8C42);
  box-shadow: 0 6px 20px rgba(255,107,53,0.35);
  color: white;
}

/* ========== 区块标题样式 ========== */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ========== 加盟页面专属样式 ========== */
.profit-card {
  background: linear-gradient(135deg, #FFF9E6, #FFF3CC);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}

.city-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.city-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.city-tag.joined {
  background: rgba(76, 175, 80, 0.1);
  border-color: rgba(76, 175, 80, 0.3);
  color: #4CAF50;
}

.bg-gold {
  background-color: #FFC107;
}

.bg-gold-light {
  background-color: #FFF9E6;
}

.text-gold {
  color: #FFC107;
}

/* ========== 表单样式 ========== */
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s;
  background: var(--bg-white);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s;
  background: var(--bg-white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.submit-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), #FF8C42);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.submit-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(255,107,53,0.2);
}

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

/* ========== 文字截断 ========== */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 标签 ========== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.tag-blue { background: #E8F4FD; color: #3B8CFF; }
.tag-green { background: #E6F9F0; color: #12B886; }
.tag-orange { background: #FFF4EB; color: #FF8C35; }
.tag-purple { background: #F3EEFF; color: #7C5CFC; }
.tag-red { background: #FFEEEE; color: #FF5252; }

/* ========== 头像 ========== */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 80px; height: 80px; }

/* ========== 分类图标 ========== */
.category-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.icon-feishou { background: linear-gradient(135deg, #E8F4FD, #D0E8FF); color: #3B8CFF; }
.icon-zushou { background: linear-gradient(135deg, #FFF4EB, #FFE8D0); color: #FF8C35; }
.icon-weixiu { background: linear-gradient(135deg, #E6F9F0, #D0F5E0); color: #12B886; }
.icon-peixun { background: linear-gradient(135deg, #F3EEFF, #E8DDFF); color: #7C5CFC; }
.icon-zhaobiao { background: linear-gradient(135deg, #FFEEEE, #FFDDDD); color: #FF5252; }
.icon-gongxu { background: linear-gradient(135deg, #EEF0FF, #DDE0FF); color: #5C6CFC; }
.icon-shequ { background: linear-gradient(135deg, #E6FFFA, #D0FFF5); color: #0D9488; }
.icon-qiuzhi { background: linear-gradient(135deg, #FFFBEB, #FFF5D0); color: #F59E0B; }
.icon-wenda { background: linear-gradient(135deg, #F5F0FF, #EDE0FF); color: #8B5CF6; }
.icon-shangjia { background: linear-gradient(135deg, #FFEEF5, #FFDDEE); color: #F06292; }

/* ========== 分页 ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 0;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination a.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90vw;
}

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

.toast-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========== Modal (底部弹窗) ========== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9997;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  z-index: 1;
  animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal-body {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  gap: 12px;
}

.modal-footer button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-cancel {
  background: var(--bg-page);
  color: var(--text-secondary);
}

.btn-confirm {
  background: var(--primary);
  color: white;
}

/* ========== 筛选标签 ========== */
.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

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

.filter-tab {
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  background: var(--bg-white);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 500;
}

/* ========== 置顶推荐 ========== */
.featured-card {
  background: linear-gradient(135deg, #FFF8F5 0%, #FFF3EE 30%, #FFFFFF 70%);
  border: 1.5px solid #FFD4C2;
}

.featured-badge {
  background: linear-gradient(135deg, var(--primary), #FF8C42);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 0 8px 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}

.featured-price {
  background: linear-gradient(135deg, var(--primary), #FF8C42);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
}

/* ========== 滚动条 ========== */
.custom-scroll::-webkit-scrollbar { display: none; }
.custom-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* ========== 分割线 ========== */
.divider {
  border-bottom: 1px solid #F0F0F0;
}

.divider:last-child { border-bottom: none; }

/* ========== 头像在线状态 ========== */
.online-dot {
  width: 8px;
  height: 8px;
  background: #12B886;
  border: 2px solid white;
  border-radius: 50%;
  position: absolute;
  bottom: 2px;
  right: 2px;
}

/* ========== 评分星星 ========== */
.stars {
  display: inline-flex;
  color: #FFB800;
  gap: 1px;
}

/* ========== 遮罩动画 ========== */
.slide-up {
  animation: slideUp 0.3s ease;
}

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

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
  body { padding-bottom: 80px; }
  .card-white { border-radius: var(--radius-md); }
}

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