/* PC端公共样式 */
:root {
  --primary: #1565C0;
  --primary-light: #1976D2;
  --primary-dark: #0D47A1;
  --primary-bg: #E3F2FD;
  --accent: #FF6F00;
  --accent-light: #FFA000;
  --success: #2E7D32;
  --success-bg: #E8F5E9;
  --warning: #F57F17;
  --warning-bg: #FFFDE7;
  --danger: #C62828;
  --danger-bg: #FFEBEE;
  --demand-color: #E65100;
  --demand-bg: #FFF3E0;
  --supply-color: #2E7D32;
  --supply-bg: #E8F5E9;
  --star-color: #FFB300;
  --gold-color: #B8860B;
  --gold-light: #FFD700;
  --gold-bg: #FFFDE7;
  --purple-bg: #F3E5F5;
  --gray-1: #F5F5F5;
  --gray-2: #EEEEEE;
  --gray-3: #E0E0E0;
  --gray-4: #BDBDBD;
  --gray-5: #9E9E9E;
  --gray-6: #757575;
  --gray-7: #616161;
  --gray-8: #424242;
  --gray-9: #212121;
  --white: #FFFFFF;
  --text-primary: #212121;
  --text-secondary: #757575;
  --border: #E0E0E0;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --header-height: 64px;
  --container-width: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary);
  background: var(--gray-1);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* 顶部导航 */
.header {
  background: var(--primary-dark);
  height: var(--header-height);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-inner {
  max-width: var(--container-width);
  margin: 0 auto; padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; gap: 24px;
}
.logo {
  font-size: 22px; font-weight: 800; color: white;
  letter-spacing: 1px; white-space: nowrap; flex-shrink: 0;
}
.logo span { color: #64B5F6; font-size: 13px; font-weight: 400; margin-left: 6px; }

/* 主导航 */
.main-nav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.nav-link {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; border-radius: var(--radius);
  color: rgba(255,255,255,0.75); font-size: 14px; cursor: pointer;
  transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
}
.nav-link:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-link.active { color: white; background: var(--primary); }

/* 搜索框 */
.header-search {
  flex: 1 1 220px; max-width: 360px; min-width: 180px;
  display: flex; align-items: center;
  background: white; border-radius: var(--radius);
  overflow: hidden;
}
.header-search input {
  flex: 1; border: none; outline: none; padding: 9px 14px;
  font-size: 14px; color: var(--text-primary);
}
.header-search input::placeholder { color: var(--gray-4); }
.header-search-btn {
  background: var(--accent); color: white;
  padding: 9px 18px; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap; border: none; cursor: pointer;
}
.header-search-btn:hover { background: var(--accent-light); }

/* 右侧操作 */
.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-btn {
  padding: 7px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  white-space: nowrap;
}
.header-btn-outline { color: white; border: 1px solid rgba(255,255,255,0.4); }
.header-btn-outline:hover { border-color: white; background: rgba(255,255,255,0.1); }
.header-btn-accent { background: var(--accent); color: white; border: none; }
.header-btn-accent:hover { background: var(--accent-light); }

.header-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 4px 8px; border-radius: var(--radius);
}
.header-user:hover { background: rgba(255,255,255,0.1); }
.header-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; border: 2px solid rgba(255,255,255,0.3);
}
.header-username { font-size: 13px; color: rgba(255,255,255,0.85); }
.notif-btn {
  position: relative; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.75); font-size: 20px; cursor: pointer;
}
.notif-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--primary-dark);
}

/* 容器 */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; cursor: pointer; border: none;
  transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-light); }
.btn-outline { background: white; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-ghost { background: transparent; color: var(--gray-6); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--gray-1); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius); }

/* 输入框 */
.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px; outline: none;
  transition: border-color 0.2s; background: white;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--gray-7); font-weight: 500; }
.form-group .hint { font-size: 12px; color: var(--gray-5); margin-top: 4px; }
select.input { cursor: pointer; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
}
.tag-blue { background: var(--primary-bg); color: var(--primary); }
.tag-orange { background: var(--demand-bg); color: var(--demand-color); }
.tag-green { background: var(--success-bg); color: var(--success); }
.tag-gray { background: var(--gray-2); color: var(--gray-6); }
.tag-red { background: var(--danger-bg); color: var(--danger); }

/* 供/求标识 */
.supply-badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; }
.supply { background: var(--success-bg); color: var(--success); }
.demand { background: var(--demand-bg); color: var(--demand-color); }
.urgent-badge { display: inline-block; padding: 3px 8px; background: var(--danger); color: white; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; }

/* 认证徽章 */
.badge-verified { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--primary); background: var(--primary-bg); padding: 2px 8px; border-radius: 3px; }
.badge-vip { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: #B8860B; background: #FFFDE7; padding: 2px 8px; border-radius: 3px; }

/* 卡片 */
.card { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }

/* 分割线 */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* 评星 */
.stars { color: #FFC107; letter-spacing: 1px; }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 6px; padding: 20px 0; justify-content: center; }
.page-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; border: 1px solid var(--border); background: white; color: var(--gray-7); }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-info { font-size: 13px; color: var(--gray-5); }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: var(--gray-5); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty p { font-size: 14px; margin-bottom: 16px; }

/* 页脚 */
.footer {
  background: #1A1A2E;
  color: rgba(255,255,255,0.5);
  padding: 40px 0 24px;
  margin-top: 60px;
}
.footer-inner { max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-brand .name { font-size: 20px; font-weight: 700; color: white; margin-bottom: 8px; }
.footer-brand p { font-size: 13px; line-height: 1.7; }
.footer-col h4 { color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 13px; color: rgba(255,255,255,0.45); }
.footer-col ul li a:hover { color: rgba(255,255,255,0.8); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; text-align: center; font-size: 12px; }

/* 响应式 */
@media (max-width: 1024px) {
  .container { padding: 0 16px; }
  .header-inner { padding: 0 16px; gap: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}


/* PC端适配优化 */
html, body { overflow-x: hidden; }
img, video { max-width: 100%; height: auto; }

@media (max-width: 1200px) {
  .header-inner { gap: 8px; padding: 0 16px; }
  .logo { font-size: 21px; }
  .logo span { display: none; }
  .main-nav { gap: 2px; }
  .nav-link { padding: 7px 9px; font-size: 13px; }
  .header-search { max-width: 260px; min-width: 160px; }
  .header-search input { padding: 8px 10px; }
  .header-search-btn { padding: 8px 12px; }
  .header-right { gap: 6px; }
  .header-btn { padding: 7px 9px; font-size: 12px; }
  .header-avatar { width: 30px; height: 30px; }
  .header-username { font-size: 12px; }
}

@media (max-width: 1024px) {
  .container { padding: 0 16px; }
  .header { height: auto; min-height: var(--header-height); }
  .header-inner { flex-wrap: wrap; align-content: center; padding: 10px 16px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .header-search { max-width: none; min-width: 220px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-content, .search-page, .publish-page, .profile-page, .detail-page { padding-left: 16px !important; padding-right: 16px !important; }
  .main-layout, .search-layout, .publish-layout, .profile-layout, .detail-layout { grid-template-columns: 1fr !important; }
  .info-grid, .result-grid, .similar-grid { grid-template-columns: 1fr !important; }
  .category-grid, .type-grid, .quick-entry, .data-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 768px) {
  .logo span, .header-username { display: none; }
  .header-search { order: 4; width: 100%; }
  .header-right { margin-left: 0; flex-wrap: wrap; }
  .hero-title { font-size: 28px !important; }
  .hero-search, .search-bar-large { flex-wrap: wrap; }
  .hero-search select, .search-bar-large select, .hero-search input, .search-bar-large input, .hero-search-btn, .search-btn { width: 100%; }
  .hero-stats, .trust-section, .ai-card, .profile-hero, .search-meta, .list-header, .content-header { flex-direction: column !important; align-items: stretch !important; }
  .ai-right, .profile-stats { width: 100%; justify-content: space-around; }
  .category-grid, .type-grid, .quick-entry, .data-cards, .footer-grid, .form-row, .form-row.three, .info-imgs { grid-template-columns: 1fr !important; }
  .table-wrap, .publish-table { overflow-x: auto; }
}
