/* ===== CSS Variables — iOS Design System ===== */
:root {
  /* Primary — iOS Green */
  --primary: #34C759;
  --primary-light: #E8F8EE;
  --primary-dark: #248A3D;
  /* iOS Accent Colors */
  --blue: #007AFF;
  --blue-light: #E3F0FF;
  --bg: #F2F2F7;
  --bg-card: #FFFFFF;
  --bg-hover: #E5E5EA;
  --bg-grouped: #F2F2F7;
  /* Text — iOS Style */
  --text-primary: #000000;
  --text-secondary: #3C3C43;
  --text-secondary-opacity: 0.6;
  --text-tertiary: #3C3C43;
  --text-tertiary-opacity: 0.3;
  /* Separators */
  --separator: rgba(60, 60, 67, 0.12);
  --separator-opaque: #C6C6C8;
  --border: rgba(60, 60, 67, 0.12);
  --border-light: rgba(60, 60, 67, 0.08);
  /* Status Colors */
  --danger: #FF3B30;
  --warning: #FF9500;
  --info: #5AC8FA;
  --success: #34C759;
  --purple: #AF52DE;
  --orange: #FF9500;
  --yellow: #FFCC00;
  /* Shadows */
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-fab: 0 4px 12px rgba(0,122,255,0.3);
  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  /* Layout */
  --header-height: 44px;
  --tabbar-height: 83px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -0.2px;
}

/* ===== Utility ===== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-1 { flex: 1; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; font-weight: 600; }
.font-bold { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.rounded { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow); }

/* ===== Buttons — iOS Style ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  background: var(--bg-hover);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { opacity: 0.6; }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--separator-opaque);
  color: var(--blue);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:active { opacity: 0.5; }

/* ===== Inputs — iOS Style ===== */
input, textarea, select {
  font-family: inherit;
  font-size: 17px;
  border: 1px solid var(--separator-opaque);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  transition: border 0.2s;
  background: #fff;
  color: var(--text-primary);
  width: 100%;
}
input:focus, textarea:focus { border-color: var(--blue); }
textarea { resize: vertical; min-height: 80px; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 0; height: 0; }

/* ===== Animations ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideInFromRight { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.fade-in { animation: fadeIn 0.25s ease; }
.slide-up { animation: slideUp 0.3s ease; }
.slide-in-right { animation: slideInRight 0.3s ease; }
.scale-in { animation: scaleIn 0.2s ease; }

/* ===== Color Tags ===== */
.color-red { background: #FFF0F0; color: #FF3B30; }
.color-orange { background: #FFF5E6; color: #FF9500; }
.color-blue { background: #E3F0FF; color: #007AFF; }
.color-green { background: #E8F8EE; color: #34C759; }
.color-purple { background: #F5F0FF; color: #AF52DE; }
.color-default { background: #F5F5F5; color: #8E8E93; }

/* Dot indicators */
.dot-red { background: #FF3B30; }
.dot-orange { background: #FF9500; }
.dot-blue { background: #007AFF; }
.dot-green { background: #34C759; }
.dot-purple { background: #AF52DE; }
.dot-default { background: #C7C7CC; }
