/* 副业避坑导航 - 全局样式 */
/* ========== 变量定义 ========== */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary-color: #64748b;
  --accent-color: #f59e0b;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --success-color: #22c55e;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
}

/* ========== 重置样式 ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
}

/* ========== 布局 ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 24px 0;
}

/* ========== 导航栏 ========== */
.navbar {
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.logo-icon {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--bg-color);
  color: var(--primary-color);
}

.nav-link.active {
  background: #eff6ff;
  color: var(--primary-color);
}

.menu-toggle {
  display: none;
  padding: 8px;
  font-size: 1.25rem;
  color: var(--text-primary);
}

/* ========== 页头 ========== */
.page-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 40px 0;
  text-align: center;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-header p {
  font-size: 1rem;
  opacity: 0.9;
}

/* ========== 搜索框 ========== */
.search-section {
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.search-box {
  display: flex;
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-btn {
  padding: 12px 24px;
  background: var(--primary-color);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--primary-dark);
}

.search-hint {
  text-align: center;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ========== 卡片 ========== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ========== 平台卡片 ========== */
.platform-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.platform-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.platform-type {
  padding: 4px 10px;
  background: #eff6ff;
  color: var(--primary-color);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.platform-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 8px;
  background: var(--bg-color);
  color: var(--text-secondary);
  border-radius: 4px;
  font-size: 0.75rem;
}

.platform-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--bg-color);
  border-radius: var(--radius-sm);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.platform-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.difficulty {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.difficulty-stars {
  color: var(--accent-color);
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.trust-a { background: #dcfce7; color: #166534; }
.trust-b { background: #dbeafe; color: #1e40af; }
.trust-c { background: #fef9c3; color: #854d0e; }
.trust-d { background: #fed7aa; color: #9a3412; }
.trust-e { background: #fecaca; color: #991b1b; }

/* ========== 骗局卡片 ========== */
.scam-card {
  border-left: 4px solid var(--danger-color);
}

.scam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.scam-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.danger-level {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.danger-high { background: var(--danger-color); }
.danger-medium { background: var(--warning-color); }
.danger-low { background: var(--success-color); }

.scam-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}

.scam-stat {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.scam-stat strong {
  color: var(--danger-color);
}

.scam-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scam-tags .tag {
  background: #fef2f2;
  color: var(--danger-color);
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

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

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

.btn-outline {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

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

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

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ========== 筛选栏 ========== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* ========== 副业匹配问卷 ========== */
.quiz-container {
  max-width: 700px;
  margin: 0 auto;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.quiz-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.quiz-progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.quiz-question {
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.quiz-question h3 {
  font-size: 1.125rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-color);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.quiz-option:hover {
  border-color: var(--primary-light);
}

.quiz-option.selected {
  border-color: var(--primary-color);
  background: #eff6ff;
}

.quiz-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

/* ========== 推荐结果 ========== */
.result-container {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  text-align: center;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.result-subtitle {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.result-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.result-platform {
  padding: 16px;
  background: var(--bg-color);
  border-radius: var(--radius-md);
  text-align: left;
}

.result-platform h4 {
  font-size: 1rem;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.result-platform p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.result-reason {
  padding: 16px;
  background: #fef3c7;
  border-radius: var(--radius-md);
  margin: 20px 0;
  text-align: left;
}

.result-reason h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 8px;
}

.result-income {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--success-color);
  margin: 20px 0;
}

/* ========== 投稿表单 ========== */
.form-container {
  max-width: 600px;
  margin: 0 auto;
}

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

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.form-radio:hover {
  border-color: var(--primary-light);
}

.form-radio.selected {
  border-color: var(--primary-color);
  background: #eff6ff;
}

.form-radio input {
  display: none;
}

/* ========== 详情页 ========== */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.detail-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.detail-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.detail-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 16px 0 8px;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-list li {
  position: relative;
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.detail-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.warning-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
}

.warning-box h4 {
  color: var(--danger-color);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.warning-box p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.info-item {
  padding: 16px;
  background: var(--bg-color);
  border-radius: var(--radius-md);
}

.info-item label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.info-item span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.income-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.income-table th,
.income-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.income-table th {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.income-table td {
  font-size: 0.9rem;
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-color);
  border-radius: var(--radius-md);
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ========== 页脚 ========== */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 24px;
}

.footer-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.footer-section ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-section a {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-section a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.disclaimer-banner {
  background: #fef3c7;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: #92400e;
}

/* ========== 热门/最新模块 ========== */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fef2f2;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--danger-color);
}

.alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--danger-color);
  margin-bottom: 4px;
}

.alert-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* ========== 加载状态 ========== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 12px;
}

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

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .navbar-inner {
    height: 56px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--card-bg);
    flex-direction: column;
    padding: 12px;
    box-shadow: var(--shadow-md);
    gap: 4px;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 12px;
  }

  .menu-toggle {
    display: block;
  }

  .page-header {
    padding: 30px 0;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .search-box {
    flex-direction: column;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
  }

  .detail-header {
    flex-direction: column;
  }

  .info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .result-platforms {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .page-header {
    padding: 24px 0;
  }

  .platform-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
}

/* ========== 动画 ========== */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== 工具类 ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.hidden { display: none; }
