/* ============================================================
   完美国际道具交易商城 - 用户端样式
   ============================================================ */

:root {
  --primary: #1a8a6f;
  --primary-light: #2bb380;
  --primary-dark: #137058;
  --bg: #f5f6fa;
  --card: #fff;
  --text: #2d3436;
  --text-light: #636e72;
  --border: #dfe6e9;
  --danger: #e74c3c;
  --warning: #f39c12;
  --success: #27ae60;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 导航 */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--card);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  padding: 0 16px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar .logo { font-size: 18px; font-weight: 700; color: var(--primary); cursor: pointer; }
.navbar .nav-right { display: flex; gap: 12px; align-items: center; }
.navbar .nav-link { color: var(--text-light); cursor: pointer; font-size: 14px; padding: 6px 12px; border-radius: 8px; transition: all .2s; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--primary); background: rgba(26,138,111,0.08); }

/* 容器 */
.container { max-width: 800px; margin: 0 auto; padding: 16px; }

/* 卡片 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; color: var(--text-light); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; transition: border-color .2s; outline: none; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 24px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: rgba(26,138,111,0.08); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* 商品网格 */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.product-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.product-card .img-wrap { aspect-ratio: 1; background: #f0f0f0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-card .img-wrap .placeholder { font-size: 36px; color: #ccc; }
.product-card .info { padding: 10px 12px; }
.product-card .name { font-size: 14px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .price { color: var(--danger); font-size: 16px; font-weight: 700; margin-top: 4px; }
.product-card .stock { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* 筛选栏 */
.filter-bar { background: var(--card); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; box-shadow: var(--shadow); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filter-bar select { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.filter-bar select:focus { border-color: var(--primary); }
.filter-bar .search-input { flex: 1; min-width: 150px; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }

/* 交易码 */
.trade-code-box {
  text-align: center; padding: 24px; background: linear-gradient(135deg, #1a8a6f 0%, #2bb380 100%);
  border-radius: var(--radius); margin: 16px 0;
}
.trade-code-box .label { color: rgba(255,255,255,0.8); font-size: 14px; margin-bottom: 8px; }
.trade-code-box .code { color: #fff; font-size: 36px; font-weight: 800; letter-spacing: 4px; font-family: 'Courier New', monospace; }
.trade-code-box .tip { color: rgba(255,255,255,0.7); font-size: 12px; margin-top: 8px; }

/* 客服二维码 */
.qr-box { text-align: center; padding: 20px; }
.qr-box img { width: 180px; height: 180px; border-radius: 12px; border: 2px solid var(--border); }
.qr-box .wechat { font-size: 16px; font-weight: 600; margin-top: 12px; color: var(--text); }
.qr-box .tip { font-size: 14px; color: var(--text-light); margin-top: 6px; }

/* 订单状态标签 */
.status-tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-0 { background: #fff3e0; color: #e65100; }
.status-1 { background: #e3f2fd; color: #1565c0; }
.status-2 { background: #fff8e1; color: #f57f17; }
.status-3 { background: #e8f5e9; color: #2e7d32; }
.status-4 { background: #fafafa; color: #757575; }
.status-5 { background: #fce4ec; color: #c62828; }
.status-6 { background: #e8eaf6; color: #283593; }

/* 订单列表 */
.order-list .order-item { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s; }
.order-list .order-item:hover { transform: translateX(2px); }
.order-item .order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-item .order-no { font-size: 13px; color: var(--text-light); }
.order-item .order-body { display: flex; gap: 12px; align-items: center; }
.order-item .order-icon { width: 48px; height: 48px; border-radius: 8px; background: #f0f0f0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.order-item .order-icon img { width: 100%; height: 100%; object-fit: cover; }
.order-item .order-info { flex: 1; }
.order-item .order-name { font-size: 14px; font-weight: 500; }
.order-item .order-price { color: var(--danger); font-weight: 700; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* 弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; padding: 24px; max-width: 400px; width: 100%; max-height: 80vh; overflow-y: auto; }
.modal .modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; text-align: center; }
.modal .modal-body { margin-bottom: 20px; }
.modal .modal-footer { display: flex; gap: 12px; }

/* Toast */
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: #fff; padding: 10px 24px; border-radius: 8px; font-size: 14px; z-index: 300; animation: toastIn .3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.pagination button { padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; font-size: 14px; }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 详情页 */
.detail-section { margin-bottom: 16px; }
.detail-section .section-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.detail-row .label { color: var(--text-light); }
.detail-row .value { font-weight: 500; }

/* 支付二维码 */
.pay-qr-box { text-align: center; padding: 20px; }
.pay-qr-box img { width: 220px; height: 220px; border: 1px solid var(--border); border-radius: 8px; }
.pay-qr-box .amount { font-size: 28px; font-weight: 700; color: var(--danger); margin: 12px 0; }

/* 支付倒计时 */
.pay-countdown { text-align: center; margin-bottom: 16px; padding: 12px; border-radius: 10px; background: var(--bg); }
.pay-countdown .countdown-label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 4px; }
.pay-countdown .countdown-timer { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--danger); letter-spacing: 2px; }
.pay-countdown .countdown-timer.urgent { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* 截图查看 */
.screenshot-viewer { text-align: center; }
.screenshot-viewer img { max-width: 100%; border-radius: 8px; box-shadow: var(--shadow); }

/* 响应式 */
@media (max-width: 600px) {
  .container { padding: 12px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar { padding: 0 12px; }
  .navbar .logo { font-size: 16px; }
  .trade-code-box .code { font-size: 28px; }
  .hero { padding: 28px 16px; }
  .hero-title { font-size: 22px; }
  .hero-step .step-num { width: 28px; height: 28px; font-size: 13px; }
  .hero-step .step-text { font-size: 12px; }
  .hero-steps { gap: 4px; }
  .step-arrow { font-size: 14px; }
}

/* 首页 Hero 横幅 */
.hero {
  background: linear-gradient(135deg, #1a8a6f 0%, #2bb380 50%, #3cc490 100%);
  padding: 40px 20px;
  text-align: center;
  color: #fff;
}
.hero-title {
  font-size: 28px; font-weight: 800; margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.hero-subtitle {
  font-size: 16px; opacity: 0.9; margin-bottom: 24px; letter-spacing: 4px;
}
.hero-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}
.hero-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.hero-step .step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.25); border: 2px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; backdrop-filter: blur(4px);
}
.hero-step .step-text { font-size: 13px; opacity: 0.9; }
.step-arrow { color: rgba(255,255,255,0.5); font-size: 18px; }

/* 底部 ICP */
.footer-icp {
  text-align: center; padding: 24px 16px; font-size: 13px; color: var(--text-light);
}
.footer-icp a { color: var(--text-light); text-decoration: none; }
.footer-icp a:hover { color: var(--primary); }

/* ========== 角色交易 ========== */

/* Hero 横幅 - 角色交易专用（紧凑版） */
.hero-trade { padding: 28px 20px; }

/* 角色交易卡片网格 */
.trade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.trade-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.trade-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.trade-card-header {
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--border);
}
.trade-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.4;
}

.trade-card-body {
  padding: 10px 16px;
  flex: 1;
}
.trade-card-stats {
  display: flex; gap: 12px; margin-bottom: 6px;
}
.trade-stat {
  font-size: 13px; color: var(--text-light);
}
.trade-stat b {
  color: var(--primary); font-size: 15px; font-weight: 700;
}
.trade-card-attack, .trade-card-hp {
  font-size: 13px; color: var(--text-light); line-height: 1.6;
}
.trade-card-equip {
  font-size: 12px; color: var(--text-light);
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed var(--border);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

.trade-card-footer {
  padding: 10px 16px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.trade-server {
  font-size: 12px; color: var(--text-light);
}
.trade-price {
  font-size: 16px; font-weight: 700; color: var(--danger);
}

/* 详情页 */
.trade-detail-card { padding: 24px; }

.trade-detail-header {
  text-align: center; margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 2px solid var(--primary);
}
.trade-detail-title {
  font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px;
}
.trade-detail-meta {
  display: flex; justify-content: center; gap: 16px;
  font-size: 13px; color: var(--text-light);
}

/* 详情页操作按钮 */
.trade-detail-actions {
  display: flex; gap: 10px; margin-bottom: 18px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border, #eee);
}
.trade-detail-actions .btn {
  flex: 1; padding: 10px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.trade-detail-actions .btn:active { opacity: 0.7; }
.trade-detail-actions .btn-copy { background: var(--primary); color: #fff; }
.trade-detail-actions .btn-share { background: var(--bg, #f5f5f5); color: var(--text); border: 1px solid var(--border, #ddd); }

.trade-detail-card .detail-section {
  margin-bottom: 18px;
}

.detail-text {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px; line-height: 1.8; color: var(--text);
}
.detail-contact {
  padding: 14px;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border-radius: 10px;
  font-size: 15px; font-weight: 500; color: var(--primary-dark);
  text-align: center;
  border: 1px solid #c8e6c9;
}

/* 发布/编辑表单 */
.trade-form-section {
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.trade-form-section:last-child { border-bottom: none; }

.trade-form-section-title {
  font-size: 14px; font-weight: 700; color: var(--primary);
  margin-bottom: 12px;
  padding-left: 10px; border-left: 3px solid var(--primary);
}

#trade-form .form-group { margin-bottom: 12px; }
#trade-form .form-group label { font-size: 13px; }
#trade-form .form-group input,
#trade-form .form-group select,
#trade-form .form-group textarea {
  font-size: 14px; padding: 10px 12px;
}
#trade-form .form-group input[type="number"] { -moz-appearance: textfield; }
#trade-form .form-group input[type="number"]::-webkit-outer-spin-button,
#trade-form .form-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* 我的发布列表 */
.my-trade-item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  transition: transform .15s;
}
.my-trade-item:hover { transform: translateX(2px); }

.my-trade-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 8px;
}
.my-trade-title {
  font-size: 15px; font-weight: 600; flex: 1;
  padding-right: 12px;
}
.my-trade-info {
  display: flex; gap: 16px;
  font-size: 13px; color: var(--text-light);
  margin-bottom: 10px;
}
.my-trade-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 8px; border-top: 1px solid var(--border);
}

.btn-login-contact {
  padding: 10px 32px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s;
}
.btn-login-contact:active { opacity: 0.7; }

.trade-disclaimer {
  margin-bottom: 18px; padding: 12px 14px;
  background: #fff8e1; border-left: 3px solid #ff9800; border-radius: 0 8px 8px 0;
}
.trade-disclaimer-title {
  font-size: 13px; font-weight: 700; color: #e65100; margin-bottom: 6px;
}
.trade-disclaimer-text {
  font-size: 12px; color: #8d6e63; line-height: 1.7;
}

/* 响应式适配 */
@media (max-width: 600px) {
  .trade-grid { grid-template-columns: 1fr; }
  .trade-detail-card { padding: 16px; }
}
