/* ============================================================
 * app.css - 爱学习 H5 全局样式
 * 复刻自小程序 app.wxss，rpx → px 换算（750rpx ≈ 100vw ≈ 375px 设计稿）
 * ============================================================ */

:root {
  /* ============ 品牌色（教育主题 - 温暖、可信赖） ============ */
  --primary: #5b8dee;
  --primary-dark: #3b6fd4;
  --primary-light: #7da8f3;
  --primary-bg: #eef4ff;
  --primary-50: #f5f8ff;
  
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --pink: #ec4899;
  
  --dark: #1a2332;
  --dark-2: #334155;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --gray-lighter: #cbd5e1;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  
  --light: #f8fafc;
  --light-warm: #fafbff;
  --surface: #ffffff;
  --surface-muted: #f8fafc;

  /* ============ 品牌渐变 ============ */
  --brand-gradient: linear-gradient(135deg, #5b8dee 0%, #7c3aed 100%);
  --brand-gradient-soft: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  --brand-gradient-warm: linear-gradient(135deg, #f472b6 0%, #fb923c 100%);
  --brand-gradient-cool: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);

  /* 旧渐变（保持兼容） */
  --gradient-1: var(--brand-gradient);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-4: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --gradient-5: linear-gradient(135deg, #30cfd0 0%, #330867 100%);

  /* ============ 间距系统（4px 基数） ============ */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ============ 圆角系统 ============ */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
  --radius-full: 999px;

  /* ============ 阴影系统 ============ */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
  
  --shadow-brand: 0 4px 16px rgba(91, 141, 238, 0.25);
  --shadow-brand-lg: 0 8px 32px rgba(91, 141, 238, 0.35);

  /* ============ 字体层级 ============ */
  --font-xs: 10px;
  --font-sm: 12px;
  --font-base: 14px;
  --font-md: 15px;
  --font-lg: 16px;
  --font-xl: 18px;
  --font-2xl: 20px;
  --font-3xl: 24px;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.2;
  --leading-snug: 1.4;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;

  /* ============ 安全区 ============ */
  --tabbar-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-top: env(safe-area-inset-top);

  /* ============ 扩展色板（语义化） ============ */
  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-surface-alt: #f1f5f9;
  --c-text: #1e293b;
  --c-text-secondary: #64748b;
  --c-text-muted: #94a3b8;
  --c-text-disabled: #cbd5e1;
  --c-border: #e2e8f0;
  --c-border-light: #f1f5f9;
  --c-overlay: rgba(15, 23, 42, 0.5);

  /* ============ 扩展阴影层级 ============ */
  --elevation-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --elevation-2: 0 2px 4px rgba(15, 23, 42, 0.06), 0 4px 8px rgba(15, 23, 42, 0.06);
  --elevation-3: 0 4px 8px rgba(15, 23, 42, 0.08), 0 8px 16px rgba(15, 23, 42, 0.06);
  --elevation-4: 0 8px 16px rgba(15, 23, 42, 0.10), 0 16px 32px rgba(15, 23, 42, 0.08);
  --elevation-brand: 0 4px 14px rgba(91, 141, 238, 0.28);
  --elevation-brand-lg: 0 8px 28px rgba(91, 141, 238, 0.38);
  --elevation-warning: 0 2px 8px rgba(245, 158, 11, 0.25);

  /* ============ 扩展圆角 ============ */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
  --radius-full: 999px;

  /* ============ 扩展字号 ============ */
  --font-3xl: 24px;

  /* ============ 过渡动效 ============ */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-normal: 200ms;
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --active-scale: 0.97;
  --focus-ring: 0 0 0 3px rgba(91, 141, 238, 0.3);

  /* ============ Z-index 层级 ============ */
  --z-base: 1;
  --z-sticky: 100;
  --z-fixed: 200;
  --z-modal: 300;
  --z-popover: 400;
  --z-tooltip: 500;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: var(--font-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  max-width: 480px;
  margin: 0 auto;
  overflow-x: hidden;
  min-height: 100vh;
  font-feature-settings: "kern" 1;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }
#page-container { flex: 1; min-height: 100vh; }

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

/* 隐藏滚动条 */
::-webkit-scrollbar { width: 0; height: 0; }

/* ============ 通用容器 ============ */
.container { padding: var(--space-3); }
.page-wrap { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom)); }

/* ============ 卡片 ============ */
.card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--elevation-1);
  margin-bottom: var(--space-3);
  border: 1px solid var(--c-border-light);
  transition: box-shadow var(--dur-normal) var(--ease-standard);
}
.card:hover { box-shadow: var(--elevation-2); }

/* ============ 按钮 ============ */
.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px var(--space-5);
  font-size: var(--font-base);
  font-weight: var(--weight-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-shadow: var(--elevation-brand);
  transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-normal) var(--ease-standard);
}
.btn-primary:active { transform: scale(var(--active-scale)); box-shadow: var(--elevation-brand); }
.btn-primary:hover { box-shadow: var(--elevation-brand-lg); }

.btn-secondary {
  background: var(--c-surface);
  color: var(--primary);
  border: 1.5px solid var(--primary-bg);
  border-radius: var(--radius-full);
  padding: 9px var(--space-5);
  font-size: var(--font-base);
  font-weight: var(--weight-semibold);
  transition: all var(--dur-fast) var(--ease-standard);
}
.btn-secondary:active { transform: scale(var(--active-scale)); }
.btn-secondary:hover { border-color: var(--primary); background: var(--primary-50); }

.btn-block { width: 100%; display: flex; }
.btn-text { color: var(--primary); font-size: var(--font-base); padding: 0; }

/* ============ 标签 ============ */
.tag {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: var(--weight-medium);
}
.tag-primary { background: var(--primary-bg); color: var(--primary); }
.tag-success { background: #d1fae5; color: var(--success); }
.tag-warning { background: #fef3c7; color: var(--warning); }
.tag-danger { background: #fee2e2; color: var(--danger); }

/* ============ 文字 ============ */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-gray { color: var(--gray); }
.text-gray-light { color: var(--gray-light); }

.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }

/* ============ Flex ============ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* ============ 间距 ============ */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }

/* ============ 学科配色（与小程序一致） ============ */
.sc-chinese { background: linear-gradient(135deg, #f87171, #ef4444); }
.sc-math { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.sc-english { background: linear-gradient(135deg, #34d399, #10b981); }
.sc-physics { background: linear-gradient(135deg, #c084fc, #8b5cf6); }
.sc-chemistry { background: linear-gradient(135deg, #f472b6, #ec4899); }
.sc-biology { background: linear-gradient(135deg, #4ade80, #22c55e); }
.sc-history { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.sc-geography { background: linear-gradient(135deg, #22d3ee, #06b6d4); }
.sc-politics { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.sc-moral { background: linear-gradient(135deg, #fb923c, #f97316); }
.sc-science { background: linear-gradient(135deg, #6ee7b7, #059669); }
.sc-programming { background: linear-gradient(135deg, #f97316, #ea580c); }
.sc-robot { background: linear-gradient(135deg, #6ee7b7, #059669); }
.sc-composition { background: linear-gradient(135deg, #fda4af, #e11d48); }
.sc-reading { background: linear-gradient(135deg, #fcd34d, #d97706); }
.sc-homeland { background: linear-gradient(135deg, #c4b5fd, #7c3aed); }
.sc-it { background: linear-gradient(135deg, #94a3b8, #64748b); }
.sc-olympiad { background: linear-gradient(135deg, #6ee7b7, #059669); }
.sc-exam-real { background: linear-gradient(135deg, #f87171, #ef4444); }
.sc-exam-mock { background: linear-gradient(135deg, #fb923c, #f97316); }
.sc-exam-summary { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.sc-exam-skill { background: linear-gradient(135deg, #22d3ee, #06b6d4); }

/* ============ 学科图标基础 ============ */
.sc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  font-size: 20px;
}
.sc-icon i { font-size: 20px; }

/* ============ 图标 SVG 通用 ============ */
.icon-svg {
  display: inline-block;
  vertical-align: middle;
}
.icon-svg svg { width: 100%; height: 100%; fill: currentColor; }

/* ============ 页面通用头部（沉浸式） ============ */
.immersive-header {
  background: var(--gradient-1);
  position: relative;
  overflow: hidden;
  color: #fff;
}
.immersive-header::before, .immersive-header::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.immersive-header::before { top: -40%; right: -15%; width: 250px; height: 250px; }
.immersive-header::after { bottom: -20%; left: -10%; width: 180px; height: 180px; background: rgba(255, 255, 255, 0.06); }

/* 顶部导航栏（沉浸式背景） */
.nav-bar-immersive {
  background: var(--brand-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  gap: var(--space-2);
  position: relative;
  z-index: var(--z-sticky);
}
.nav-bar-immersive .nav-back { color: #fff; padding: var(--space-1) var(--space-2); font-size: var(--font-xl); border-radius: var(--radius-md); transition: background var(--dur-fast); }
.nav-bar-immersive .nav-back:active { background: rgba(255,255,255,0.2); }
.nav-bar-immersive .nav-back i { font-size: var(--font-xl); }
.nav-bar-immersive .nav-title { font-size: var(--font-lg); font-weight: var(--weight-semibold); flex: 1; text-align: center; }
.nav-bar-immersive .nav-action { width: 32px; text-align: right; }

/* 顶部导航栏（白色背景） */
.nav-bar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  gap: var(--space-2);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  box-shadow: var(--elevation-1);
}
.nav-bar .nav-back { color: var(--c-text); padding: var(--space-1) var(--space-2); font-size: var(--font-xl); border-radius: var(--radius-md); transition: background var(--dur-fast); }
.nav-bar .nav-back:active { background: var(--c-surface-alt); }
.nav-bar .nav-back i { font-size: var(--font-xl); }
.nav-bar .nav-title { flex: 1; font-size: var(--font-lg); font-weight: var(--weight-semibold); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-bar .nav-action { width: 32px; }

/* 状态栏占位 */
.status-bar-placeholder { height: var(--safe-top); }

/* ============ 底部 TabBar ============ */
.app-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--c-border-light);
  display: flex;
  justify-content: space-around;
  padding: var(--space-2) 0 calc(var(--space-2) + var(--safe-bottom));
  z-index: var(--z-fixed);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}
.app-tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-1) 14px;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard);
  font-size: var(--font-xs);
  position: relative;
  border-radius: var(--radius-md);
}
.app-tabbar-item:active { transform: scale(0.94); }
.app-tabbar-item.active { color: var(--primary); }
.app-tabbar-icon {
  width: 22px;
  height: 22px;
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: transform var(--dur-fast) var(--ease-standard);
}
.app-tabbar-item.active .app-tabbar-icon { transform: scale(1.12); }
.app-tabbar-icon i { font-size: 20px; }
.app-tabbar-text { font-size: var(--font-xs); font-weight: var(--weight-medium); }

/* ============ 全局加载 ============ */
.global-loading {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--c-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-tooltip);
  transition: opacity 0.3s;
}
.global-loading.hide { opacity: 0; pointer-events: none; }

.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(91, 141, 238, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  font-weight: var(--weight-medium);
  z-index: var(--z-tooltip);
  pointer-events: none;
  max-width: 80%;
  text-align: center;
  box-shadow: var(--elevation-3);
  animation: toast-in var(--dur-fast) var(--ease-standard);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -45%); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* ============ Modal ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: var(--c-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  animation: fade-in var(--dur-normal);
}
.modal-box {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  width: 86%;
  max-width: 320px;
  overflow: hidden;
  box-shadow: var(--elevation-4);
  animation: scale-in var(--dur-normal);
}
.modal-title { font-size: var(--font-lg); font-weight: var(--weight-bold); text-align: center; padding: var(--space-5) var(--space-4) var(--space-2); color: var(--c-text); }
.modal-content { padding: var(--space-2) var(--space-4) var(--space-4); font-size: var(--font-base); color: var(--c-text-secondary); text-align: center; line-height: var(--leading-snug); }
.modal-actions { display: flex; border-top: 1px solid var(--c-border); }
.modal-btn { flex: 1; padding: var(--space-4); font-size: var(--font-base); font-weight: var(--weight-semibold); background: var(--c-surface); transition: background var(--dur-fast); }
.modal-btn:active { background: var(--c-surface-alt); }
.modal-btn-cancel { color: var(--c-text-muted); border-right: 1px solid var(--c-border); }
.modal-btn-confirm { color: var(--primary); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* ============ 空状态 ============ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  color: var(--c-text-muted);
  text-align: center;
}
.empty-state .empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-3);
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.empty-state .empty-icon i { font-size: 48px; }
.empty-state .empty-text { font-size: var(--font-base); color: var(--c-text-muted); }

/* ============ 加载更多 ============ */
.loading-more {
  text-align: center;
  padding: var(--space-4);
  color: var(--c-text-muted);
  font-size: var(--font-sm);
}
.loading-more .spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
  margin: 0 auto var(--space-2);
}

/* ============ 通用表单 ============ */
.form-group { margin-bottom: var(--space-4); }
.form-label { font-size: var(--font-base); color: var(--c-text-secondary); margin-bottom: var(--space-2); display: block; font-weight: var(--weight-medium); }
.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  background: var(--c-surface);
  color: var(--c-text);
  transition: border-color var(--dur-normal) var(--ease-standard), box-shadow var(--dur-normal) var(--ease-standard);
}
.form-input:focus { border-color: var(--primary); box-shadow: var(--focus-ring); }

/* ============ 分组菜单（我的页/设置页） ============ */
.menu-list {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  margin: 0 var(--space-3) var(--space-3);
  overflow: hidden;
  box-shadow: var(--elevation-1);
}
.menu-group-title {
  font-size: var(--font-sm);
  color: var(--c-text-muted);
  padding: var(--space-4) var(--space-4) var(--space-2);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.5px;
}
.menu-item {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--c-border-light);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-standard);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--c-surface-alt); }
.menu-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-3);
  flex-shrink: 0;
  font-size: var(--font-lg);
}
.menu-icon i { font-size: var(--font-lg); }
.menu-icon.icon-orange { background: #fff7ed; color: #f97316; }
.menu-icon.icon-amber { background: #fffbeb; color: #f59e0b; }
.menu-icon.icon-blue { background: #eff6ff; color: #3b82f6; }
.menu-icon.icon-teal { background: #f0fdfa; color: #14b8a6; }
.menu-icon.icon-pink { background: #fdf2f8; color: #ec4899; }
.menu-icon.icon-indigo { background: #eef2ff; color: #6366f1; }
.menu-icon.icon-green { background: #ecfdf5; color: #10b981; }
.menu-icon.icon-purple { background: #faf5ff; color: #a855f7; }
.menu-text { flex: 1; min-width: 0; }
.menu-name { font-size: var(--font-base); font-weight: var(--weight-medium); color: var(--c-text); }
.menu-desc { font-size: var(--font-xs); color: var(--c-text-muted); margin-top: var(--space-1); }
.menu-right { display: flex; align-items: center; gap: var(--space-2); color: var(--c-text-muted); font-size: var(--font-sm); }
.menu-arrow { width: 14px; height: 14px; }

/* ============ 通用 Section 标题 ============ */
.section-head {
  display: flex;
  align-items: center;
  padding: var(--space-4) var(--space-4) var(--space-3);
}
.section-head-bar {
  width: 3px;
  height: 14px;
  background: var(--brand-gradient);
  border-radius: var(--radius-sm);
  margin-right: var(--space-2);
}
.section-head-text { font-size: var(--font-lg); font-weight: var(--weight-bold); color: var(--c-text); flex: 1; }
.section-head-extra { font-size: var(--font-sm); color: var(--c-text-muted); }

/* ============ 通用 footer 版权 ============ */
.app-footer {
  text-align: center;
  padding: var(--space-6) var(--space-4) calc(var(--space-4) + var(--safe-bottom));
  color: var(--c-text-muted);
  font-size: var(--font-sm);
}
.app-footer a { color: var(--c-text-secondary); }

/* ============ 工具类 ============ */
.hidden { display: none !important; }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-ellipsis-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ 页面过渡动画 ============ */
.page-enter {
  animation: page-enter var(--dur-normal) var(--ease-standard);
}
@keyframes page-enter {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 文章/协议正文样式 */
.article-body { padding: var(--space-4); line-height: 1.75; color: var(--c-text); font-size: var(--font-base); background: var(--c-surface); }
.article-body h1 { font-size: var(--font-2xl); margin: 18px 0 12px; text-align: center; color: var(--c-text); font-weight: var(--weight-bold); }
.article-body h2 { font-size: var(--font-lg); margin: 16px 0 var(--space-2); color: var(--primary); border-left: 3px solid var(--primary); padding-left: var(--space-3); font-weight: var(--weight-semibold); }
.article-body h3 { font-size: var(--font-base); margin: var(--space-3) 0 var(--space-1); color: var(--c-text); font-weight: var(--weight-semibold); }
.article-body p { margin: var(--space-2) 0; }
.article-body ul, .article-body ol { margin: var(--space-2) 0 var(--space-2) var(--space-5); }
.article-body li { margin: var(--space-1) 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: var(--space-3) 0; font-size: var(--font-sm); }
.article-body th, .article-body td { border: 1px solid var(--c-border); padding: var(--space-2); text-align: left; }
.article-body th { background: var(--primary-bg); color: var(--primary); font-weight: var(--weight-semibold); }
.article-body strong { color: var(--c-text); font-weight: var(--weight-bold); }
.article-body a { color: var(--primary); text-decoration: underline; }

/* ============ Toggle Switch ============ */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--c-text-disabled);
  cursor: pointer;
  transition: background var(--dur-normal) var(--ease-standard);
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--primary); }
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--elevation-1);
  transition: transform var(--dur-normal) var(--ease-standard);
}
.toggle-switch.on::after { transform: translateX(20px); }

/* ============ Checkbox ============ */
.form-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--c-text-disabled);
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease-standard);
}
.form-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}
.form-checkbox-icon {
  color: #fff;
  font-size: var(--font-xs);
  line-height: 1;
}

/* ============ Action Sheet ============ */
.action-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--c-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-2) 0 calc(var(--space-2) + var(--safe-bottom));
  z-index: var(--z-modal);
  box-shadow: var(--elevation-4);
  animation: sheet-up var(--dur-normal) var(--ease-standard);
}
@keyframes sheet-up {
  from { transform: translateX(-50%) translateY(100%); }
  to { transform: translateX(-50%) translateY(0); }
}
.action-sheet-title {
  text-align: center;
  font-size: var(--font-base);
  color: var(--c-text-muted);
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--c-border-light);
}
.action-sheet-item {
  padding: var(--space-4) var(--space-5);
  font-size: var(--font-lg);
  color: var(--c-text);
  cursor: pointer;
  text-align: center;
  border-bottom: 1px solid var(--c-border-light);
  transition: background var(--dur-fast);
}
.action-sheet-item:active { background: var(--c-surface-alt); }
.action-sheet-cancel {
  padding: var(--space-4);
  font-size: var(--font-lg);
  color: var(--c-text-muted);
  cursor: pointer;
  text-align: center;
  margin-top: var(--space-1);
  font-weight: var(--weight-medium);
}

/* ============ Order Status ============ */
.status-pending { background: #fef3c7; color: #d97706; }
.status-paid { background: #d1fae5; color: #059669; }
.status-cancelled { background: #fee2e2; color: #dc2626; }
.status-refunded { background: #f1f5f9; color: #64748b; }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

/* ============ VIP Plan Card ============ */
.plan-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  position: relative;
  border: 2px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.plan-card.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, #fff 0%, #faf5ff 100%);
  box-shadow: 0 4px 16px rgba(99,102,241,0.12);
}
.plan-badge {
  position: absolute;
  top: -1px;
  right: 16px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
}
.plan-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}
.plan-desc {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 12px;
}
.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}
.plan-currency {
  font-size: 16px;
  color: #ef4444;
  font-weight: 600;
}
.plan-price {
  font-size: 32px;
  color: #ef4444;
  font-weight: 800;
  line-height: 1;
}
.plan-original {
  font-size: 13px;
  color: var(--gray-light);
  text-decoration: line-through;
  margin-left: 4px;
}
.plan-duration {
  font-size: 12px;
  color: var(--gray);
  margin-left: 4px;
}
.plan-daily {
  font-size: 11px;
  color: var(--gray-light);
  margin-bottom: 14px;
}
.plan-daily-price {
  color: var(--primary);
  font-weight: 600;
}
.plan-btn {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border-radius: 22px;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.plan-btn:active { transform: scale(0.98); }
.plan-btn.btn-upgrade { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 4px 12px rgba(245,158,11,0.3); }

/* ============ Partner Card ============ */
.partner-hero {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  padding: 20px 16px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.partner-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -20px;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.partner-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #fff;
  margin: -20px 12px 12px;
  border-radius: 14px;
  padding: 16px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  position: relative;
  z-index: 2;
}
.partner-stat {
  text-align: center;
}
.partner-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}
.partner-stat-label {
  font-size: 11px;
  color: var(--gray);
  margin-top: 2px;
}

/* ============ VIP Benefits ============ */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 12px;
}
.benefit-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.benefit-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.benefit-icon-wrap.bg-purple { background: #ede9fe; }
.benefit-icon-wrap.bg-orange { background: #fff7ed; }
.benefit-icon-wrap.bg-green { background: #ecfdf5; }
.benefit-icon-wrap.bg-blue { background: #eff6ff; }
.benefit-icon-wrap.bg-pink { background: #fdf2f8; }
.benefit-icon-wrap.bg-amber { background: #fffbeb; }
.benefit-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.benefit-icon i { font-size: 20px; }
.benefit-title { font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.benefit-desc { font-size: 10px; color: var(--gray); line-height: 1.4; }

/* ============ VIP Hero Banner ============ */
.vip-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 100%);
  padding: calc(var(--safe-top) + 10px) 16px 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.vip-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(251,191,36,0.15);
  border-radius: 50%;
}
.vip-banner-upgrade {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  margin-top: 12px;
}
.vip-banner-active {
  background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
  border-radius: 16px;
  padding: 20px;
  margin-top: 12px;
}
.vip-crown {
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.vip-crown i { font-size: 40px; }
.vip-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.vip-subtitle { font-size: 12px; opacity: 0.85; }
.vip-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #fbbf24;
  color: #78350f;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 14px;
  cursor: pointer;
}

/* ============ Invite Card ============ */
.invite-hero {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  padding: 30px 20px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.invite-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -30px;
  width: 180px;
  height: 180px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.invite-code-box {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 16px;
  margin: 16px 12px 0;
  text-align: center;
}
.invite-code-label { font-size: 12px; opacity: 0.8; margin-bottom: 6px; }
.invite-code-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  font-family: 'Courier New', monospace;
  margin-bottom: 10px;
}
.invite-copy-btn {
  background: #fff;
  color: #6366f1;
  padding: 6px 20px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ============ Form Elements ============ */
.form-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 10px;
}
.form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  min-height: 80px;
  resize: vertical;
}
.form-unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: 13px;
}

/* ============ Badge / Pill ============ */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.pill-gold { background: #fef3c7; color: #b45309; }
.pill-blue { background: #dbeafe; color: #1d4ed8; }
.pill-green { background: #d1fae5; color: #047857; }
.pill-red { background: #fee2e2; color: #b91c1c; }
.pill-gray { background: #f1f5f9; color: #475569; }

/* ============ Avatar ============ */
.avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  cursor: pointer;
  position: relative;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.avatar-edit-badge img {
  width: 12px;
  height: 12px;
  filter: brightness(0) invert(1);
}

/* ============ Nav Bar Variants ============ */
.nav-bar-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
}
.nav-bar-gradient .nav-title { color: #fff; }
.nav-bar-gradient .nav-back { color: #fff; }
.nav-bar-gradient .nav-back img { filter: brightness(0) invert(1); }
.nav-bar-gradient .nav-back i { filter: brightness(0) invert(1); }

/* ============ Loading Skeleton ============ */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ Enhanced Design System v2 ============ */

/* Extended spacing scale */
:root {
  --space-0: 0;
  --space-1: 4px;
  --space-1\.5: 6px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Extended radius scale */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
  --radius-3xl: 32px;
  --radius-full: 999px;

  /* Elevation system (consistent shadow layers) */
  --elevation-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --elevation-2: 0 2px 4px rgba(15, 23, 42, 0.06), 0 4px 8px rgba(15, 23, 42, 0.06);
  --elevation-3: 0 4px 8px rgba(15, 23, 42, 0.08), 0 8px 16px rgba(15, 23, 42, 0.06);
  --elevation-4: 0 8px 16px rgba(15, 23, 42, 0.10), 0 16px 32px rgba(15, 23, 42, 0.08);
  --elevation-brand: 0 4px 14px rgba(91, 141, 238, 0.28);
  --elevation-brand-lg: 0 8px 28px rgba(91, 141, 238, 0.38);
  --elevation-success: 0 4px 14px rgba(16, 185, 129, 0.28);
  --elevation-warning: 0 4px 14px rgba(245, 158, 11, 0.28);
  --elevation-danger: 0 4px 14px rgba(239, 68, 68, 0.28);

  /* Semantic colors */
  --c-bg: #f5f7fb;
  --c-bg-warm: #fafbff;
  --c-surface: #ffffff;
  --c-surface-alt: #f8fafc;
  --c-border: #e5eaf1;
  --c-border-strong: #cbd5e1;
  --c-text: #1a2332;
  --c-text-secondary: #475569;
  --c-text-muted: #94a3b8;
  --c-text-disabled: #cbd5e1;

  /* Interaction tokens */
  --ring-color: rgba(91, 141, 238, 0.5);
  --ring-width: 3px;
  --focus-ring: 0 0 0 var(--ring-width) var(--ring-color);
  --hover-opacity: 0.75;
  --active-scale: 0.97;

  /* Motion tokens */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-decelerate: cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --dur-fast: 120ms;
  --dur-normal: 200ms;
  --dur-slow: 350ms;

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* ============ Enhanced Card System ============ */
.card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--elevation-1);
  margin-bottom: var(--space-3);
  border: 1px solid var(--c-border);
  transition: box-shadow var(--dur-normal) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.card:hover { box-shadow: var(--elevation-2); }
.card:active { transform: scale(var(--active-scale)); }

.card-flat { box-shadow: none; border: 1px solid var(--c-border); }
.card-lifted { box-shadow: var(--elevation-2); }
.card-elevated { box-shadow: var(--elevation-3); }

/* ============ Enhanced Button System ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all var(--dur-fast) var(--ease-standard);
  font-family: inherit;
}
.btn:active { transform: scale(var(--active-scale)); }

.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 11px 22px;
  box-shadow: var(--elevation-brand);
}
.btn-primary:hover { box-shadow: var(--elevation-brand-lg); }

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary-bg);
  border-radius: var(--radius-full);
  padding: 10px 21px;
}
.btn-secondary:hover { background: var(--primary-50); border-color: var(--primary); }

.btn-ghost {
  background: transparent;
  color: var(--c-text-secondary);
  border-radius: var(--radius-md);
  padding: 8px 16px;
}
.btn-ghost:hover { background: var(--c-surface-alt); color: var(--primary); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary-bg);
  border-radius: var(--radius-full);
  padding: 10px 21px;
}
.btn-outline:hover { background: var(--primary-50); }

.btn-block { width: 100%; display: flex; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ============ Enhanced Tag/Badge System ============ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.tag-primary { background: var(--primary-bg); color: var(--primary); }
.tag-success { background: #d1fae5; color: #059669; }
.tag-warning { background: #fef3c7; color: #d97706; }
.tag-danger { background: #fee2e2; color: #dc2626; }
.tag-info { background: #dbeafe; color: #2563eb; }
.tag-purple { background: #ede9fe; color: #7c3aed; }
.tag-pink { background: #fce7f3; color: #db2777; }
.tag-amber { background: #fef3c7; color: #d97706; }

.tag-solid { color: #fff; }
.tag-solid.tag-primary { background: var(--primary); }
.tag-solid.tag-success { background: #10b981; }
.tag-solid.tag-warning { background: #f59e0b; }
.tag-solid.tag-danger { background: #ef4444; }

/* Semester-specific tags with icons */
.tag-semester { background: #ecfdf5; color: #059669; }
.tag-semester::before { content: ""; }
.tag-version { background: #fce7f3; color: #db2777; }
.tag-recommend { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #dc2626; font-weight: 600; }
.tag-vip { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; font-weight: 600; }
.tag-free { background: #fff7ed; color: #ea580c; }
.tag-hot { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #dc2626; }

/* ============ Enhanced Filter Chip System ============ */
.chip {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-standard);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}
.chip-default { background: #f1f5f9; color: var(--c-text-secondary); }
.chip-default:active { background: #e2e8f0; }
.chip-active { background: var(--brand-gradient); color: #fff; box-shadow: var(--elevation-brand); }
.chip-hot { background: #fff7ed; color: #ea580c; }
.chip-hot.chip-active { background: #f59e0b; color: #fff; }
.chip-cold { background: #ecfdf5; color: #059669; }
.chip-cold.chip-active { background: #10b981; color: #fff; }

/* ============ Enhanced Empty/Loading States ============ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  color: var(--c-text-muted);
  text-align: center;
}
.empty-state .empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-3);
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.empty-state .empty-icon i { font-size: 48px; }
.empty-state .empty-text { font-size: 14px; color: var(--c-text-muted); }
.empty-state .empty-action { margin-top: var(--space-4); }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  gap: var(--space-3);
  color: var(--c-text-muted);
  font-size: 13px;
}
.loading-state .spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--c-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ============ Enhanced Form System ============ */
.input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: #fff;
  color: var(--c-text);
  transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
  font-family: inherit;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  outline: none;
}
.input::placeholder { color: var(--c-text-muted); }

/* ============ Section Header ============ */
.section-head {
  display: flex;
  align-items: center;
  padding: var(--space-4) var(--space-4) var(--space-2);
}
.section-head-bar {
  width: 3px;
  height: 16px;
  background: var(--brand-gradient);
  border-radius: 2px;
  margin-right: var(--space-2);
}
.section-head-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
  flex: 1;
}
.section-head-extra { font-size: 12px; color: var(--c-text-muted); }

/* ============ Scrollbar ============ */
.thin-scrollbar::-webkit-scrollbar { width: 4px; height: 4px; }
.thin-scrollbar::-webkit-scrollbar-track { background: transparent; }
.thin-scrollbar::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 2px; }
.thin-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--c-text-muted); }

/* ============ Reduced Motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ Typography Utilities ============ */
.h1 { font-size: 24px; font-weight: 700; line-height: 1.3; color: var(--c-text); }
.h2 { font-size: 20px; font-weight: 700; line-height: 1.35; color: var(--c-text); }
.h3 { font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--c-text); }
.h4 { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--c-text); }
.body-lg { font-size: 15px; line-height: 1.6; color: var(--c-text); }
.body { font-size: 14px; line-height: 1.55; color: var(--c-text-secondary); }
.body-sm { font-size: 13px; line-height: 1.5; color: var(--c-text-secondary); }
.caption { font-size: 12px; line-height: 1.4; color: var(--c-text-muted); }
.overline { font-size: 10px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--c-text-muted); }

/* ============ Layout Utilities ============ */
.container-fluid { padding: 0 var(--space-4); }
.container-narrow { padding: 0 var(--space-3); }
.divider { height: 1px; background: var(--c-border); margin: var(--space-4) 0; }
.divider-dashed { height: 1px; background: repeating-linear-gradient(90deg, var(--c-border) 0, var(--c-border) 4px, transparent 4px, transparent 8px); margin: var(--space-4) 0; }

/* ============ Badge/Pill System ============ */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.pill-gold { background: #fef3c7; color: #92400e; }
.pill-blue { background: #dbeafe; color: #1e40af; }
.pill-green { background: #d1fae5; color: #065f46; }
.pill-red { background: #fee2e2; color: #991b1b; }
.pill-gray { background: #f1f5f9; color: #475569; }
.pill-purple { background: #ede9fe; color: #5b21b6; }
.pill-pink { background: #fce7f3; color: #9d174d; }

/* ============ Icon Button ============ */
.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-standard);
}
.icon-btn:hover { background: var(--c-surface-alt); color: var(--c-text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn-sm { width: 32px; height: 32px; }
.icon-btn-lg { width: 44px; height: 44px; }
.icon-btn i { font-size: 18px; }

/* ============ Status Colors ============ */
.status-pending { background: #fef3c7; color: #b45309; }
.status-paid { background: #d1fae5; color: #047857; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }
.status-refunded { background: #f1f5f9; color: #475569; }

/* ============ Progress Bar ============ */
.progress {
  height: 8px;
  background: var(--c-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: var(--radius-full);
  transition: width var(--dur-slow) var(--ease-decelerate);
}

/* ============ Avatar ============ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface-alt);
  color: var(--c-text-muted);
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-circle { border-radius: 50%; }
.avatar-rounded { border-radius: var(--radius-lg); }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 72px; height: 72px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============ Grid System ============ */
.grid { display: grid; gap: var(--space-3); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }

/* ============ Responsive ============ */
@media (min-width: 375px) {
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}
@media (min-width: 414px) {
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ============ Shimmer Loading ============ */
.shimmer {
  position: relative;
  overflow: hidden;
  background: var(--c-surface-alt);
}
.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============ Page Transitions ============ */
.page-enter { animation: page-in var(--dur-normal) var(--ease-decelerate); }
.page-exit { animation: page-out var(--dur-fast) var(--ease-accelerate); }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes page-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ============ Utility ============ */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.tap-highlight-none { -webkit-tap-highlight-color: transparent; }
