/* WBTI - Custom Styles (Light Theme) */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent-main: #f59e0b;
  --accent-blue: #3b82f6;
  --type-fish: #0ea5e9;
  --type-ddog: #8b5cf6;
  --type-mkfc: #f97316;
  --type-weed: #22c55e;
  --type-hide: #14b8a6;
  --type-bird: #ef4444;
  --type-food: #eab308;
  --type-drum: #ec4899;
  --type-mess: #78716c;
  --type-fail: #a855f7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}

/* === Animations === */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.3); }
  50% { box-shadow: 0 0 20px 4px rgba(245,158,11,0.15); }
}

@keyframes selectPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes flashOverlay {
  0% { opacity: 0.3; }
  100% { opacity: 0; }
}

.emoji-float {
  animation: float 3s ease-in-out infinite;
}

.page-enter {
  animation: fadeIn 0.35s ease-out;
}

/* === Landing Page === */

.landing-emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  justify-items: center;
  max-width: 280px;
}

.cta-btn {
  background: var(--accent-main);
  color: white;
  border: none;
  padding: 14px 36px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: pulse 2.5s ease-in-out infinite;
}

.cta-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 28px rgba(245,158,11,0.35);
}

.cta-btn:active {
  transform: scale(0.97);
}

/* === Quiz Page === */

.option-card {
  background: var(--bg-secondary);
  border: 1.5px solid var(--bg-tertiary);
  border-radius: 14px;
  padding: 15px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  -webkit-user-select: none;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.option-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.12);
}

.option-card:active {
  transform: scale(0.98);
}

.option-card.selected {
  animation: selectPop 0.3s ease;
  border-color: var(--accent-main);
  background: rgba(245, 158, 11, 0.06);
  transform: scale(1);
}

.progress-track {
  background: var(--bg-tertiary);
  border-radius: 100px;
  height: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-main));
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Result Page === */

.result-avatar {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--type-color, var(--accent-main));
  overflow: hidden;
}

.result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Dimension bars */
.dim-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dim-emoji {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.dim-label {
  font-size: 12px;
  color: var(--text-secondary);
  width: 72px;
  flex-shrink: 0;
  text-align: right;
}

.dim-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 100px;
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  border-radius: 100px;
  width: 0;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.dim-score {
  font-size: 12px;
  color: var(--text-muted);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* === Toast === */

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: white;
  padding: 10px 24px;
  border-radius: 100px;
  font-size: 14px;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

/* === Debug Page === */

.debug-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.debug-type-card {
  background: var(--bg-secondary);
  border: 1.5px solid var(--bg-tertiary);
  border-radius: 16px;
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.debug-type-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.debug-type-card:active {
  transform: scale(0.97);
}

.debug-type-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin: 0 auto 8px;
}

/* 图鉴详情弹窗 */
.collection-detail {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
  backdrop-filter: blur(4px);
}

.collection-detail-card {
  background: var(--bg-secondary);
  border-radius: 20px;
  max-width: 400px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease;
}

/* === Utility === */

.text-balance {
  text-wrap: balance;
}

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