/* ============================================================
   包蕉原型 · 基础样式（设备壳 / 导航栏 / 状态栏 / TabBar / 通用原子类）
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-body);
  background: #e9ecf2;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; outline: none; }
button { border: none; background: none; padding: 0; cursor: pointer; }
input, textarea { border: none; background: transparent; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ---------- 手机壳 ---------- */
.phone-shell {
  position: relative;
  width: min(100%, var(--frame-w));
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  overflow-x: hidden;
}
@media (min-width: 520px) {
  body { padding: 0; }
  .phone-shell { min-height: 100vh; box-shadow: 0 0 48px rgba(23, 32, 64, .18); }
}
.phone-fixed {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--frame-w));
  z-index: 1000;
}

/* ---------- 状态栏 ---------- */
.proto-status {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--frame-w));
  top: 0;
  height: var(--status-h);
  padding: 0 20px 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1200;
  pointer-events: none;
  color: #1a1a1a;
  transition: color var(--transition);
}
.proto-status.is-light { color: #fff; }
.proto-status__time { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.proto-status__icons { display: flex; align-items: center; gap: 5px; }
.proto-status__icons svg { display: block; fill: currentColor; }

/* ---------- 自定义导航栏 ---------- */
.proto-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: var(--status-h);
  width: min(100%, var(--frame-w));
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 48px;
  z-index: 1100;
  color: #333;
  transition: background var(--transition), color var(--transition), backdrop-filter var(--transition);
}
.proto-nav.is-light { color: #fff; }
.proto-nav.is-frosted {
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.proto-nav.is-solid { background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, .04); }
.proto-nav__title {
  font-size: 16px;
  font-weight: 500;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.proto-nav__back {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}
.proto-nav__back:active { background: rgba(0, 0, 0, .06); }
.proto-nav__back svg { width: 12px; height: 20px; }
.proto-nav__right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.proto-nav__spacer { height: var(--nav-total); }
/* 搜索型导航 */
.proto-nav.is-search { padding: 0 15px; }
.proto-nav__search {
  flex: 1;
  height: 36px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(120, 130, 150, .18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  color: #999;
  font-size: 13px;
  cursor: pointer;
}
.proto-nav__search .uni-icons { font-size: 15px; color: #9aa1b2; }

/* ---------- TabBar ---------- */
.proto-tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, var(--frame-w));
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, .08);
  z-index: 1000;
}
.proto-tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #666;
  cursor: pointer;
  user-select: none;
}
.proto-tabbar__item img { width: 24px; height: 24px; }
.proto-tabbar__item span { font-size: 10px; line-height: 1.2; }
.proto-tabbar__item.is-active { color: #667eea; }
.proto-tabbar__placeholder { height: calc(var(--tabbar-h) + var(--safe-bottom)); }

/* 底部 Home Indicator（机型拟真） */
.proto-home-indicator {
  position: fixed;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, .85);
  z-index: 1300;
  pointer-events: none;
}
.proto-tabbar + .proto-home-indicator { bottom: 8px; }

/* ---------- 页面容器 ---------- */
.page-content {
  position: relative;
  z-index: 1;
  padding-bottom: 24px;
}
.container { padding: 0 15px; }
/* 只作用于内容容器，避免命中同时带 has-tabbar 的 home indicator，把它撑成黑色方块 */
.page-content.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); }
.has-bottom-bar { padding-bottom: 90px; }

/* ---------- 渐变头图 ---------- */
.page-hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 260px;
  background: var(--primary-gradient);
  overflow: hidden;
  z-index: 0;
}
.page-hero__orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, 0) 70%);
}
.page-hero__orb--1 { width: 200px; height: 200px; right: -50px; top: -36px; animation: orbFloat 8s ease-in-out infinite; }
.page-hero__orb--2 { width: 100px; height: 100px; left: -24px; top: 60px; background: radial-gradient(circle, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, 0) 70%); animation: orbFloat 6s ease-in-out infinite reverse; }
.page-hero__orb--3 { width: 80px; height: 80px; right: 32px; top: 120px; background: radial-gradient(circle, rgba(139, 95, 207, .5) 0%, rgba(139, 95, 207, 0) 72%); animation: orbFloat 10s ease-in-out infinite; }
.page-hero::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -46px;
  height: 100px;
  background: var(--bg);
  border-radius: 50% 50% 0 0;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

/* ---------- 通用卡片 ---------- */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 10px; }
.card-pad { padding: 14px 15px; }
.section { margin-top: 14px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  margin-bottom: 10px;
}
.section-head__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
  padding-left: 10px;
}
.section-head__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #667eea, #8b5fcf);
}
.section-head__more {
  font-size: 12px;
  color: #98a0b3;
  background: #f7f8fb;
  border-radius: 12px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ---------- 文本 / 布局原子类 ---------- */
.text-primary { color: var(--text-primary); }
.text-body { color: var(--text-body); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }
.text-white { color: #fff; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.fs-10 { font-size: 10px; } .fs-11 { font-size: 11px; } .fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fs-15 { font-size: 15px; }
.fs-16 { font-size: 16px; } .fs-17 { font-size: 17px; } .fs-18 { font-size: 18px; }
.fs-20 { font-size: 20px; } .fs-22 { font-size: 22px; } .fs-26 { font-size: 26px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-2, .line-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.line-2 { -webkit-line-clamp: 2; }
.line-3 { -webkit-line-clamp: 3; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-15 { gap: 15px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-10 { margin-top: 10px; }
.mt-14 { margin-top: 14px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-10 { margin-bottom: 10px; } .mb-14 { margin-bottom: 14px; }
.px-15 { padding-left: 15px; padding-right: 15px; }
.py-10 { padding-top: 10px; padding-bottom: 10px; }
.relative { position: relative; }
.w-full { width: 100%; }
.round-8 { border-radius: 8px; } .round-10 { border-radius: 10px; } .round-12 { border-radius: 12px; }

/* ---------- List Cell（仿 uni-app 列表） ---------- */
.cell-group { background: #fff; border-radius: var(--radius-lg); overflow: hidden; }
.cell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 12px 15px;
  background: #fff;
}
.cell:first-child { border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
.cell:last-child { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.cell + .cell::before {
  content: "";
  position: absolute;
  left: 15px;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--border);
  transform: scaleY(.5);
}
.cell__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 16px;
  flex-shrink: 0;
}
.cell__title { font-size: 14px; color: #333; }
.cell__desc { font-size: 12px; color: #9ca3af; margin-top: 1px; }
.cell__value { margin-left: auto; font-size: 13px; color: #999; display: flex; align-items: center; gap: 4px; }
.cell__arrow {
  width: 7px; height: 7px;
  border-top: 1.5px solid #c7ccd6;
  border-right: 1.5px solid #c7ccd6;
  transform: rotate(45deg);
  margin-left: 6px;
  flex-shrink: 0;
}
.cell--clickable { cursor: pointer; }
.cell--clickable:active { background: #fafbfc; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  background: #f0f2f5;
  color: #333;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn--primary { background: var(--primary-gradient); color: #fff; }
.btn--accent { background: var(--accent); color: #fff; }
.btn--gold { background: var(--gold-gradient); color: #fff; }
.btn--ghost { background: #f5f5f5; color: #666; }
.btn--outline { background: #fff; border: 1px solid var(--accent); color: var(--accent); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--sm { height: 32px; padding: 0 14px; border-radius: 16px; font-size: 13px; }
.btn--xs { height: 26px; padding: 0 10px; border-radius: 13px; font-size: 11px; }
.btn--lg { height: 48px; border-radius: 24px; font-size: 16px; }
.btn--block { display: flex; width: 100%; }
.btn--disabled { background: #dfe3ea !important; color: #fff !important; pointer-events: none; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.tag--free { background: rgba(16, 185, 129, .12); color: #0e9f6e; }
.tag--price { background: rgba(239, 68, 68, .1); color: #e8453c; }
.tag--new { background: linear-gradient(135deg, #667eea, #8b5fcf); color: #fff; }
.tag--gold { background: rgba(245, 166, 35, .12); color: #bb7d14; }
.tag--gray { background: #f2f4f7; color: #8c94a6; }
.tag--green { background: rgba(82, 196, 26, .1); color: #3f9c0a; }
.tag--blue { background: rgba(24, 144, 255, .1); color: #187ad7; }

/* ---------- 价格 ---------- */
.price { color: var(--red); font-weight: 800; }
.price__symbol { font-size: 11px; font-weight: 700; margin-right: 1px; }
.price__unit { font-size: 10px; font-weight: 400; color: #9ca3af; margin-left: 1px; }
.price--old { color: #bfbfbf; font-weight: 400; text-decoration: line-through; font-size: 11px; margin-left: 4px; }

/* ---------- 加载 / 空状态 ---------- */
.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #e8eaed;
  border-top-color: #667eea;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state-box {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}
.state-box__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(102, 126, 234, .08);
  color: #a0a8bd;
  font-size: 28px;
}
.state-box__title { font-size: 14px; color: #8c8c8c; }
.state-box__desc { font-size: 12px; color: #b0b6c3; }
.state-box--error .state-box__icon { background: rgba(255, 77, 79, .06); color: #ff4d4f; }
.skeleton {
  background: linear-gradient(90deg, #eef0f4 25%, #f7f8fa 37%, #eef0f4 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: 6px;
}
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 滑块 / 横滑隐藏滚动条 ---------- */
.scroll-x { display: flex; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth; }
.scroll-x::-webkit-scrollbar { display: none; }

/* ---------- 头像 ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: #e8eaf0; flex-shrink: 0; }
.avatar--28 { width: 28px; height: 28px; }
.avatar--36 { width: 36px; height: 36px; }
.avatar--44 { width: 44px; height: 44px; }
.avatar--64 { width: 64px; height: 64px; }

/* ---------- 图片占位 / 加载失败 ---------- */
.img-fallback {
  background: linear-gradient(135deg, #eef1f8, #e4e8f2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b6bdcb;
  font-size: 20px;
}

/* ---------- Toast / 遮罩层（基础） ---------- */
.proto-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 260px;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(30, 34, 45, .88);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  z-index: 5000;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
  white-space: pre-wrap;
}
.proto-toast.is-show { opacity: 1; }
.proto-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 3000;
  opacity: 0;
  transition: opacity .28s ease;
}
.proto-mask.is-show { opacity: 1; }
.proto-layer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--frame-w));
  z-index: 3100;
}
