:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-success: #16a34a;
  --color-warning: #ea580c;
  --color-danger: #dc2626;
  --color-bg: #f8fafc;
  --color-card: #ffffff;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --max-width: 480px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 80px;
  min-height: 100vh;
}

/* Card */
.card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: var(--radius);
  font-size: var(--font-size-base); font-weight: 600;
  border: none; cursor: pointer; transition: all 0.15s;
  background: var(--color-card); color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-primary { background: var(--color-primary); color: #fff; border: none; }
.btn-primary:active { background: var(--color-primary-dark); transform: scale(0.98); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 16px 32px; font-size: var(--font-size-lg); }
.btn:disabled { opacity: 0.6; pointer-events: none; }

/* Tags */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: var(--font-size-sm); font-weight: 500; }
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-green { background: #dcfce7; color: #166534; }
.tag-orange { background: #ffedd5; color: #9a3412; }
.tag-red { background: #fee2e2; color: #991b1b; }

/* Input */
.input {
  width: 100%; padding: 12px 16px; border: 1px solid var(--color-border);
  border-radius: var(--radius); font-size: var(--font-size-base);
  outline: none; transition: border-color 0.2s;
  background: var(--color-card); color: var(--color-text);
}
.input:focus { border-color: var(--color-primary); }

/* Bottom Navigation */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: var(--max-width);
  margin: 0 auto; background: var(--color-card); border-top: 1px solid var(--color-border);
  display: flex; justify-content: space-around; padding: 8px 0;
  z-index: 100; box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center;
  font-size: 0.75rem; color: var(--color-text-secondary);
  text-decoration: none; padding: 4px 12px; transition: color 0.15s;
}
.nav-item.active { color: var(--color-primary); }
.nav-item .nav-icon { font-size: 1.35rem; margin-bottom: 2px; }

/* Progress Bar */
.progress-bar { height: 6px; background: var(--color-border); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--color-primary); border-radius: 3px; transition: width 0.3s; }

/* Loading */
.loading { text-align: center; padding: 40px 0; color: var(--color-text-secondary); font-size: var(--font-size-sm); }
.loading::after { content: "·"; animation: dots 1.5s infinite; }
@keyframes dots { 0%,20% { content: "·"; } 40% { content: "··"; } 60%,100% { content: "···"; } }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-secondary); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }

/* Toast */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 8px; color: #fff;
  font-weight: 600; z-index: 9999; opacity: 0; transition: opacity 0.3s;
  pointer-events: none; max-width: 90vw; text-align: center;
}

/* Activation overlay */
.activation-overlay { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.activation-modal { animation: slideUp 0.3s ease; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
}
