/* ==========================================
   避坑网 - 主样式文件
   ========================================== */

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Navbar ---- */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.logo-icon { font-size: 22px; }
.logo-text { font-size: 20px; font-weight: 700; color: var(--danger); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }

.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #7c3aed 100%);
  color: #fff;
  padding: 60px 0 48px;
  text-align: center;
}

.hero-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.3;
}

.highlight {
  background: linear-gradient(90deg, #fbbf24, #f87171);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 16px;
  opacity: .85;
  margin-bottom: 24px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 32px;
}

.stat-item { text-align: center; }
.stat-num { font-size: 32px; font-weight: 700; display: block; }
.stat-label { font-size: 13px; opacity: .8; }

.search-form {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

.search-input {
  flex: 1;
  padding: 14px 20px;
  font-size: 15px;
  border: none;
  outline: none;
}

.search-btn {
  padding: 14px 24px;
  background: var(--warning);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s;
}

.search-btn:hover { background: #e08e00; }

/* ---- Main Content ---- */
.main-content { padding: 32px 0; }

/* ---- Filter Bar ---- */
.filter-bar {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.filter-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; }
.filter-group { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.filter-group select, .filter-group input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

.result-count { font-size: 14px; color: var(--text-light); white-space: nowrap; }

/* ---- Company Cards ---- */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.company-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  transition: all .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.company-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  text-decoration: none;
  border-color: var(--primary);
}

.company-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 10px; }

.company-avatar {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.company-info { flex: 1; }
.company-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.company-meta { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
  background: #eff6ff;
  color: #3b82f6;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
}

.company-score {
  width: 52px; height: 52px;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.company-desc { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }

.company-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}

/* ---- Stars ---- */
.star { font-size: 16px; }
.star.filled { color: #f59e0b; }
.star.empty { color: #d1d5db; }

/* ---- Company Hero ---- */
.company-hero {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 40px 0;
}

.company-hero-inner {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.company-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 16px;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 36px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.company-hero-info { flex: 1; }
.company-hero-info h1 { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.company-desc-full { font-size: 14px; opacity: .85; margin-top: 8px; }

.score-big {
  width: 90px; height: 90px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.score-num { font-size: 28px; font-weight: 800; color: #fff; }
.score-label { font-size: 11px; color: rgba(255,255,255,.85); }
.stars-big { font-size: 12px; }

/* ---- Two column layout ---- */
.two-col { display: flex; gap: 24px; align-items: flex-start; }
.col-main { flex: 1; min-width: 0; }
.col-side { width: 280px; flex-shrink: 0; }

/* ---- Section Header ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h2 { font-size: 20px; font-weight: 600; }
.count-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  padding: 1px 10px;
  font-size: 13px;
  margin-left: 8px;
}

/* ---- Review Cards ---- */
.review-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.reviewer-info { display: flex; align-items: flex-start; gap: 12px; }

.reviewer-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reviewer-name { font-weight: 600; font-size: 15px; }
.reviewer-pos { color: var(--text-light); font-size: 13px; }
.work-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
}
.work-status.current { background: #d1fae5; color: #065f46; }
.work-status.left { background: #fef3c7; color: #92400e; }

.review-meta-right { text-align: right; }
.review-score {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}
.review-time { font-size: 12px; color: var(--text-light); }

/* ---- Score Breakdown ---- */
.score-breakdown {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
}

.score-item { display: flex; align-items: center; gap: 6px; }
.score-item span { color: var(--text-light); white-space: nowrap; }

/* ---- Pit Tags ---- */
.pit-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pit-tag {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
}

/* ---- Review Sections ---- */
.review-section {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
}

.review-section.pros { background: #f0fdf4; }
.review-section.cons { background: #fff5f5; }
.review-section.advice { background: #fffbeb; }

.label-icon { font-size: 20px; flex-shrink: 0; }
.review-section strong { display: block; margin-bottom: 4px; font-size: 13px; color: var(--text-light); }
.review-section p { color: var(--text); line-height: 1.6; }

.review-actions { text-align: right; margin-top: 8px; }
.report-link { font-size: 12px; color: #94a3b8; }
.report-link:hover { color: var(--danger); }

/* ---- Side Cards ---- */
.side-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.side-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

/* ---- Rating Distribution ---- */
.dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.dist-label { width: 26px; text-align: right; flex-shrink: 0; color: var(--text-light); }

.dist-bar-wrap {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.dist-bar { height: 100%; background: var(--warning); border-radius: 4px; transition: width .5s; }
.dist-count { width: 24px; text-align: right; color: var(--text-light); flex-shrink: 0; }

/* ---- Dimension Scores ---- */
.dim-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}
.dim-name { width: 60px; flex-shrink: 0; color: var(--text-light); }
.dim-bar-wrap { flex: 1; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.dim-bar { height: 100%; background: var(--primary); border-radius: 4px; }
.dim-score { width: 30px; text-align: right; font-weight: 600; flex-shrink: 0; }

/* ---- Tag Cloud ---- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.pit-tag-big {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
}
.pit-tag-big em { font-style: normal; color: #94a3b8; font-size: 11px; margin-left: 4px; }

.cta-card { text-align: center; }
.cta-card h3 { margin-bottom: 8px; }
.cta-card p { color: var(--text-light); font-size: 13px; margin-bottom: 16px; }

/* ---- Forms ---- */
.form-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.form-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.required::after { content: ' *'; color: var(--danger); }
.required-mark { color: var(--danger); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  transition: border-color .2s;
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; display: block; }

.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

.radio-group { display: flex; gap: 20px; }
.radio-item { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }

/* ---- Rating Stars ---- */
.rating-grid { display: flex; flex-direction: column; gap: 14px; }
.rating-row { display: flex; align-items: center; gap: 16px; }
.rating-row label { width: 90px; font-size: 14px; font-weight: 500; flex-shrink: 0; }

.star-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  direction: ltr;
}

.star-rating input[type="radio"] { display: none; }
.star-rating label {
  font-size: 28px;
  cursor: pointer;
  color: #d1d5db;
  transition: color .1s;
  width: auto;
  font-weight: normal;
}
.star-rating .rating-text {
  font-size: 13px;
  color: var(--text-light);
  margin-left: 8px;
  min-width: 50px;
}

/* ---- Tag Selector ---- */
.tag-selector { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-check { cursor: pointer; }
.tag-check input[type="checkbox"] { display: none; }
.tag-check span {
  display: inline-block;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  transition: all .2s;
  background: #fff;
}
.tag-check input:checked + span {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.tag-check:hover span { border-color: var(--primary); }

/* ---- Submit Section ---- */
.submit-section { text-align: center; }
.disclaimer { font-size: 12px; color: var(--text-light); margin-bottom: 16px; }

/* ---- Success/Error Boxes ---- */
.success-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.success-icon { font-size: 48px; margin-bottom: 16px; }
.success-box h2 { font-size: 22px; color: #166534; margin-bottom: 8px; }
.success-box p { color: #15803d; }

.error-box {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.error-box p { color: var(--danger); font-size: 14px; margin: 0; }

/* ---- Page Header ---- */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 26px; font-weight: 700; }
.page-header p { color: var(--text-light); margin-top: 6px; }

/* ---- Autocomplete ---- */
.form-group { position: relative; }
.suggest-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 999;
  max-height: 240px;
  overflow-y: auto;
}
.suggest-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
}
.suggest-item:hover { background: #f0f9ff; }
.suggest-item span { color: var(--text-light); font-size: 12px; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text-light); margin-bottom: 20px; }

/* ---- Pagination ---- */
.pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pager a {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  text-decoration: none;
  transition: all .2s;
}
.pager a:hover, .pager a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

/* ---- Footer ---- */
.footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 30px 0;
  text-align: center;
  margin-top: 60px;
  font-size: 14px;
}
.footer a { color: #94a3b8; }
.footer a:hover { color: #fff; }
.footer p + p { margin-top: 8px; }
.footer .beian { font-size: 12px; color: #64748b; margin-top: 10px; }
.footer .beian a { color: #64748b; display: inline-flex; align-items: center; gap: 4px; }
.footer .beian a:hover { color: #94a3b8; text-decoration: none; }
.footer .beian img { width: 16px; height: 16px; vertical-align: middle; }
.footer .beian-divider { margin: 0 10px; color: #475569; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-title { font-size: 24px; }
  .company-grid { grid-template-columns: 1fr; }
  .two-col { flex-direction: column; }
  .col-side { width: 100%; }
  .form-row { flex-direction: column; gap: 0; }
  .hero-stats { gap: 20px; }
  .score-big { width: 70px; height: 70px; }
  .score-num { font-size: 22px; }
}
