/* =============================================================
   第二套新增组件样式：
   1) 点单端首页增强：4 格功能区 + 分类分组双列商品
      对齐第一套「26神羔独眼蛇自研」h5/index.php 的 function-grid
      与「分类 › 子分类」商品分组
   2) 多身份（老板端 / 打手端 / 商家端）：切换 · 申请 · 商家工作台 · 后台审核中心
   ============================================================= */

/* ---------- 4 格功能区 ---------- */
.fn-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 10px 10px 0;
  padding: 14px 8px;
  background: #fff; border-radius: var(--r-l);
  box-shadow: var(--shadow-card);
}
.fn-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 4px 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-align: center;
}
.fn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 14px;
  /* 参照图效果：高饱和渐变实底 + 白色图标 + 顶部内高光 + 浮起投影（主色保持蓝） */
  background: var(--grad-main);
  color: #fff;
  box-shadow: 0 6px 14px rgba(60, 156, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .38);
  transition: transform .18s ease, box-shadow .18s ease;
}
.fn-item:active .fn-icon { transform: scale(.94); box-shadow: 0 3px 8px rgba(60, 156, 255, .26), inset 0 1px 0 rgba(255, 255, 255, .38); }
.fn-item:hover .fn-icon { box-shadow: 0 8px 18px rgba(60, 156, 255, .42), inset 0 1px 0 rgba(255, 255, 255, .38); }
.fn-icon svg { width: 23px; height: 23px; }
.fn-icon img { width: 23px; height: 23px; object-fit: contain; }
.fn-label { font-size: 12px; color: var(--text-2); line-height: 1.2; }

/* ---------- 分类 › 子分类 分组 ---------- */
.home-group { margin: 0 10px 14px; }
.home-group-head {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 2px 9px;
}
.home-group-bar {
  width: 3px; height: 15px; border-radius: 2px;
  background: var(--grad-modern); flex-shrink: 0;
}
.home-group-title {
  font-size: 14.5px; font-weight: 700; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-group-title .sub { color: var(--text-3); font-weight: 500; }

.home-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.home-card {
  display: flex; flex-direction: column;
  background: #f8f9fc;
  border: 1px solid rgba(0, 0, 0, .04);
  border-radius: var(--r-m);
  box-shadow: 2px 3px 6px rgba(0, 0, 0, .04), -2px 3px 6px rgba(0, 0, 0, .04);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.home-card:active { transform: scale(.985); }
.home-card-img { position: relative; width: 100%; padding-bottom: 66%; background: #e9eef5; }
.home-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-card-body { padding: 8px 9px 10px; }
.home-card-title {
  font-size: 13px; 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: 35px;
}
.home-card-price {
  margin-top: 7px; display: flex; align-items: baseline; gap: 1px;
  font-size: 17px; font-weight: 700; color: var(--price-num);
}
.home-card-price .sym { font-size: 12px; font-weight: 600; color: var(--price-sym); }
.home-card-old { margin-left: 5px; font-size: 11.5px; font-weight: 400; color: var(--text-4); text-decoration: line-through; }
.home-card-tag {
  position: absolute; left: 0; top: 0; z-index: 2;
  padding: 2px 7px; border-radius: 0 0 8px 0;
  font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--grad-warm);
}
.home-card-sold {
  position: absolute; right: 6px; bottom: 6px; z-index: 2;
  padding: 1px 6px; border-radius: var(--r-pill);
  font-size: 10.5px; color: #fff; background: rgba(0, 0, 0, .42);
}

@media (max-width: 360px) {
  .fn-grid { gap: 6px; padding: 12px 4px; }
  .fn-icon { width: 40px; height: 40px; border-radius: 12px; }
  .fn-icon svg, .fn-icon img { width: 20px; height: 20px; }
  .fn-label { font-size: 11px; }
  .home-card-price { font-size: 15px; }
}

/* =============================================================
   多身份：切换 · 申请 · 商家工作台 · 后台审核中心
   ============================================================= */

/* ---------- 「我的」页身份切换 ---------- */
.role-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.role-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 15px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  background: #f2f4f8; border: 1px solid rgba(0, 0, 0, .05);
  text-decoration: none; transition: all .18s ease;
}
.role-pill.on {
  color: #fff; background: var(--grad-modern);
  box-shadow: 0 3px 10px rgba(43, 133, 228, .28);
}
.role-pill.pending { color: #b26a00; background: #fff6e5; border-color: #ffe0a3; }
.role-pill.ghost { color: var(--primary); background: #fff; border: 1px dashed rgba(60, 156, 255, .5); }
.role-tip { margin-top: 10px; font-size: 12px; color: var(--text-3); line-height: 1.5; }

/* ---------- 身份申请 ---------- */
.role-apply-note { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 14px; }
.role-reject-note {
  margin-bottom: 12px; padding: 10px 12px; border-radius: var(--r-s);
  font-size: 12.5px; line-height: 1.6; color: #b02a1f;
  background: rgba(250, 85, 72, .08); border: 1px solid rgba(250, 85, 72, .18);
}

/* ---------- 审核中心：身份申请 / 商家服务卡片 ---------- */
.role-app-list { display: flex; flex-direction: column; gap: 10px; }
.role-app-item {
  padding: 12px 14px; border-radius: var(--r-m);
  background: #f8f9fc; border: 1px solid rgba(0, 0, 0, .05);
}
.role-app-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 7px;
}
.role-app-name { font-size: 14px; font-weight: 700; color: var(--text-strong); }
.role-app-meta { font-size: 12.5px; color: var(--text-3); line-height: 1.8; word-break: break-all; }
.role-app-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.role-app-acts form { display: flex; align-items: center; gap: 8px; margin: 0; }

/* ---------- 商家工作台 ---------- */
.mch-kpi {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 10px 10px 0; padding: 14px 10px;
  background: #fff; border-radius: var(--r-l); box-shadow: var(--shadow-card);
}
.mch-kpi-item { text-align: center; }
.mch-kpi-num { font-size: 16px; font-weight: 700; color: var(--text-strong); }
.mch-kpi-label { margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.mch-list { display: flex; flex-direction: column; gap: 8px; }
.mch-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-m);
  background: #f8f9fc; border: 1px solid rgba(0, 0, 0, .05);
}
.mch-item-main { min-width: 0; }
.mch-item-title {
  font-size: 13.5px; font-weight: 600; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mch-item-meta { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.mch-state {
  flex-shrink: 0; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600;
}
.mch-state.ok   { color: #1f9d63; background: rgba(31, 157, 99, .12); }
.mch-state.wait { color: #b26a00; background: #fff6e5; }
.mch-state.off  { color: var(--text-4); background: rgba(0, 0, 0, .06); }

@media (max-width: 360px) {
  .mch-kpi { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* =============================================================
   打手端·接单大厅（布局照搬 26「发单抢单系统」user/index.php）
   公告栏 → 游戏分类导航 → 服务类型筛选 → 订单卡片（订单价 / 到手）
   ============================================================= */

.game-nav { margin: 10px 10px 0; }
.game-nav-grid {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 5px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.game-nav-grid::-webkit-scrollbar { display: none; }
.game-nav-item {
  flex-shrink: 0; padding: 7px 16px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: var(--text-2);
  background: #fff; border: 1px solid rgba(0, 0, 0, .05);
  text-decoration: none; box-shadow: var(--shadow-card);
  transition: all .18s ease;
}
.game-nav-item.active {
  color: #fff; background: var(--grad-modern);
  border-color: transparent; box-shadow: 0 3px 10px rgba(43, 133, 228, .28);
}

.server-filter {
  display: flex; gap: 8px; overflow-x: auto;
  margin: 8px 10px 0; padding-bottom: 5px; scrollbar-width: none;
}
.server-filter::-webkit-scrollbar { display: none; }
.server-filter-item {
  flex-shrink: 0; padding: 6px 14px; border-radius: var(--r-s);
  font-size: 12.5px; font-weight: 600; color: var(--text-3);
  background: var(--blue-soft); text-decoration: none; transition: all .18s ease;
}
.server-filter-item.active { color: var(--primary); background: rgba(60, 156, 255, .14); }

.order-list { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.order-card {
  position: relative;
  background: #fff; border-radius: var(--r-l);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.order-card .order-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 12px 8px;
}
.order-card .order-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.order-card .user-avatar {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 15px; font-weight: 700; color: #fff;
  background: var(--grad-main);
}
.order-card .user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.order-card .user-info { min-width: 0; }
.order-card .user-name {
  font-size: 13.5px; font-weight: 700; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.order-card .user-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.order-card .user-tag {
  padding: 1px 7px; border-radius: var(--r-pill);
  font-size: 10.5px; color: var(--primary); background: var(--blue-soft-2);
}
.order-card .order-price-box { flex-shrink: 0; text-align: right; }
.order-card .order-price { font-size: 17px; font-weight: 700; color: var(--price-num); }
.order-card .order-gain { margin-top: 3px; font-size: 11.5px; font-weight: 600; color: #1f9d63; }
.order-card .order-body { padding: 0 12px; }
.order-card .order-title { font-size: 14px; font-weight: 600; color: var(--text-strong); line-height: 1.4; }
.order-card .order-remark {
  margin-top: 5px; font-size: 12px; color: var(--text-3); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.order-card .order-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px 12px; margin-top: 8px;
  border-top: 1px solid var(--divider-soft);
}
.order-card .order-foot-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.order-card .order-time { font-size: 11px; color: var(--text-4); white-space: nowrap; }
.order-card .order-foot-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.order-cta { font-size: 12.5px; font-weight: 600; color: var(--primary); white-space: nowrap; }

/* =============================================================
   打手主页「找 TA 代练」- 选择商品弹窗（对齐第一套：点单 - 选择商品）
   ============================================================= */
.pd-pick-mask {
  position: fixed; inset: 0; z-index: 1100; display: none;
  align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .45);
}
.pd-pick-mask.on { display: flex; }
.pd-pick {
  width: 100%; max-width: 640px; max-height: 82vh;
  display: flex; flex-direction: column;
  padding: 16px 14px calc(14px + env(safe-area-inset-bottom));
  background: #fff; border-radius: 18px 18px 0 0;
  animation: pdPickUp .22s ease;
}
@keyframes pdPickUp { from { transform: translateY(14px); opacity: .4; } to { transform: none; opacity: 1; } }
.pd-pick-head { display: flex; align-items: center; justify-content: center; position: relative; padding-bottom: 12px; }
.pd-pick-title { font-size: 16px; font-weight: 700; color: var(--text-strong); }
.pd-pick-close {
  position: absolute; right: 0; top: -2px;
  width: 30px; height: 30px; line-height: 1; border: 0; cursor: pointer;
  background: transparent; color: var(--text-4); font-size: 24px;
}
.pd-pick-search { padding-bottom: 10px; }
.pd-pick-input {
  width: 100%; height: 40px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: #f7f8fa; font-size: 14px; color: var(--text-strong); outline: none;
}
.pd-pick-input:focus { border-color: var(--primary); background: #fff; }
.pd-pick-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}
.pd-pick-tab {
  flex-shrink: 0; padding: 5px 14px; border-radius: var(--r-pill);
  background: #f2f3f5; color: var(--text-3); font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.pd-pick-tab.on { background: var(--grad-modern); color: #fff; font-weight: 600; }
.pd-pick-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pd-pick-item {
  display: flex; align-items: center; gap: 10px; position: relative;
  padding: 8px 6px; border-radius: var(--r-m); text-decoration: none;
  border-bottom: 1px solid var(--divider-soft);
}
.pd-pick-item:active { background: var(--blue-soft); }
.pd-pick-thumb { flex-shrink: 0; width: 62px; height: 62px; border-radius: var(--r-s); overflow: hidden; background: #e9eef5; }
.pd-pick-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-pick-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pd-pick-name {
  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;
}
.pd-pick-meta { font-size: 11.5px; color: var(--text-4); }
.pd-pick-price { display: flex; align-items: baseline; gap: 1px; color: var(--price-num); font-weight: 800; font-size: 15px; }
.pd-pick-price i { font-size: 11px; font-style: normal; font-weight: 600; }
.pd-pick-price em { margin-left: 5px; font-size: 11.5px; font-weight: 400; color: var(--text-4); text-decoration: line-through; font-style: normal; }
.pd-pick-sold { flex-shrink: 0; font-size: 11px; color: #fff; background: var(--text-5); border-radius: var(--r-pill); padding: 2px 8px; }
.pd-pick-item.is-sold { opacity: .62; }
.pd-pick-empty { padding: 30px 0; text-align: center; font-size: 13px; color: var(--text-4); }
