/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  color: var(--color-text-primary);
  background: linear-gradient(180deg, #3e2315 0%, #24140b 100%);
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  height: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--color-bg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

/* ===== 页面容器 ===== */
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf9 0%, var(--color-bg) 18%, var(--color-bg) 100%);
}

.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom));
}

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

.page-header {
  flex-shrink: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  background: var(--color-primary-gradient);
  color: white;
  position: relative;
  z-index: 10;
}

.page-header-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: white;
  flex: 1;
  text-align: center;
}

.page-back-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.96);
  outline: 1px solid rgba(245, 220, 200, 0.92);
  box-shadow: 0 8px 18px rgba(143, 81, 32, 0.12);
  cursor: pointer;
  color: var(--color-primary-strong);
  font-size: 18px;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: transform var(--duration-fast), opacity var(--duration-fast), box-shadow var(--duration-fast);
}

.page-back-btn:active {
  opacity: 0.86;
  transform: scale(0.96);
  box-shadow: 0 5px 12px rgba(143, 81, 32, 0.1);
}

.subpage-header-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.subpage-header-main {
  min-width: 0;
  flex: 1;
}

.subpage-header-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-text-primary);
}

.subpage-header-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.subpage-header-side {
  flex-shrink: 0;
}

.tab-hero {
  position: relative;
  padding: 22px 18px 24px;
  background:
    linear-gradient(180deg, rgba(255,124,71,0.2) 0%, rgba(255,124,71,0) 100%),
    var(--tab-hero-bg, none) center top / cover no-repeat;
  color: white;
  overflow: hidden;
}

.tab-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(110,45,11,0.06) 0%, rgba(110,45,11,0.16) 100%);
  pointer-events: none;
}

.tab-hero > * {
  position: relative;
  z-index: 1;
}

.tab-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tab-hero-main {
  min-width: 0;
  flex: 1;
}

.tab-hero-title {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  color: white;
}

.tab-hero-subtitle {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255,255,255,0.84);
}

.tab-hero-side {
  flex-shrink: 0;
}

.tab-hero-body {
  margin-top: 18px;
}

/* ===== 滚动区 ===== */
.scroll-view {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll-view::-webkit-scrollbar { display: none; }

/* ===== 工具类 ===== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none !important; }
.pointer { cursor: pointer; }

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-hint { color: var(--color-text-hint); }
.text-white { color: white; }
.text-red { color: var(--color-red); }
.text-blue { color: var(--color-blue); }
.text-gold { color: var(--color-gold); }

.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
