:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-focus: rgba(37, 99, 235, 0.15);
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #cbd5e1;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部导航栏 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.brand-title span {
  color: var(--primary);
}

.nav-search {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.nav-search input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.nav-search input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-focus);
}

.nav-search .search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-focus);
}

.btn-outline-primary {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.2);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* 主内容容器 */
.main-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  width: 100%;
  flex: 1;
}

/* 分类胶囊导航 */
.category-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.category-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.category-card.active {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), var(--shadow);
}

.category-card.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
}

.cat-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.category-card.active .cat-icon-box,
.category-card:hover .cat-icon-box {
  background: var(--primary-light);
  color: var(--primary);
}

.cat-info {
  flex: 1;
  min-width: 0;
}

.cat-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.category-card.active .cat-badge {
  background: var(--primary-light);
  color: var(--primary);
}

/* 多维筛选栏 */
.filter-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
  gap: 1rem;
}
.filter-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.filter-row:first-child {
  padding-top: 0;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 70px;
  flex-shrink: 0;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.filter-chip {
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-main);
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  border: 1px solid transparent;
}

.filter-chip:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.filter-chip.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  border-color: rgba(37, 99, 235, 0.2);
}

.price-custom-input {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
}

.price-custom-input input {
  width: 70px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  outline: none;
}
.price-custom-input input:focus {
  border-color: var(--primary);
}

/* 列表控制与状态条 */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.list-stats {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.list-stats strong {
  color: var(--primary);
  font-weight: 700;
}

.sort-select {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}
.sort-select:focus {
  border-color: var(--primary);
}

/* 信息卡片网格 */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-lg);
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  background: #e2e8f0;
  overflow: hidden;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .card-img-wrapper img {
  transform: scale(1.04);
}

.card-img-count {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.card-category-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
}

.card-status-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(16, 185, 129, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}
.card-status-badge.completed {
  background: rgba(100, 116, 139, 0.9);
}

.card-body {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.card-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: #dc2626;
  font-feature-settings: "tnum";
}

.card-price-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc2626;
  margin-left: 0.15rem;
}

.card-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}

.tag-pill {
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: auto;
}

.card-publisher {
  color: var(--text-muted);
  font-weight: 500;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  grid-column: 1 / -1;
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* 模态框通用 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.96) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-overlay.open .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #fcfdfe;
}

/* 详情页画廊与参数 */
.detail-gallery {
  margin-bottom: 1.25rem;
}

.detail-main-img {
  width: 100%;
  height: 360px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  background: #000;
}

.detail-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.detail-thumb {
  width: 70px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  opacity: 0.7;
}
.detail-thumb:hover,
.detail-thumb.active {
  opacity: 1;
  border-color: var(--primary);
}

.detail-price-box {
  background: var(--primary-light);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.detail-price-huge {
  font-size: 1.8rem;
  font-weight: 800;
  color: #dc2626;
}

.detail-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-key {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.spec-val {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.detail-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.25rem 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-desc-text {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.7;
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.contact-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* 发布表单 */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-label .required {
  color: var(--danger);
  margin-left: 0.2rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-focus);
}

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

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

.cat-select-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.cat-select-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.cat-select-card:hover {
  border-color: var(--primary);
}

.cat-select-card.active {
  background: var(--primary-light);
  border-color: var(--primary);
  font-weight: 700;
  color: var(--primary);
}

.dynamic-fields-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1.1rem;
}

/* 图片上传器 */
.upload-dropzone {
  border: 2px dashed var(--border-focus);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--bg-subtle);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.upload-preview-item {
  position: relative;
  width: 100%;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-remove-btn {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideUp 0.3s ease forwards;
  pointer-events: auto;
}

.toast.success { background: #065f46; color: #ecfdf5; border-left: 4px solid #10b981; }
.toast.error { background: #991b1b; color: #fef2f2; border-left: 4px solid #ef4444; }
.toast.warning { background: #92400e; color: #fffbeb; border-left: 4px solid #f59e0b; }

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

/* 页脚 */
.footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 2rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 响应式适配 */
@media (max-width: 768px) {
  .nav-container {
    flex-wrap: wrap;
  }
  .nav-search {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin-top: 0.25rem;
  }
  .posts-grid {
    grid-template-columns: 1fr;
  }
  .modal-container {
    max-height: 95vh;
  }
  .detail-main-img {
    height: 240px;
  }
}
