/* ============================================================
   水陆通 H5 移动端样式 — 对齐小程序设计语言
   设计 token 取自 miniapp/app.wxss，保证 H5 与小程序视觉一致
   同一后端、同一数据库、数据互通
   ============================================================ */
/* 全局禁用移动端点击高亮（点击时不出现阴影/灰块） */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-focus-ring-color: transparent;
  outline: none;
  text-decoration: none;
}
a { text-decoration: none; }
.h5-btn, .h5-icon-btn, .h5-more, .h5-link { text-decoration: none !important; }
:root {
  --primary: #065A82;          /* 主色（深蓝青） */
  --primary-dark: #21295C;     /* 深色辅助（导航渐变顶） */
  --accent: #1C7293;           /* 辅助蓝 */
  --accent2: #00A896;          /* 辅助青绿（成功/价格） */
  --gold: #E8B830;             /* 金色 */
  --coral: #F96167;            /* 珊瑚红（价格/取消） */
  --bg: #F0F4F8;               /* 页面背景灰 */
  --surface: #FFFFFF;          /* 卡片表面 */
  --text: #1E293B;             /* 主文字 */
  --text2: #64748B;            /* 次要文字 */
  --divider: #E2E8F0;          /* 分割线 */
  --tag-blue-bg: #E6F2FA;
  --tag-green-bg: #E6FAF5;
  --tag-red-bg: #FEE2E2;
  --tag-gold-bg: #FEF3C7;
  --tag-gold-text: #B45309;

  --page-padding: 16px;
  --card-padding: 16px;
  --card-gap: 12px;
  --card-radius: 14px;
  --btn-radius: 10px;
  --chip-radius: 16px;
}
/* 订单详情：关联详情跳转行 */
.h5-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--divider);
}
.h5-link-row:last-child { border-bottom: none; }
.h5-link-row .h5-arrow { color: var(--text2); font-size: 18px; }

/* 移动端根容器：限制最大宽度，模拟手机屏幕 */
.h5-root {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

/* 顶部导航栏（移动端固定） */
.h5-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--accent) 100%);
  color: #fff;
  padding: 14px var(--page-padding) 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(6, 90, 130, 0.25);
}
.h5-header .h5-title { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }
.h5-header .h5-header-right { display: flex; align-items: center; gap: 14px; }
.h5-header .h5-icon-btn { color: #fff; opacity: 0.95; cursor: pointer; }
.h5-header .h5-icon-btn svg { width: 20px; height: 20px; }

/* 内容区 */
.h5-content { padding: 12px var(--page-padding) 16px; }

/* Hero 横幅（首页顶部） */
.h5-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--accent) 100%);
  color: #fff;
  padding: 18px var(--page-padding) 22px;
}
.h5-hero-title { font-size: 20px; font-weight: 700; }
.h5-hero-sub { font-size: 12px; opacity: 0.85; margin-top: 2px; }

/* 身份切换 segmented control */
.h5-role-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 3px;
  margin-top: 14px;
}
.h5-role-switch button {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 0;
  border-radius: 999px;
  transition: all 0.25s;
  cursor: pointer;
}
.h5-role-switch button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* 首页快捷发布（简化表单） */
.h5-quick-form { display: flex; flex-direction: column; gap: 10px; }
.h5-qf-row { display: flex; align-items: center; gap: 8px; }
.h5-qf-row .h5-input { flex: 1; min-width: 0; }
.h5-qf-arrow { color: var(--primary); font-weight: 700; flex-shrink: 0; }

/* 卡片 */
.h5-card {
  background: var(--surface);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  margin-bottom: var(--card-gap);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.h5-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.h5-card-title .h5-more { font-size: 12px; color: var(--text2); font-weight: 400; cursor: pointer; }

/* 快捷发布表单（首页） */
/* 左右不再额外加 margin，宽度由外层 .h5-content 统一控制，与待处理订单等卡片保持一致 */
.h5-quick-publish { margin: -14px 0 0; position: relative; z-index: 5; }
.h5-quick-publish .h5-card { border: 1px solid rgba(6, 90, 130, 0.08); }
.h5-publish-row { display: flex; align-items: center; gap: 8px; }
.h5-publish-row .h5-port-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 1.5px solid var(--divider);
  border-radius: var(--btn-radius);
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h5-publish-row .h5-port-input:focus { border-color: var(--primary); }
.h5-publish-arrow { color: var(--text2); display: flex; align-items: center; }
.h5-publish-arrow svg { width: 18px; height: 18px; }
.h5-publish-btn {
  width: 100%;
  height: 46px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  border: none;
  border-radius: var(--btn-radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.2s;
}
.h5-publish-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.h5-publish-btn:active { opacity: 0.85; }

/* 按钮 */
.h5-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--btn-radius);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.h5-btn:active { opacity: 0.85; }
.h5-btn-primary { background: var(--primary); color: #fff; }
.h5-btn-accent { background: var(--accent2); color: #fff; }
.h5-btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.h5-btn-ghost { background: #fff; color: var(--text2); border: 1px solid var(--divider); }
.h5-btn-danger { background: var(--coral); color: #fff; }
.h5-btn-block { width: 100%; }
.h5-btn-sm { padding: 6px 12px; font-size: 12px; }

/* 路线行 */
.h5-route { display: flex; align-items: center; gap: 8px; }
.h5-route .h5-port {
  font-size: 16px; font-weight: 700; color: var(--text);
  max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.h5-route .h5-arrow { color: var(--text2); font-size: 14px; flex-shrink: 0; }
.h5-route-meta { font-size: 12px; color: var(--text2); margin-top: 4px; }
.h5-price { color: var(--coral); font-weight: 700; font-size: 16px; }

/* 费用预估卡片（发布货源 - 平台计价实时算价） */
.h5-price-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.h5-price-head span { font-size: 13px; color: var(--text2); }
.h5-price-head b { font-size: 22px; font-weight: 800; color: var(--coral); }
.h5-price-rows { border-top: 1px dashed var(--divider); padding-top: 8px; }
.h5-price-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.h5-price-row span { color: var(--text2); display: flex; align-items: baseline; gap: 6px; }
.h5-price-row span i { font-style: normal; font-size: 11px; color: var(--text3); }
.h5-price-row b { color: var(--text); font-weight: 600; }
.h5-form-error { color: var(--coral); font-size: 12px; padding: 4px 0; }
.h5-price small { font-size: 11px; font-weight: 400; }

/* 状态标签 */
.h5-status {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.h5-status-open { background: var(--tag-blue-bg); color: var(--primary); }
.h5-status-matched { background: var(--tag-green-bg); color: var(--accent2); }
.h5-status-booked { background: var(--tag-blue-bg); color: var(--primary); }
.h5-status-completed, .h5-status-arrived, .h5-status-in_transit { background: var(--tag-green-bg); color: var(--accent2); }
.h5-status-cancelled { background: var(--tag-red-bg); color: var(--coral); }
.h5-status-pending { background: var(--tag-gold-bg); color: var(--tag-gold-text); }
.h5-status-confirmed, .h5-status-loading { background: var(--tag-blue-bg); color: var(--accent); }

/* 底部 TabBar（药丸形，对齐小程序 custom-tabbar） */
.h5-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 100;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: transparent;
  pointer-events: none;
}
.h5-tabbar-pill {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--surface);
  border-radius: 36px;
  padding: 6px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
  border: 1px solid var(--divider);
  pointer-events: auto;
}
.h5-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 0;
  border-radius: 32px;
  background: transparent;
  border: none;
  border-bottom: none;
  text-decoration: none;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text2);
  position: relative;
}
.h5-tab:hover, .h5-tab:focus, .h5-tab:active { text-decoration: none; border-bottom: none; }
.h5-tab svg { width: 22px; height: 22px; margin-bottom: 2px; }
.h5-tab span { font-size: 10px; font-weight: 500; }
.h5-tab.active { background: var(--primary); color: #fff; }
.h5-tab .h5-tab-badge {
  position: absolute;
  top: 0;
  right: 50%;
  transform: translateX(14px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  border-radius: 8px;
  text-align: center;
}

/* 表单 */
.h5-form-group { margin-bottom: 16px; }
.h5-form-label { font-size: 13px; color: var(--text2); margin-bottom: 6px; display: block; font-weight: 500; }
.h5-req { color: #ef4444; margin-left: 2px; font-weight: 700; }
.h5-input, .h5-textarea, .h5-select {
  width: 100%;
  border: 1.5px solid var(--divider);
  border-radius: var(--btn-radius);
  padding: 11px 12px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
}
.h5-input:focus, .h5-textarea:focus, .h5-select:focus { border-color: var(--primary); }
/* datetime-local / date 选择器：保证宽高与文字正常显示 */
.h5-input[type="datetime-local"], .h5-input[type="date"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}
.h5-textarea { min-height: 80px; resize: vertical; }
.h5-form-hint { font-size: 11px; color: var(--text2); margin-top: 4px; }

/* 港口选择器：国家 chips + 港口列表 */
.h5-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.h5-chip {
  font-size: 12px; padding: 5px 12px; border-radius: var(--chip-radius);
  background: var(--surface); color: var(--text2); border: 1px solid var(--divider);
  cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.h5-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.h5-port-option:active { background: var(--tag-blue-bg); }

/* 步骤指示器 */
.h5-steps { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 0; }
.h5-step-dot { width: 24px; height: 4px; border-radius: 2px; background: var(--divider); }
.h5-step-dot.active { background: var(--primary); }

/* 注册页角色选择（显著选中态） */
.role-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  background: var(--surface);
  border: 1.5px solid var(--divider);
  border-radius: 12px;
  padding: 14px 12px;
  transition: all 0.2s;
  position: relative;
}
.role-opt svg { width: 18px; height: 18px; flex-shrink: 0; }
.role-opt.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(6, 90, 130, 0.28);
}
.role-opt.active svg { color: #fff; }

/* 空状态 */
.h5-empty { text-align: center; padding: 48px 24px; color: var(--text2); }
.h5-empty .h5-empty-icon { font-size: 44px; opacity: 0.4; margin-bottom: 10px; }
.h5-empty .h5-empty-text { font-size: 14px; }

/* 列表项（我的页面） */
.h5-menu-list { background: var(--surface); border-radius: var(--card-radius); overflow: hidden; margin-bottom: var(--card-gap); }
.h5-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px var(--card-padding);
  cursor: pointer;
  border-bottom: 1px solid var(--divider);
}
.h5-menu-item:last-child { border-bottom: none; }
.h5-menu-item .h5-menu-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--tag-blue-bg); color: var(--primary);
}
.h5-menu-item .h5-menu-icon svg { width: 18px; height: 18px; }
.h5-menu-item .h5-menu-label { flex: 1; font-size: 14px; color: var(--text); font-weight: 500; }
.h5-menu-item .h5-menu-arrow { color: var(--text2); }
.h5-menu-item .h5-menu-arrow svg { width: 16px; height: 16px; }
.h5-menu-item .h5-menu-badge {
  font-size: 11px; background: var(--coral); color: #fff;
  padding: 1px 7px; border-radius: 8px; font-weight: 600;
}

/* 用户资料卡（我的页顶部） */
.h5-profile-card {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--accent) 100%);
  border-radius: var(--card-radius);
  padding: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--card-gap);
}
.h5-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; flex-shrink: 0;
}
.h5-profile-card .h5-profile-name { font-size: 17px; font-weight: 700; }
.h5-profile-card .h5-profile-role { font-size: 12px; opacity: 0.85; margin-top: 3px; }

/* 钱包余额卡 */
.h5-wallet {
  background: linear-gradient(135deg, #21295C 0%, #065A82 100%);
  border-radius: var(--card-radius);
  padding: 18px;
  color: #fff;
  margin-bottom: var(--card-gap);
}
.h5-wallet .h5-wallet-label { font-size: 12px; opacity: 0.85; }
.h5-wallet .h5-wallet-balance { font-size: 28px; font-weight: 700; margin: 4px 0 14px; }
.h5-wallet-actions { display: flex; gap: 10px; }
.h5-wallet-actions .h5-btn { flex: 1; }

/* 统计小卡 */
.h5-stats-row { display: flex; gap: 10px; margin-bottom: var(--card-gap); }
.h5-stat {
  flex: 1;
  background: var(--surface);
  border-radius: var(--card-radius);
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}
.h5-stat .h5-stat-value { font-size: 18px; font-weight: 700; color: var(--primary); }
.h5-stat .h5-stat-label { font-size: 11px; color: var(--text2); margin-top: 2px; }

/* Toast（移动端覆盖，底部居中） */
.h5-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,23,42,0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 9999;
  animation: h5ToastIn 0.25s ease;
}
@keyframes h5ToastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 全屏加载遮罩 */
.h5-loading {
  position: fixed; inset: 0; background: rgba(255,255,255,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 9998;
}
.h5-spinner {
  width: 32px; height: 32px; border: 3px solid var(--divider);
  border-top-color: var(--primary); border-radius: 50%;
  animation: h5Spin 0.8s linear infinite;
}
@keyframes h5Spin { to { transform: rotate(360deg); } }

/* 支付流水 - 筛选条 */
.h5-filter-row { display: flex; gap: 8px; padding: 10px 14px 4px; }
.h5-filter {
  padding: 5px 16px; border-radius: 999px; font-size: 13px;
  background: var(--surface); color: var(--text2);
  border: 1px solid var(--divider); cursor: pointer; user-select: none;
  transition: all 0.15s;
}
.h5-filter.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 支付流水 - 列表项 */
.h5-flow-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: var(--card-radius);
  padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}
.h5-flow-main { flex: 1; min-width: 0; }
.h5-flow-title { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.h5-flow-tag { font-size: 11px; font-weight: 400; color: var(--text2); background: var(--tag-blue-bg); padding: 1px 7px; border-radius: 6px; }
.h5-flow-time { font-size: 11px; color: var(--text2); margin-top: 3px; }
.h5-flow-amount { font-size: 16px; font-weight: 700; white-space: nowrap; }

/* 底部固定操作条 */
.h5-bottom-bar {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--divider);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center;
  z-index: 90;
}

/* 海报弹层 */
.h5-poster-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 24px;
}
.h5-poster-box { background: #fff; border-radius: 16px; padding: 16px; max-width: 340px; width: 100%; text-align: center; }
.h5-poster-frame { width: 100%; max-width: 300px; height: 450px; border: none; border-radius: 12px; background: #0F172A; }
.h5-poster-actions { display: flex; gap: 10px; margin-top: 14px; }

/* 隐藏 PC 端导航（移动端页面） */
body.h5-mode { background: var(--bg); }
body.h5-mode > nav:first-of-type { display: none !important; }
body.h5-mode > footer { display: none !important; }
body.h5-mode #toast-container { display: none !important; }

/* 弹窗（余额/线下支付、密码） */
.h5-sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 9990; display: none; align-items: flex-end; justify-content: center;
}
.h5-sheet-mask.show { display: flex; }
.h5-sheet {
  background: #fff; width: 100%; max-width: 480px;
  border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  animation: h5SheetUp 0.25s ease;
}
@keyframes h5SheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.h5-sheet-title { font-size: 16px; font-weight: 700; text-align: center; margin-bottom: 16px; position: relative; }
.h5-sheet-title .h5-sheet-close { position: absolute; right: 0; top: 0; color: var(--text2); cursor: pointer; font-size: 20px; line-height: 1; }
.h5-pay-amount { text-align: center; font-size: 28px; font-weight: 700; color: var(--coral); margin: 8px 0 18px; }
.h5-pay-method {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1.5px solid var(--divider); border-radius: var(--btn-radius);
  margin-bottom: 12px; cursor: pointer; transition: all 0.2s;
}
.h5-pay-method.active { border-color: var(--primary); background: var(--tag-blue-bg); }
.h5-pay-method .h5-pay-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.h5-pay-method .h5-pay-label { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.h5-pay-method .h5-pay-desc { font-size: 11px; color: var(--text2); }
.h5-pay-method .h5-pay-check { width: 18px; height: 18px; color: var(--primary); }

/* 港口选择输入框（自定义箭头，避免系统原生控件） */
.h5-port-select { position: relative; display: block; width: 100%; }
.h5-port-select .h5-input { width: 100%; padding-right: 32px; cursor: pointer; }
.h5-field-arrow {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; color: var(--text2); pointer-events: none;
}
.h5-field-arrow svg { width: 16px; height: 16px; transition: transform 0.2s; }
.h5-port-select:active .h5-field-arrow svg { color: var(--primary); }
