/* ============================================================
   电竞护航 - 全局设计系统
   品牌橙 + 暖黄，白底内容，圆角，响应式
   ============================================================ */

:root {
  --brand: #ff6a00;
  --brand-light: #ff9b45;
  --brand-pale: #fff3e8;
  --brand-gradient: linear-gradient(135deg, #ff9b45 0%, #ff6a00 100%);
  --text-strong: #202124;
  --text: #4b4b4b;
  --text-secondary: #8c8c8c;
  --line: #eeeeee;
  --page: #f7f7f7;
  --surface: #ffffff;
  --success: #20c878;
  --warning: #f4a62a;
  --danger: #f25555;
  --info: #3d8be8;
  --complete: #8069df;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --bottom-nav-h: 64px;
  --header-h: 52px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--page);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 999px; padding: 10px 20px;
  font-size: 14px; font-weight: 500; line-height: 1;
  transition: opacity .15s, transform .05s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand-gradient); color: #fff; }
.btn-primary:hover { opacity: .92; }
.btn-outline { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---------- 标签/胶囊 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 999px; font-size: 12px;
  background: #f2f2f2; color: var(--text); cursor: pointer; border: 1px solid transparent;
}
.chip.active { background: var(--brand-pale); color: var(--brand); border-color: var(--brand); font-weight: 600; }

.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 6px; font-size: 11px; line-height: 1.4;
}
.tag-orange { background: var(--brand-pale); color: var(--brand); }
.tag-blue { background: #eaf3ff; color: var(--info); }
.tag-green { background: #e6f9f0; color: var(--success); }
.tag-red { background: #ffeaea; color: var(--danger); }
.tag-purple { background: #f0edff; color: var(--complete); }
.tag-gray { background: #f2f2f2; color: var(--text-secondary); }

/* ---------- 状态徽章（图标+文字，不只靠颜色） ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-pending_payment, .badge-pending { background: #fff4e0; color: var(--warning); }
.badge-pending_accept { background: #eaf3ff; color: var(--info); }
.badge-in_progress, .badge-online, .badge-success { background: #e6f9f0; color: var(--success); }
.badge-pending_confirm { background: #eaf3ff; color: var(--info); }
.badge-after_sale, .badge-rejected, .badge-failed, .badge-danger { background: #ffeaea; color: var(--danger); }
.badge-completed, .badge-complete { background: #f0edff; color: var(--complete); }
.badge-cancelled, .badge-offline, .badge-gray { background: #f2f2f2; color: var(--text-secondary); }
.badge-busy { background: #fff4e0; color: var(--warning); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.panel {
  background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm);
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; background: #fff; color: var(--text-strong); outline: none;
  transition: border-color .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand); }
.textarea { resize: vertical; min-height: 80px; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ---------- 顶部栏 ---------- */
.header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  background: var(--brand-gradient); color: #fff; padding: 0 16px;
}
.header .title { font-size: 18px; font-weight: 700; flex: 1; }
.header .icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255,255,255,.2);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.header.white { background: #fff; color: var(--text-strong); border-bottom: 1px solid var(--line); }
.header.white .icon-btn { background: #f2f2f2; color: var(--text); }

/* ---------- 底部导航（手机） ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: var(--bottom-nav-h); padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--line);
  display: flex;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-secondary); font-size: 11px; position: relative;
}
.bottom-nav a .ico { font-size: 20px; line-height: 1; }
.bottom-nav a.active { color: var(--brand); font-weight: 600; }
.bottom-nav a .dot {
  position: absolute; top: 6px; right: 50%; margin-right: -12px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger);
}

/* ---------- 底部固定操作栏（在底部导航上方） ---------- */
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 999;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
}
@media (max-width: 767px) {
  .sticky-bar { bottom: var(--bottom-nav-h); padding-bottom: 10px; }
}
/* 底部操作栏内容层：移动端保持原布局；桌面端由 desktop.css 约束宽度居中 */
.sticky-bar .sticky-inner {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-width: 0;
}

/* ---------- PC 桌面导航 ---------- */
.desktop-nav {
  display: none;
  position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line);
}
.desktop-nav .inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 24px; }
.desktop-nav .logo { font-size: 20px; font-weight: 800; color: var(--brand); display: flex; align-items: center; gap: 8px; }
.desktop-nav .logo .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--brand-gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.desktop-nav nav { display: flex; gap: 20px; flex: 1; }
.desktop-nav nav a { color: var(--text); font-size: 15px; padding: 4px 0; border-bottom: 2px solid transparent; }
.desktop-nav nav a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.desktop-nav .actions { display: flex; align-items: center; gap: 14px; }

/* ---------- 商品卡片 ---------- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.product-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card .thumb { position: relative; aspect-ratio: 1 / 1; background: #f2f2f2; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .thumb .corner {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 6px;
  background: var(--brand-gradient); color: #fff; font-size: 11px; font-weight: 600;
}
.product-card .body { padding: 10px; }
.product-card .title { font-size: 14px; font-weight: 600; color: var(--text-strong); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.product-card .subtitle { font-size: 12px; color: var(--text-secondary); margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card .foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; }
.product-card .price { color: var(--brand); font-size: 17px; font-weight: 800; }
.product-card .price small { font-size: 12px; }
.product-card .price .orig { color: var(--text-secondary); font-size: 12px; text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.product-card .sold { color: var(--text-secondary); font-size: 12px; }

/* ---------- 打手卡片 ---------- */
.worker-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.worker-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); cursor: pointer; }
.worker-card .thumb { position: relative; aspect-ratio: 1 / 1; }
.worker-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.worker-card .thumb .status { position: absolute; top: 8px; right: 8px; }
.medal-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); cursor: help;
}
.medal-gold { background: linear-gradient(135deg,#ffd700,#ffb300); color:#7a5a00; }
.medal-silver { background: linear-gradient(135deg,#e8e8e8,#c0c0c0); color:#555; }
.medal-bronze { background: linear-gradient(135deg,#e8a77a,#cd7f32); color:#fff; }
.worker-card .thumb .namebar { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-weight: 600; font-size: 15px; }
.worker-card .body { padding: 10px; }
.worker-card .meta { font-size: 12px; color: var(--text-secondary); }
.worker-card .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

/* ---------- 订单卡片 ---------- */
.order-card { background: #fff; border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.order-card .top { display: flex; align-items: center; gap: 10px; }
.order-card .top .no { font-size: 12px; color: var(--text-secondary); flex: 1; }
.order-card .main { display: flex; gap: 10px; margin: 12px 0; }
.order-card .main img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.order-card .main .info { flex: 1; }
.order-card .main .info .t { font-weight: 600; color: var(--text-strong); font-size: 14px; }
.order-card .main .info .d { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.order-card .amount { color: var(--brand); font-weight: 700; }
.order-card .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---------- 状态条 ---------- */
.notice-bar { display: flex; align-items: center; gap: 8px; background: #fff7e6; color: #b26a00; padding: 8px 12px; border-radius: 8px; font-size: 13px; }

/* ---------- 空状态 / 骨架 ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty .ico { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty .t { font-size: 16px; color: var(--text); margin-bottom: 6px; }

.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(0,0,0,.85); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; max-width: 90vw; animation: toastIn .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 420px; overflow: hidden; animation: modalIn .2s; }
@keyframes modalIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.modal .m-head { padding: 16px 18px; font-size: 17px; font-weight: 700; color: var(--text-strong); border-bottom: 1px solid var(--line); }
.modal .m-body { padding: 18px; }
.modal .m-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); justify-content: flex-end; }

/* 底部弹层（移动端） */
.sheet-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: flex-end; }
.sheet { background: #fff; border-radius: 16px 16px 0 0; width: 100%; max-height: 80vh; overflow: auto; padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheetIn .25s; }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- 搜索框 ---------- */
.searchbar { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.95); border-radius: 28px; padding: 6px 6px 6px 16px; }
.searchbar input { flex: 1; border: none; outline: none; background: transparent; font-size: 14px; color: var(--text-strong); }
.searchbar .btn { border-radius: 22px; padding: 8px 18px; }

/* ---------- 设置列表项 ---------- */
.set-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; color: var(--text);
}
.set-item + .set-item { border-top: 1px solid var(--line); }
.set-ico { display: flex; color: var(--text-secondary); flex-shrink: 0; }
.set-chev { display: flex; color: var(--text-secondary); flex-shrink: 0; }

/* ---------- 首页主视觉（移动端基础，PC 端由 desktop.css 覆盖为左右布局） ---------- */
.banner-box {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--brand-gradient);
}
.banner-box .banner-slide { display: block; width: 100%; }
.banner-box .banner-slide img { width: 100%; height: auto; display: block; }
.banner-ph {
  width: 100%;
  aspect-ratio: 3 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.banner-dots {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 6px;
}
.banner-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,.5); cursor: pointer;
  transition: width .2s, background .2s;
}
.banner-dot.on { width: 16px; background: #fff; }

.home-quick-cats {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
}
.quick-cat-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.quick-cat-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.quick-cat {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
}
.quick-cat-ico {
  width: 46px; height: 46px; border-radius: 12px;
  background: #f2f2f2;
  display: flex; align-items: center; justify-content: center;
  color: var(--brand);
  overflow: hidden;
}
.quick-cat-ico img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 用户中心（移动端显示 me-mobile；桌面端显示 me-desktop） ---------- */
.me-desktop { display: none; }

/* ---------- 响应式断点 ---------- */
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .desktop-nav { display: block; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .worker-grid { grid-template-columns: repeat(3, 1fr); }
  body { padding-bottom: 0; }
}
@media (min-width: 1200px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .worker-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 移动端底部留白避免被导航遮挡 */
@media (max-width: 767px) {
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 12px); }
}

/* 工具类 */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.flex { display: flex; } .flex-1 { flex: 1; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.text-secondary { color: var(--text-secondary); } .text-strong { color: var(--text-strong); }
.text-brand { color: var(--brand); } .text-danger { color: var(--danger); } .text-success { color: var(--success); }
.text-center { text-align: center; } .bold { font-weight: 700; }
.hidden { display: none !important; }
.price { color: var(--brand); font-weight: 700; }
