:root {
  /* 默认主题 (简约白/Light) */
  --primary: #667EEA;
  --primary-light: #EBF0FF;
  --bg-page: #F5F7FA;
  --bg-card: #FFFFFF;
  --text-main: #2D3748;
  --text-muted: #718096;
  --border-color: #E2E8F0;
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --radius-md: 12px;
  --radius-lg: 16px;
  
  /* 功能色 */
  --success: #48BB78;
  --warning: #ED8936;
  --error: #F56565;
}

[data-theme="warm"] {
  /* 暖色主题 (Warm) */
  --primary: #ED8936;
  --primary-light: #FFF5F0;
  --bg-page: #FFF9F5;
  --bg-card: #FFFFFF;
  --text-main: #4A4A4A;
  --text-muted: #8D766B;
  --border-color: #FBD38D;
  --shadow-card: 0 4px 6px -1px rgba(237, 137, 54, 0.1);
}

[data-theme="dark"] {
  /* 深色主题 (Dark) */
  --primary: #667EEA;
  --primary-light: rgba(102, 126, 234, 0.2);
  --bg-page: #1A202C;
  --bg-card: #2D3748;
  --text-main: #F7FAFC;
  --text-muted: #A0AEC0;
  --border-color: #4A5568;
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

/* 布局容器 */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 80px; /* 留出底部导航空间 */
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
}

/* 标题 */
.page-header {
  text-align: center;
  margin-bottom: 32px;
  padding-top: 20px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 表单元素 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-page);
  color: var(--text-main);
  font-size: 16px;
  outline: none;
  transition: all 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 16px;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-page);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  height: 52px;
  font-size: 18px;
}

/* 用户选择卡片 */
.user-selector {
  display: flex;
  gap: 16px;
}

.user-card {
  flex: 1;
  background: var(--bg-page);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.user-card:active {
  transform: scale(0.95);
}

.user-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.user-avatar {
  font-size: 40px;
  margin-bottom: 8px;
  display: inline-block;
  padding: 10px;
  border-radius: 50%;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

/* 底部导航 */
.navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-card);
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  z-index: 100;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.navbar-container {
  display: flex;
  justify-content: space-around;
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12px;
  gap: 4px;
  transition: color 0.2s;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-icon {
  font-size: 24px;
}

/* 列表样式 */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-title {
  font-weight: 500;
  color: var(--text-main);
}

.list-item-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 统计概览 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-color);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* 工具类 */
.text-center { text-align: center; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }

/* 动画 */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 320px;
}

.toast {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  border-left: 4px solid var(--primary);
  animation: slideDown 0.3s ease-out;
}

.toast.error { border-left-color: var(--error); }
.toast.success { border-left-color: var(--success); }

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 主题选择器 */
.theme-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.theme-option {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-page);
}

.theme-option.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
