/* 页面基础样式 */
body {
  margin: 0;
  font-family: "微软雅黑", Arial, sans-serif;
  background: #ede9e6;
  color: #222;
}

/* 顶部导航栏 - 统一管理后台样式 */
.header-container {
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #f0f0f0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 15px 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.top-nav-item {
  color: #666;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 18px;
  transition: all 0.3s ease;
  position: relative;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.top-nav-item:hover {
  color: #ff8000;
  background: rgba(255,128,0,0.1);
  transform: translateY(-1px);
}

.top-nav-item.active {
  color: #ff8000;
  background: rgba(255,128,0,0.15);
  font-weight: 600;
}

.top-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: #ff8000;
  border-radius: 1px;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .header-content {
    padding: 0 10px;
  }
  
  .top-nav {
    flex-wrap: nowrap;
    gap: 0;
    padding: 10px 0;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .top-nav-item {
    font-size: 1.1rem;
    padding: 8px 10px;
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 8px;
  }
  
  .top-nav {
    padding: 8px 0;
    gap: 0;
  }
  
  .top-nav-item {
    font-size: 1.1rem;
    padding: 6px 8px;
    margin: 0;
    border-radius: 12px;
  }
}

@media (max-width: 360px) {
  .header-content {
    padding: 0 5px;
  }
  
  .top-nav {
    padding: 6px 0;
  }
  
  .top-nav-item {
    font-size: 1.1rem;
    padding: 4px 6px;
    margin: 0;
    border-radius: 10px;
  }
}

/* 分类选择按钮 */
.category-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px 0;
  justify-content: flex-start;
}
.cat-btn {
  padding: 7px 20px;
  border: none;
  background: #fff;
  color: #ff8000;
  border-radius: 18px;
  font-size: 1.1rem;
  cursor: pointer;
  border: 2px solid #ff8000;
  transition: background 0.2s, color 0.2s;
  font-weight: 500;
}
.cat-btn.selected, .cat-btn:active {
  background: #ff8000;
  color: #fff;
  font-weight: bold;
}

/* 发布表单卡片 */
.publish-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #eee;
  padding: 18px 12px 12px 12px;
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.publish-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.publish-form textarea {
  width: 100%;
  min-height: 90px;
  border-radius: 10px;
  border: 1.5px solid #eee;
  padding: 10px;
  font-size: 1.1rem;
  resize: vertical;
  box-sizing: border-box;
}
.publish-form input[type="text"], 
.publish-form input[type="input"], 
.publish-form input[type='file'], 
.publish-form input[type="password"], 
.publish-form input[type="number"], 
.publish-form input[name="contact"], 
.publish-form input[name="address"], 
.publish-form input[name="price"] {
  width: 100%;
  border-radius: 10px;
  border: 1.5px solid #eee;
  padding: 10px;
  font-size: 1.1rem;
  box-sizing: border-box;
}

/* 图片上传区域和缩略图 */
.img-upload-area {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 0 0;
}
.img-upload-btn {
  width: 90px;
  height: 90px;
  border: 2px dashed #ff8000;
  border-radius: 12px;
  background: #fff7f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ff8000;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  transition: border 0.2s;
}
.img-upload-btn:hover {
  border: 2.5px solid #ff8000;
  background: #fff2e0;
}
.img-upload-btn svg {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}
.img-thumb {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
  border: 1.5px solid #eee;
  position: relative;
}
.img-thumb-wrap {
  position: relative;
  display: inline-block;
}
.img-thumb-del {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff8000;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* 支付发布按钮（底部悬浮） */
.publish-btn-fixed {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  background: #ff8000;
  color: #fff;
  border: none;
  border-radius: 0;
  padding: 18px 0;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 -2px 8px #ff800033;
  z-index: 999;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.publish-btn-fixed:hover {
  background: #ff9900;
}

/* 卡片内容样式 */
.card {
  background: #fff;
  margin: 15px 10px 15px 10px;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px #eee;
}
img {
  max-width: 100%;
  border-radius: 8px;
}

/* 底部导航栏 */
.bottom-nav {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  height: 60px;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}
.nav-item {
  flex: 1;
  text-align: center;
  color: #888;
  font-size: 12px;
  text-decoration: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.nav-item img {
  width: 26px;
  height: 26px;
  margin-bottom: 2px;
}
.nav-item span {
  margin-top: 2px;
}
.nav-publish {
  position: relative;
  top: -22px;
  z-index: 101;
  background: none;
}
.publish-btn {
  width: 48px;
  height: 48px;
  background: #ff8000;
  color: #fff;
  border-radius: 50%;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2px auto;
  box-shadow: 0 2px 8px #ff800033;
  border: 4px solid #fff;
}
.nav-publish span {
  color: #ff8000;
  font-weight: bold;
  margin-top: 0;
}

/* 图片容器样式 */
.image-container {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: calc(33.333% - 6px);
}

.image-container img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.image-container img:hover {
  transform: scale(1.02);
}

/* 响应式 */
@media (max-width: 600px) {
  .publish-card { max-width: 100vw; }
  .publish-btn-fixed { font-size: 1.05rem; }
  .card { margin: 10px 2vw 10px 2vw; }
  html { font-size: 14px; }
  
  .image-container {
    max-width: calc(50% - 4px);
  }
  
  .image-container img {
    height: 100px;
  }
}

@media (max-width: 480px) {
  .image-container {
    max-width: calc(50% - 4px);
  }
  
  .image-container img {
    height: 90px;
  }
}



.img-upload-area {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 0 0;
}
.img-upload-btn {
  width: 90px;
  height: 90px;
  border: 2px dashed #ff8000;
  border-radius: 12px;
  background: #fff7f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ff8000;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  transition: border 0.2s;
}
.img-upload-btn:hover {
  border: 2.5px solid #ff8000;
  background: #fff2e0;
}
.img-upload-btn svg {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}
.img-thumb {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
  border: 1.5px solid #eee;
  position: relative;
}
.img-thumb-wrap {
  position: relative;
  display: inline-block;
}
.img-thumb-del {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff8000;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}




.comment-bottom-bar {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  height: 56px;
  background: #fff;
  border-top: 1.5px solid #eee;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1001;
  box-shadow: 0 -2px 8px #eee;
}
.comment-bar-btn {
  flex: 1;
  text-align: center;
  color: #888;
  font-size: 13px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  font-weight: 500;
}
.comment-bar-btn span {
  margin-top: 2px;
  font-size: 13px;
}
.comment-bar-btn:active span,
.comment-bar-btn:focus span {
  color: #ff8000;
}
.comment-bar-btn svg {
  display: block;
  margin: 0 auto;
}




.comment-bottom-bar {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  height: 56px;
  background: #fff;
  border-top: 1.5px solid #eee;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1001;
  box-shadow: 0 -2px 8px #eee;
}
.comment-bar-btn {
  flex: 1;
  text-align: center;
  color: #888;
  font-size: 13px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  font-weight: 500;
}
.comment-bar-btn span {
  margin-top: 2px;
  font-size: 13px;
}
.comment-bar-btn:active span,
.comment-bar-btn:focus span {
  color: #ff8000;
}
.comment-bar-btn svg {
  display: block;
  margin: 0 auto;
}