/* ============================================================
   trade-index.css — 交易中心首页组件样式
   从 index.html 内联 <style> 块提取
   ============================================================ */

/* ── 交易中心主题样式 ── */
.trade-hero {
  background: linear-gradient(135deg, #14532d 0%, #166534 40%, #15803d 65%, #22c55e 100%);
  margin: 0 -15px 25px -15px;
  padding: 28px 30px;
  position: relative;
  overflow: hidden;
  min-height: 118px;
  height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 0;
}
.trade-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='15'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.trade-hero-top {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.trade-hero-title { color: #fff; }
.trade-hero-title h1 { font-size: 26px; font-weight: 700; margin: 0 0 4px; letter-spacing: 0.5px; }
.trade-hero-title p { font-size: 13px; opacity: 0.75; margin: 0; }
.trade-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer; transition: all .2s;
  white-space: nowrap;
}
.hero-action-btn.wallet { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.hero-action-btn.wallet:hover { background: rgba(255,255,255,0.25); }
.hero-action-btn.stats { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.hero-action-btn.stats:hover { background: rgba(255,255,255,0.2); }

/* ── Tab 导航 ── */
.trade-tabs {
  background: #fff;
  margin: 0 -30px 24px;
  padding: 0 32px;
  display: flex; gap: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-bottom: 1px solid #f0f0f0;
  position: sticky; top: 0; z-index: 10;
}
.trade-tab-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 14px 22px; font-size: 14px; font-weight: 600;
  border: none; background: none; cursor: pointer;
  color: #9ca3af; border-bottom: 3px solid transparent;
  margin-bottom: -1px; transition: all .2s; white-space: nowrap;
}
.trade-tab-btn:hover { color: #374151; }
.trade-tab-btn.active { color: #16a34a; border-bottom-color: #16a34a; }
.trade-tab-btn .tab-badge {
  background: #ef4444; color: #fff;
  border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700;
}
.trade-tab-btn .tab-badge.warn { background: #f59e0b; }
.trade-tab-spacer { flex: 1; }

/* ── 出售商品卡片 ── */
.trade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.trade-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.trade-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.13); }
.trade-card-img {
  position: relative; height: 160px;
  background: linear-gradient(135deg, #e0e7ff, #f3e8ff);
  overflow: hidden;
}
.trade-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.trade-card:hover .trade-card-img img { transform: scale(1.05); }
.trade-card-img .no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.trade-card-img .no-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.trade-badge-province {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  color: #fff; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 500;
}
.trade-badge-id {
  position: absolute; top: 10px; right: 10px;
  background: #16a34a; color: #fff; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.trade-badge-type {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(16,185,129,0.9); color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px;
}
.trade-card-body { padding: 14px; flex: 1; }
.trade-card-name { font-weight: 600; font-size: 15px; color: #1f2937; }
.trade-card-latin { font-size: 11px; color: #9ca3af; font-style: italic; }
.trade-card-meta { font-size: 12px; color: #9ca3af; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.trade-card-price { font-size: 18px; font-weight: 800; color: #ef4444; }
.trade-card-price span { font-size: 13px; }
.trade-card-name-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px;
}
.trade-card-footer {
  padding: 10px 14px; border-top: 1px solid #f3f4f6;
  display: flex; gap: 8px; align-items: center; justify-content: space-between;
}
.trade-btn-detail {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; background: #f0fdf4; color: #16a34a;
  border-radius: 8px; text-decoration: none; font-size: 15px;
  border: none; cursor: pointer; transition: background .15s, transform .1s;
  position: relative;
}
.trade-btn-detail:hover { background: #dcfce7; transform: scale(1.1); }
.trade-btn-cancel {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; background: #fef2f2; color: #dc2626;
  border-radius: 8px; border: none; cursor: pointer; font-size: 15px;
  transition: background .15s, transform .1s;
}
.trade-btn-cancel:hover { background: #fee2e2; transform: scale(1.1); }
.trade-btn-edit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; background: #eff6ff; color: #2563eb;
  border-radius: 8px; border: none; cursor: pointer; font-size: 15px;
  transition: background .15s, transform .1s;
}
.trade-btn-edit:hover { background: #dbeafe; transform: scale(1.1); }

/* ── 修改挂单弹窗 ── */
.edit-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 9000; align-items: center; justify-content: center;
}
.edit-modal-overlay.active { display: flex; }
.edit-modal-box {
  background: #fff; border-radius: 16px; padding: 28px 24px; width: 92%; max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18); position: relative;
}
.edit-modal-title { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 18px; }
.edit-modal-label { font-size: 13px; color: #374151; margin-bottom: 5px; display: block; }
.edit-modal-input {
  width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 14px; margin-bottom: 14px; outline: none; transition: border .15s;
}
.edit-modal-input:focus { border-color: #3b82f6; }
.edit-modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.edit-modal-submit {
  padding: 9px 22px; background: #3b82f6; color: #fff; border: none;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.edit-modal-cancel-btn {
  padding: 9px 18px; background: #f3f4f6; color: #374151; border: none;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}

/* ── 求购列表 ── */
.wanted-card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  text-decoration: none; color: inherit;
  transition: box-shadow .2s, transform .2s;
  border-left: 4px solid transparent;
}
.wanted-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); transform: translateX(3px); border-left-color: #f59e0b; }
.wanted-card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; flex-shrink: 0;
}
.wanted-card-body { flex: 1; min-width: 0; }
.wanted-card-title { font-weight: 700; font-size: 15px; color: #1f2937; margin-bottom: 5px; }
.wanted-card-meta { font-size: 12px; color: #6b7280; display: flex; gap: 14px; flex-wrap: wrap; }
.wanted-card-price { text-align: right; white-space: nowrap; }
.wanted-card-price .price-num { font-size: 20px; font-weight: 800; color: #ef4444; }
.wanted-card-price .price-date { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.wanted-status-active { background: #d1fae5; color: #065f46; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.wanted-status-closed { background: #f3f4f6; color: #9ca3af; padding: 2px 9px; border-radius: 10px; font-size: 11px; white-space: nowrap; }

/* ── 发布求购表单 ── */
.want-form-card {
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
  border: 1px solid #fde68a; border-radius: 14px;
  padding: 22px; margin-bottom: 22px;
  box-shadow: 0 2px 8px rgba(245,158,11,0.1);
}
.want-form-title { margin: 0 0 18px; color: #92400e; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.want-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.want-form-group label { font-size: 13px; color: #374151; display: block; margin-bottom: 5px; font-weight: 500; }
.want-form-group input, .want-form-group textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #e5e7eb;
  border-radius: 8px; font-size: 14px; box-sizing: border-box;
  transition: border-color .15s; outline: none;
}
.want-form-group input:focus, .want-form-group textarea:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.1); }
.want-submit-btn {
  padding: 10px 28px; background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; border: none; border-radius: 8px;
  cursor: pointer; font-size: 14px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3); transition: all .2s;
}
.want-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,0.4); }

/* ── 空状态 ── */
.empty-state { text-align: center; padding: 60px 20px; color: #9ca3af; }
.empty-state-icon { font-size: 56px; margin-bottom: 14px; opacity: 0.4; }
.empty-state p { font-size: 15px; color: #6b7280; margin-bottom: 6px; }
.empty-state small { font-size: 13px; color: #9ca3af; }

/* ── 分页 ── */
.trade-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.page-btn {
  padding: 7px 16px; border: 1px solid #e5e7eb; border-radius: 8px;
  color: #374151; text-decoration: none; font-size: 13px; transition: all .15s;
}
.page-btn:hover { background: #f3f4f6; }
.page-btn.active { background: #16a34a; color: #fff; border-color: #16a34a; }

/* ── 搜索栏 ── */
.trade-search-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  background: #fff; padding: 14px 18px; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 20px;
  align-items: center;
}
.trade-search-bar input, .trade-search-bar select {
  padding: 8px 14px; border: 1px solid #e5e7eb; border-radius: 8px;
  font-size: 14px; outline: none; transition: border-color .15s;
}
.trade-search-bar input:focus, .trade-search-bar select:focus { border-color: #16a34a; }
.trade-search-btn {
  padding: 8px 20px; background: #16a34a; color: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: all .15s;
}
.trade-search-btn:hover { background: #15803d; }

/* ── 查看更多按钮 ── */
.view-more-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 30px; border-radius: 10px;
  font-size: 14px; font-weight: 700; text-decoration: none;
  transition: all .2s; cursor: pointer; border: 2px solid;
}
.view-more-btn.sale { color: #16a34a; border-color: #16a34a; background: #fff; }
.view-more-btn.sale:hover { background: #16a34a; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(22,163,74,0.3); }
.view-more-btn.wanted { color: #f59e0b; border-color: #f59e0b; background: #fff; }
.view-more-btn.wanted:hover { background: #f59e0b; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245,158,11,0.3); }

/* ── 订单内嵌样式 ── */
.order-inner-tabs {
  display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; margin-bottom: 20px;
}
.order-inner-tab {
  padding: 10px 24px; font-size: 14px; font-weight: 600;
  border: none; background: none; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  color: #6b7280; transition: all .2s;
}
.order-inner-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.order-card {
  background: #fff; border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 16px 20px; margin-bottom: 12px;
}
.order-card-row { display: flex; align-items: flex-start; gap: 16px; }
.order-img {
  width: 80px; height: 80px; border-radius: 8px;
  overflow: hidden; background: #f3f4f6; flex-shrink: 0;
}
.order-img img { width: 100%; height: 100%; object-fit: cover; }
.order-img-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #d1d5db; font-size: 24px;
}
.order-info { flex: 1; min-width: 0; }
.order-name { font-weight: 600; font-size: 15px; color: #1f2937; margin-bottom: 2px; }
.order-meta { font-size: 12px; color: #9ca3af; margin-bottom: 8px; }
.order-sub { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #6b7280; }
.order-actions { text-align: right; min-width: 120px; }
.order-status {
  display: inline-block; border-radius: 16px;
  padding: 4px 10px; font-size: 12px; font-weight: 600; margin-bottom: 8px;
}
.status-pending-ship { background: #fef3c7; color: #92400e; }
.status-shipped { background: #dbeafe; color: #1e40af; }
.status-completed { background: #d1fae5; color: #065f46; }
.order-action-btn {
  display: block; padding: 6px 14px;
  border-radius: 6px; text-decoration: none;
  font-size: 13px; font-weight: 600; text-align: center;
}
.order-express {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #f3f4f6;
  display: flex; align-items: center; gap: 12px; font-size: 13px; color: #6b7280;
}
.order-empty { text-align: center; padding: 80px 20px; color: #9ca3af; }
.order-empty i { font-size: 48px; margin-bottom: 16px; display: block; }
.pending-warn {
  background: #fef3c7; border-radius: 8px;
  padding: 10px 16px; font-size: 13px; color: #92400e;
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
}

/* ── 发布求购按钮 ── */
.publish-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px; background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; border: none; border-radius: 10px;
  cursor: pointer; font-size: 14px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(245,158,11,0.3); transition: all .2s;
}
.publish-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(245,158,11,0.4); }

/* ── 全量列表模式标题 ── */
.list-header {
  display: flex; align-items: center; gap: 12px;
  background: #fff; padding: 14px 18px; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 18px;
}
.list-header-back {
  font-size: 13px; color: #6b7280; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px; transition: background .15s;
}
.list-header-back:hover { background: #f3f4f6; color: #374151; }
.list-header-title { font-size: 15px; font-weight: 700; color: #1f2937; }

/* ── 购物车按钮 ── */
.hero-action-btn.cart {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff; border: none; font-size: 14px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(217,119,6,0.45);
  padding: 9px 18px;
}
.hero-action-btn.cart:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 4px 14px rgba(217,119,6,0.6);
  transform: translateY(-1px);
}
.cart-badge {
  position: absolute; top: -8px; right: -8px;
  background: #ef4444; color: #fff; border-radius: 50%;
  width: 22px; height: 22px; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; border: 2px solid #fff;
  animation: cartBadgePulse 1.5s infinite;
}
@keyframes cartBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* ── 订单类型标签 ── */
.order-type-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  color: #fff; font-weight: 600; display: inline-block; vertical-align: middle;
}

/* ── 卡片加购按钮 ── */
.trade-btn-cart {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; background: #fef3c7; color: #d97706;
  border-radius: 8px; border: none; cursor: pointer; font-size: 12px;
  font-weight: 600; transition: background .15s; white-space: nowrap;
}
.trade-btn-cart:hover { background: #fde68a; }
.trade-btn-cart-added {
  padding: 7px 10px; background: #f3f4f6; color: #9ca3af;
  border-radius: 8px; text-decoration: none; font-size: 12px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ── 英雄区蘑菇装饰 ── */
.hero-mushroom { position: absolute; z-index: 1; pointer-events: none; }
.hm-l { width: 200px; height: auto; right: -30px; top: -50px; }
.hm-m { width: 110px; height: auto; left: -8px; bottom: -28px; }
.hm-s { width: 72px; height: auto; right: 28%; top: 8px; }

/* ── 图片防盗保护 ── */
.trade-container {
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}
.trade-item img, .specimen-card img, .trade-hero img {
  pointer-events: none; -webkit-user-drag: none; -khtml-user-drag: none;
  -moz-user-drag: none; -o-user-drag: none; user-drag: none;
}
.no-context-menu {
  position: fixed; top: 20px; right: 20px;
  background: rgba(220, 38, 38, 0.9); color: white;
  padding: 12px 20px; border-radius: 8px; font-size: 14px;
  z-index: 10000; display: none; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
@media print { body { display: none !important; } }

/* ── 响应式 ── */
@media (max-width: 768px) {
  .trade-hero { margin: -15px -15px 0; padding: 24px 16px 0; }
  .trade-tabs { margin: 0 -15px 18px; padding: 0 16px; }
  .trade-hero-actions { gap: 6px; }
  .hero-action-btn { padding: 7px 12px; font-size: 12px; }
  .trade-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .want-form-grid { grid-template-columns: 1fr; }
  .wanted-card { padding: 14px; gap: 12px; }
  .wanted-card-icon { width: 40px; height: 40px; font-size: 18px; }
  .hm-l { width: 110px; right: -12px; top: -28px; }
  .hm-m { display: none; }
  .hm-s { display: none; }
}
