/* =============================================
   武城同城 - 主样式表
   移动端优先 + 简洁现代风格
   ============================================= */

/* ---------- CSS 变量 ---------- */
:root {
  --primary: #FF6B35;
  --primary-light: #FF8A5B;
  --primary-bg: #FFF4EF;
  --secondary: #2D3748;
  --text-main: #1A202C;
  --text-sub: #718096;
  --text-mute: #A0AEC0;
  --border: #E2E8F0;
  --bg: #F7F8FA;
  --white: #FFFFFF;
  --card-shadow: 0 1px 8px rgba(0,0,0,0.07);
  --card-shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --topbar-h: 52px;
  --bottom-nav-h: 60px;
  --green: #48BB78;
  --red: #FC8181;
  --blue: #4299E1;
  --yellow: #F6AD55;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: var(--topbar-h);
  padding-bottom: var(--bottom-nav-h);
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: var(--font); font-size: inherit; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  max-width: 680px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}
.logo-icon { font-size: 1.3rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.btn-login-sm {
  background: var(--primary);
  color: var(--white);
  padding: 5px 14px;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  font-weight: 600;
}
.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-bg);
}

/* ---------- Bottom Nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-sub);
  font-size: 0.7rem;
  padding: 6px 0;
  transition: color 0.2s;
}
.nav-item.active { color: var(--primary); }
.nav-icon { font-size: 1.25rem; line-height: 1; }
.nav-post { position: relative; }
.nav-post-btn {
  width: 44px; height: 44px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-style: normal;
  box-shadow: 0 4px 14px rgba(255,107,53,0.4);
  margin-top: -16px;
}

/* ---------- Main Content ---------- */
.main-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 12px 0;
}

/* ---------- Banner / Swiper ---------- */
.banner-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
}
.banner-wrap h2 { font-size: 1.3rem; font-weight: 700; }
.banner-wrap p { font-size: 0.85rem; opacity: 0.85; margin-top: 4px; }

/* ---------- 分类入口 ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  box-shadow: var(--card-shadow);
}
.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
.cat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--primary-bg);
  transition: transform 0.2s;
}
.cat-item:active .cat-icon { transform: scale(0.9); }
.cat-label { font-size: 0.7rem; color: var(--text-sub); }

/* ---------- 信息卡片 ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title::before {
  content: '';
  width: 3px; height: 16px;
  background: var(--primary);
  border-radius: 2px;
  display: block;
}
.section-more {
  font-size: 0.8rem;
  color: var(--text-mute);
}

/* 信息列表（竖排）*/
.post-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.post-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--card-shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: box-shadow 0.2s;
  position: relative;
}
.post-card:active { box-shadow: var(--card-shadow-hover); }
.post-thumb {
  width: 80px; height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}
.post-thumb-ph {
  width: 80px; height: 80px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}
.post-info { flex: 1; min-width: 0; }
.post-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.post-desc {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-mute);
  flex-wrap: wrap;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
}
.tag-orange { background: var(--primary-bg); color: var(--primary); }
.tag-green { background: #F0FFF4; color: var(--green); }
.tag-blue { background: #EBF8FF; color: var(--blue); }
.tag-gray { background: var(--bg); color: var(--text-sub); }
.price-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}
.price-label small { font-size: 0.7rem; }

/* 横向卡片滚动 */
.card-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.card-scroll::-webkit-scrollbar { display: none; }
.card-h {
  flex-shrink: 0;
  width: 140px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.card-h-img {
  width: 140px; height: 90px;
  object-fit: cover;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.card-h-body { padding: 8px; }
.card-h-title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.card-h-sub { font-size: 0.7rem; color: var(--text-mute); }

/* ---------- 搜索栏 ---------- */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 8px 14px;
  gap: 8px;
  margin-bottom: 14px;
  box-shadow: var(--card-shadow);
  border: 1.5px solid transparent;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--primary); }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  background: transparent;
  color: var(--text-main);
}
.search-bar input::placeholder { color: var(--text-mute); }
.search-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  cursor: pointer;
}

/* ---------- 表单 ---------- */
.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  box-shadow: var(--card-shadow);
  margin-bottom: 14px;
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}
.form-label .req { color: var(--primary); margin-left: 2px; }
.form-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
  background: var(--white);
}
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: var(--text-mute); }
textarea.form-input { resize: vertical; min-height: 90px; }
.form-select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  background: var(--white);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A0AEC0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-xl);
  padding: 11px 24px;
  transition: opacity 0.2s, transform 0.1s;
  text-align: center;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn-primary { background: var(--primary); color: var(--white); width: 100%; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-wechat { background: #07C160; color: var(--white); width: 100%; gap: 8px; font-size: 1rem; padding: 13px; }

/* ---------- 页面标题 ---------- */
.page-hero {
  padding: 16px 0 10px;
  text-align: center;
}
.page-hero h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}
.page-hero p {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 4px;
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-mute);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-text { font-size: 0.9rem; }

/* ---------- Toast提示 ---------- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(0,0,0,0.75);
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--primary);
  color: var(--white);
}

/* ---------- 用户信息区域 ---------- */
.user-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  margin: -12px -12px 14px;
  padding: 24px 20px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-hero-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  object-fit: cover;
}
.user-hero-info h3 { font-size: 1.1rem; font-weight: 700; }
.user-hero-info p { font-size: 0.8rem; opacity: 0.85; margin-top: 2px; }

/* ---------- 菜单列表 ---------- */
.menu-list {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 14px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.9rem;
}
.menu-item:last-child { border-bottom: none; }
.menu-icon { font-size: 1.2rem; width: 24px; text-align: center; }
.menu-item span:nth-child(2) { flex: 1; }
.menu-arrow { color: var(--text-mute); font-size: 0.8rem; }

/* ---------- 招聘卡片 ---------- */
.job-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.job-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--card-shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.1s;
}
.job-card:active {
  box-shadow: var(--card-shadow-hover);
  transform: scale(0.98);
}
.job-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #FFF4EF, #FFE8D9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.job-body { flex: 1; min-width: 0; }
.job-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-salary {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.job-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.job-tags .tag { font-size: 0.72rem; padding: 2px 7px; }
.job-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-mute);
}

/* ---------- 详情页 ---------- */
.detail-imgs { margin-bottom: 14px; }
.detail-imgs img {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}
.detail-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}
.detail-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}
.detail-body {
  font-size: 0.9rem;
  color: var(--text-sub);
  line-height: 1.8;
}
.seller-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.seller-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
}
.seller-info h4 { font-size: 0.95rem; font-weight: 600; }
.seller-info p { font-size: 0.78rem; color: var(--text-mute); }
.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

/* ---------- 上传区域 ---------- */
.upload-area {
  border: 2px dashed #c5d0db;
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-mute);
  cursor: pointer;
  transition: all 0.25s ease;
  background: #fafbfc;
  position: relative;
  overflow: hidden;
}
.upload-area::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(74,144,226,0.03), rgba(74,144,226,0.08));
  opacity: 0; transition: opacity 0.25s;
}
.upload-area:hover { 
  border-color: var(--primary);
  background: #f5f8ff;
}
.upload-area:hover::before { opacity: 1; }
.upload-area:active { transform: scale(0.98); }
.upload-area input[type="file"] { display: none; }

/* ---------- 公告栏 ---------- */
.notice-bar {
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  overflow: hidden;
}

/* ---------- 登录页 ---------- */
.login-page {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-logo { font-size: 3.5rem; margin-bottom: 12px; }
.login-title { font-size: 1.4rem; font-weight: 700; color: var(--text-main); margin-bottom: 4px; }
.login-sub { font-size: 0.85rem; color: var(--text-sub); margin-bottom: 32px; }
.login-card { width: 100%; max-width: 360px; background: var(--white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--card-shadow); }
.divider { text-align: center; color: var(--text-mute); font-size: 0.8rem; margin: 16px 0; position: relative; }
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* ---------- 提示信息 ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.alert-error { background: #FFF5F5; color: #C53030; border: 1px solid #FED7D7; }
.alert-success { background: #F0FFF4; color: #276749; border: 1px solid #C6F6D5; }
.alert-info { background: #EBF8FF; color: #2B6CB0; border: 1px solid #BEE3F8; }

/* ---------- 分类筛选 ---------- */
.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
  margin-bottom: 14px;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  font-size: 0.82rem;
  color: var(--text-sub);
  background: var(--white);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-tab.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ---------- Loading ---------- */
.loading { text-align: center; padding: 20px; color: var(--text-mute); font-size: 0.85rem; }

/* ---------- 桌面端兼容 ---------- */
@media (min-width: 680px) {
  .main-content { padding: 14px 0; }
  .category-grid { grid-template-columns: repeat(10, 1fr); }
  .post-card { cursor: pointer; }
  .post-card:hover { box-shadow: var(--card-shadow-hover); }
}
