/* ============================================================
   乡镇邻里便民信息站 - 全局样式
   设计原则：老年人友好（大字体、高对比度、布局清晰）
   ============================================================ */

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 18px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #2c3e50;
  background: linear-gradient(180deg, #f0f7e8 0%, #f8faf4 100%);
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
a { color: #2d7a45; text-decoration: none; transition: color 0.2s; }
a:hover { color: #1a5a30; text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ---------- 布局容器 ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  background: linear-gradient(135deg, #2d7a45 0%, #3d9e55 100%);
  color: #fff;
  padding: 10px 0;
  box-shadow: 0 2px 12px rgba(45, 122, 69, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.header-user {
  position: absolute;
  top: 8px;
  right: 20px;
  z-index: 101;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.user-greeting {
  color: rgba(255,255,255,0.9);
  font-size: 0.76rem;
}
.user-link {
  color: #fff;
  font-size: 0.76rem;
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 10px;
  transition: all 0.2s;
  white-space: nowrap;
}
.user-link:hover {
  background: rgba(255,255,255,0.2);
  border-color: #fff;
  text-decoration: none;
}

/* 微信二维码悬停弹窗 */
.wechat-qr-wrapper {
  position: relative;
  display: inline-flex;
}
.wechat-icon {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  min-width: 34px;
}
.wechat-icon:hover {
  background: rgba(255,255,255,0.2);
  border-color: #fff;
}
.wechat-qr-popup {
  position: absolute;
  top: 100%;
  right: -5px;
  margin-top: 8px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  padding: 12px;
  text-align: center;
  width: 150px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 200;
}
.wechat-qr-popup::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 14px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 2px;
}
.wechat-qr-wrapper:hover .wechat-qr-popup,
.wechat-qr-wrapper:focus-within .wechat-qr-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.wechat-qr-popup img {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 4px;
}
.wechat-qr-popup-label {
  font-size: 0.75rem;
  color: #2d7a45;
  margin-top: 6px;
  line-height: 1.2;
  font-weight: 500;
  white-space: nowrap;
}
.site-header .container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.site-brand {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  text-align: center;
}
.brand-grains {
  letter-spacing: -0.3em;
  margin-right: 4px;
}
.site-brand:hover { color: #e8f5e9; text-decoration: none; }
.brand-666 {
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(180deg, #ffd700 0%, #ff8c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 2px 3px rgba(255, 200, 0, 0.5));
  display: inline-block;
  margin: 0 2px;
  animation: luckyPulse 2s ease-in-out infinite;
}
@keyframes luckyPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.site-subtitle {
  font-size: 0.76rem;
  font-weight: normal;
  opacity: 0.9;
  margin-left: 8px;
}
.main-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  width: 100%;
  overflow-x: auto;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  color: rgba(255, 255, 255, 0.92);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.main-nav a:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  text-decoration: none;
}
.main-nav a.active {
  background: #fff;
  color: #2d7a45;
  font-weight: 600;
}
.nav-scroll-btn {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  padding: 0;
}
.nav-scroll-btn:hover { background: rgba(255,255,255,0.35); }
.nav-scroll-left { left: 0; }
.nav-scroll-right { right: 0; }
.nav-scroll-wrap {
  position: relative;
  width: 100%;
}

/* ---------- 主体内容 ---------- */
main.container {
  padding-top: 28px;
  padding-bottom: 40px;
  flex: 1;
  width: 100%;
}
.page-title {
  font-size: 1.35rem;
  color: #2d7a45;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 3px solid #c8e0c8;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.home-layout + .page-title {
  margin-left: -20px;
}
.page-title-info {
  font-size: 0.76rem;
  color: #7a8a7a;
  font-weight: normal;
}
.section-title {
  font-size: 1.4rem;
  color: #2d7a45;
  margin: 28px 0 16px;
  padding-left: 14px;
  border-left: 5px solid #2d7a45;
}

/* ---------- 快捷导航 ---------- */
.quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.quick-nav a {
  background: #fff;
  padding: 18px 12px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid #e0ecda;
  transition: all 0.2s;
  font-size: 1.05rem;
  color: #2d7a45;
  font-weight: 500;
}
.quick-nav a:hover {
  background: #2d7a45;
  color: #fff;
  border-color: #2d7a45;
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(45, 122, 69, 0.25);
}
.quick-nav .icon {
  display: block;
  font-size: 1.8rem;
  margin-bottom: 6px;
}

/* ---------- 提示框 ---------- */
.tip-box {
  background: #fff9e6;
  border: 2px solid #ffd966;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
  color: #7a5a00;
  font-size: 1.05rem;
}
.flash-message {
  padding: 14px 18px;
  border-radius: 10px;
  margin: 12px 0;
  font-size: 1.05rem;
  font-weight: 500;
}
.flash-success { background: #e8f5e9; border: 2px solid #81c784; color: #1b5e20; }
.flash-error { background: #ffebee; border: 2px solid #e57373; color: #b71c1c; }

/* ---------- 分隔线 ---------- */
.divider-town {
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #c8e0c8 50%, transparent 100%);
  margin: 32px 0;
}

/* ---------- 筛选栏 ---------- */
.filter-bar {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  line-height: 2;
}
.filter-label {
  font-weight: 600;
  color: #5a6a5a;
  margin-right: 6px;
}
.filter-link {
  padding: 4px 14px;
  border-radius: 16px;
  background: #f0f7e8;
  color: #5a6a5a;
  font-size: 0.76rem;
}
.filter-link:hover {
  background: #c8e0c8;
  color: #2d7a45;
  text-decoration: none;
}
.filter-link.active {
  background: #2d7a45;
  color: #fff;
}

/* ---------- 搜索框 ---------- */
.search-box {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.search-box input[type="text"] {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid #c8e0c8;
  border-radius: 10px;
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-box input[type="text"]:focus { border-color: #2d7a45; }
.search-box button {
  padding: 14px 28px;
  background: #2d7a45;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.search-box button:hover { background: #1a5a30; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-accent { background: #e67e22; color: #fff; }
.btn-accent:hover { background: #d35400; color: #fff; }
.btn-secondary { background: #fff; color: #2d7a45; border: 2px solid #2d7a45; }
.btn-secondary:hover { background: #2d7a45; color: #fff; }
.btn-small { padding: 8px 16px; font-size: 1rem; }

/* ---------- 列表 / 卡片网格 ---------- */
.item-list, .grid-2 {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.grid-2 { grid-template-columns: repeat(6, 1fr); }

/* ---------- 信息卡片 ---------- */
.item-card {
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
  border: 1px solid #e8efe0;
}
.item-card:hover {
  box-shadow: 0 4px 12px rgba(45, 122, 69, 0.1);
  transform: translateY(-2px);
  border-color: #c8e0c8;
}

/* ============================================
   搜索结果卡片（电商风格）
   ============================================ */
.search-card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.search-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.search-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-card-img {
  width: 100%;
  height: 100px;
  overflow: hidden;
  background: #e8f5e9;
  position: relative;
}

.ad-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #e67e22;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.search-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #2d7a45;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.search-card-body {
  padding: 8px 10px;
}

.search-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #2c3e2c;
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-card-desc {
  font-size: 0.68rem;
  color: #8a9a8a;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.65rem;
  color: #8a9a8a;
}

.search-card-footer .badge {
  font-size: 0.65rem;
  padding: 1px 6px;
}

@media (max-width: 1400px) {
  .search-card-grid,
  .grid-2 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .search-card-grid,
  .grid-2 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .search-card-grid,
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .search-card-img {
    height: 120px;
  }
  .item-img-preview {
    height: 120px;
  }
}
.item-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
  line-height: 1.3;
}
.item-title a { color: #2c3e50; }
.item-title a:hover { color: #2d7a45; text-decoration: underline; }
.item-excerpt {
  color: #5a6a5a;
  font-size: 0.68rem;
  margin: 4px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-price {
  font-size: 0.9rem;
  color: #e67e22;
  font-weight: 700;
  margin: 3px 0;
}
.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #8a9a8a;
  font-size: 0.65rem;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e0ecda;
}
.item-img-preview {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #f0f7e8;
}

/* ---------- 徽章 / 标签 ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  background: #e8f5e9;
  color: #2d7a45;
  border-radius: 10px;
  font-size: 0.65rem;
  margin-right: 4px;
  margin-bottom: 3px;
  font-weight: 500;
}
.badge-top {
  background: #e67e22;
  color: #fff;
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #8a9a8a;
  background: #fff;
  border-radius: 12px;
  border: 2px dashed #c8e0c8;
  margin: 20px 0;
}
.empty-state .big-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.6;
}
.empty-state div:last-child {
  font-size: 1.15rem;
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 28px 0;
}
.pagination a {
  padding: 8px 16px;
  background: #fff;
  border: 2px solid #c8e0c8;
  border-radius: 8px;
  color: #5a6a5a;
  font-size: 1.05rem;
  font-weight: 500;
  min-width: 44px;
  text-align: center;
}
.pagination a:hover {
  background: #2d7a45;
  color: #fff;
  border-color: #2d7a45;
  text-decoration: none;
}
.pagination a.current {
  background: #2d7a45;
  color: #fff;
  border-color: #2d7a45;
  font-weight: 700;
}
.pagination a.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- 详情页 ---------- */
.detail-header {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
}
.detail-header h1 {
  font-size: 1.7rem;
  color: #2c3e50;
  margin-bottom: 16px;
  line-height: 1.5;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: #7a8a7a;
  font-size: 1rem;
  padding: 14px 0;
  border-top: 1px dashed #e0ecda;
  border-bottom: 1px dashed #e0ecda;
  margin-top: 14px;
}
.detail-content {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 1.1rem;
  line-height: 2;
  color: #3c4e3c;
}
.detail-content p { margin: 10px 0; }
.detail-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.detail-images img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s;
}
.detail-images img:hover { transform: scale(1.02); }

.detail-info-box {
  background: #f0f7e8;
  border-radius: 12px;
  padding: 18px 22px;
  margin: 18px 0;
}
.detail-info-box .row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px dashed #c8e0c8;
}
.detail-info-box .row:last-child { border-bottom: none; }
.detail-info-box .label {
  min-width: 100px;
  color: #5a6a5a;
  font-weight: 600;
}
.detail-info-box .value {
  flex: 1;
  color: #2c3e50;
}

.back-link {
  display: inline-block;
  margin: 12px 0 20px;
  color: #2d7a45;
  font-weight: 500;
  padding: 6px 0;
}

/* ---------- 留言 / 评论区 ---------- */
.comment-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  margin-top: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.comment-section h2 {
  color: #2d7a45;
  margin-bottom: 16px;
  font-size: 1.4rem;
}
.comment-item {
  padding: 14px 0;
  border-bottom: 1px dashed #e0ecda;
}
.comment-item:last-child { border-bottom: none; }
.comment-meta {
  color: #8a9a8a;
  font-size: 0.76rem;
  margin-bottom: 6px;
}
.comment-content {
  color: #3c4e3c;
  line-height: 1.8;
}

.comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 2px solid #c8e0c8;
  border-radius: 8px;
  font-size: 1.05rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
}
.comment-form textarea:focus { border-color: #2d7a45; }
.comment-form input[type="text"] {
  padding: 10px 12px;
  border: 2px solid #c8e0c8;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  width: 200px;
  max-width: 100%;
}
.comment-form input[type="text"]:focus { border-color: #2d7a45; }
.comment-form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- 表单（发布页） ---------- */
.publish-form {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #3c4e3c;
  margin-bottom: 8px;
}
.form-group label .required {
  color: #e67e22;
  margin-left: 4px;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #c8e0c8;
  border-radius: 8px;
  font-size: 0.76rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.form-group textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #2d7a45; }
.form-group input[type="file"] {
  padding: 8px;
  border: 2px dashed #c8e0c8;
  border-radius: 8px;
  width: 100%;
  font-size: 0.76rem;
}
.form-hint {
  color: #7a8a7a;
  font-size: 0.76rem;
  margin-top: 6px;
}
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.form-actions .btn { min-width: 140px; }

/* ---------- 底部 ---------- */
.site-footer {
  background: linear-gradient(135deg, #2d7a45 0%, #3d9e55 100%);
  color: #e8f5e9;
  padding: 14px 0 14px;
  margin-top: 20px;
  text-align: center;
  width: 100%;
}
.site-footer .container {
  display: block;
}
.footer-left {
  text-align: center;
}
.footer-links {
  margin-bottom: 6px;
  font-size: 0.76rem;
}
.footer-links a {
  color: #fff;
  margin: 0 8px;
}
.footer-links a:hover { text-decoration: underline; }
.footer-text {
  font-size: 0.76rem;
  opacity: 0.9;
  line-height: 1.4;
  white-space: nowrap;
}

/* ---------- 404 页面 ---------- */
.error-page {
  text-align: center;
  padding: 60px 20px;
}
.error-page .big-icon {
  font-size: 6rem;
  margin-bottom: 20px;
}
.error-page h1 {
  font-size: 2.2rem;
  color: #2d7a45;
  margin-bottom: 16px;
}
.error-page p {
  font-size: 1.15rem;
  color: #5a6a5a;
  margin-bottom: 24px;
}

/* ---------- 管理员入口链接 ---------- */
.admin-entry {
  text-align: right;
  margin-top: 8px;
  font-size: 0.76rem;
  opacity: 0.6;
}

/* ============================================================
   管理员后台样式
   ============================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  margin-top: 20px;
  font-size: 0.76rem;
  align-items: start;
}
.admin-sidebar {
  background: #fff;
  border-radius: 12px;
  padding: 16px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  height: fit-content;
}
.admin-sidebar h3 {
  color: #2d7a45;
  font-size: 0.9rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0ecda;
}
.admin-sidebar a {
  display: block;
  padding: 8px 12px;
  color: #5a6a5a;
  border-radius: 8px;
  margin-bottom: 3px;
  font-size: 0.76rem;
}
.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: #2d7a45;
  color: #fff;
  text-decoration: none;
}
.admin-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 0.76rem;
}
.admin-content h1,
.admin-content h2,
.admin-content h3 {
  color: #2d7a45;
}
.admin-content h1 {
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.admin-content h2 {
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.admin-content h3 {
  font-size: 0.8rem;
  margin-bottom: 12px;
}

/* 管理员表格 */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.76rem;
}
.admin-table th,
.admin-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e0ecda;
}
.admin-table th {
  background: #f0f7e8;
  color: #2d7a45;
  font-weight: 600;
}
.admin-table tr:hover td {
  background: #fafdf5;
}
.admin-table .actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-table .actions form { display: inline; }
.admin-btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.76rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}
.admin-btn-edit { background: #fff; color: #2d7a45; border: 1px solid #2d7a45; }
.admin-btn-edit:hover { background: #2d7a45; color: #fff; text-decoration: none; }
.admin-btn-top { background: #fff; color: #e67e22; border: 1px solid #e67e22; }
.admin-btn-top:hover { background: #e67e22; color: #fff; text-decoration: none; }
.admin-btn-approve { background: #fff; color: #2d7a45; border: 1px solid #2d7a45; }
.admin-btn-approve:hover { background: #2d7a45; color: #fff; }
.admin-btn-delete { background: #fff; color: #c0392b; border: 1px solid #c0392b; }
.admin-btn-delete:hover { background: #c0392b; color: #fff; }

/* 管理员统计卡片 */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.stat-card {
  background: linear-gradient(135deg, #f0f7e8 0%, #fff 100%);
  border: 2px solid #c8e0c8;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.stat-card .num {
  font-size: 2.2rem;
  font-weight: 700;
  color: #2d7a45;
  margin-bottom: 6px;
}
.stat-card .label {
  font-size: 1rem;
  color: #5a6a5a;
}

/* 登录页 */
.login-page {
  max-width: 500px;
  margin: 60px auto;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.login-page h1 {
  text-align: center;
  color: #2d7a45;
  margin-bottom: 12px;
  font-size: 0.76rem;
}
.login-page .btn {
  width: 100%;
  padding: 8px;
  font-size: 0.76rem;
}
.login-page .form-group {
  margin-bottom: 12px;
}
.login-page .form-group label {
  margin-bottom: 4px;
  font-size: 0.76rem;
}
.login-page .form-group input {
  padding: 8px 12px;
  font-size: 0.76rem;
}

/* ---------- 首页搜索栏（固定悬浮，独立于容器）---------- */
.home-sidebar {
  position: fixed;
  left: 0;
  top: 235px;
  max-height: calc(100vh - 235px - 60px);
  overflow-y: auto;
  z-index: 99;
  width: 270px;
  padding: 12px 12px 12px 16px;
  background: #f5f8f2;
  border-right: 1px solid #e0e8d8;
  border-radius: 0 12px 12px 0;
  box-shadow: 2px 0 16px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- 首页布局（全宽）---------- */
.home-page {
  display: flex;
  gap: 0;
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  flex: 1;
}

.home-content {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
  margin-left: 270px;
}

.sidebar-row {
  display: flex;
  gap: 16px;
}

.sidebar-col {
  flex: 1;
  min-width: 0;
}

.sidebar-title {
  color: #2d7a45;
  font-size: 0.76rem;
  margin-bottom: 4px;
  padding-bottom: 3px;
  border-bottom: 2px solid #c8e0c8;
  white-space: nowrap;
}

.check-item {
  display: flex;
  align-items: center;
  padding: 3px 6px;
  border-radius: 5px;
  background: #f0f7e8;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  font-size: 0.76rem;
  margin-bottom: 2px;
}

.check-item:hover {
  background: #c8e0c8;
}

.check-item input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin-right: 4px;
  accent-color: #2d7a45;
  flex-shrink: 0;
}

.check-item input[type="checkbox"]:checked + span {
  color: #2d7a45;
  font-weight: 600;
}

.check-item span {
  color: #3c4e3c;
}

.sidebar-search-btn {
  padding: 6px 8px;
  font-size: 0.76rem;
}

.sidebar-keyword-form {
  display: flex;
  gap: 6px;
  width: 100%;
}

.sidebar-keyword-form input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 2px solid #c8e0c8;
  border-radius: 6px;
  font-size: 0.76rem;
  outline: none;
}

.sidebar-keyword-form input:focus {
  border-color: #2d7a45;
}

.sidebar-keyword-form .btn-small {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 0.76rem;
}

.search-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.placeholder-icon {
  font-size: 4rem;
  color: #8a9a8a;
  margin-bottom: 16px;
}

.placeholder-text {
  font-size: 1.5rem;
  color: #5a6a5a;
  font-weight: 600;
  margin-bottom: 12px;
}

.placeholder-hint {
  font-size: 1rem;
  color: #8a9a8a;
}

/* ---------- 首页广告位 ---------- */
.ad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(50vh - 50px);
  background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%);
  border: 2px dashed #e0c870;
  border-radius: 12px;
  padding: 26px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.ad-label {
  font-size: 0.76rem;
  color: #c0a050;
  background: #fff;
  padding: 2px 12px;
  border-radius: 10px;
  border: 1px solid #e0c870;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.ad-content {
  font-size: 1rem;
  color: #8a7a4a;
  font-weight: 600;
  text-align: center;
  line-height: 1.6;
}

.results-header {
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 1rem;
  color: #5a6a5a;
}

.results-header strong {
  color: #2d7a45;
}

.result-filter {
  background: #e8f5e9;
  padding: 6px 12px;
  border-radius: 16px;
  color: #2d7a45;
  font-size: 0.76rem;
}

/* ---------- 认证页面 ---------- */
.auth-page {
  max-width: 700px;
  margin: 40px auto;
}
.auth-form-wrapper {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.auth-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.auth-box {
  background: #f8faf6;
  border: 1px solid #e8f0e4;
  border-radius: 8px;
  padding: 14px;
}
.auth-box-left {
  flex: 1;
}
.auth-box-right {
  flex: 1;
}
.auth-box-bottom {
  text-align: center;
  padding: 14px 20px;
  background: #f0f6ec;
  border-top: 2px solid #c8e0c8;
  border-radius: 0 0 10px 10px;
}
.auth-form .form-group {
  margin-bottom: 20px;
}
.auth-form .form-group:last-child {
  margin-bottom: 0;
}
.auth-form .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #3c4e3c;
  font-size: 0.85rem;
}
.auth-form input[type="text"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #c8e0c8;
  border-radius: 10px;
  font-size: 0.85rem;
  outline: none;
}
.auth-form input:focus {
  border-color: #2d7a45;
}
.auth-form input::placeholder {
  font-size: 0.85rem;
}
.code-row {
  display: flex;
  gap: 8px;
}
.code-row input {
  flex: 1;
}
.code-row button {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.76rem;
  padding: 8px 10px;
}
/* 密码输入框 + 眼睛按钮 */
.pwd-wrap {
  position: relative;
}
.pwd-wrap input {
  width: 100%;
  padding-right: 40px;
}
.pwd-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 1;
}
.pwd-toggle:hover {
  opacity: 1;
}
.auth-submit {
  width: 100%;
  padding: 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.auth-footer {
  color: #8a9a8a;
  font-size: 0.76rem;
}
.auth-footer a {
  color: #2d7a45;
  font-weight: 600;
}

/* ---------- 用户中心页面 ---------- */
.profile-layout {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}
.profile-sidebar {
  width: 20%;
  min-width: 200px;
  flex-shrink: 0;
}
.profile-main {
  flex: 1;
  min-width: 0;
}
.profile-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.profile-avatar {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.profile-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d7a45;
  margin-bottom: 4px;
}
.profile-phone {
  font-size: 0.76rem;
  color: #7a8a7a;
}
.profile-stats {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.profile-stat-item {
  display: flex;
  flex-direction: column;
}
.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d7a45;
}
.stat-label {
  font-size: 0.76rem;
  color: #7a8a7a;
  margin-top: 2px;
}
.profile-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.profile-section-title {
  font-size: 0.85rem;
  color: #3c4e3c;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e8f5e9;
}
.category-stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.category-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  padding: 4px 0;
}
.category-stat-name {
  color: #5a6a5a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}
.category-stat-count {
  font-weight: 600;
  color: #2d7a45;
  background: #f0f7e8;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
}
.empty-small {
  text-align: center;
  color: #aaa;
  font-size: 0.76rem;
  padding: 12px 0;
}
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.profile-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.profile-header-left h2 {
  color: #2d7a45;
  font-size: 1.3rem;
  margin: 0;
}
.total-badge {
  background: #f0f7e8;
  color: #2d7a45;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 600;
}
.btn-new-post {
  padding: 6px 16px !important;
  font-size: 0.8rem !important;
  border-radius: 8px !important;
}
.profile-search {
  display: flex;
  gap: 6px;
}
.profile-search input {
  padding: 6px 10px;
  border: 1px solid #c8e0c8;
  border-radius: 6px;
  font-size: 0.76rem;
  width: 180px;
  outline: none;
}
.profile-search input:focus {
  border-color: #2d7a45;
}
.my-post-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.my-post-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  gap: 12px;
}
.my-post-main {
  flex: 1;
  min-width: 0;
}
.my-post-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.my-post-badge {
  background: #e8f5e9;
  color: #2d7a45;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.my-post-title {
  color: #2c3e50;
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-post-title:hover {
  color: #2d7a45;
  text-decoration: none;
}
.my-post-meta {
  display: flex;
  gap: 14px;
  color: #7a8a7a;
  font-size: 0.7rem;
  flex-wrap: wrap;
}
.my-post-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.my-post-actions .btn-small {
  padding: 4px 10px;
  font-size: 0.7rem;
}

.user-page {
  max-width: 800px;
  margin: 20px auto;
}
.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.user-header h2 {
  color: #2d7a45;
  font-size: 1.4rem;
}
.user-actions {
  display: flex;
  gap: 10px;
}
.user-info-bar {
  background: #f0f7e8;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  gap: 24px;
  color: #5a6a5a;
  font-size: 0.76rem;
}
.item-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}
.btn-danger {
  background: #e74c3c;
  color: #fff;
}
.btn-danger:hover {
  background: #c0392b;
}

/* ---------- 发帖页面 ---------- */
.create-page {
  max-width: 900px;
  margin: 20px auto;
}
.publish-form {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.publish-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.publish-col {
  flex: 1;
}
.publish-form .form-group {
  margin-bottom: 14px;
}
.publish-form .form-group:last-child {
  margin-bottom: 0;
}
.publish-form .form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: #3c4e3c;
  font-size: 0.76rem;
}
.publish-form select,
.publish-form input[type="text"],
.publish-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #c8e0c8;
  border-radius: 8px;
  font-size: 0.76rem;
  outline: none;
  font-family: inherit;
}
.publish-form select:focus,
.publish-form input:focus,
.publish-form textarea:focus {
  border-color: #2d7a45;
}
.publish-form input[type="file"] {
  font-size: 0.76rem;
}
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #c8e6c9;
  border-radius: 10px;
  padding: 24px;
  background: #f5faf5;
  cursor: pointer;
  transition: all 0.3s;
}
.upload-area:hover {
  border-color: #2d7a45;
  background: #e8f5e9;
}
.upload-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}
.upload-text {
  font-size: 0.82rem;
  color: #2d7a45;
  font-weight: 600;
}
.upload-hint {
  font-size: 0.72rem;
  color: #999;
  margin-top: 4px;
}
.img-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.img-preview-item {
  position: relative;
  width: 100%;
  padding-top: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
}
.img-preview-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-preview-item.is-cover {
  border: 2px solid #2d7a45;
}
.cover-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #2d7a45;
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  z-index: 2;
}
.img-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.img-remove-btn:hover { background: #e74c3c; }
@media (max-width: 600px) {
  .img-preview-grid { grid-template-columns: repeat(3, 1fr); }
}
.required {
  color: #e74c3c;
}
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.form-actions .btn {
  padding: 10px 24px;
}

/* ---------- 帖子详情页 ---------- */
.detail-page {
  max-width: 1100px;
  margin: 20px auto;
  font-size: 0.76rem;
}
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.detail-left {
  position: sticky;
  top: 20px;
}
.detail-main-image {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
.detail-main-image img {
  max-width: 100%;
  max-height: 500px;
  border-radius: 8px;
  cursor: pointer;
  object-fit: contain;
}
.detail-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.detail-thumbs .thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.detail-thumbs .thumb:hover {
  border-color: #c8e0c8;
}
.detail-thumbs .thumb.active {
  border-color: #2d7a45;
}
.detail-no-image {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 60px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  text-align: center;
  color: #b0c0b0;
  font-size: 0.76rem;
}
.detail-right {
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.detail-header {
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin: 0;
}
.detail-header .badge {
  display: inline-block;
  padding: 2px 8px;
  background: #e8f5e9;
  color: #2d7a45;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.detail-header h2 {
  font-size: 0.76rem;
  margin: 2px 0 6px;
  color: #2c3e50;
  line-height: 1.4;
  font-weight: 700;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #8a9a8a;
  font-size: 0.76rem;
  line-height: 1.4;
  padding: 0;
  border: none;
  margin: 0;
}
.detail-section {
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.detail-section h3 {
  color: #2d7a45;
  font-size: 0.76rem;
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e8efe0;
}
.detail-desc {
  margin: 0;
  line-height: 1.5;
  color: #333;
  font-size: 0.76rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.contact-info {
  font-size: 0.76rem;
  color: #2d7a45;
  font-weight: 600;
  padding: 6px 12px;
  background: #f0f7e8;
  border-radius: 8px;
  display: inline-block;
  margin: 0;
}
.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0;
}
.detail-actions .btn {
  padding: 6px 16px;
  font-size: 0.76rem;
  border-radius: 8px;
}

/* ========================================
   响应式：移动端 (≤768px)
   ======================================== */
@media (max-width: 768px) {
  /* --- 基础 --- */
  html { font-size: 17px; }
  .container { padding: 0 12px; }

  /* --- 头部 --- */
  .site-header .container { gap: 4px; }
  .header-top { flex-wrap: wrap; gap: 6px; }
  .header-user { position: relative; top: auto; right: auto; justify-content: center; gap: 6px; }
  .site-brand { font-size: 1.1rem; }
  .site-subtitle { display: block; margin: 2px 0 0; font-size: 0.76rem; }
  .user-link { font-size: 0.76rem; padding: 3px 8px; }

  /* --- 导航栏：触摸友好横向滚动 --- */
  .main-nav { gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .main-nav a { padding: 10px 12px; font-size: 0.85rem; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
  .nav-scroll-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; font-size: 0.8rem; }
  .nav-scroll-wrap { position: relative; }

  /* --- 标题 --- */
  .page-title { font-size: 1.25rem; }
  .section-title { font-size: 1.2rem; }

  /* --- 快捷导航 --- */
  .quick-nav { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .quick-nav a { padding: 14px 8px; font-size: 1rem; }

  /* --- 网格 / 卡片：单列 --- */
  .grid-2 { grid-template-columns: 1fr; }
  .search-card-grid { grid-template-columns: 1fr; }
  .item-card { padding: 14px 16px; }
  .item-title { font-size: 0.9rem; }
  .item-img-preview { width: 100%; height: 180px; }
  .search-card-img { height: 180px; }

  /* --- 搜索框 --- */
  .search-box { flex-direction: column; }
  .search-box button { width: 100%; }

  /* --- 表单：触摸友好 --- */
  input[type="text"],
  input[type="number"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="url"],
  select,
  textarea { font-size: 16px !important; }
  input[type="text"],
  input[type="number"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="url"],
  select { min-height: 44px; }
  button, .btn { min-height: 44px; min-width: 44px; }
  .form-group { margin-bottom: 16px; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }

  /* --- 管理员后台 --- */
  .admin-layout { grid-template-columns: 1fr; }
  .admin-content { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table { font-size: 0.7rem; }
  .admin-table th,
  .admin-table td { padding: 8px 6px; }
  .admin-sidebar { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
  .admin-sidebar h3 { width: 100%; margin-bottom: 6px; }
  .admin-sidebar a { font-size: 0.72rem; padding: 6px 10px; white-space: nowrap; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }

  /* --- 详情页 --- */
  .detail-layout { grid-template-columns: 1fr; }
  .detail-left { position: static; }
  .detail-header, .detail-section { padding: 16px 18px; }
  .detail-main-image { min-height: 200px; max-height: 250px; }
  .detail-main-image img { max-height: 250px; }
  .detail-images { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .detail-images img { height: 140px; }
  .detail-header h1 { font-size: 1.4rem; }
  .detail-header h2 { font-size: 1.1rem; }
  .detail-meta { flex-direction: column; gap: 6px; }
  .detail-info-box .row { flex-direction: column; }
  .detail-info-box .label { min-width: auto; margin-bottom: 2px; }
  .detail-content { padding: 18px; font-size: 1rem; line-height: 1.8; }

  /* --- 发布页 --- */
  .publish-form { padding: 18px; }
  .publish-row { flex-direction: column; gap: 0; }

  /* --- 首页搜索侧边栏 --- */
  .home-page { width: 100% !important; left: 0; transform: none; order: 1; flex: 0 0 auto; }
  .home-sidebar { position: relative !important; left: auto !important; top: auto !important; max-height: none !important; overflow: visible !important; width: 100% !important; border-radius: 0; box-shadow: none; order: 2; flex: 0 0 auto; }
  .home-content { margin-left: 0; width: 100%; padding: 10px 12px; }
  .site-footer { order: 3; flex: 0 0 auto; }
  .sidebar-row { flex-direction: column; gap: 10px; overflow: visible; }
  .sidebar-col { flex: 1 1 auto; min-width: 0; }
  .sidebar-col .check-item { display: inline-flex; margin-right: 6px; margin-bottom: 4px; }
  .sidebar-keyword-form { flex-direction: row; }

  /* --- 底部 --- */
  .site-footer { text-align: center; padding: 20px 12px; }
  .site-footer .container { flex-direction: column; align-items: center; }
  .footer-left { text-align: center; }
  .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .footer-text { white-space: normal; }

  /* --- 提示消息 --- */
  .flash-message { margin: 8px 0; padding: 12px 14px; font-size: 0.95rem; border-radius: 8px; }

  /* --- 评论区 --- */
  .comment-section { padding: 16px 18px; }
  .comment-form-row { flex-direction: column; align-items: stretch; }
  .comment-form input[type="text"] { width: 100%; }

  /* --- 认证页面 --- */
  .auth-row { flex-direction: column; }
  .auth-page { margin: 20px auto; }
  .auth-form-wrapper { padding: 20px; }

  /* --- 个人中心 --- */
  .profile-layout { flex-direction: column; }
  .profile-sidebar { width: 100%; min-width: auto; }
  .profile-search input { width: 140px; }
  .my-post-item { flex-direction: column; align-items: flex-start; }
  .my-post-actions { align-self: flex-end; }

  /* --- 登录页 --- */
  .login-page { margin: 20px auto; padding: 16px; }

  /* --- 分页 --- */
  .pagination a { padding: 6px 12px; font-size: 0.9rem; min-width: 38px; }

  /* --- 筛选栏 --- */
  .filter-row { flex-direction: column; align-items: flex-start; }

  /* --- 搜索结果 --- */
  .results-header { flex-direction: column; align-items: flex-start; }

  /* --- 搜索占位 --- */
  .search-placeholder { min-height: 200px; padding: 20px; }
  .placeholder-text { font-size: 1.2rem; }

  /* --- 404 页面 --- */
  .error-page h1 { font-size: 1.6rem; }
  .error-page .big-icon { font-size: 4rem; }
}

/* ========================================
   响应式：小屏手机 (≤480px)
   ======================================== */
@media (max-width: 480px) {
  .quick-nav { grid-template-columns: repeat(2, 1fr); }
  .site-brand { font-size: 1.2rem; }
  .brand-grains { display: none; }
  .header-user { font-size: 0.8rem; }
  .main-nav a { padding: 8px 10px; font-size: 0.78rem; }
  .nav-scroll-btn { width: 26px; height: 26px; font-size: 0.7rem; }
  .search-card-img { height: 150px; }
  .item-img-preview { height: 150px; }
  .detail-main-image { max-height: 200px; }
  .detail-main-image img { max-height: 200px; }
  .admin-stats { grid-template-columns: 1fr; }
  .pagination a { padding: 5px 10px; font-size: 0.8rem; min-width: 34px; }
  .pagination { gap: 4px; }
  .img-preview-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-thumbs .thumb { width: 56px; height: 56px; }
}

/* ========================================
   响应式：平板 (≤1024px)
   ======================================== */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .search-card-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { gap: 16px; }
  .admin-layout { grid-template-columns: 160px 1fr; gap: 14px; }
  .home-content { padding: 16px 20px; }
}

/* ========================================
   触摸设备友好增强
   ======================================== */
@media (hover: none) and (pointer: coarse) {
  a, button, .btn, .nav-scroll-btn, .item-card, .search-card {
    cursor: pointer;
  }
  input[type="text"],
  input[type="number"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px; /* 防止 iOS 聚焦时缩放 */
  }
  button, .btn {
    min-height: 44px;
    min-width: 44px;
  }
}
