/* 商户 H5 端公共样式 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --primary: #5b6cff;
  --primary-dark: #4251f5;
  --primary-light: #eef0ff;
  --success: #2ec27e;
  --success-light: #e7f8ee;
  --warning: #ff8f3c;
  --warning-light: #fff3e6;
  --danger: #f5333d;
  --danger-light: #fdecec;
  --info: #8a94a6;
  --info-light: #f0f2f5;
  --border: #ebedf2;
  --bg: #f4f5fa;
  --text: #1c2230;
  --text-sub: #6b7280;
  --text-muted: #9ca3af;
  --shadow-sm: 0 1px 2px rgba(28, 34, 48, .04), 0 1px 3px rgba(28, 34, 48, .06);
  --shadow-md: 0 4px 12px rgba(28, 34, 48, .06), 0 2px 6px rgba(28, 34, 48, .04);
  --shadow-lg: 0 12px 32px rgba(28, 34, 48, .10), 0 4px 12px rgba(28, 34, 48, .06);
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: break-word;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* 顶栏 */
.navbar {
  position: sticky; top: 0; z-index: 50;
  height: 52px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(235, 237, 242, .8);
  display: flex; align-items: center; padding: 0 14px;
}
.navbar .title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.navbar .nav-right { width: 44px; text-align: right; font-size: 13px; color: var(--text-sub); }

/* 底部导航（固定在最底部） */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  transform: translateZ(0);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
}
.tabbar a { flex: 1; text-align: center; font-size: 10px; color: var(--text-muted); padding: 5px 0; position: relative; transition: color .2s ease; }
.tabbar a .ic { font-size: 19px; display: block; line-height: 1.3; transition: transform .2s ease; }
.tabbar a.active { color: var(--primary); font-weight: 500; }
.tabbar a.active .ic { transform: translateY(-2px) scale(1.08); }

/* 内容区 */
.page { padding: 14px; padding-bottom: 90px; }

/* 卡片 */
.card {
  background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(235, 237, 242, .6);
}
.card-title { font-size: 13px; color: var(--text-sub); margin-bottom: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.card-title::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, var(--primary), var(--primary-dark)); }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; font-weight: 500; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; background: #fafbfc; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(91, 108, 255, .12); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 13px 16px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 1px;
  box-shadow: 0 6px 18px rgba(91, 108, 255, .28);
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; box-shadow: none; }
.btn-ghost { background: #fff; color: var(--text-sub); border: 1px solid var(--border); box-shadow: none; }
.btn-sm { width: auto; padding: 7px 14px; font-size: 13px; border-radius: 9px; letter-spacing: 0; }
.btn-danger { background: linear-gradient(135deg, #ff6b6b, #f5333d); box-shadow: 0 6px 18px rgba(245, 51, 61, .25); }
.btn-warn { background: linear-gradient(135deg, #ffb35c, #ff8f3c); box-shadow: 0 6px 18px rgba(255, 143, 60, .28); }

/* 列表条目 */
.item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 2px; border-bottom: 1px solid var(--border);
}
.item:last-child { border-bottom: none; }
.item .ic {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.item .info { flex: 1; min-width: 0; }
.item .info .t { font-size: 14px; font-weight: 500; }
.item .info .s { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.item .amt { font-size: 15px; font-weight: 600; text-align: right; flex-shrink: 0; max-width: 55%; overflow-wrap: anywhere; }
.amt-in { color: var(--success); }
.amt-out { color: var(--text); }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 500; }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-info { background: var(--info-light); color: var(--info); }
.tag-primary { background: var(--primary-light); color: var(--primary); }

/* 空状态 */
.empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 32px 0; }

/* 加载更多 */
.load-more { text-align: center; color: var(--text-muted); font-size: 13px; padding: 12px 0 2px; }
.load-more:active { opacity: .6; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 24, 34, .55);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-mask.show { display: flex; animation: maskIn .2s ease; }
.modal {
  background: #fff; border-radius: 18px; padding: 22px 18px 18px;
  width: 100%; max-width: 340px; max-height: 84vh; overflow-y: auto;
  animation: popIn .25s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

/* toast */
.toast {
  position: fixed; top: 18%; left: 50%; transform: translateX(-50%);
  z-index: 999; padding: 10px 18px; border-radius: 10px;
  color: #fff; font-size: 14px; max-width: 80vw; text-align: center;
  animation: maskIn .2s ease;
}
