@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

* { box-sizing: border-box; }
body {
  margin: 0;
  padding-top: 56px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
  line-height: 1.6;
}
a { color: #333; text-decoration: none; }
a:hover { color: #000; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* 导航吸顶 */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.nav {
  background: #fff;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.logo { font-size: 18px; font-weight: 700; color: #000; }
.nav-links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.nav-links a,
.nav-user-link {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: #555;
  line-height: 1;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active,
.nav-user-link:hover { color: #000; }
.nav-links a.active { font-weight: 600; }
#nav-user { display: contents; }

/* 手机底部导航（桌面隐藏） */
#mobile-nav-wrap { display: none; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: all .2s;
}
.btn:hover { background: #f0f0f0; border-color: #999; }
.btn-primary { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.btn-primary:hover { background: #333; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 卡片 */
.card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.card-title { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.card-meta { font-size: 13px; color: #888; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: #eee;
  color: #555;
  margin-right: 6px;
}
.tag-supply { background: #e8e8e8; color: #333; }
.tag-demand { background: #d0d0d0; color: #111; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; color: #555; margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: #1a1a1a;
}
.form-control:focus { outline: none; border-color: #999; }
textarea.form-control { min-height: 120px; resize: vertical; }

/* 筛选标签（三行） */
.filter-bar { margin-bottom: 20px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-row:last-child { margin-bottom: 0; }

.tabs { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid #d9d9d9;
  background: #fff;
  cursor: pointer;
  color: #1a1a1a;
  user-select: none;
  line-height: 1;
  transition: background .15s, border-color .15s, color .15s;
}
.tab .tab-icon {
  font-size: 12px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.75;
}
.tab.active .tab-icon { opacity: 1; }
.tab:hover { border-color: #999; }
.tab.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* 页面标题 */
.page-title { font-size: 22px; font-weight: 700; margin: 24px 0 16px; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: #999; }

/* Toast */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 24px 0; }
.pagination button {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.pagination button.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* 分类入口 */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.cat-item {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.cat-item:hover { border-color: #999; box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.cat-item h3 { margin: 0 0 4px; font-size: 16px; }
.cat-item p { margin: 0; font-size: 13px; color: #888; }

/* 详情 */
.detail-section { margin-bottom: 20px; }
.detail-section h3 { font-size: 15px; color: #555; margin: 0 0 8px; }
.contact-box {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
}
.guest-tip {
  background: #f0f0f0;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

/* 后台 */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; }
.admin-table th { background: #fafafa; color: #555; font-weight: 600; }
.child-row td:first-child { padding-left: 32px; }

/* 响应式 */
/* 图片 */
.img-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.post-img { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid #e0e0e0; }
.upload-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.upload-item { position: relative; width: 80px; height: 80px; }
.upload-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid #ddd; }
.upload-item .remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #333; color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 14px; padding: 20px; text-align: center; }
.stat-card .num { font-size: 28px; font-weight: 700; color: #000; }
.stat-card .label { font-size: 13px; color: #888; margin-top: 4px; }

/* 用户头像 */
.user-avatar {
  display: block;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: #f0f0f0;
  flex-shrink: 0;
}
.user-avatar-sm { width: 24px; height: 24px; }
.user-avatar-md { width: 80px; height: 80px; }
.user-avatar-lg { width: 96px; height: 96px; }
.nav-user-link { gap: 6px; }
.nav-user-link span { line-height: 1; }
.avatar-setting {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.avatar-setting-preview {
  position: relative;
  cursor: pointer;
}
.avatar-setting-preview input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.avatar-setting-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.avatar-setting-tip { font-size: 13px; color: #888; margin: 0; }

/* 个人中心 Tab */
.center-tabs { display: flex; gap: 0; border-bottom: 1px solid #e0e0e0; margin-bottom: 20px; }
.center-tab { padding: 12px 24px; font-size: 14px; cursor: pointer; color: #888; border-bottom: 2px solid transparent; }
.center-tab.active { color: #000; border-bottom-color: #000; font-weight: 600; }

/* 首页模拟动态消息 */
.live-feed-wrap {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}
.live-feed-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  min-height: 40px;
}
.live-feed-label {
  font-size: 12px;
  color: #666;
  background: #f0f0f0;
  padding: 3px 10px;
  border-radius: 8px;
  flex-shrink: 0;
  font-weight: 600;
}
.live-feed-text {
  flex: 1;
  font-size: 13px;
  color: #555;
  overflow: hidden;
  height: 20px;
  line-height: 20px;
  position: relative;
}
.live-feed-item {
  position: absolute;
  left: 0;
  right: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s, transform .35s;
}
.live-feed-item.active {
  opacity: 1;
  transform: translateY(0);
}
.live-feed-item a { color: #333; }
.live-feed-item a:hover { color: #000; text-decoration: underline; }

/* 滚动广告 Banner */
.ad-banner-wrap {
  background: #1a1a1a;
  color: #fff;
  overflow: hidden;
  border-bottom: 1px solid #333;
}
.ad-banner {
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ad-banner-track {
  display: flex;
  width: max-content;
  animation: banner-scroll 35s linear infinite;
}
.ad-banner-track:hover { animation-play-state: paused; }
.ad-banner-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 10px 0;
}
.ad-banner-item {
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  padding: 0 8px;
  opacity: .92;
}
.ad-banner-item:hover { opacity: 1; text-decoration: underline; }
.ad-banner-dot {
  color: #666;
  padding: 0 16px;
  user-select: none;
}
@keyframes banner-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* 轮播广告 */
.carousel-wrap {
  position: relative;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}
.carousel-viewport {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
}
.carousel-slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.carousel-slide-text {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  color: #fff;
  text-align: center;
}
.carousel-slide-text span {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .5px;
}
.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  cursor: pointer;
}
.carousel-dot.active { background: #fff; }

/* 置顶 / VIP 标识 */
.post-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
  flex-shrink: 0;
  line-height: 1;
}
.icon-pin,
.icon-vip {
  display: block;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}
.icon-pin { height: 14px; }
.icon-vip { height: 12px; }
.card.card-top { border-color: #bbb; }
.card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}
.user-name-vip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: middle;
  line-height: 1.4;
}
.card-title-row .card-title { flex: 1; margin: 0; line-height: 1.4; }

@media (max-width: 640px) {
  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  #nav .nav-links { display: none !important; }
  #nav .nav-inner { justify-content: center; }
  #mobile-nav-wrap {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .06);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-nav {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 56px;
    max-width: 100%;
    margin: 0 auto;
  }
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 0 6px;
    font-size: 11px;
    color: #888;
    border: none;
    background: none;
    cursor: pointer;
    min-width: 0;
  }
  .mobile-nav-item i { font-size: 20px; line-height: 1; }
  .mobile-nav-item.active { color: #000; font-weight: 600; }
  .mobile-nav-publish { margin-top: -18px; }
  .mobile-nav-publish-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  }
  .mobile-nav-publish.active .mobile-nav-publish-btn { background: #333; }
  .center-mobile-menu { margin-bottom: 16px; }
  .center-mobile-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .center-mobile-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    text-align: center;
  }
  .center-mobile-link i { font-size: 18px; color: #555; }
  .filter-bar { margin-left: -16px; margin-right: -16px; }
  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 8px;
    padding: 0 16px;
  }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-row .tab {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .live-feed-inner { padding: 8px 12px; gap: 8px; }
  .live-feed-label { font-size: 11px; padding: 2px 8px; }
  .live-feed-text { font-size: 12px; }
  .ad-banner-item { font-size: 13px; padding: 0 6px; }
  .ad-banner-dot { padding: 0 12px; }
  .ad-banner-group { padding: 8px 0; }
  .icon-pin { height: 12px; }
  .icon-vip { height: 11px; }
  .carousel-viewport { height: 160px; }
  .carousel-slide-text span { font-size: 16px; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 641px) {
  .center-mobile-menu { display: none; }
}
