/* ============================================================
   全局:去除浏览器点击高亮色 + 移除链接/按钮焦点蓝框
   (v28 修复:国产浏览器/iOS Safari 点击元素时显示蓝色或灰色色块)
   ============================================================ */
* {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
}
*:focus {
  outline: none;
}
a, button, [role="button"], [data-tab], [data-act], [onclick], input, select, textarea, label {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
}
/* 长按选中默认禁用(图片/可点击元素),正文文字保留可选 */
a, button, [role="button"], .w-tabbar__item, .tabbar a, .admin-tabbar a {
  -webkit-user-select: none;
  user-select: none;
}

/* 例外:输入框 / 文本区 / .selectable 类 保留可选 */
input, textarea, [contenteditable="true"], .selectable, .chat-bubble, .msg-bubble, p, span, div.text {
  -webkit-user-select: auto;
  user-select: auto;
}

/* ============================================================
   陪玩平台 · 打手端样式
   设计语言：绿色工作台 + 卡片式 H5，参考骑手/接单 app
   ============================================================ */

:root {
  --w-bg: #f5f5f7;
  --w-surface: #ffffff;
  --w-surface-2: #f9fafb;
  --w-border: #e8e8eb;
  --w-text: #1a1a1a;
  --w-text-2: #4a5568;
  --w-text-3: #9ca3af;
  --w-text-4: #cbd5e0;

  /* 主色:荧光绿(新版设计) */
  --w-primary: #A4F040;
  --w-primary-dark: #8DD92E;
  --w-primary-soft: #E8FBC8;
  --w-primary-text: #2D5016;

  /* 强调与功能色 */
  --w-warning: #f59e0b;
  --w-warning-soft: #fef3c7;
  --w-danger: #ef4444;
  --w-danger-soft: #fee2e2;
  --w-info: #0ea5e9;
  --w-info-soft: #e0f2fe;
  --w-coin: #f59e0b;

  --w-r-sm: 6px;
  --w-r-md: 12px;
  --w-r-lg: 18px;
  --w-r-xl: 24px;
  --w-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --w-shadow-md: 0 4px 14px rgba(15,23,42,0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--w-bg);
  color: var(--w-text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 80px; /* 给底部 tabbar 留空间 */
}
a { color: var(--w-primary-text); text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
input, textarea, select { font: inherit; }
img { display: block; max-width: 100%; }

/* ============================================================
   顶部 header（绿色渐变 + 状态栏）
   ============================================================ */
.w-header {
  background: linear-gradient(135deg, var(--w-primary) 0%, var(--w-primary-dark) 100%);
  color: #fff;
  padding: 18px 18px 24px;
  position: relative;
}
.w-header__top {
  display: flex; align-items: center;
  gap: 12px;
}
.w-header__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  border: 2px solid rgba(255,255,255,0.3);
}
.w-header__info { flex: 1; min-width: 0; }
.w-header__name {
  font-size: 16px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.w-header__sub {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 2px;
}
.w-header__status {
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.w-header__status:hover { background: rgba(255,255,255,0.3); }
.w-header__status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74,222,128,0.3);
}
.w-header__status.is-offline .dot { background: #cbd5e0; box-shadow: none; }
.w-header__status.is-offline { background: rgba(255,255,255,0.1); }

/* 顶部数据统计条 */
.w-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--w-r-md);
  margin-top: 16px;
  overflow: hidden;
}
.w-stats__item {
  background: rgba(255,255,255,0.08);
  padding: 12px 8px;
  text-align: center;
}
.w-stats__num {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.w-stats__label {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 2px;
}

/* 内容容器（页面外层用） */
.w-container {
  padding: 14px;
}

/* 标题 */
.w-section {
  margin-bottom: 14px;
}
.w-section__head {
  display: flex; align-items: center;
  margin: 6px 4px 10px;
}
.w-section__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--w-text);
  flex: 1;
}
.w-section__more {
  font-size: 12px;
  color: var(--w-text-3);
}

/* ============================================================
   订单卡片
   ============================================================ */
.w-order {
  background: var(--w-surface);
  border-radius: var(--w-r-md);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--w-shadow-sm);
  position: relative;
  overflow: hidden;
}
.w-order--pending::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--w-warning);
}
.w-order--working::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--w-primary);
}
.w-order__head {
  display: flex; align-items: center;
  margin-bottom: 8px;
}
.w-order__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--w-text);
  flex: 1;
  line-height: 1.3;
}
.w-order__tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 500;
}
.w-order__tag--pending { background: var(--w-warning-soft); color: #b45309; }
.w-order__tag--working { background: var(--w-primary-soft); color: var(--w-primary-text); }
.w-order__tag--done { background: var(--w-info-soft); color: #0369a1; }
.w-order__tag--canceled { background: #f3f4f6; color: var(--w-text-3); }
.w-order__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--w-text-2);
  margin-bottom: 10px;
}
.w-order__meta span {
  display: inline-flex; align-items: center; gap: 4px;
}
.w-order__meta svg { width: 13px; height: 13px; }
.w-order__foot {
  display: flex; align-items: center;
  padding-top: 10px;
  border-top: 1px dashed var(--w-border);
}
.w-order__price {
  font-size: 13px;
  color: var(--w-text-3);
  flex: 1;
}
.w-order__price b {
  font-size: 18px;
  color: var(--w-coin);
  font-weight: 700;
  margin-right: 2px;
}
.w-order__actions { display: flex; gap: 8px; }

/* ============================================================
   按钮
   ============================================================ */
.w-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: var(--w-r-md);
  font-size: 13px;
  font-weight: 500;
  background: var(--w-surface);
  color: var(--w-text);
  border: 1px solid var(--w-border);
  transition: all .12s;
  white-space: nowrap;
}
.w-btn:active { transform: scale(0.97); }
.w-btn--primary {
  background: var(--w-primary);
  color: #1a1a1a;
  border-color: var(--w-primary);
  box-shadow: 0 2px 8px rgba(164,240,64,0.35);
  font-weight: 600;
}
.w-btn--primary:active { background: var(--w-primary-dark); }
.w-btn--ghost {
  background: transparent;
  border: 1px solid var(--w-border);
  color: var(--w-text-2);
}
.w-btn--danger {
  background: var(--w-surface);
  border-color: var(--w-danger);
  color: var(--w-danger);
}
.w-btn--block {
  display: flex;
  width: 100%;
  padding: 12px;
  font-size: 15px;
}
.w-btn--sm { padding: 5px 12px; font-size: 12px; }

/* ============================================================
   底部 tabbar
   ============================================================ */
.w-tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--w-surface);
  border-top: 1px solid var(--w-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.w-tabbar__item {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 9px 0 8px;
  color: var(--w-text-3);
  font-size: 11px;
  position: relative;
}
.w-tabbar__item svg { width: 22px; height: 22px; }
.w-tabbar__item.is-active { color: #16a34a; font-weight: 600; }
.w-tabbar__item.is-active svg { stroke-width: 2.2; }
.w-tabbar__item .badge {
  position: absolute;
  top: 6px;
  right: 50%;
  margin-right: -22px;
  background: var(--w-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 0 5px;
  height: 14px;
  line-height: 14px;
  border-radius: 999px;
  min-width: 14px;
  text-align: center;
}

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

/* 卡片 */
.w-card {
  background: var(--w-surface);
  border-radius: var(--w-r-md);
  padding: 14px;
  box-shadow: var(--w-shadow-sm);
  margin-bottom: 10px;
}
.w-card__title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex; align-items: center;
}
.w-card__title b { flex: 1; }

/* 列表行 */
.w-row {
  display: flex; align-items: center;
  padding: 16px 16px;
  background: var(--w-surface);
  border-bottom: 1px solid #f1f3f5;
  transition: background 0.15s;
}
.w-row:last-child { border-bottom: none; }
.w-row:active { background: #f8f9fa; }
.w-row__ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  display: flex; align-items: center; justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
}
.w-row__ico svg { width: 17px; height: 17px; }
/* 不同色调 — 让卡片不再单调 */
.w-row__ico--blue   { background: #dbeafe; color: #2563eb; }
.w-row__ico--green  { background: #d1fae5; color: #059669; }
.w-row__ico--yellow { background: #fef3c7; color: #d97706; }
.w-row__ico--red    { background: #fee2e2; color: #dc2626; }
.w-row__ico--purple { background: #e9d5ff; color: #7c3aed; }
.w-row__ico--gray   { background: #f1f5f9; color: #475569; }

.w-row__body { flex: 1; min-width: 0; }
.w-row__title { font-size: 14.5px; color: var(--w-text); font-weight: 500; }
.w-row__sub { font-size: 12px; color: var(--w-text-3); margin-top: 3px; }
.w-row__right { color: var(--w-text-3); font-size: 13px; }
.w-row__chev {
  color: #cbd5e1;
  margin-left: 8px;
}
.w-row__chev svg { width: 14px; height: 14px; }

/* 输入框 */
.w-field {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.w-field__label {
  font-size: 13px;
  color: var(--w-text-2);
  font-weight: 500;
}
.w-input, .w-textarea, .w-select {
  width: 100%;
  border: 1px solid var(--w-border);
  border-radius: var(--w-r-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--w-text);
  background: var(--w-surface);
}
.w-input:focus, .w-textarea:focus, .w-select:focus {
  outline: none;
  border-color: var(--w-primary);
}
.w-textarea { resize: vertical; min-height: 80px; }

/* 标签徽章 */
.w-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: var(--w-primary-soft);
  color: var(--w-primary-text);
  font-weight: 500;
}
.w-badge--gray { background: #f3f4f6; color: var(--w-text-2); }
.w-badge--warning { background: var(--w-warning-soft); color: #b45309; }

/* Tab 切换 */
.w-tabs {
  display: flex;
  background: var(--w-surface);
  border-radius: var(--w-r-md);
  padding: 4px;
  margin-bottom: 12px;
  box-shadow: var(--w-shadow-sm);
}
.w-tabs__item {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--w-text-2);
  border-radius: var(--w-r-sm);
  font-weight: 500;
}
.w-tabs__item.is-active {
  background: var(--w-primary);
  color: #fff;
}

/* 空状态 */
.w-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--w-text-3);
}
.w-empty svg { width: 56px; height: 56px; color: var(--w-text-4); margin-bottom: 10px; }
.w-empty p { margin: 0; font-size: 13px; }

/* Toast */
.w-toast {
  position: fixed;
  top: 30%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--w-r-md);
  font-size: 14px;
  z-index: 300;
  box-shadow: var(--w-shadow-md);
  animation: wtIn .2s ease, wtOut .2s ease 2s forwards;
  display: flex; align-items: center; gap: 6px;
}
.w-toast svg { width: 16px; height: 16px; }
@keyframes wtIn { from { opacity: 0; transform: translate(-50%, -60%); } }
@keyframes wtOut { to { opacity: 0; } }

/* 弹窗 */
.w-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
  animation: wfIn .2s ease;
}
@keyframes wfIn { from { opacity: 0; } }
.w-dialog {
  background: var(--w-surface);
  border-radius: var(--w-r-lg);
  width: 100%;
  max-width: 320px;
  overflow: hidden;
}
.w-dialog__title { padding: 18px 20px 8px; font-size: 16px; font-weight: 600; text-align: center; }
.w-dialog__body { padding: 0 20px 18px; font-size: 13px; color: var(--w-text-2); text-align: center; line-height: 1.6; }
.w-dialog__foot {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--w-border);
}
.w-dialog__btn {
  padding: 13px;
  font-size: 15px;
  color: var(--w-text-2);
  border-right: 1px solid var(--w-border);
}
.w-dialog__btn:last-child { border-right: none; color: var(--w-primary); font-weight: 600; }
.w-dialog__btn--danger { color: var(--w-danger) !important; }

/* 上拉 sheet */
.w-sheet-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 110;
  display: flex; align-items: flex-end;
  animation: wfIn .2s ease;
}
.w-sheet {
  width: 100%;
  background: var(--w-surface);
  border-radius: var(--w-r-xl) var(--w-r-xl) 0 0;
  max-height: 80vh;
  display: flex; flex-direction: column;
  animation: wsUp .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes wsUp { from { transform: translateY(100%); } }
.w-sheet__head {
  padding: 16px 18px 10px;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--w-border);
}
.w-sheet__title { font-size: 16px; font-weight: 600; flex: 1; }
.w-sheet__close { color: var(--w-text-3); padding: 4px; }
.w-sheet__body {
  flex: 1; overflow-y: auto;
  padding: 16px 18px;
}
.w-sheet__foot {
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--w-border);
}

/* 登录页 */
.w-login {
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--w-primary) 0%, var(--w-primary-dark) 40%, var(--w-bg) 40%, var(--w-bg) 100%);
  padding: 40px 20px;
}
.w-login__brand {
  text-align: center;
  color: #fff;
  margin-bottom: 30px;
}
.w-login__logo {
  width: 60px; height: 60px;
  margin: 0 auto 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  border: 2px solid rgba(255,255,255,0.3);
}
.w-login__title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.w-login__subtitle { font-size: 13px; opacity: 0.9; }
.w-login__card {
  background: var(--w-surface);
  border-radius: var(--w-r-lg);
  padding: 24px 20px;
  box-shadow: var(--w-shadow-md);
}

/* 工具类 */
body.no-tabbar { padding-bottom: 0; }
.w-hidden { display: none !important; }
.w-mono { font-family: "SF Mono", Menlo, Consolas, monospace; }
.w-muted { color: var(--w-text-3); }
.w-text-coin { color: var(--w-coin); }
.w-text-primary { color: var(--w-primary); }
.w-divider { height: 8px; background: transparent; }
