/* ============================================
   游戏交易H5平台 - 全局样式
   ============================================ */

:root {
  --primary: #2979ff;
  --primary-dark: #1565c0;
  --primary-light: #82b1ff;
  --success: #07c160;
  --danger: #ee0a24;
  --warning: #448aff;
  --info: #2979ff;
  --bg: #f5f6fa;
  --bg-white: #ffffff;
  --border: #ebedf0;
  --text-primary: #1a1a2e;
  --text-secondary: #666;
  --text-muted: #999;
  --text-white: #ffffff;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --online: #07c160;
  --offline: #999;
  --gold: #448aff;
  --vip: #ff4d4f;
  --safety-index: calc(1vh + 1px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

/* ========== 通用组件 ========== */

/* 页面容器 */
.page {
  display: none;
  min-height: 100vh;
  padding-bottom: 100px;
  background: var(--bg);
  /* 移动端滚动优化 */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.page.active {
  display: block;
}

/* 特殊页面：商品详情 全屏聊天 */
#page-equipment.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 50px);
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}
#page-equipment.active > .detail-wrapper {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* 求购详情页也全屏 */
#page-purchase-detail.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 50px);
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}
#page-purchase-detail.active > .detail-wrapper {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* 私信页也全屏 */
#page-private-chat.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 50px);
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}
#page-private-chat.active > .chat-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 详情折叠滚动区 */
.detail-scroll-area {
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 40vh;
}
.detail-scroll-area::-webkit-scrollbar { width: 4px; }

/* 顶部导航 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
}
.navbar-title {
  font-size: 18px;
  font-weight: 700;
}
.navbar-back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}
.navbar-back:active {
  background: rgba(255,255,255,0.2);
}
.navbar-back svg {
  width: 20px;
  height: 20px;
}
/* 黄色导航栏主题（商品详情页专用） */
.navbar-back-yellow:active {
  background: rgba(92,61,0,0.1);
}
.navbar-online-btn {
  font-size: 12px;
  cursor: pointer;
  color: #5c3d00;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 2px;
}
.navbar-online-btn b { color: #e65100; }
.navbar-online-btn:active { opacity: 0.7; }
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.navbar-btn {
  font-size: 13px;
  cursor: pointer;
  opacity: 0.9;
  padding: 4px 8px;
  border-radius: 4px;
}
.navbar-btn:active {
  opacity: 0.7;
}

/* 底部导航 */
.tabbar {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 16px);
  max-width: 464px;
  height: 56px;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 28px;
  display: flex;
  align-items: center;
  z-index: 200;
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}
.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #333;
  font-size: 12px;
  font-weight: 500;
  gap: 3px;
  position: relative;
  transition: color 0.2s;
}
.tabbar-item.active {
  color: var(--primary);
  font-weight: 700;
}
.tabbar-item svg {
  width: 25px;
  height: 25px;
}
.tabbar-item .badge {
  position: absolute;
  top: 2px;
  right: 50%;
  transform: translateX(22px);
  min-width: 16px;
  height: 16px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* 搜索栏 */
.search-bar {
  margin: 12px 16px;
  display: flex;
  align-items: center;
  background: var(--bg-white);
  border-radius: 20px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  gap: 8px;
}
.search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--text-primary);
}
.search-bar input::placeholder {
  color: var(--text-muted);
}

/* 卡片容器 */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  margin: 12px 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title .more {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  gap: 6px;
}
.btn:active {
  transform: scale(0.96);
  opacity: 0.85;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-white);
}
.btn-success {
  background: var(--success);
  color: var(--text-white);
}
.btn-warning {
  background: linear-gradient(135deg, #f5a623, #f7c948);
  color: #5c3d00;
  font-weight: 700;
}
.btn-danger {
  background: var(--danger);
  color: var(--text-white);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-block {
  width: 100%;
  display: flex;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 14px;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius);
}

/* 商品卡片 - 装备列表 */
.item-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  margin: 10px 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
}
.item-card:active {
  transform: scale(0.98);
}
.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.item-card-game {
  display: flex;
  align-items: center;
  gap: 8px;
}
.item-card-game img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.item-card-game .game-name {
  font-size: 13px;
  color: var(--text-secondary);
}
.item-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}
.item-card-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--danger);
}
.item-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.item-card-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.tag-legendary { background: #fff3e0; color: #e65100; }
.tag-epic { background: #f3e5f5; color: #7b1fa2; }
.tag-rare { background: #e3f2fd; color: #1565c0; }
.tag-uncommon { background: #e8f5e9; color: #2e7d32; }
.tag-common { background: #f5f5f5; color: #616161; }
.tag-limited { background: #fce4ec; color: #c62828; }
.tag-hot { background: #fff8e1; color: #ff6f00; }
.tag-new { background: #e0f7fa; color: #00838f; }

.item-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.item-card-seller {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.item-card-seller .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.item-card-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.online { background: var(--online); box-shadow: 0 0 6px var(--online); }
.status-dot.offline { background: var(--offline); }

/* 公告弹窗 */
.announcement-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s;
}
.announcement-content {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin: 0 30px;
  width: calc(100% - 60px);
  max-width: 360px;
  text-align: center;
  animation: scaleIn 0.3s;
}
.announcement-content h3 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 16px;
}
.announcement-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: left;
  margin-bottom: 20px;
}
.announcement-content .btn {
  width: 100%;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 99999;
  animation: toastIn 0.3s;
  pointer-events: none;
}

/* 分类标签 */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 13px;
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  border: 1px solid var(--border);
}
.category-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 子分类 */
.sub-category-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg);
}
.sub-category-tab {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.sub-category-tab.active {
  background: var(--primary-light);
  color: #fff;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state p {
  font-size: 14px;
}

/* 加载动画 */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: block;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-white);
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
}
.form-textarea {
  resize: vertical;
  min-height: 80px;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* 评分星星 */
.stars {
  display: flex;
  gap: 4px;
}
.stars svg {
  width: 16px;
  height: 16px;
}
.stars svg.filled { color: var(--gold); }
.stars svg.empty { color: #ddd; }

/* 信誉等级 */
.reputation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.reputation-badge.v5 { background: #fff3e0; color: #e65100; }
.reputation-badge.v4 { background: #f3e5f5; color: #7b1fa2; }
.reputation-badge.v3 { background: #e3f2fd; color: #1565c0; }
.reputation-badge.v2 { background: #e8f5e9; color: #2e7d32; }
.reputation-badge.v1 { background: #f5f5f5; color: #757575; }

/* 消息列表 */
.message-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-white);
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border);
}
.message-item:active { background: #f7f8fa; }
.message-item.unread { background: #f0f7ff; }
.message-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.message-avatar.system {
  background: var(--warning);
}
.message-info {
  flex: 1;
  min-width: 0;
}
.message-info .name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.message-info .preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-meta {
  text-align: right;
  flex-shrink: 0;
}
.message-meta .time {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.message-meta .unread-dot {
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  margin-left: auto;
}

/* 密码输入 */
.pin-input-group {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.pin-input {
  width: 45px;
  height: 52px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s;
  color: var(--text-primary);
  background: var(--bg-white);
}
.pin-input:focus {
  border-color: var(--primary);
}

/* 群聊 */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 50px);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  position: relative;
}
.chat-bubble.mine {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.other {
  background: var(--bg-white);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.chat-bubble .sender {
  font-size: 11px;
  margin-bottom: 4px;
  opacity: 0.8;
  font-weight: 600;
}
.chat-bubble .time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
}
.chat-input-area {
  display: flex;
  gap: 2px;
  padding: 4px 2px !important;
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  align-items: center;
  flex-shrink: 0;
}
.chat-input-area input {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  font-size: 16px;
  outline: none;
  background: var(--bg);
  min-width: 0;
}
.chat-input-area .send-btn {
  padding: 8px 18px;
  height: 38px;
  border-radius: 19px;
  background: var(--primary);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
}

/* 系统消息 */
.system-msg {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ========== 首页 ========== */
.home-banner {
  margin: 12px 16px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  height: 140px;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  display: flex;
  align-items: center;
  padding: 20px;
}
.home-banner-text h2 {
  font-size: 20px;
  color: #fff;
  margin-bottom: 6px;
}
.home-banner-text p {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.home-banner-img {
  font-size: 60px;
  margin-left: auto;
  opacity: 0.9;
}
.home-stats {
  display: flex;
  margin: 12px 16px;
  gap: 10px;
}
.home-stat-item {
  flex: 1;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.home-stat-item .num {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}
.home-stat-item .label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.home-hot-games {
  margin: 0 16px 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.home-game-item {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
}
.home-game-item:active { transform: scale(0.96); }
.home-game-item .game-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.home-game-item .game-info {
  flex: 1;
  min-width: 0;
}
.home-game-item .game-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.home-game-item .game-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* 首页5大卡片功能模块 */
.home-modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px;
}
.home-module-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.home-module-card:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-lg);
}
.home-module-card .module-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: #fff;
}
.home-module-card .module-info {
  flex: 1;
  min-width: 0;
}
.home-module-card .module-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.home-module-card .module-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== 首页 v5: 横向游戏标签栏 ========== */
.home-game-tabs {
  display: flex;
  overflow-x: auto;
  padding: 12px 16px;
  gap: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.home-game-tabs::-webkit-scrollbar { display: none; }
.home-game-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.2s;
  scroll-snap-align: start;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.game-tab-icon { font-size: 28px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.home-game-tab .game-tab-icon { font-size: 28px; }
.home-game-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,53,0.35);
}

/* ========== 首页：二级分类（纯文字版） ========== */
.home-sub-categories {
  display: flex;
  flex-wrap: wrap;
  padding: 0 16px 12px;
  gap: 8px;
}
.home-sub-cat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: var(--bg-white);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  white-space: nowrap;
}
.home-sub-cat.active {
  border-color: var(--primary);
  background: #fff5f0;
  color: var(--primary);
}
.home-sub-cat:active { transform: scale(0.95); }

/* ========== 首页：通栏功能卡片 ========== */
.home-func-card {
  margin: 8px 16px;
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  position: relative;
  overflow: hidden;
}
.home-func-card:active { transform: scale(0.98); }
.home-func-card .func-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.home-func-card .func-info { flex: 1; min-width: 0; }
.home-func-card .func-title { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.home-func-card .func-desc { font-size: 12px; color: var(--text-muted); }
.home-func-card .func-arrow { color: var(--text-muted); font-size: 16px; }
.home-func-card .func-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* ========== 首页：双列商品卡片 ========== */
.home-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 0 4px;
  width: 100%;
  box-sizing: border-box;
}
.home-product-card {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
}
.home-product-card:active { transform: scale(0.96); }
.home-product-card .prod-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--bg), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  position: relative;
}
.home-product-card .prod-img .prod-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
}
/* 区服标签 */
.prod-tag.server-qq { background: #1890ff; }
.prod-tag.server-wx { background: #07c160; }

/* 已售标识 */
.prod-sold-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) rotate(-15deg);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 4px;
  border: 2px solid #ff4d4f;
  pointer-events: none;
  letter-spacing: 4px;
}
.home-product-card.sold {
  opacity: 0.6;
  pointer-events: auto;
}
.home-product-card.sold:active { transform: none; }
/* 交易列表区服标签 */
.server-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
  color: #fff;
}
.server-tag.server-qq { background: #1890ff; }
.server-tag.server-wx { background: #07c160; }
/* 已售的item-card */
.item-card.sold {
  opacity: 0.55;
  position: relative;
}
.item-card.sold::after {
  content: '已售';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) rotate(-15deg);
  font-size: 20px;
  font-weight: 800;
  color: var(--danger);
  border: 2px solid var(--danger);
  padding: 4px 16px;
  border-radius: 4px;
  letter-spacing: 4px;
  opacity: 0.9;
  pointer-events: none;
}
.home-product-card .prod-body {
  padding: 10px 12px 12px;
}
.home-product-card .prod-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-product-card .prod-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--danger);
}
.home-product-card .prod-price .yuan { font-size: 12px; }
.home-product-card .prod-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ========== 首页：认证店铺卡片 ========== */
.home-shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 4px;
}
.home-shop-card {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.home-shop-card:active { transform: scale(0.96); }
.home-shop-card .shop-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.home-shop-card .shop-info { flex: 1; min-width: 0; }
.home-shop-card .shop-name { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.home-shop-card .shop-desc { font-size: 11px; color: var(--text-muted); }
.home-shop-card .shop-level {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  position: absolute;
  top: 8px;
  right: 8px;
}
.shop-level-diamond { background: #e8f5e9; color: #2e7d32; }
.shop-level-gold { background: #fff8e1; color: #f57f17; }
.shop-level-silver { background: #eceff1; color: #546e7a; }

/* ========== 首页：分区标题 ========== */
.home-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}
.home-section-title .sec-title {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}
.home-section-title .sec-title .sec-icon { font-size: 18px; }
.home-section-title .sec-more {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
}

/* 万人群聊页面 */
.chat-rooms {
  padding: 12px 16px;
}
.chat-room-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-room-card:active { transform: scale(0.97); }
.chat-room-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.chat-room-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.chat-room-info .room-name {
  font-size: 16px;
  font-weight: 700;
}
.chat-room-info .room-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.chat-room-right {
  text-align: right;
}
.chat-room-right .online-count {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}
.chat-room-right .badge-count {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  min-width: 18px;
  text-align: center;
}

/* 群聊消息页面 */
.group-chat-header-compact {
  background: var(--bg-white);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.room-label-compact {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.online-tag-compact {
  font-size: 11px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 3px;
}
.group-chat-header {
  background: var(--bg-white);
  padding: 4px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.group-chat-header .room-label {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.group-chat-header .online-tag {
  font-size: 11px;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 3px;
}
.group-chat-messages-expanded {
  padding: 10px 14px 90px;
  min-height: calc(100vh - 200px);
}
.group-chat-messages {
  padding: 10px 14px 90px;
  min-height: calc(100vh - 200px);
}
.group-chat-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.group-chat-msg.self {
  flex-direction: row-reverse;
}
.group-chat-msg .msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.group-chat-msg .msg-body {
  max-width: 70%;
}
.group-chat-msg .msg-sender {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.group-chat-msg.self .msg-sender {
  text-align: right;
}
.group-chat-msg .msg-bubble {
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}
.group-chat-msg.self .msg-bubble {
  background: var(--primary);
  color: #fff;
}
.chat-input-bar {
  background: var(--bg-white);
  padding: 4px 2px !important;
  display: flex;
  gap: 2px;
  align-items: center;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input-bar input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px 20px;
  font-size: 16px;
  outline: none;
  background: var(--bg);
  min-width: 0;
}
.chat-input-bar .send-btn {
  padding: 8px 18px;
  height: 38px;
  border-radius: 19px;
  background: #2979ff;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.send-media-btn, .send-link-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.send-media-btn:active, .send-link-btn:active { background: var(--bg); }

/* 群聊分享卡片 */
.shared-card {
  display: flex;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  max-width: 240px;
  transition: transform 0.15s;
  border: 1px solid var(--border);
}
.shared-card:active { transform: scale(0.97); }
.shared-card-img {
  width: 64px;
  min-height: 64px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  background-color: var(--bg);
}
.shared-card-body {
  flex: 1;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}
.shared-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}
.shared-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
}
.shared-card-meta .server-tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
}
.server-tag.server-qq { background: #1890ff; }
.server-tag.server-wx { background: #07c160; }
.shared-card-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--danger);
}

/* 消息页面 tabs */
.msg-tabs {
  display: flex;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 46px;
  z-index: 5;
}
.msg-tab {
  flex: 1;
  text-align: center;
  padding: 13px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}
.msg-tab.active {
  color: var(--primary);
}
.msg-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* 消息列表项 */
.msg-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-white);
  transition: background 0.2s;
}
.msg-list-item:active { background: #f7f8fa; }
.msg-list-item.unread { background: #f0f7ff; }
.msg-list-item .msg-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.msg-list-item .msg-content {
  flex: 1;
  min-width: 0;
}
.msg-list-item .msg-name {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.msg-list-item .msg-name .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}
.msg-list-item .msg-preview {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-list-item .msg-meta {
  text-align: right;
  flex-shrink: 0;
}
.msg-list-item .msg-time {
  font-size: 11px;
  color: var(--text-muted);
}
.msg-list-item .msg-count {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  margin-top: 4px;
  min-width: 18px;
  text-align: center;
}

/* 弹窗/遮罩 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.show {
  display: flex;
}
.modal-sheet {
  background: var(--bg-white);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  animation: slideUp 0.3s;
}
.modal-sheet-title {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}

/* ========== 商品详情页 V5 最终版 ========== */
.detail-wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* ===== 共用：模式切换按钮 ===== */
.detail-mode-bar {
  display: flex;
  justify-content: center;
  padding: 10px 16px 8px;
}
.detail-mode-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 5px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.detail-mode-btn:active { background: #e8e8e8; }

/* ===== 收起状态：单行横向紧凑布局 ===== */
.detail-collapsed-card {
  margin: 0 10px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.detail-clp-row {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  gap: 8px;
  min-height: 52px;
}
.detail-clp-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background-color: var(--bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-clp-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-clp-status {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}
.detail-clp-price {
  font-size: 15px;
  font-weight: 900;
  color: var(--danger);
  white-space: nowrap;
  flex-shrink: 0;
}
.detail-clp-orderid {
  font-size: 9px;
  color: #bbb;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: monospace;
}
.detail-clp-buy {
  font-size: 11px;
  padding: 4px 14px;
  border-radius: 13px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* 展开态：顶部黑色信息栏（全内嵌：缩略图+标题+状态+价格+按钮+词条+功能入口） */
.detail-header-expand {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #fff;
  padding: 10px 12px 8px;
  margin: 0 10px;
  border-radius: var(--radius);
}
/* 顶行：缩略图 + 信息 + 价格 */
.detail-exp-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-exp-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background-color: rgba(255,255,255,0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.detail-exp-info {
  flex: 1;
  min-width: 0;
}
.detail-exp-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-exp-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.detail-exp-meta .status-dot {
  width: 5px; height: 5px; border-radius: 50%;
}
.detail-exp-meta .status-dot.online { background: var(--online); }
.detail-exp-meta .status-dot:not(.online) { background: rgba(255,255,255,0.3); }
.detail-exp-meta .server-tag {
  font-size: 9px; padding: 1px 6px; border-radius: 3px; color: #fff;
}
.detail-exp-price-col {
  flex-shrink: 0;
  text-align: right;
}
.detail-exp-price {
  font-size: 18px;
  font-weight: 900;
  color: #ff4d4f;
  line-height: 1;
}
/* 底行：订单ID + 立即购买 */
.detail-exp-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}
.detail-exp-ordid {
  font-size: 10px;
  font-family: monospace;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-exp-buy {
  font-size: 13px;
  padding: 6px 22px;
  border-radius: 16px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* 词条和功能入口保留在黑色信息栏 */
.detail-traits-inline {
  margin-top: 6px;
  padding: 6px 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.detail-traits-label {
  font-size: 10px;
  font-weight: 700;
  color: #f5c842;
  margin-bottom: 4px;
  display: block;
}
.detail-traits-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.detail-trait {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, #d4a017, #f5c842);
  color: #5c3d00;
  border: 1px solid #c49b1f;
  box-shadow: 0 1px 3px rgba(212,160,23,0.3);
}
.detail-desc-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.detail-desc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 0;
}
.detail-desc-header .desc-arrow {
  font-size: 10px;
  opacity: 0.6;
}
.detail-desc-body {
  margin-top: 6px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-func-row {
  display: flex;
  gap: 4px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.detail-func-item {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
  transition: background 0.2s;
}
.detail-func-item:active { background: rgba(255,255,255,0.22); }

/* ===== 共用：底部聊天区（加大占比，减少留白） ===== */
.detail-chat-section {
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.detail-chat-container {
  background: var(--bg-white);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.detail-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-chat-bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.detail-chat-bubble.mine {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.detail-chat-bubble.other {
  background: var(--bg);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.detail-chat-sender {
  font-size: 10px;
  margin-bottom: 3px;
  opacity: 0.75;
  font-weight: 600;
}
.detail-chat-time {
  font-size: 9px;
  opacity: 0.5;
  margin-top: 3px;
  text-align: right;
}
.detail-chat-input-area {
  display: flex;
  gap: 2px;
  padding: 4px 2px !important;
  border-top: 1px solid var(--border);
  align-items: center;
  background: var(--bg-white);
  flex-shrink: 0;
}
.detail-chat-input-area input {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 16px;
  outline: none;
  background: var(--bg);
  min-width: 0;
}
.detail-chat-input-area .btn-send {
  padding: 0 14px;
  height: 38px;
  border-radius: 19px;
  background: var(--primary);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
  font-weight: 600;
}
.chat-media-btn, .chat-link-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-media-btn:active, .chat-link-btn:active { background: var(--bg); }

/* ========== 筹购专区 ========== */
.purchase-card {
  background: var(--bg-white);
  border-radius: 4px;
  margin: 6px 0 0 0;
  padding: 12px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border-bottom: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
}
.purchase-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.purchase-card-title {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  word-break: break-all;
}
.purchase-card-budget {
  font-size: 18px;
  font-weight: 800;
  color: var(--danger);
  flex-shrink: 0;
}
.purchase-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.purchase-card-info span {
  display: flex;
  align-items: center;
  gap: 3px;
}
.purchase-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.purchase-card-deadline {
  font-size: 11px;
  color: var(--text-muted);
}
.purchase-card-deadline.urgent {
  color: var(--danger);
}

/* 求购专区 — 一级标签（全部求购单 / 我的求购） */
.purchase-top-bar {
  position: sticky;
  top: 46px;
  z-index: 10;
  background: var(--bg);
  padding: 10px 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.purchase-main-tabs {
  display: flex;
  gap: 4px;
}
.purchase-main-tab {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}
.purchase-main-tab.active {
  color: var(--primary);
  background: rgba(41,121,255,0.08);
}

/* 我的 — 角色标签（我的求购 / 我的接单） */
.purchase-role-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 0;
}
.purchase-role-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  background: var(--bg-page);
  transition: all 0.2s;
}
.purchase-role-tab.active {
  color: #fff;
  background: var(--primary);
}

/* 我的求购 — 二级标签（待接单/已接单/待发货/已完成/退款） */
.purchase-sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: 8px 0 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.purchase-sub-tabs::-webkit-scrollbar { display: none; }
.purchase-sub-tab {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.purchase-sub-tab.active {
  color: var(--primary);
  font-weight: 600;
}
.purchase-sub-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}
.purchase-sub-badge {
  display: inline-block;
  min-width: 14px; height: 14px;
  line-height: 14px;
  border-radius: 7px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  text-align: center;
  margin-left: 3px;
  padding: 0 4px;
  vertical-align: middle;
}

/* ========== 现金专区 ========== */
.cash-hero {
  margin: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 30px 20px;
  text-align: center;
  color: #fff;
}
.cash-hero .amount {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}
.cash-hero .amount-desc {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 8px;
}
.cash-rules {
  margin: 0 16px;
}
.cash-rule-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cash-rule-item:last-child { border-bottom: none; }
.cash-rule-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.cash-rule-text h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.cash-rule-text p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========== 错误页/404 ========== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px;
}
.error-page .icon {
  font-size: 60px;
  margin-bottom: 20px;
}
.error-page h2 {
  font-size: 18px;
  margin-bottom: 10px;
}
.error-page p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ========== 支付弹窗 ========== */
.pay-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
.pay-modal.show {
  display: flex;
}
.pay-modal-content {
  background: var(--bg-white);
  border-radius: var(--radius);
  width: calc(100% - 40px);
  max-width: 340px;
  padding: 24px;
  text-align: center;
  animation: scaleIn 0.3s;
}
.pay-modal-content h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.pay-modal-content .price {
  font-size: 36px;
  font-weight: 800;
  color: var(--danger);
  margin: 16px 0;
}
.pay-modal-content .method {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: #07c160;
  color: #fff;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
}
.pay-modal-content .method svg {
  width: 24px;
  height: 24px;
}

/* 屏蔽滚动穿透 */
body.modal-open {
  overflow: hidden;
}

/* ========== 我的页面 ========== */
.profile-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, var(--primary) 100%);
  padding: 24px 20px 30px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.profile-header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.3);
}
.profile-info {
  flex: 1;
  min-width: 0;
}
.profile-name {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-id {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}
.profile-signature {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.profile-signature .edit-icon {
  font-size: 10px;
  opacity: 0.6;
}
.profile-badges {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.profile-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.profile-badge.merchant {
  background: rgba(41,121,255,0.3);
  color: var(--primary-light);
  border: 1px solid rgba(41,121,255,0.5);
}
.profile-badge.member {
  background: rgba(123,31,162,0.3);
  color: #ce93d8;
  border: 1px solid rgba(123,31,162,0.5);
}
.profile-badge.vip {
  background: rgba(41,121,255,0.3);
  color: var(--primary-light);
  border: 1px solid rgba(41,121,255,0.5);
}

/* 钱包卡片 */
.wallet-card {
  margin: -15px 16px 0;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wallet-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.wallet-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}
.wallet-actions {
  display: flex;
  gap: 8px;
}

/* 认证/会员入口 */
.profile-entries {
  display: flex;
  gap: 10px;
  margin: 16px;
}
.profile-entry {
  flex: 1;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
}
.profile-entry:active { transform: scale(0.96); }
.profile-entry .entry-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.profile-entry .entry-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.profile-entry .entry-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 功能菜单 */
.menu-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  margin: 12px 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.menu-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 14px 16px 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #f7f8fa; }
.menu-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.menu-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.menu-item-text {
  font-size: 14px;
  font-weight: 500;
}
.menu-item-right {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.menu-item-right .arrow {
  font-size: 14px;
}
.menu-item .badge-count {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* 订单统计 */
.order-stats-bar {
  display: flex;
  gap: 0;
  margin: 12px 16px;
}
.order-stat-item {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  background: var(--bg-white);
  cursor: pointer;
  transition: background 0.2s;
  border-right: 1px solid var(--border);
}
.order-stat-item:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.order-stat-item:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-right: none; }
.order-stat-item:active { background: #f7f8fa; }
.order-stat-item .stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2px;
}
.order-stat-item .stat-label {
  font-size: 11px;
  color: var(--text-muted);
}
.order-stat-item .stat-num.green { color: var(--success); }
.order-stat-item .stat-num.orange { color: var(--warning); }

/* 在售订单 */
.order-list {
  margin: 12px 16px;
}
.order-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.order-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.order-item-id {
  font-size: 11px;
  color: var(--text-muted);
}
.order-item-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.order-item-status.completed { background: #e8f5e9; color: #2e7d32; }
.order-item-status.pending { background: #fff3e0; color: #e65100; }
.order-item-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.order-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.order-item-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--danger);
}

/* 会员卡片 */
.membership-hero {
  margin: 16px;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  border-radius: var(--radius);
  padding: 24px 20px;
  color: #fff;
  text-align: center;
}
.membership-hero h3 {
  font-size: 20px;
  margin-bottom: 6px;
}
.membership-hero p {
  font-size: 12px;
  opacity: 0.8;
}

.membership-card {
  margin: 12px 16px;
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.membership-card:active { transform: scale(0.97); }
.membership-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.membership-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.membership-card-header .level-name {
  font-size: 18px;
  font-weight: 700;
}
.membership-card-header .level-icon {
  font-size: 32px;
}
.membership-card-price {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.membership-card-price .unit {
  font-size: 14px;
  opacity: 0.8;
  font-weight: 600;
}
.membership-card-bonus {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}
.membership-perks {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.membership-perk {
  font-size: 10px;
  padding: 3px 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
}

/* 系统消息页 */
.sys-msg-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-white);
}
.sys-msg-item:active { background: #f7f8fa; }
.sys-msg-item.unread { background: #f0f7ff; }
.sys-msg-item .sys-msg-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.sys-msg-item .sys-msg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}
.sys-msg-item .sys-msg-content {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.sys-msg-item .sys-msg-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* 投诉建议表单 */
.feedback-form {
  padding: 16px;
}
.feedback-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.feedback-type-tab {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-white);
  transition: all 0.2s;
}
.feedback-type-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 店铺卡片 */
.shop-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  margin: 12px 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.shop-card .shop-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.shop-card .shop-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.shop-card .shop-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 12px 0;
}
.shop-card .shop-stat {
  text-align: center;
}
.shop-card .shop-stat .num {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}
.shop-card .shop-stat .lbl {
  font-size: 11px;
  color: var(--text-muted);
}

/* 拉黑管理 */
.blocked-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
}
.blocked-user-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.blocked-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}
.blocked-user-name {
  font-size: 14px;
  font-weight: 500;
}
.blocked-user-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.unblock-btn {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  padding: 6px 14px;
  border: 1px solid var(--primary);
  border-radius: 14px;
  background: transparent;
}

/* 温馨提示卡片 */
.tips-card {
  margin: 12px 16px;
  padding: 14px;
  background: #fff8e1;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
}
.tips-card .tips-title {
  font-size: 13px;
  font-weight: 700;
  color: #f57f17;
  margin-bottom: 6px;
}
.tips-card .tips-content {
  font-size: 12px;
  color: #8d6e00;
  line-height: 1.6;
}

/* 手续费说明 */
.fee-notice {
  margin: 12px 16px;
  padding: 14px;
  background: #e3f2fd;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--info);
}
.fee-notice .fee-title {
  font-size: 13px;
  font-weight: 700;
  color: #1565c0;
  margin-bottom: 6px;
}
.fee-notice .fee-content {
  font-size: 12px;
  color: #0d47a1;
  line-height: 1.6;
}

/* ========== 首页：顶部快捷按钮区 ========== */
.home-quick-actions {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
}
.home-quick-btn {
  flex: 1;
  padding: 14px 0;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  border: none;
}
.home-quick-btn:active { transform: scale(0.96); }
.home-quick-btn.btn-sell {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 14px rgba(255,107,53,0.3);
}
.home-quick-btn.btn-buy {
  background: linear-gradient(135deg, var(--info), #0052d9);
  box-shadow: 0 4px 14px rgba(25,137,250,0.3);
}

/* ========== 首页：四大功能模块区 ========== */
.home-module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 12px;
}
.home-module-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.home-module-item:active {
  transform: scale(0.96);
  box-shadow: var(--shadow-lg);
}
.home-module-item .mod-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: #fff;
}
.home-module-item .mod-info { flex: 1; min-width: 0; }
.home-module-item .mod-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
}
.home-module-item .mod-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== 导航栏搜索框 ========== */
.navbar-search {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 16px;
  padding: 4px 10px;
  gap: 4px;
  border: 1px solid var(--border);
}
.navbar-search input {
  border: none;
  background: transparent;
  font-size: 12px;
  width: 110px;
  outline: none;
  color: var(--text-primary);
}
.navbar-search input::placeholder { color: var(--text-muted); }
.navbar-search .search-btn {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* ========== 首页轮播图 ========== */
.home-carousel {
  margin: 8px 16px 20px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  height: 240px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.home-carousel .carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease;
}
.home-carousel .carousel-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  position: relative;
}
.home-carousel .carousel-slide .slide-icon {
  font-size: 42px;
  margin-bottom: 6px;
}
.home-carousel .carousel-slide .slide-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 2px;
}
.home-carousel .carousel-slide .slide-desc {
  font-size: 12px;
  opacity: 0.9;
}
.home-carousel .carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s;
}
.home-carousel .carousel-arrow:active { background: rgba(255,255,255,0.5); }
.home-carousel .carousel-prev { left: 8px; }
.home-carousel .carousel-next { right: 8px; }
.home-carousel .carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.home-carousel .carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s;
}
.home-carousel .carousel-dot.active {
  background: #fff;
  width: 18px;
  border-radius: 3px;
}

/* ========== 首页公告栏 ========== */
.home-announce-bar {
  margin: 8px 16px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid #90caf9;
}
.home-announce-bar .announce-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.home-announce-bar marquee {
  font-size: 12px;
  color: #1565c0;
  font-weight: 500;
  line-height: 1.5;
}
.home-announce-bar:active {
  opacity: 0.8;
}

/* ========== 群聊房间切换器 ========== */
.room-switcher {
  display: flex;
  gap: 6px;
  padding: 6px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.room-switcher::-webkit-scrollbar { display: none; }
.room-switcher .room-switch-tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.room-switcher .room-switch-tab.active {
  background: var(--primary);
  color: #fff;
}

/* ========== 搜索页面 ========== */
.search-result-item {
  background: var(--bg-white);
  margin: 8px 16px;
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.15s;
}
.search-result-item:active { transform: scale(0.98); }
.search-result-item .sr-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.search-result-item .sr-info { flex: 1; min-width: 0; }
.search-result-item .sr-name { font-size: 14px; font-weight: 600; }
.search-result-item .sr-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.search-result-item .sr-price { font-size: 16px; font-weight: 800; color: var(--danger); }
.search-result-item .sr-type {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

/* ========== 装备选择器（群聊分享装备） ========== */
.equip-pick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.equip-pick-item:active { background: #f7f8fa; }
.equip-pick-item:last-child { border-bottom: none; }

/* ========== 群聊 ========== */

/* ========== 群聊房间列表 ========== */
.chat-rooms-list {
  padding-top: 4px;
}

/* ========== 群聊：系统消息条 ========== */
.group-chat-system-msg {
  text-align: center;
  font-size: 11px;
  color: var(--warning);
  padding: 8px 12px;
  background: #fff8e1;
  border-radius: 8px;
  margin: 6px 8px;
  font-weight: 600;
}

/* ========== 传世商城 ========== */
.shop-container {
  width: 100%;
  box-sizing: border-box;
  padding: 0;
}
/* 传世商城 — 主标签栏（传世商城 / 我的 / 我要出售） */
.shop-main-tabs {
  position: sticky;
  top: 46px;
  z-index: 10;
  display: flex;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 10px;
}
.shop-main-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.shop-main-tab.active {
  color: var(--primary);
}
.shop-main-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.shop-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 4px;
}
.shop-top-bar .shop-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}
.shop-top-bar .shop-count {
  font-size: 13px;
  color: var(--text-muted);
}
.shop-top-bar .shop-back-btn {
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 0;
}
/* 传世商城 - 我的出售/购买入口 */
.shop-sub-entries {
  display: flex;
  gap: 10px;
  margin: 10px 0 12px;
}
.shop-sub-entry {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: var(--bg-white);
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.shop-sub-entry:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(41,121,255,.15);
}
.sse-icon { font-size: 28px; }
.sse-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
/* 传世商城 - 状态标签 */
.shop-status-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.shop-status-tab {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.shop-status-tab.active {
  color: #fff;
  background: var(--primary);
}
.shop-status-tab .purchase-sub-badge {
  background: rgba(255,255,255,.3);
  color: inherit;
  font-size: 10px;
  padding: 0 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}

/* ========== 全局：页面统收紧 ========== */
@media (min-width: 500px) {
  .page-container {
    max-width: 480px;
    margin: 0 auto;
  }
}
#app .page {
  max-width: 480px;
  margin: 0 auto;
}

/* ========== 客服页面 ========== */
.service-hero {
  text-align: center;
  padding: 28px 20px 20px;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  color: #fff;
}
.service-hero-icon {
  font-size: 48px;
  margin-bottom: 8px;
}
.service-hero-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}
.service-hero-desc {
  font-size: 12px;
  opacity: 0.75;
}
.service-quick-row {
  display: flex;
  gap: 10px;
  margin: 12px 16px;
}
.service-quick-item {
  flex: 1;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
}
.service-quick-item:active { transform: scale(0.96); }
.service-quick-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.service-quick-text {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}
.service-quick-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.service-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 16px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.service-tabs::-webkit-scrollbar { display: none; }
.service-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.service-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.service-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.service-upload-area:active { border-color: var(--primary); }
.service-upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.service-upload-text {
  font-size: 12px;
  color: var(--text-muted);
}
.service-upload-previews {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.service-ticket-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.service-ticket-item:last-child { border-bottom: none; }
.svc-ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.svc-ticket-cat {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e3f2fd;
  color: #1565c0;
  font-weight: 600;
}
.svc-ticket-status {
  font-size: 11px;
  font-weight: 600;
}
.svc-ticket-status.pending { color: var(--warning); }
.svc-ticket-status.replied { color: var(--success); }
.svc-ticket-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.svc-ticket-time {
  font-size: 11px;
  color: var(--text-muted);
}
.service-ticket-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}
.service-ticket-empty p {
  font-size: 13px;
  margin-top: 8px;
}
/* FAQ弹窗 */
.faq-list {
  padding: 4px 0;
}
.faq-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.faq-a {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== 我的页面V2 ========== */
.profile-header-v2 {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, var(--primary) 100%);
  padding: 24px 16px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.profile-top-v2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.profile-avatar-v2 {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.4);
  overflow: hidden;
}
.profile-info-v2 { flex: 1; min-width: 0; }
.profile-name-v2 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-id-v2 {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin-top: 3px;
}
.profile-actions-v2 {
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.profile-wallet-card, .profile-membership-card {
  flex: 1;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 12px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.2s;
}
.profile-wallet-card:active, .profile-membership-card:active { transform: scale(0.97); }
.pw-left { margin-bottom: 8px; }
.pw-label { font-size: 10px; opacity: 0.7; }
.pw-amount { font-size: 18px; font-weight: 800; }
.pw-btn { font-size: 11px; padding: 4px 12px; }
.profile-membership-card { display: flex; align-items: center; gap: 8px; }
.pm-icon { font-size: 22px; flex-shrink: 0; }
.pm-info { flex: 1; min-width: 0; }
.pm-title { font-size: 13px; font-weight: 700; }
.pm-sub { font-size: 10px; opacity: 0.7; }
.pm-arrow { font-size: 14px; opacity: 0.6; }
.pm-progress { margin-top: 6px; }
.pm-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 3px;
}
.pm-progress-fill {
  height: 100%;
  background: var(--warning);
  border-radius: 2px;
  transition: width 0.3s;
}
.pm-progress-text { font-size: 9px; opacity: 0.6; }

/* 功能图标网格 2x4 */
.profile-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 12px 16px;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.profile-grid-item {
  background: var(--bg-white);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.profile-grid-item:active { background: #f7f8fa; transform: scale(0.97); }
.profile-grid-item.disabled { opacity: 0.5; cursor: default; }
.profile-grid-item.disabled:active { background: var(--bg-white); }
.pgi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 6px;
}
.pgi-label { font-size: 11px; color: var(--text-primary); font-weight: 600; }
.pgi-sub { font-size: 9px; color: var(--text-muted); margin-top: 2px; }
.pgi-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}

/* 签名栏 */
.profile-signature-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 12px 14px;
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background 0.2s;
}
.profile-signature-bar:active { background: #f7f8fa; }
.psb-label { font-size: 12px; font-weight: 700; color: var(--text-primary); flex-shrink: 0; }
.psb-text { flex: 1; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psb-edit { font-size: 11px; color: var(--primary); font-weight: 600; flex-shrink: 0; }

/* 四宫格统计 */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 16px 12px;
}
.psg-item {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.psg-item:active { transform: scale(0.95); }
.psg-num { font-size: 20px; font-weight: 800; color: var(--primary); }
.psg-num.green { color: var(--success); }
.psg-num.orange { color: var(--warning); }
.psg-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* 底部模块 */
.profile-bottom-modules {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 16px 16px;
}
.pbm-module {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
  position: relative; z-index: 10; pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
}
.pbm-module:active { transform: scale(0.97); }
.pbm-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}
.pbm-info { flex: 1; min-width: 0; }
.pbm-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.pbm-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pbm-arrow { font-size: 16px; color: var(--text-muted); }

/* ========== 子页面通用 ========== */
.subpage-container { max-width: 480px; margin: 0 auto; padding-bottom: 20px; }
.subpage-hero {
  text-align: center;
  padding: 28px 20px;
  color: #fff;
  margin-bottom: 4px;
}
.subpage-hero h3 { font-size: 18px; font-weight: 700; margin: 8px 0 4px; }
.subpage-hero p { font-size: 12px; opacity: 0.85; }

/* 信誉评价 */
.rep-tabs {
  display: flex;
  background: var(--bg-white);
  margin: 0 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.rep-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}
.rep-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #fff5f0;
}
.rep-score-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  margin: 12px 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.rep-score-big { font-size: 48px; font-weight: 800; color: var(--primary); line-height: 1; }
.rep-score-label { font-size: 14px; color: var(--text-secondary); margin: 6px 0 16px; }
.rep-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.rep-stat { text-align: center; }
.rstat-num { font-size: 18px; font-weight: 700; }
.rstat-num.green { color: var(--success); }
.rstat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.review-item-v2 {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.review-item-v2:last-child { border-bottom: none; }
.rv2-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rv2-user { font-size: 13px; font-weight: 600; }
.rv2-stars { font-size: 12px; color: var(--gold); }
.rv2-content { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.rv2-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* 订单标签 */
.order-tabs-bar {
  display: flex;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 46px;
  z-index: 5;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.order-tabs-bar::-webkit-scrollbar { display: none; }
.order-tab {
  flex-shrink: 0;
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.order-tab.active { color: var(--primary); }
.order-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.order-item-v2 {
  background: var(--bg-white);
  margin: 10px 16px;
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ov2-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.ov2-id { font-size: 11px; color: var(--text-muted); }
.ov2-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.ov2-status.done { background: #e8f5e9; color: #2e7d32; }
.ov2-status.pending { background: #fff3e0; color: #e65100; }
.ov2-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.ov2-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); }
.ov2-price { font-size: 16px; font-weight: 700; color: var(--danger); }

/* 我的店铺V2 */
.shop-card-v2 {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: var(--radius);
  margin: 16px;
  padding: 20px;
  color: #fff;
}
.scv2-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.scv2-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.scv2-info { flex: 1; }
.scv2-name { font-size: 16px; font-weight: 700; }
.scv2-badge { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.scv2-stats { display: flex; gap: 0; }
.scv2-stat { flex: 1; text-align: center; }
.scv2-stat-num { font-size: 22px; font-weight: 800; }
.scv2-stat-num.green { color: var(--success); }
.scv2-stat-label { font-size: 10px; opacity: 0.7; margin-top: 2px; }

/* 采纳建议 */
.adopted-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.adopted-item:last-child { border-bottom: none; }
.adopted-left { flex: 1; min-width: 0; padding-right: 10px; }
.adopted-title { font-size: 13px; font-weight: 600; }
.adopted-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.adopted-reward { font-size: 16px; font-weight: 800; color: var(--danger); flex-shrink: 0; }

/* ========== 会员弹窗 ========== */
.membership-modal-sheet { padding: 0 !important; overflow-y: auto; }
.m-modal-header {
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  color: #fff;
  text-align: center;
  padding: 24px 20px 20px;
}
.m-modal-icon { font-size: 40px; margin-bottom: 8px; }
.m-modal-header h3 { font-size: 18px; }
.m-modal-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
}
.m-benefit {
  background: var(--bg-white);
  padding: 12px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.m-benefit span { display: block; font-size: 18px; margin-bottom: 2px; }
.m-modal-plans { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.m-plan-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.m-plan-card:active { transform: scale(0.97); }
.m-plan-card.current { border-color: var(--primary); background: #fff5f0; }
.m-plan-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.m-plan-level { font-size: 15px; font-weight: 700; }
.m-plan-current { font-size: 10px; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 10px; }
.m-plan-price { font-size: 28px; font-weight: 800; color: var(--primary); }
.m-plan-unit { font-size: 12px; opacity: 0.6; }
.m-plan-bonus { font-size: 12px; color: var(--warning); margin: 4px 0 8px; }
.m-plan-perks { display: flex; flex-wrap: wrap; gap: 4px; }
.m-plan-perk {
  font-size: 10px;
  padding: 2px 8px;
  background: rgba(255,107,53,0.1);
  border-radius: 10px;
  color: var(--primary);
  font-weight: 600;
}

/* ========== 钱包页面 ========== */
.wallet-hero {
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  margin: 12px 16px;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  color: #fff;
}
.wallet-hero-label { font-size: 12px; opacity: 0.7; }
.wallet-hero-amount { font-size: 36px; font-weight: 800; margin: 8px 0 16px; }
.wallet-hero-actions { display: flex; gap: 10px; justify-content: center; }
.wallet-action-btn { min-width: 100px; }
.merchant-bound-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.mbi-icon { font-size: 28px; }
.mbi-text { flex: 1; }
.mbi-title { font-size: 14px; font-weight: 700; color: var(--success); }
.mbi-id { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.mbi-name { font-size: 12px; color: var(--text-secondary); }
.merchant-form { padding: 4px 0; }
.wallet-tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.wallet-tx-item:last-child { border-bottom: none; }
.wtx-left { flex: 1; min-width: 0; padding-right: 10px; }
.wtx-desc { font-size: 13px; font-weight: 500; }
.wtx-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.wtx-amount { font-size: 16px; font-weight: 800; flex-shrink: 0; }

/* 提现方式选择 */
.withdraw-methods { display: flex; gap: 8px; }
.withdraw-method {
  flex: 1; text-align: center; padding: 12px 6px;
  background: var(--bg); border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer;
  transition: all 0.2s;
}
.withdraw-method.active {
  border-color: var(--primary); background: rgba(41,121,255,0.08);
}
.wmethod-icon { font-size: 28px; }
.wmethod-name { font-size: 13px; font-weight: 600; margin: 4px 0 2px; }
.wmethod-desc { font-size: 10px; color: var(--text-muted); }

/* 快捷金额 */
.withdraw-quick-amounts {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0;
}
.wqa-item {
  padding: 4px 12px; background: var(--bg); border-radius: 20px;
  font-size: 13px; cursor: pointer; border: 1px solid var(--border);
  transition: all 0.2s;
}
.wqa-item.selected, .wqa-item:active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* 提现弹窗 */
.withdraw-modal-sheet { padding: 20px; border-radius: 16px 16px 0 0; background: #fff; }
.wtx-amount.income { color: var(--success); }
.wtx-amount.expense { color: var(--danger); }

/* 充值金额选择 */
.recharge-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.recharge-amount-item {
  padding: 14px 8px;
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.recharge-amount-item.selected {
  border-color: var(--primary);
  background: #fff5f0;
  color: var(--primary);
}
.recharge-amount-item:active { transform: scale(0.95); }
.pay-method-select { margin: 8px 0 16px; }
.pay-method-item {
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.pay-method-item.selected {
  border-color: var(--primary);
  background: #fff5f0;
}

/* Toggle开关 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ddd;
  border-radius: 12px;
  transition: 0.3s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ========== 购买置顶 ========== */
.boost-entry {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #f0f8ff, #e3f0ff);
  border: 1px solid #c0d8ff; border-radius: var(--radius-sm);
  padding: 12px 14px; cursor: pointer; transition: transform 0.2s;
}
.boost-entry:active { transform: scale(0.98); }
.boost-entry-left { display: flex; align-items: center; gap: 10px; }
.boost-icon { font-size: 28px; }
.boost-title { font-size: 15px; font-weight: 700; color: var(--primary); }
.boost-desc { font-size: 11px; color: var(--text-muted); }
.boost-price-tags { display: flex; gap: 6px; }
.boost-tag {
  padding: 3px 8px; background: var(--primary); color: #fff;
  border-radius: 12px; font-size: 11px; font-weight: 600;
}

/* 置顶时长选项 */
.boost-time-options { display: flex; gap: 10px; }
.boost-time-option {
  flex: 1; text-align: center; padding: 14px 8px;
  background: var(--bg); border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer; transition: all 0.2s;
}
.boost-time-option.active {
  border-color: var(--primary); background: rgba(41,121,255,0.08);
}
.bto-price { font-size: 22px; font-weight: 800; color: var(--primary); }
.bto-duration { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* 商品选择 */
.boost-item-select {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-xs); margin-bottom: 6px;
  cursor: pointer; transition: all 0.2s;
}
.boost-item-select.selected {
  border-color: var(--primary); background: rgba(41,121,255,0.05);
}
.bis-check { width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.boost-item-select.selected .bis-check { border-color: var(--primary); background: var(--primary); }
.bis-info { flex: 1; }
.bis-name { font-size: 14px; font-weight: 600; }
.bis-meta { font-size: 11px; color: var(--text-muted); }
.bis-boosting {
  font-size: 10px; padding: 2px 6px; background: #fff3cd; color: #856404;
  border-radius: 10px; flex-shrink: 0;
}

/* 置顶弹窗 */
.boost-modal-sheet { padding: 20px; border-radius: 16px 16px 0 0; background: #fff; }

/* 置顶中徽章 */
.item-boost-badge {
  position: absolute; top: 0; left: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 3px 10px 3px 8px; border-radius: 0 0 8px 0;
  z-index: 2;
}
.item-card.boosted { border: 1.5px solid var(--primary); position: relative; }
.item-card.boosted::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(41,121,255,0.05), transparent);
  border-radius: var(--radius-sm); pointer-events: none; z-index: 1;
}
.home-product-card.boosted {
  border: 1.5px solid var(--primary);
  box-shadow: 0 2px 12px rgba(41,121,255,0.15);
}
.prod-boost-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(41,121,255,0.3);
}

/* 置顶金额网格 (4列) */
.boost-amount-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ========== 收款码上传 ========== */
.qr-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  background: var(--bg);
}
.qr-upload-area:hover { border-color: var(--primary); }
.qr-upload-placeholder img { max-width: 100%; height: auto; }

/* ========== 头像/名字编辑提示 ========== */
.profile-avatar-v2 {
  position: relative;
  cursor: pointer;
}
.profile-avatar-v2 .avatar-edit-hint {
  display: none;
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px; height: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  border: 2px solid #fff;
}
.profile-avatar-v2:active .avatar-edit-hint { display: block; }

.profile-name-v2 {
  cursor: pointer;
  position: relative;
}
.profile-name-v2 .name-edit-hint {
  display: inline-block;
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.profile-name-v2:active .name-edit-hint { opacity: 1; }

/* ============================================
   交易生命周期 - 订单卡片、详情、发货、退款
   ============================================ */

/* 订单标签计数 */
.otab-count {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  text-align: center;
  margin-left: 4px;
  padding: 0 5px;
  vertical-align: middle;
}

/* 订单一级标签徽章（替代 otab-count） */
.otab-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  text-align: center;
  margin-left: 3px;
  padding: 0 4px;
  vertical-align: middle;
}
.otab-badge.sm { min-width: 14px; height: 14px; line-height: 14px; font-size: 9px; }

/* 订单二级标签栏 */
.order-l2-tabs {
  display: flex;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.order-l2-tabs::-webkit-scrollbar { display: none; }
.order-l2-tab {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.order-l2-tab.active {
  color: var(--primary);
  font-weight: 600;
}
.order-l2-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* 交易订单卡片 */
.tx-order-card {
  background: var(--bg-white);
  margin: 8px 16px;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
}
.tx-order-card:active { transform: scale(0.98); }

/* ========== 浏览历史卡片 ========== */
.history-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin: 0 12px 8px;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.15s;
}
.history-card:active { transform: scale(0.98); background: #f8f8fa; }
.history-img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.history-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.history-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.history-game {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 3px;
}
.history-price {
  color: #e74c3c;
  font-weight: 700;
}
.history-time {
  font-size: 11px;
  color: var(--text-muted);
}
.history-arrow {
  font-size: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.tx-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tx-card-id {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}
.tx-card-role {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #f0f0f0;
  color: var(--text-secondary);
}
.tx-card-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.tx-card-body {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tx-card-icon { font-size: 24px; flex-shrink: 0; }
.tx-card-info { flex: 1; min-width: 0; }
.tx-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.tx-card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--danger);
  flex-shrink: 0;
}
.tx-card-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* 订单详情 - 信息卡片 */
.tx-info-card {
  background: var(--bg-white);
  margin: 8px 16px;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.tx-info-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tx-info-icon { font-size: 32px; flex-shrink: 0; }
.tx-info-main { flex: 1; min-width: 0; }
.tx-info-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.tx-info-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.tx-info-status-big {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  flex-shrink: 0;
}
.tx-info-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.tx-info-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--danger);
}
.tx-info-id {
  font-size: 11px;
  color: var(--text-muted);
}
.tx-info-people {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
}
.tx-person {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tx-person-label {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #f0f0f0;
  color: var(--text-muted);
}
.tx-person-sep {
  color: var(--text-muted);
  font-size: 16px;
}

/* 时间线 */
.tx-timeline {
  margin: 12px 16px;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
}
.tx-timeline-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  position: relative;
  opacity: 0.4;
}
.tx-timeline-item.active { opacity: 1; }
.tx-timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  z-index: 1;
}
.tx-timeline-item.active .tx-timeline-dot {
  background: var(--primary-light);
}
.tx-timeline-line {
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: -8px;
  width: 2px;
  background: #e0e0e0;
  z-index: 0;
}
.tx-timeline-item.active + .tx-timeline-item .tx-timeline-line,
.tx-timeline-item.active .tx-timeline-line { background: var(--primary-light); }
.tx-timeline-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.tx-timeline-item.active .tx-timeline-label { color: var(--text-primary); }
.tx-timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* 操作栏 */
.tx-action-bar {
  margin: 12px 16px;
}
.tx-waiting-tip {
  text-align: center;
  padding: 16px;
  background: #fffbe6;
  border-radius: var(--radius);
  color: var(--warning);
  font-size: 14px;
  font-weight: 600;
}
.tx-prompt {
  text-align: center;
  padding: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* 信息盒 */
.tx-info-box {
  margin: 12px 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: #f5f6fa;
}
.tx-info-box.warn { background: #fff3e0; }
.tx-info-box.done { background: #e8f5e9; }
.tx-info-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.tx-info-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 发货凭证卡 */
.tx-delivery-card {
  margin: 8px 16px;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.tx-delivery-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.tx-delivery-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}
.tx-delivery-img {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
}
.tx-delivery-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* 发货表单 */
.delivery-form {
  margin: 8px 16px;
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.delivery-form-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
}
.delivery-upload-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.delivery-upload-btn {
  width: 80px;
  height: 80px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s;
}
.delivery-upload-btn:hover { border-color: var(--primary); }
.delivery-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  position: relative;
  border: 1px solid var(--border);
}
.delivery-thumb-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

/* 交易页全屏左侧分类栏布局 */
#page-trade.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 50px - 90px);
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}
/* 传世商城也使用同样布局 */
#page-shop.active {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 50px);
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}
/* 群聊页面 — flex布局，顶部+底部固定 */
#page-group-chat.active {
  display: flex !important;
  flex-direction: column;
  height: calc(100vh - 50px);
  min-height: 0;
  overflow: hidden;
  padding: 0;
}
#page-group-chat.active .group-chat-messages-expanded {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
/* 刷新订单详情 */
#page-order-detail.active {
  min-height: 0;
}

/* ========== 左侧分类栏布局（交易页/传世商城） ========== */
/* ========== 交易页：横排游戏分类标签 ========== */
.trade-game-tabs {
  display: flex;
  overflow-x: auto;
  padding: 12px 16px;
  gap: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--bg-white);
}
.trade-game-tabs::-webkit-scrollbar { display: none; }
.trade-game-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: all 0.2s;
  scroll-snap-align: start;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.trade-game-tab .game-tab-icon { font-size: 28px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.trade-game-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,107,53,0.35);
}

/* 侧边栏内的子分类（横向滑动） */
.trade-subcats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.trade-subcats::-webkit-scrollbar { display: none; }
.trade-subcat {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 12px;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  border: 2px solid transparent;
}
.trade-subcat.active {
  background: #e3f2fd;
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.trade-subcat:active {
  transform: scale(0.95);
}

/* 右侧商品列表区 */
.trade-products {
  padding: 8px;
}
.trade-products .empty-state {
  padding: 60px 20px;
  text-align: center;
}

/* 交易页：购买置顶入口栏 */
.trade-boost-bar {
  padding: 0 16px 10px;
  background: var(--bg-white);
}
.trade-boost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(41,121,255,0.25);
  transition: all 0.15s;
}
.trade-boost-btn:active {
  transform: scale(0.96);
  opacity: 0.85;
}


/* ========== 微信支付弹窗 ========== */
.wxpay-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.55);
  z-index: 600;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s;
}
.wxpay-sheet {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 20px 0 30px;
  animation: slideUp 0.3s ease-out;
}
.wxpay-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 10px;
  border-bottom: 1px solid #f0f0f0;
}
.wxpay-sheet-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
}
.wxpay-sheet-close {
  font-size: 20px;
  color: #999;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.wxpay-sheet-close:active { background: #f5f5f5; }
.wxpay-amount {
  text-align: center;
  padding: 20px;
}
.wxpay-amount-label {
  font-size: 13px;
  color: #999;
  margin-bottom: 4px;
}
.wxpay-amount-value {
  font-size: 42px;
  font-weight: 800;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.wxpay-amount-value .yen {
  font-size: 22px;
  font-weight: 600;
  vertical-align: top;
  margin-right: 2px;
}
.wxpay-order-info {
  padding: 0 20px 12px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #666;
}
.wxpay-methods {
  padding: 12px 20px 0;
}
.wxpay-method-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid #07c160;
  background: #f0fff4;
  transition: all 0.15s;
}
.wxpay-method-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wxpay-method-icon {
  width: 36px;
  height: 36px;
  background: #07c160;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}
.wxpay-method-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.wxpay-method-desc {
  font-size: 11px;
  color: #07c160;
  margin-top: 2px;
}
.wxpay-method-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #07c160;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
}
.wxpay-btn {
  margin: 20px;
  width: calc(100% - 40px);
  height: 48px;
  border-radius: 24px;
  background: #07c160;
  color: #fff;
  border: none;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: opacity 0.15s;
}
.wxpay-btn:active { opacity: 0.85; }

/* 微信支付密码输入 */
.wxpay-pin-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 700;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.wxpay-pin-sheet {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 24px 20px;
}
.wxpay-pin-title {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.wxpay-pin-sub {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-bottom: 20px;
}
.wxpay-pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.wxpay-pin-dot {
  width: 44px;
  height: 44px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  transition: all 0.15s;
}
.wxpay-pin-dot.filled {
  border-color: #333;
  background: #fff;
}
.wxpay-pin-dot.filled::after {
  content: '';
  width: 12px;
  height: 12px;
  background: #333;
  border-radius: 50%;
}
.wxpay-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid #e8e8e8;
}
.wxpay-num-key {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid #e8e8e8;
  border-right: 1px solid #e8e8e8;
  transition: background 0.1s;
  -webkit-tap-highlight-color: rgba(0,0,0,0.05);
}
.wxpay-num-key:nth-child(3n) { border-right: none; }
.wxpay-num-key:active { background: #e8e8e8; }
.wxpay-num-key.empty { cursor: default; }
.wxpay-num-key.empty:active { background: transparent; }
.wxpay-num-key.del {
  font-size: 16px;
  color: #999;
}

/* 微信支付成功页 */
.wxpay-success-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wxpay-success-card {
  background: #fff;
  border-radius: 16px;
  width: calc(100% - 60px);
  max-width: 340px;
  padding: 36px 24px 28px;
  text-align: center;
  animation: scaleIn 0.3s;
}
.wxpay-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: #07c160;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  animation: bounceIn 0.5s;
}
.wxpay-success-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}
.wxpay-success-amount {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}
.wxpay-success-amount b {
  color: #333;
  font-size: 20px;
}
.wxpay-success-btn {
  width: 100%;
  height: 44px;
  border-radius: 22px;
  background: #07c160;
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
}

/* 微信支付 - 扫码收款 */
.wxpay-qr-section {
  padding: 20px;
  text-align: center;
}
.wxpay-qr-box {
  width: 180px;
  height: 180px;
  margin: 0 auto 12px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
}
.wxpay-qr-box svg {
  width: 140px;
  height: 140px;
}
.wxpay-qr-tip {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ========== 首页热区放大：游戏分类标签增强 ========== */
.home-game-tab {
  -webkit-tap-highlight-color: rgba(41,121,255,0.1);
  user-select: none;
}
.home-game-tab:active {
  transform: scale(0.94);
  opacity: 0.85;
}
.home-sub-cat {
  -webkit-tap-highlight-color: rgba(41,121,255,0.1);
  user-select: none;
}

/* ========== 移动端触摸优化（仅触屏设备，不影响桌面端） ========== */
@media (hover: none) and (pointer: coarse) {
  /* 全局触摸反馈优化 */
  .btn, .pbm-module, .profile-grid-item, .psg-item, .profile-signature-bar,
  .order-tab, .shop-status-tab, .service-tab, .purchase-sub-tab,
  .home-game-tab, .home-sub-cat, .category-tab {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* 全局最小触摸区域 44x44px */
  .btn, .order-tab, .shop-status-tab, .service-tab, .purchase-sub-tab {
    min-height: 44px;
    padding-top: min(13px, calc((44px - 1em) / 2));
    padding-bottom: min(13px, calc((44px - 1em) / 2));
  }

  /* 滚动容器统一 IOS 平滑 */
  .order-tabs-bar,
  .shop-status-tabs,
  .service-tabs,
  .purchase-sub-tabs,
  .category-tabs,
  .detail-scroll-area,
  .chat-messages-area {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* 防止页面跳转时闪回 — 导航时用 instant 滚动 */
  html {
    scroll-behavior: auto;
  }

  /* 页面容器滚动防穿透 */
  .page.active {
    overscroll-behavior-y: contain;
  }
}
