/* ===== 敞开收 · 网页原型 · 全局样式 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  --bg-deep: #0a0618;
  --bg-mid: #1a0b2e;
  --bg-soft: #2d1b4d;
  --gold: #e8c97a;
  --gold-bright: #f5d98a;
  --gold-deep: #c9a227;
  --gold-dim: rgba(232, 201, 122, 0.55);
  --rose-gold: #d4a574;
  --white: #ffffff;
  --white-80: rgba(255, 255, 255, 0.8);
  --white-60: rgba(255, 255, 255, 0.6);
  --white-40: rgba(255, 255, 255, 0.4);
  --white-20: rgba(255, 255, 255, 0.2);
  --white-10: rgba(255, 255, 255, 0.1);
  --glass: rgba(30, 20, 60, 0.45);
  --glass-border: rgba(255, 255, 255, 0.18);
  --purple: #8b6cc7;
  --purple-bright: #a78bfa;
  --green-free: #4ade80;
  --pink-price: #fb7185;
  --vip: #a855f7;
  --tab-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --phone-w: 390px;
  --phone-h: 844px;
  --serif: 'Noto Serif SC', 'Songti SC', serif;
  --sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--sans);
  background: #05030c;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font-family: inherit; border: none; outline: none; background: none; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ===== 手机外壳 ===== */
.app-shell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(88, 40, 140, 0.35), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(40, 60, 140, 0.25), transparent 45%),
    #05030c;
}

.phone {
  position: relative;
  width: min(100vw, var(--phone-w));
  height: min(100vh, var(--phone-h));
  background: var(--bg-deep);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 40px 80px rgba(0,0,0,0.55);
}

@media (min-width: 430px) {
  .phone {
    border-radius: 28px;
  }
}

/* ===== 星空背景 ===== */
.starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 50, 160, 0.45), transparent 55%),
    radial-gradient(ellipse at 80% 60%, rgba(40, 30, 100, 0.4), transparent 40%),
    radial-gradient(ellipse at 20% 80%, rgba(60, 20, 90, 0.35), transparent 40%),
    linear-gradient(180deg, #12081f 0%, #0a0618 50%, #140a28 100%);
  overflow: hidden;
}

.starfield::before,
.starfield::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 30% 40%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 70% 30%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 85% 15%, rgba(255,230,180,0.9), transparent),
    radial-gradient(1px 1px at 15% 70%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 45% 75%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 65% 85%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1.5px 1.5px at 90% 65%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 25% 90%, rgba(255,230,180,0.6), transparent),
    radial-gradient(1px 1px at 55% 50%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 75% 55%, rgba(255,255,255,0.65), transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}

.starfield::after {
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 40% 60%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 80% 80%, rgba(255,230,180,0.7), transparent),
    radial-gradient(1px 1px at 5% 50%, rgba(255,255,255,0.6), transparent);
  animation-delay: -2s;
  opacity: 0.7;
}

@keyframes twinkle {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.streaks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.streaks span {
  position: absolute;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: rotate(-35deg);
  animation: streak 8s linear infinite;
  opacity: 0;
}

.streaks span:nth-child(1) { top: 15%; left: -20%; animation-delay: 0s; }
.streaks span:nth-child(2) { top: 45%; left: -20%; animation-delay: 3s; width: 80px; }
.streaks span:nth-child(3) { top: 70%; left: -20%; animation-delay: 5.5s; width: 100px; }

@keyframes streak {
  0% { opacity: 0; transform: rotate(-35deg) translateX(0); }
  10% { opacity: 0.7; }
  100% { opacity: 0; transform: rotate(-35deg) translateX(500px); }
}

/* ===== 页面层 ===== */
.pages {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
}

.page {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.page.active { display: flex; }

.page-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 28px);
  scrollbar-width: none;
}

.page-scroll::-webkit-scrollbar { display: none; }

/* 防止子页面 padding 简写把底部留白覆盖成 0，导致被 Tab 遮挡 */
.page:not(.no-tab) > .page-scroll {
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 28px) !important;
}

.page.no-tab .page-scroll {
  padding-bottom: 24px !important;
}

/* ===== 顶部栏 ===== */
.nav-bar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 16px;
  flex-shrink: 0;
}

.nav-bar .back {
  position: absolute;
  left: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--white);
  opacity: 0.9;
}

.nav-bar .nav-title {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.nav-bar .nav-actions {
  position: absolute;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-bar .nav-actions button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  font-size: 16px;
}

/* ===== 底部 Tab ===== */
.tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: rgba(10, 6, 24, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-bar.hidden { display: none; }

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--white-40);
  transition: color 0.25s;
  font-size: 11px;
}

.tab-item .tab-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.25s, transform 0.25s;
}

.tab-item .tab-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

.tab-item.active {
  color: var(--gold-bright);
}

.tab-item.active .tab-icon {
  filter: drop-shadow(0 0 8px rgba(245, 217, 138, 0.75));
  transform: translateY(-1px);
}

.tab-item[data-tab="zen"].active {
  color: #e9d5ff;
}

.tab-item[data-tab="zen"].active .tab-icon {
  filter: drop-shadow(0 0 10px rgba(192, 132, 252, 0.85));
}

/* ===== 通用组件 ===== */
.glass {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f5e6b8 0%, #e8c97a 40%, #c9a227 100%);
  color: #2a1a08;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 20px rgba(232, 201, 122, 0.4), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}

.btn-gold::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
  0%, 60% { left: -100%; }
  100% { left: 150%; }
}

.btn-gold:active { transform: scale(0.97); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
}

.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4facfe 0%, #8b7cf7 45%, #f093fb 100%);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 6px 28px rgba(162, 155, 254, 0.5);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s;
}

.tag-pill.selected {
  border-color: rgba(232, 201, 122, 0.75);
  color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(232, 201, 122, 0.4);
  background: rgba(232, 201, 122, 0.14);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.badge-free {
  background: linear-gradient(135deg, #34d399, #22c55e);
  color: #fff;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
}
.badge-vip { background: rgba(168, 85, 247, 0.25); color: #c4b5fd; }
.badge-price {
  background: linear-gradient(135deg, #c084fc 0%, #e879f9 55%, #fb7185 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232, 121, 249, 0.3);
}

.section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 2px;
}

.section-sub {
  text-align: center;
  font-size: 13px;
  color: var(--white-60);
  margin-top: 6px;
  letter-spacing: 0.5px;
}

.brand-footer {
  text-align: center;
  padding: 22px 16px 10px;
  opacity: 0.72;
}

.brand-footer .main {
  font-size: 14px;
  letter-spacing: 1px;
}

.brand-footer .sub {
  font-size: 11px;
  color: var(--white-40);
  margin-top: 4px;
}

/* ===== 弹窗 ===== */
.modal-mask {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-mask.center {
  align-items: center;
  padding: 24px;
}

.modal-mask.show { display: flex; }

.modal-sheet {
  width: 100%;
  max-height: 85%;
  background: linear-gradient(180deg, #2a1848 0%, #160e2a 100%);
  border-radius: 24px 24px 0 0;
  border: 1px solid rgba(232, 201, 122, 0.25);
  border-bottom: none;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  overflow-y: auto;
  animation: sheetUp 0.35s ease;
}

.modal-center {
  width: 100%;
  max-width: 320px;
  background: linear-gradient(160deg, rgba(50, 30, 80, 0.95), rgba(20, 12, 40, 0.98));
  border-radius: 20px;
  border: 1px solid rgba(232, 201, 122, 0.35);
  box-shadow: 0 0 40px rgba(232, 201, 122, 0.15), 0 20px 60px rgba(0,0,0,0.5);
  padding: 28px 22px 22px;
  animation: fadeScale 0.3s ease;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fadeScale {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  opacity: 0.5;
  font-size: 18px;
}

/* ===== 呼吸动效 ===== */
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(232, 201, 122, 0.3); }
  50% { box-shadow: 0 0 28px rgba(232, 201, 122, 0.65); }
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes goldFall {
  0% { transform: translateY(-20px) scale(0); opacity: 0; }
  20% { opacity: 1; transform: translateY(0) scale(1); }
  100% { transform: translateY(100vh) scale(0.5); opacity: 0; }
}

.hidden { display: none !important; }
