/* ==============================================
   JD蓝白灰主题 v1.0
   适用项目: ThinkPHP5 H5商城
   主色调: 蓝 #1562b8  灰背景 #f5f5f5  白卡片 #fff
   修改颜色只需改 :root 变量
   ============================================== */

:root {
  --blue:        #1562b8;
  --blue-2:      #1a7ad4;
  --blue-dark:   #0e4a8a;
  --blue-light:  #e8f1fb;
  --red:         #e12022;
  --orange:      #ff6600;
  --green:       #07c160;
  --bg:          #f5f5f5;
  --bg-2:        #ebebeb;
  --white:       #ffffff;
  --border:      #e5e5e5;
  --text:        #333333;
  --text-2:      #666666;
  --text-3:      #999999;
  --header-h:    48px;
  --tabbar-h:    52px;
  --radius:      8px;
  --radius-sm:   4px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; font-size: 14px; color: var(--text); background: var(--bg); font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
ul, li { list-style: none; margin: 0; padding: 0; }
img { display: block; max-width: 100%; border: 0; }
input, button, textarea, select { font-family: inherit; font-size: inherit; outline: none; border: none; background: none; }
button { cursor: pointer; }
p { margin: 0; }

/* ─── 顶部固定导航栏 ─── */
.g-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--header-h); background: var(--blue);
  display: flex; align-items: center; padding: 0 4px;
  box-shadow: 0 1px 6px rgba(0,0,0,.15);
}
.g-header .h-back {
  width: 44px; height: 100%; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; color: #fff;
}
.g-header .h-back svg { width: 22px; height: 22px; fill: #fff; }
.g-header .h-title {
  flex: 1; text-align: center; font-size: 16px; font-weight: 600;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 8px;
}
.g-header .h-right {
  width: 60px; text-align: center; color: #fff; font-size: 13px; flex-shrink: 0;
}
/* 搜索款导航 */
.g-header .h-search {
  flex: 1; margin: 0 6px; height: 30px; background: rgba(255,255,255,.18);
  border-radius: 15px; display: flex; align-items: center; padding: 0 10px; gap: 6px;
}
.g-header .h-search input { flex: 1; background: transparent; color: #fff; font-size: 13px; }
.g-header .h-search input::placeholder { color: rgba(255,255,255,.65); }
.g-header .h-search svg { width: 15px; height: 15px; fill: rgba(255,255,255,.7); flex-shrink: 0; }

/* ─── 底部 tabbar（首页版，4个标签）─── */
.g-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
  height: var(--tabbar-h); background: var(--white);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom);
}
.g-tabbar .tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; color: var(--text-3); cursor: pointer;
}
.g-tabbar .tab-item svg { width: 24px; height: 24px; fill: currentColor; }
.g-tabbar .tab-item.active { color: var(--blue); }
.g-tabbar .tab-item span { line-height: 1; }

/* ─── 页面内容区（自动留出顶部/底部空间）─── */
.g-page { padding-top: var(--header-h); padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); min-height: 100vh; }
.g-page-notab { padding-top: var(--header-h); padding-bottom: 16px; min-height: 100vh; }
/* 无顶部header的页面 */
.g-page-bare { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); min-height: 100vh; }

/* ─── 卡片 ─── */
.g-card { background: var(--white); border-radius: var(--radius); overflow: hidden; }
.g-card + .g-card { margin-top: 8px; }
.g-card-header { padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; }
.g-card-header .title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.g-card-header .title::before { content: ''; width: 3px; height: 15px; background: var(--blue); border-radius: 2px; display: block; }
.g-card-header .more { font-size: 12px; color: var(--text-3); }

/* ─── cell列表行 ─── */
.g-cell {
  display: flex; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--border); gap: 12px; background: var(--white);
}
.g-cell:last-child { border-bottom: none; }
.g-cell .cell-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.g-cell .cell-icon svg { width: 18px; height: 18px; fill: #fff; }
.g-cell .cell-body { flex: 1; overflow: hidden; }
.g-cell .cell-label { font-size: 14px; color: var(--text); }
.g-cell .cell-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.g-cell .cell-value { font-size: 13px; color: var(--text-2); text-align: right; flex-shrink: 0; }
.g-cell .cell-arrow { flex-shrink: 0; }
.g-cell .cell-arrow svg { width: 16px; height: 16px; fill: var(--text-3); }

/* ─── 表单 ─── */
.g-form { background: var(--white); }
.g-form-item { padding: 0 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; height: 52px; }
.g-form-item:last-child { border-bottom: none; }
.g-form-item .f-label { width: 80px; flex-shrink: 0; font-size: 14px; color: var(--text); }
.g-form-item .f-input { flex: 1; font-size: 14px; color: var(--text); height: 100%; }
.g-form-item .f-input::placeholder { color: var(--text-3); }
.g-form-item .f-suffix { flex-shrink: 0; font-size: 13px; color: var(--blue); }

/* ─── 登录/注册专用输入框（全宽无label）─── */
.auth-input-wrap {
  width: 100%; height: 50px; background: var(--bg);
  border-radius: var(--radius-sm); display: flex; align-items: center;
  padding: 0 14px; gap: 10px; margin-bottom: 12px;
}
.auth-input-wrap svg { width: 18px; height: 18px; fill: var(--text-3); flex-shrink: 0; }
.auth-input-wrap input { flex: 1; font-size: 15px; background: transparent; color: var(--text); }
.auth-input-wrap input::placeholder { color: var(--text-3); }
/* 手机区号选择器融入 */
.auth-input-wrap .iti { flex: 1; }
.auth-input-wrap .iti input { width: 100%; }
.iti--allow-dropdown { width: 100%; }
.iti--separate-dial-code .iti__selected-flag { background: transparent; }

/* ─── 主按钮 ─── */
.g-btn {
  display: block; width: 100%; height: 48px; line-height: 48px;
  background: var(--blue); color: #fff; text-align: center;
  font-size: 16px; font-weight: 600; border-radius: 24px;
  border: none; cursor: pointer; letter-spacing: 1px;
  transition: opacity .15s;
}
.g-btn:active { opacity: .85; }
.g-btn.secondary { background: var(--white); color: var(--blue); border: 1px solid var(--blue); }
.g-btn.danger { background: var(--red); }
.g-btn.orange { background: var(--orange); }
.g-btn.sm { height: 36px; line-height: 36px; font-size: 14px; border-radius: 18px; }
.g-btn.xs { height: 28px; line-height: 28px; font-size: 12px; border-radius: 14px; padding: 0 14px; display: inline-block; width: auto; }
.g-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── 徽标 ─── */
.g-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; color: #fff; }
.g-badge.blue   { background: var(--blue); }
.g-badge.green  { background: var(--green); }
.g-badge.red    { background: var(--red); }
.g-badge.orange { background: var(--orange); }
.g-badge.grey   { background: var(--text-3); }
.g-badge.outline { background: transparent; border: 1px solid currentColor; }

/* ─── 分区标题 ─── */
.g-section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px; background: var(--white);
}
.g-section-title .s-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.g-section-title .s-title::before { content: ''; width: 3px; height: 15px; background: var(--blue); border-radius: 2px; display: block; }
.g-section-title .s-more { font-size: 12px; color: var(--text-3); }

/* ─── Banner 轮播 ─── */
.g-banner { width: 100%; overflow: hidden; }
.g-banner .swiper-container { width: 100%; }
.g-banner img { width: 100%; height: 160px; object-fit: cover; display: block; }
.g-banner .swiper-pagination-bullet-active { background: var(--blue) !important; }

/* ─── 公告栏 ─── */
.g-notice {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); padding: 10px 14px;
  font-size: 12px; color: var(--text-2); overflow: hidden;
}
.g-notice .n-icon { color: var(--orange); font-size: 15px; flex-shrink: 0; line-height: 1; }
.g-notice marquee { flex: 1; }

/* ─── 空状态 ─── */
.g-empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.g-empty svg { width: 64px; height: 64px; fill: var(--border); margin: 0 auto 12px; }
.g-empty p { font-size: 13px; }

/* ─── 加载中 ─── */
.g-loading { text-align: center; padding: 20px; color: var(--text-3); font-size: 13px; }

/* ─── 间隔块 ─── */
.g-gap { height: 8px; background: var(--bg); }

/* ─── 价格文字 ─── */
.price-red { color: var(--red); font-weight: 600; }
.price-red .symbol { font-size: .75em; font-weight: normal; }

/* ─── Toast 提示 ─── */
.g-toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.7); color: #fff; padding: 10px 20px;
  border-radius: 6px; font-size: 14px; z-index: 9999;
  text-align: center; pointer-events: none; max-width: 240px;
  white-space: pre-line;
}

/* ─── 图片懒加载占位 ─── */
img[loading="lazy"] { background: var(--bg-2); }

/* ─── 滚动容器 隐藏滚动条 ─── */
.no-scroll-bar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scroll-bar::-webkit-scrollbar { display: none; }

/* ─── 通用 flex 工具 ─── */
.flex-c { display: flex; align-items: center; }
.flex-cb { display: flex; align-items: center; justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }

/* ─── 文字截断 ─── */
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ellipsis-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ─── 右侧箭头（通用）─── */
.g-arrow { display: inline-block; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(-45deg); margin-left: 4px; }

/* ─── 分割线 ─── */
.g-divider { height: 1px; background: var(--border); margin: 0; }

/* ─── 悬浮按钮区（固定底部，1或2个按钮）─── */
.g-footer-btn {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--white); border-top: 1px solid var(--border);
  display: flex; gap: 10px;
}
.g-footer-btn .g-btn { flex: 1; }

/* ─── 头部渐变（个人中心、详情页用）─── */
.g-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-2) 100%);
  padding: 24px 16px 30px; color: #fff;
}

/* ─── 统计数字组件 ─── */
.g-stats { display: flex; }
.g-stats .stat-item { flex: 1; text-align: center; padding: 10px 0; }
.g-stats .stat-item .num { font-size: 20px; font-weight: 700; color: var(--text); }
.g-stats .stat-item .label { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.g-stats .stat-item.highlight .num { color: var(--blue); }
.g-stats .stat-divider { width: 1px; background: var(--border); margin: 8px 0; }

/* ─── Tab 切换栏 ─── */
.g-tabs {
  display: flex; background: var(--white);
  border-bottom: 1px solid var(--border); overflow-x: auto;
}
.g-tabs .tab { flex: 1; min-width: 70px; text-align: center; padding: 12px 8px; font-size: 14px; color: var(--text-2); cursor: pointer; position: relative; white-space: nowrap; }
.g-tabs .tab.active { color: var(--blue); font-weight: 600; }
.g-tabs .tab.active::after { content: ''; position: absolute; bottom: 0; left: 20%; width: 60%; height: 2px; background: var(--blue); border-radius: 1px; }

/* ─── Swiper 分页样式覆盖 ─── */
.swiper-pagination-bullet { background: rgba(255,255,255,.6); opacity: 1; }
.swiper-pagination-bullet-active { background: var(--white) !important; }

/* ─── 通知弹框 ─── */
.g-modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 800; display: flex; align-items: center; justify-content: center; }
.g-modal { background: var(--white); border-radius: var(--radius); width: 85%; max-width: 320px; overflow: hidden; }
.g-modal .modal-hd { padding: 20px 16px 10px; font-size: 16px; font-weight: 600; text-align: center; }
.g-modal .modal-bd { padding: 10px 16px 20px; font-size: 14px; color: var(--text-2); line-height: 1.7; max-height: 260px; overflow-y: auto; }
.g-modal .modal-ft { display: flex; border-top: 1px solid var(--border); }
.g-modal .modal-ft .modal-btn { flex: 1; height: 46px; line-height: 46px; text-align: center; font-size: 15px; cursor: pointer; }
.g-modal .modal-ft .modal-btn + .modal-btn { border-left: 1px solid var(--border); }
.g-modal .modal-ft .modal-btn.confirm { color: var(--blue); font-weight: 600; }

/* ─── 页面过渡动画 ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-in { animation: fadeIn .25s ease; }
