/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f2d3d;
  background: #f5f7fa;
}
a { text-decoration: none; color: inherit; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.btn {
  border: none; cursor: pointer; border-radius: 6px;
  padding: 10px 20px; font-size: 14px; transition: 0.2s;
}
.btn-primary { background: #1a5fa8; color: #fff; }
.btn-primary:hover { background: #14497f; }
.btn-outline { background: #fff; color: #1a5fa8; border: 1px solid #1a5fa8; }

/* ============ 顶部导航 ============ */
.header { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; height: 60px; gap: 32px; }
.logo { font-size: 20px; font-weight: 700; color: #1a5fa8; }
.logo-en {
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
  color: #6b9ccb; border: 1px solid #cfe0f0; border-radius: 4px;
  padding: 1px 5px; margin-left: 4px; vertical-align: 2px;
}
.nav { display: flex; gap: 24px; flex: 1; }
.nav-link { font-size: 15px; color: #5a6b7b; padding: 6px 0; }
.nav-link.active, .nav-link:hover { color: #1a5fa8; border-bottom: 2px solid #1a5fa8; }

/* ============ 横幅 ============ */
.hero {
  background: linear-gradient(135deg, #0d3b66 0%, #1a5fa8 100%);
  color: #fff; padding: 56px 0; text-align: center;
}
.hero h1 { font-size: 32px; margin-bottom: 10px; }
.hero p { opacity: 0.85; margin-bottom: 28px; }
.search-box { display: flex; max-width: 560px; margin: 0 auto; }
.search-box input {
  flex: 1; border: none; border-radius: 6px 0 0 6px; padding: 12px 16px; font-size: 14px; outline: none;
}
.search-box .btn { border-radius: 0 6px 6px 0; }

/* ============ 分类 ============ */
.categories { margin-top: 32px; }
.section-title { font-size: 20px; margin-bottom: 16px; }
.category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.category-card {
  background: #fff; border-radius: 8px; padding: 28px 14px; text-align: center;
  cursor: pointer; transition: 0.2s; border: 1px solid transparent;
}
.category-card:hover { border-color: #1a5fa8; transform: translateY(-2px); }
.category-card .icon { font-size: 36px; }
.category-card .name { margin-top: 10px; font-size: 15px; color: #33445a; }
.category-card .desc { margin-top: 6px; font-size: 12px; color: #9aa8b6; line-height: 1.5; }
@media (max-width: 880px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 540px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 商品 ============ */
.goods-section { margin: 32px auto 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.goods-count { font-size: 13px; color: #8492a6; }
.filter-bar { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.filter-tag {
  padding: 6px 14px; border-radius: 16px; background: #fff; font-size: 13px;
  color: #5a6b7b; cursor: pointer; border: 1px solid #e3e8ee;
}
.filter-tag.active { background: #1a5fa8; color: #fff; border-color: #1a5fa8; }
.sub-filter-bar { margin-top: -8px; }
.filter-tag.sub { font-size: 12px; padding: 4px 12px; border-radius: 14px; background: #fff; }
.filter-tag.sub.active { background: #e8f1fa; color: #1a5fa8; border-color: #9cc3ea; }
.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.goods-card {
  background: #fff; border-radius: 8px; overflow: hidden; transition: 0.2s; cursor: pointer;
}
.goods-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.goods-card { position: relative; }
.goods-share {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(13,59,102,0.72); color: #fff; font-size: 12px;
  padding: 4px 10px; border-radius: 12px; cursor: pointer;
  opacity: 0; transition: opacity 0.2s;
}
.goods-card:hover .goods-share { opacity: 1; }
.goods-img {
  height: 150px; background: linear-gradient(135deg, #cfe3f7, #9cc3ea);
  display: flex; align-items: center; justify-content: center; font-size: 48px;
}
.goods-info { padding: 12px 14px 14px; }
.goods-title { font-size: 15px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goods-meta { display: flex; justify-content: space-between; align-items: center; }
.goods-price { color: #e0483e; font-weight: 700; font-size: 17px; }
.goods-price::before { content: "¥"; font-size: 13px; }
.goods-cat { font-size: 12px; color: #8492a6; background: #f0f4f8; padding: 2px 8px; border-radius: 10px; }

/* ============ 弹窗 / 表单 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,35,60,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: 10px; width: 380px; max-width: 92vw;
  max-height: 90vh; overflow-y: auto; padding: 0 0 20px;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 8px;
}
.modal-head h3 { font-size: 18px; }
.modal-close { border: none; background: none; font-size: 24px; cursor: pointer; color: #8492a6; }
.modal-body { padding: 8px 20px 0; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: #5a6b7b; margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; border: 1px solid #d9e2ec; border-radius: 6px; padding: 10px 12px;
  font-size: 14px; outline: none; font-family: inherit;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: #1a5fa8; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; }
.field-error { color: #e0483e; font-size: 12px; min-height: 16px; margin: 4px 0; }
.btn-block { width: 100%; }
.btn-wechat { background: #07c160; color: #fff; }
.divider { text-align: center; color: #b3bfcc; font-size: 12px; margin: 14px 0; position: relative; }
.form-tip { text-align: center; color: #8492a6; font-size: 12px; margin-top: 12px; }
.user-badge { font-size: 14px; color: #1a5fa8; margin-right: 8px; font-weight: 600; }
.goods-photo { width: 100%; height: 150px; object-fit: cover; display: block; }
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: #1f2d3d; color: #fff; padding: 10px 22px; border-radius: 6px;
  font-size: 14px; z-index: 200;
}

/* ============ 管理后台 ============ */
.modal-wide { width: 640px; }
.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid #eef2f6;
}
.admin-row-title { font-size: 14px; font-weight: 600; color: #1f2d3d; }
.admin-row-meta { font-size: 12px; color: #8492a6; margin-top: 4px; }
.admin-empty { text-align: center; color: #8492a6; padding: 30px 0; font-size: 14px; }
.admin-section-title {
  font-size: 13px; color: #1a5fa8; font-weight: 600;
  margin: 18px 0 4px; padding-bottom: 6px; border-bottom: 1px solid #eef2f6;
}
.admin-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-mini { border: 1px solid #d9e2ec; background: #fff; border-radius: 5px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.btn-mini:hover { border-color: #1a5fa8; color: #1a5fa8; }
.btn-mini.btn-approve { color: #0a7a3d; }
.btn-mini.btn-reject { color: #e0483e; }
.st { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.st-pending { background: #fdf3e0; color: #b8860b; }
.st-approved { background: #e6f5ec; color: #0a7a3d; }
.st-rejected { background: #fdeaea; color: #e0483e; }
.status-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-top: 8px; }
.status-tag.pending { background: #fdf3e0; color: #b8860b; }
.status-tag.rejected { background: #fdeaea; color: #e0483e; }

/* ============ 商品详情页 ============ */
.detail-wrap { padding: 28px 16px 56px; }
.detail-loading, .detail-empty {
  text-align: center; color: #8492a6; padding: 80px 0; font-size: 15px;
}
.detail-empty a { color: #1a5fa8; }
.detail-card {
  background: #fff; border-radius: 10px; overflow: hidden;
  display: flex; gap: 0; flex-wrap: wrap;
}
.detail-media { flex: 1 1 420px; min-width: 300px; background: #eef3f9; }
.detail-media img { width: 100%; height: 100%; max-height: 460px; object-fit: cover; display: block; }
.detail-placeholder {
  height: 380px; display: flex; align-items: center; justify-content: center;
  font-size: 96px; background: linear-gradient(135deg, #cfe3f7, #9cc3ea);
}
.detail-info { flex: 1 1 420px; min-width: 300px; padding: 28px 30px; }
.detail-title { font-size: 22px; line-height: 1.4; margin-bottom: 16px; }
.detail-price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-price { color: #e0483e; font-size: 30px; font-weight: 700; }
.detail-price::before { content: "¥"; font-size: 18px; }
.price-origin { color: #8492a6; font-size: 13px; text-decoration: line-through; }
.detail-tags { margin-bottom: 18px; }
.detail-meta {
  display: grid; grid-template-columns: 80px 1fr; gap: 10px 0;
  font-size: 14px; color: #33445a; border-top: 1px solid #eef2f6; padding-top: 16px;
}
.detail-meta dt { color: #8492a6; }
.detail-desc { margin-top: 20px; }
.detail-desc h3 { font-size: 15px; margin-bottom: 8px; }
.detail-desc p { font-size: 14px; line-height: 1.8; color: #4a5a6a; }
.reject-note {
  margin-top: 16px; background: #fdeaea; color: #e0483e;
  font-size: 13px; padding: 10px 14px; border-radius: 6px;
}
.detail-actions { display: flex; gap: 12px; margin-top: 24px; }
.detail-tip { font-size: 12px; color: #b3bfcc; margin-top: 16px; line-height: 1.6; }

/* ============ 分享图 ============ */
.poster-panel {
  background: #fff; border-radius: 12px; width: 420px; max-width: 94vw;
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
}
.poster-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid #eef2f6;
}
.poster-body { padding: 16px 20px; overflow-y: auto; text-align: center; }
.poster-body img { width: 100%; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.poster-hint { font-size: 12px; color: #8492a6; margin-top: 10px; }
.poster-actions { padding: 0 20px 18px; text-align: center; }
.poster-actions .btn { display: inline-block; }

/* ============ 帮我买（求购） ============ */
.hero-sm { padding: 36px 0; }
.hero-sm h1 { font-size: 26px; }
.hero-sm p { margin-bottom: 20px; font-size: 14px; }
.wanted-wrap { padding: 28px 16px 56px; }
.wanted-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 8px;
}
.wanted-sub { font-size: 13px; color: #8492a6; margin-top: 6px; }
.wanted-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 20px; }
.wanted-list { display: flex; flex-direction: column; gap: 12px; }
.want-card {
  background: #fff; border-radius: 10px; padding: 18px 20px;
  display: flex; gap: 16px; justify-content: space-between; align-items: flex-start;
  border: 1px solid transparent; transition: 0.2s;
}
.want-card:hover { border-color: #cfe0f0; }
.want-card.promoted { border-color: #f0c76a; background: linear-gradient(180deg, #fffdf6, #ffffff); }
.want-main { flex: 1; min-width: 0; }
.want-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.want-title { font-size: 16px; font-weight: 600; color: #1f2d3d; }
.badge-promote {
  font-size: 11px; color: #8a5a00; background: #ffefc2;
  padding: 2px 8px; border-radius: 10px; font-weight: 600;
}
.badge-closed { font-size: 11px; color: #8492a6; background: #f0f4f8; padding: 2px 8px; border-radius: 10px; }
.want-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.want-cat { font-size: 12px; color: #1a5fa8; background: #e8f1fa; padding: 2px 10px; border-radius: 10px; }
.want-budget { font-size: 13px; color: #e0483e; font-weight: 600; }
.want-chip { font-size: 12px; color: #8492a6; background: #f5f7fa; padding: 2px 10px; border-radius: 10px; }
.want-desc { font-size: 13px; color: #5a6b7b; line-height: 1.7; margin-top: 10px; }
.want-foot { font-size: 12px; color: #9aa8b6; margin-top: 12px; display: flex; gap: 6px; }
.want-side { flex-shrink: 0; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.form-row.two-col { display: flex; gap: 12px; }
.form-row.two-col > div { flex: 1; }

/* ============ 页脚 ============ */
.footer { background: #0d3b66; color: #cfe0f0; padding: 28px 0; text-align: center; font-size: 14px; }
.footer-sub { opacity: 0.6; font-size: 12px; margin-top: 6px; }

/* ============ 货源状态（现货 / 可调货） ============ */
.section-head-right { display: flex; align-items: center; gap: 12px; }
.stock-toggle {
  border: 1px solid #cfd9e4; background: #fff; color: #5a6b7b;
  font-size: 12px; padding: 5px 12px; border-radius: 14px; cursor: pointer; transition: 0.2s;
}
.stock-toggle:hover { border-color: #0a7a3d; color: #0a7a3d; }
.stock-toggle.active { background: #0a7a3d; border-color: #0a7a3d; color: #fff; }
.supply-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.supply-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600; letter-spacing: 0.3px;
}
.supply-badge.stock { background: #e6f5ec; color: #0a7a3d; }
.supply-badge.order { background: #f2f4f7; color: #6b7c8f; }
.invoice-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: #eef3fb; color: #3b6ea5; border: 1px solid #dbe6f4;
}

/* 详情页货源提示块 */
.detail-supply {
  font-size: 13px; padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; font-weight: 600;
}
.detail-supply.stock { background: #e6f5ec; color: #0a7a3d; }
.detail-supply.order { background: #fff8e9; color: #a9741a; }

/* 表单辅助 */
.form-hint { font-size: 12px; color: #9aa8b6; margin-top: 6px; line-height: 1.5; }
.check-label { display: flex !important; align-items: center; gap: 8px; font-size: 14px; color: #33445a; cursor: pointer; }
.check-label input { width: auto; }

/* ============ 求购引导条 ============ */
.match-banner { margin-bottom: 48px; }
.match-inner {
  background: linear-gradient(120deg, #0d3b66, #1a5fa8);
  border-radius: 10px; padding: 24px 28px; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.match-text h3 { color: #fff; font-size: 18px; margin-bottom: 8px; }
.match-text p { color: #cfe0f0; font-size: 13px; line-height: 1.7; }
.match-inner .btn-primary { background: #fff; color: #0d3b66; font-weight: 600; white-space: nowrap; }
.match-inner .btn-primary:hover { background: #e8f1fa; }

/* ============ 库存 / 售罄（SOLD OUT） ============ */
.stock-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 600;
  background: #eef3fb; color: #3b6ea5; border: 1px solid #dbe6f4;
}
.soldout-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 700;
  background: #1f2d3d; color: #fff; letter-spacing: 0.5px;
}
.soldout-cover {
  position: absolute; top: 0; left: 0; right: 0; height: 150px; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 30, 45, 0.5); pointer-events: none;
}
.soldout-cover span {
  color: #fff; font-size: 15px; font-weight: 800; letter-spacing: 3px;
  border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 4px;
  padding: 6px 14px; transform: rotate(-6deg);
}
.goods-card.sold-out .goods-photo,
.goods-card.sold-out .goods-img { filter: grayscale(1) blur(1px); }
.goods-card.sold-out .goods-title { color: #8492a6; }
.goods-card.sold-out .goods-price { color: #8492a6; }

/* 详情页售罄横幅 */
.detail-soldout {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #1f2d3d; color: #fff; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 16px;
}
.detail-soldout strong { font-size: 15px; letter-spacing: 2px; }
.detail-soldout span { font-size: 13px; color: #c8d4e0; }
.sold-text { color: #e0483e; font-weight: 700; }

/* 详情页库存管理（仅发布者可见） */
.stock-manage {
  margin-top: 18px; padding: 14px 16px; border: 1px dashed #cfdcea;
  border-radius: 8px; background: #f8fbff;
}
.stock-manage-head { font-size: 13px; font-weight: 700; color: #1a5fa8; margin-bottom: 10px; }
.stock-manage-head span { font-weight: 400; color: #8492a6; }
.stock-manage-ctrl { display: flex; align-items: center; gap: 10px; }
.stock-step {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid #cfdcea;
  background: #fff; color: #1a5fa8; font-size: 18px; line-height: 1; cursor: pointer;
}
.stock-step:hover { border-color: #1a5fa8; }
.stock-now { min-width: 48px; text-align: center; font-size: 18px; font-weight: 700; color: #1f2d3d; }
.stock-soldout-btn {
  margin-left: auto; padding: 7px 14px; border-radius: 6px; cursor: pointer;
  border: 1px solid #1f2d3d; background: #1f2d3d; color: #fff; font-size: 13px;
}
.stock-soldout-btn:hover { background: #35485f; }
.stock-manage-tip { font-size: 12px; color: #8492a6; margin-top: 8px; }

/* ============ 价格口径：含税 / 运费 ============ */
.goods-price-wrap { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.price-term {
  font-size: 11px; line-height: 1.5; color: #5c718a;
  background: #f0f4f8; border: 1px solid #e3eaf2;
  padding: 1px 6px; border-radius: 4px; white-space: nowrap;
}
.price-term.lg { font-size: 12px; padding: 3px 9px; background: #fff6ea; border-color: #f3e0c4; color: #a9741a; }
.goods-card.sold-out .price-term { color: #93a1b0; background: #f5f7f9; border-color: #eaeef2; }

/* 单选组（发布表单） */
.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-label {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: 14px; color: #33445a; padding: 8px 14px;
  border: 1px solid #d8e2ee; border-radius: 8px; background: #fff;
  transition: all 0.15s;
}
.radio-label:hover { border-color: #9dbfe0; }
.radio-label input { width: auto; margin: 0; accent-color: #1a5fa8; }
.radio-label:has(input:checked) { border-color: #1a5fa8; background: #f2f8ff; color: #1a5fa8; font-weight: 600; }

/* 价格行拥挤时允许分类标签换行，避免重叠 */
.goods-meta { flex-wrap: wrap; row-gap: 4px; column-gap: 8px; }
.goods-meta .goods-cat { margin-left: auto; }
.goods-price-wrap { flex-shrink: 0; }

/* ICP 备案号 */
.footer .beian { margin-top: 8px; font-size: 12px; }
.footer .beian a { color: #cfe0f0; opacity: 0.75; text-decoration: none; }
.footer .beian a:hover { opacity: 1; text-decoration: underline; }
