/* ============================================
 * 电玩寄售 — 商品后台管理页样式
 * ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --brand: #ff2c2c;
  --brand-soft: #fff0f0;
  --text: #1a1a1a;
  --muted: #888;
  --border: #ececec;
  --bg: #f5f6f8;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.admin-wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }

/* ---------- 头部 ---------- */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 20px;
}
.admin-title { display: flex; align-items: center; gap: 12px; }
.admin-logo {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff5a5a, var(--brand));
  color: #fff;
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(255, 44, 44, 0.3);
}
.admin-title h1 { font-size: 19px; }
.admin-sub { font-size: 12px; color: var(--muted); }
.btn-back {
  flex-shrink: 0;
  text-decoration: none;
  font-size: 13px;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 18px;
  padding: 7px 16px;
  transition: background .15s;
}
.btn-back:hover { background: var(--brand-soft); }

/* ---------- Tab ---------- */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-tab {
  flex: 1;
  padding: 11px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.admin-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* ---------- 卡片 ---------- */
.admin-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
.admin-card h2 { font-size: 15px; margin-bottom: 14px; }
.count-badge {
  display: inline-block;
  min-width: 22px;
  padding: 1px 8px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* ---------- 表单 ---------- */
.game-form { display: flex; flex-direction: column; gap: 12px; }
.form-row label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-row .req { color: var(--brand); }
.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="url"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 44, 44, 0.1);
}
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-row textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 44, 44, 0.1);
}

.notice-card { margin-bottom: 16px; }
.notice-tip { font-size: 12px; color: var(--muted); margin-top: 10px; }

.platform-group { display: flex; gap: 8px; flex-wrap: wrap; }
.plat-opt {
  display: flex !important;
  align-items: center;
  gap: 5px;
  margin-bottom: 0 !important;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px !important;
  cursor: pointer;
  user-select: none;
}
.plat-opt:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.plat-opt input { accent-color: var(--brand); }

.cover-upload {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.upload-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.upload-status {
  font-size: 12px;
  color: var(--muted);
}
.upload-status.ok { color: #2aa; }
.upload-status.err { color: var(--brand); }
.cover-preview {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cover-preview img {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.btn-primary {
  border: none;
  border-radius: 8px;
  padding: 11px 26px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(255, 44, 44, 0.3); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 20px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.btn-danger {
  border: none;
  border-radius: 8px;
  padding: 11px 26px;
  background: #ff4d4f;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.btn-danger:hover { box-shadow: 0 6px 16px rgba(255, 77, 79, 0.3); }
.btn-danger:active { transform: scale(0.98); }

.order-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.order-actions .btn-primary,
.order-actions .btn-danger { padding: 8px 18px; font-size: 13px; }

.btn-ghost-sm {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

/* ---------- 列表 ---------- */
.list-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 30px 0;
}
.game-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--border);
}
.game-item:last-child { border-bottom: none; }
.item-cover {
  width: 56px; height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 10px;
}
.item-cover img { width: 100%; height: 100%; object-fit: cover; }
.item-info { flex: 1; min-width: 0; }
.item-name { font-size: 14px; font-weight: 600; }
.item-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.item-tag {
  font-size: 10px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 1px 7px;
  border-radius: 8px;
}
.item-price { font-size: 15px; font-weight: 700; color: var(--brand); flex-shrink: 0; }
.item-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.icon-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #555;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn.danger:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------- 用户补缺申请 ---------- */
.request-list { display: flex; flex-direction: column; gap: 10px; }
.request-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.request-item.done { opacity: 0.65; background: #fafafa; }
.req-body { flex: 1; min-width: 0; }
.req-content { font-size: 14px; line-height: 1.5; word-break: break-all; }
.req-meta {
  display: flex; gap: 12px; align-items: center;
  margin-top: 6px; font-size: 12px; color: var(--muted);
}
.req-status { color: #eab308; }
.request-item.done .req-status { color: #16a34a; }
.req-img { display: inline-block; margin-top: 8px; }
.req-img img {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

/* ---------- 底部 ---------- */
.admin-footer {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  line-height: 1.8;
  padding-top: 8px;
}

/* ---------- 在线客服 ---------- */
.chat-wrap {
  display: flex;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-height: 360px;
}
.chat-users {
  width: 240px;
  flex-shrink: 0;
  background: #fafafa;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: 520px;
}
.chat-users .list-empty { padding: 30px 10px; }
.chat-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.chat-user:hover { background: #f0f0f0; }
.chat-user.active { background: var(--brand-soft); }
.chat-user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #ddd;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.chat-user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-user-info { flex: 1; min-width: 0; }
.chat-user-name {
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.chat-user-last {
  font-size: 12px; color: var(--muted);
  margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-user-badge {
  display: inline-block;
  min-width: 18px; padding: 1px 6px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  text-align: center;
}
.chat-room {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
}
.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-msg { display: flex; flex-direction: column; max-width: 78%; }
.chat-msg.user { align-self: flex-end; align-items: flex-end; }
.chat-msg.admin { align-self: flex-start; align-items: flex-start; }
.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.chat-msg.user .chat-msg-bubble { background: #ffe5e5; color: #333; border-bottom-right-radius: 4px; }
.chat-msg.admin .chat-msg-bubble { background: #f5f5f5; color: #333; border-bottom-left-radius: 4px; }
.chat-msg-time { font-size: 11px; color: #aaa; margin-top: 4px; }
.chat-reply-bar {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.chat-reply-bar input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.chat-reply-bar input:focus { outline: none; border-color: var(--brand); }

/* ---------- 轻提示 ---------- */
.toast-tip {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 13px;
  padding: 9px 20px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  z-index: 99;
}
.toast-tip.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 寄售订单 ---------- */
.orders-list { display: flex; flex-direction: column; gap: 14px; }
.order-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.order-no { font-size: 13px; color: var(--muted); }
.order-status {
  font-size: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}
.order-user {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  margin-bottom: 12px;
  color: #444;
}
.order-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.order-item {
  display: flex;
  gap: 10px;
  background: #fafafa;
  border-radius: 8px;
  padding: 10px;
}
.order-item-cover {
  width: 56px; height: 56px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #eee;
  display: flex; align-items: center; justify-content: center;
}
.order-item-cover img { width: 100%; height: 100%; object-fit: cover; }
.order-item-no-cover { font-size: 11px; color: #bbb; }
.order-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.order-item-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.order-item-spec { font-size: 12px; color: var(--muted); }
.order-item-price { font-size: 14px; color: var(--brand); font-weight: 700; margin-top: 4px; }
.order-total {
  text-align: right;
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
}
.order-total b { color: var(--brand); font-size: 16px; }
.order-payee {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.8;
  color: #444;
  margin-bottom: 10px;
}
.order-remark {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #614700;
  margin-bottom: 10px;
}
.order-time { font-size: 12px; color: #aaa; text-align: right; }
.order-note {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.order-note-title {
  font-size: 13px;
  font-weight: 600;
  color: #614700;
  margin-bottom: 6px;
}
.order-note-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #ffd666;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #333;
  background: #fff;
  box-sizing: border-box;
  resize: vertical;
}
.order-note-input:focus { outline: none; border-color: #faad14; }
.order-note-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.order-note-hint {
  font-size: 12px;
  color: #999;
}
.order-note-save {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
}
