:root {
  --primary: #2563EB;
  --secondary: #F97316;
  --bg: #F8FAFC;
  --text: #1E293B;
  --card: #FFFFFF;
  --tag-bg: #EFF6FF;
  --success: #10B981;
  --danger: #EF4444;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --radius-md: 12px;
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --tab-h: 56px;
  --header-extra: 120px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--tab-h) + 72px + env(safe-area-inset-bottom, 0px));
}
button { font: inherit; cursor: pointer; border: none; background: none; }
img { display: block; }
.hidden { display: none !important; }

.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--card); border-bottom: 1px solid var(--gray-200);
  padding: 10px 12px 8px;
}
.search-bar { display: flex; gap: 8px; align-items: center; }
.city-picker { flex-shrink: 0; font-weight: 700; color: var(--primary); font-size: 14px; }
.search-input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--gray-200);
  border-radius: 999px; background: var(--bg); font-size: 14px;
}
.search-input:focus { outline: none; border-color: var(--primary); }
.search-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; }

.hot-tags, .tag-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px;
  -webkit-overflow-scrolling: touch;
}
.hot-tag, .tag-pill, .filter-chip {
  flex-shrink: 0; padding: 6px 12px; border-radius: 999px; font-size: 12px;
  background: var(--tag-bg); color: var(--text);
}
.tag-pill.active, .filter-chip.active, .hot-tag:hover { background: var(--primary); color: #fff; }

.main-content { padding: 0 12px 12px; max-width: 720px; margin: 0 auto; }
.filter-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 0;
  font-size: 13px;
}
.filter-trigger, .view-toggle {
  padding: 6px 12px; border-radius: 8px; background: var(--card);
  border: 1px solid var(--gray-200);
}
.filter-summary { flex: 1; color: var(--gray-500); }

.job-list { display: flex; flex-direction: column; gap: 12px; }
.job-card {
  background: var(--card); border-radius: var(--radius-md); padding: 14px;
  box-shadow: var(--shadow-md); border: 1px solid var(--gray-200);
  transition: transform 0.25s, opacity 0.25s;
}
.job-card.swipe-out { opacity: 0; transform: translateX(-40px); }
.job-card__head { display: flex; gap: 10px; align-items: flex-start; }
.job-card__head img { border-radius: 10px; flex-shrink: 0; }
.job-card__title { margin: 0; font-size: 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.job-card__company { margin: 4px 0 0; font-size: 13px; color: var(--gray-500); }
.job-card__fav { margin-left: auto; font-size: 20px; color: var(--gray-400); }
.job-card__fav.is-on { color: var(--danger); }
.job-card__salary { margin: 10px 0 6px; font-size: 18px; font-weight: 800; color: var(--secondary); }
.job-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.job-card__tags .tag { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--tag-bg); }
.job-card__meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-500); }
.job-card__swipe-hint { margin: 8px 0 0; font-size: 10px; color: var(--gray-400); text-align: center; }

.badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.badge--urgent { background: #FEE2E2; color: var(--danger); }
.badge--verified { background: #DCFCE7; color: var(--success); }

.skeleton { height: 120px; border-radius: var(--radius-md); background: linear-gradient(90deg, #f0f0f0, #fafafa, #f0f0f0); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 12px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-500); }

.map-container { min-height: 360px; border-radius: var(--radius-md); overflow: hidden; background: var(--card); border: 1px solid var(--gray-200); }
.map-canvas-fallback { width: 100%; display: block; }

.job-detail {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  overflow-y: auto; padding: 12px 12px 90px;
}
.detail-back { margin-bottom: 12px; color: var(--primary); font-weight: 600; }
.company-header { display: flex; gap: 12px; background: var(--card); padding: 16px; border-radius: var(--radius-md); margin-bottom: 12px; }
.company-header h2 { margin: 0 0 4px; font-size: 20px; }
.detail-salary { color: var(--secondary); font-weight: 800; font-size: 18px; }
.job-detail__content { background: var(--card); padding: 16px; border-radius: var(--radius-md); font-size: 14px; line-height: 1.7; }
.job-detail__content h3 { margin: 16px 0 8px; font-size: 15px; }
.detail-stats { color: var(--gray-500); font-size: 12px; }
.apply-bar {
  position: fixed; left: 0; right: 0; bottom: var(--tab-h);
  display: flex; gap: 8px; padding: 10px 12px; background: var(--card);
  border-top: 1px solid var(--gray-200); z-index: 210;
}

.publish-wizard { padding-bottom: 20px; }
.wizard-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.wizard-header h2 { margin: 0; font-size: 18px; }
.wizard-steps { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; }
.wizard-dot {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--gray-200); font-size: 12px; font-weight: 700;
}
.wizard-dot.active { background: var(--primary); color: #fff; }
.wizard-dot.done { background: var(--success); color: #fff; }
.wizard-form { background: var(--card); padding: 16px; border-radius: var(--radius-md); }
.form-group { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--gray-200); border-radius: 8px; font-weight: 400;
}
.wizard-actions { margin-top: 16px; }

.filter-backdrop {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.4);
}
.filter-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 310;
  background: var(--card); border-radius: 16px 16px 0 0; padding: 16px;
  max-height: 75vh; overflow-y: auto;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.filter-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.filter-section { margin-bottom: 16px; }
.filter-section h4 { margin: 0 0 8px; font-size: 14px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-actions { display: flex; gap: 10px; margin-top: 12px; }

.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 250;
  display: flex; background: var(--card); border-top: 1px solid var(--gray-200);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10px; color: var(--gray-500);
}
.tab-item span { font-size: 20px; }
.tab-item.active { color: var(--primary); font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--secondary { background: var(--gray-200); color: var(--text); }
.btn--outline { background: transparent; border: 1px solid var(--gray-200); color: var(--text); }
.btn--full { width: 100%; }
.apply-bar .btn { flex: 1; padding: 10px 8px; font-size: 12px; }

.toast {
  position: fixed; bottom: calc(var(--tab-h) + 24px); left: 50%; transform: translateX(-50%);
  z-index: 500; background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
}
.toast--error { background: var(--danger); }

.contact-footer {
  background: var(--card); border-top: 1px solid var(--gray-200);
  padding: 12px 16px; margin-top: 16px;
}
.contact-footer__btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.contact-footer__cta, .contact-footer__btn {
  padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; text-decoration: none;
}
.contact-footer__cta { background: var(--primary); color: #fff !important; }
.contact-footer__btn { background: var(--bg); border: 1px solid var(--gray-200); color: var(--text) !important; }
.contact-footer__brand { text-align: center; font-size: 11px; color: var(--gray-500); margin: 8px 0 0; }

.mine-empty { text-align: center; padding: 40px 16px; color: var(--gray-500); }

@media (min-width: 768px) {
  .main-content { padding: 0 20px 20px; }
  .job-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}
