/*
 * 金果生活商城 - 全局自定义样式
 * 说明：主题色彩通过 Tailwind CDN 的 tailwind.config 扩展（见各页面内联配置或 assets/js/theme.js），
 * 本文件仅补充 Tailwind 原子类难以表达的动效、安全区适配、滚动条隐藏等细节样式。
 */

:root {
  --brand-50: #eefbf3;
  --brand-100: #d5f5e1;
  --brand-200: #aeecc7;
  --brand-300: #7ddda8;
  --brand-400: #4bc687;
  --brand-500: #2aab6a;
  --brand-600: #189a56;
  --brand-700: #147247;
  --brand-800: #125b3a;
  --brand-900: #0f4a30;
  --accent-500: #f5a623;
  --accent-600: #e0921a;
  --danger-500: #e0503c;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { -webkit-font-smoothing: antialiased; }
body {
  background: linear-gradient(180deg, #f3fbf6 0%, #f6f8f6 220px, #f6f8f6 100%);
  color: #1f2d24;
  overscroll-behavior-y: none;
}

/* 隐藏滚动条但保留滚动能力 */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* 底部导航安全区适配 */
.pb-safe { padding-bottom: calc(10px + var(--safe-bottom)); }
.pt-safe { padding-top: var(--safe-top); }

/* 页面内容区默认底部留白，避免被底部Tab遮挡 */
.page-with-tabbar { padding-bottom: calc(76px + var(--safe-bottom)); }
/* 购物车页：额外为结算栏留白（结算栏抬到 Tab 上方） */
.page-with-tabbar.has-settle-bar { padding-bottom: calc(140px + var(--safe-bottom)); }

/* 底部Tab栏 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(8px);
  border-top: 1px solid #eef3ef;
  box-shadow: 0 -4px 16px rgba(20,114,71,0.06);
  padding-bottom: var(--safe-bottom);
}
.tabbar-item { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; flex:1; padding:8px 0 4px; color:#94a3a1; transition: color .2s, transform .2s; position: relative; }
.tabbar-item svg { width:24px; height:24px; transition: transform .25s; }
.tabbar-item.active { color: var(--brand-600); }
.tabbar-item.active svg { transform: translateY(-2px) scale(1.05); }
.tabbar-item .tabbar-label { font-size:11px; }
.tabbar-icon-wrap { position: relative; display: inline-flex; width:24px; height:24px; align-items:center; justify-content:center; }
.tabbar-badge {
  position: absolute; top: -5px; right: -11px; z-index: 1;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger-500); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 600;
  box-shadow: 0 0 0 1.5px #fff;
  pointer-events: none;
}
.tabbar-badge.hidden { display: none; }

/* 购物车结算栏：抬到 Tab 上方，避免购买/结算按钮被挡住 */
.settle-above-tabbar {
  bottom: calc(56px + var(--safe-bottom)) !important;
  z-index: 45;
}

/* 卡片通用阴影 */
.card-shadow { box-shadow: 0 4px 18px rgba(20,114,71,0.08); }

/* 淡入上滑动画 */
@keyframes fadeSlideUp { from { opacity:0; transform: translateY(10px);} to { opacity:1; transform:translateY(0);} }
.anim-in { animation: fadeSlideUp .35s ease both; }

/* Toast 提示 */
#toast-root { position: fixed; top: 46%; left: 50%; transform: translate(-50%,-50%); z-index: 999; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; }
.toast-item { background: rgba(31,41,36,0.88); color:#fff; font-size:13.5px; padding:10px 18px; border-radius: 10px; max-width: 78vw; text-align:center; animation: toastPop .18s ease both; }
@keyframes toastPop { from { opacity:0; transform: scale(.9);} to { opacity:1; transform: scale(1);} }

/* 加载遮罩 */
#loading-root { position: fixed; inset:0; z-index:998; display:none; align-items:center; justify-content:center; background: rgba(255,255,255,0.35); backdrop-filter: blur(2px); }
#loading-root.show { display:flex; }
.spinner { width:34px; height:34px; border-radius:50%; border:3px solid var(--brand-100); border-top-color: var(--brand-500); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架屏 */
.skeleton { background: linear-gradient(90deg,#eef3ef 25%,#f6f9f7 37%,#eef3ef 63%); background-size: 400% 100%; animation: skeletonMove 1.4s ease infinite; border-radius:8px; }
@keyframes skeletonMove { 0%{background-position:100% 50%;} 100%{background-position:0 50%;} }

/* 弹层模态：未展示时必须 pointer-events:none，否则透明遮罩会挡住整页点击（返回按钮等） */
.modal-mask {
  position: fixed; inset:0; background: rgba(15,25,20,0.45); z-index:996;
  opacity:0; visibility:hidden; pointer-events:none;
  transition: opacity .2s, visibility .2s;
}
.modal-mask.show { opacity:1; visibility:visible; pointer-events:auto; }
.modal-panel {
  position: fixed; left:50%; bottom:0; transform: translate(-50%, 100%);
  width:100%; max-width:520px; background:#fff; border-radius:18px 18px 0 0;
  z-index:997; transition: transform .28s cubic-bezier(.32,.72,0,1);
  padding-bottom: var(--safe-bottom); pointer-events:none;
}
.modal-panel.show { transform: translate(-50%, 0); pointer-events:auto; }
.modal-panel.center { left:50%; top:50%; bottom:auto; transform: translate(-50%,-40%) scale(.92); border-radius:16px; opacity:0; pointer-events:none; }
.modal-panel.center.show { transform: translate(-50%,-50%) scale(1); opacity:1; pointer-events:auto; }

/* 按钮按压反馈 + 统一可点区域（避免文字行高导致按钮过瘦） */
.btn-press {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  transition: transform .12s ease, opacity .12s ease;
}
.btn-press:active { transform: scale(.96); opacity:.9; }

/* 主操作按钮统一尺寸（登录/注册/提交/结算等） */
.btn-main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  min-height: 48px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  min-height: 44px;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}

/* 等级进度条光泽动画 */
.progress-shine::after {
  content:''; position:absolute; inset:0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  background-size: 200% 100%; animation: shineMove 2.2s ease infinite;
}
@keyframes shineMove { 0%{background-position: 120% 0;} 100%{background-position: -20% 0;} }

/* 空位虚位以待卡片 */
.seat-placeholder { border: 1.5px dashed #cfe8da; background: #f7fcf9; }
.seat-placeholder.is-action { cursor: pointer; transition: background .15s, border-color .15s, transform .12s; }
.seat-placeholder.is-action:active { transform: scale(.96); }
.seat-placeholder.is-action:hover { background: #eefbf3; border-color: var(--brand-400); }

/* 代注册底部弹层 */
.proxy-sheet {
  height: min(92vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.proxy-sheet .proxy-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.prod-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border: 1.5px solid #e8eee9; border-radius: 12px; background: #fff;
  transition: border-color .15s, background .15s;
}
.prod-pick.is-on { border-color: var(--brand-500); background: #f3fbf6; }
.prod-qty {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid #d8eee2; border-radius: 999px; overflow: hidden; background: #fff;
}
.prod-qty button {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  color: var(--brand-600); font-size: 16px; line-height: 1;
}
.prod-qty span { min-width: 22px; text-align: center; font-size: 13px; color: #334; }
