/* ===== CSS Variables & Reset ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --accent-gold: #FFD700;
  --accent-orange: #FF8C00;
  --accent-amber: #FFBF00;
  --accent-blue: #4A90D9;
  --accent-purple: #8B5CF6;
  --accent-green: #10B981;
  --accent-red: #EF4444;
  --accent-pink: #EC4899;
  --gradient-gold: linear-gradient(135deg, #FFD700, #FF8C00);
  --gradient-blue: linear-gradient(135deg, #4A90D9, #8B5CF6);
  --gradient-green: linear-gradient(135deg, #10B981, #34D399);
  --gradient-fire: linear-gradient(135deg, #EF4444, #F59E0B);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --header-h: 56px;
  --tab-h: 52px;
}

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

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
input { border: none; outline: none; font-family: inherit; }
a { text-decoration: none; color: inherit; }

.hidden { display: none !important; }

/* ===== Splash Screen ===== */
.splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.splash-screen.fade-out { opacity: 0; transform: scale(1.05); pointer-events: none; }

.splash-content { text-align: center; }

.splash-icon { margin-bottom: 20px; animation: pulse-glow 2s ease-in-out infinite; }
.splash-logo { width: 100px; height: 100px; }

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255,215,0,0.3)); }
  50% { filter: drop-shadow(0 0 25px rgba(255,215,0,0.6)); }
}

.splash-title {
  font-size: 2rem; font-weight: 900;
  background: var(--gradient-gold); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 6px;
}
.splash-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 30px; }

.splash-loader { width: 180px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin: 0 auto; }
.loader-bar {
  width: 0; height: 100%; background: var(--gradient-gold); border-radius: 3px;
  animation: load-bar 1.8s ease-in-out forwards;
}
@keyframes load-bar { to { width: 100%; } }

/* ===== App Header ===== */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
}
.header-bg {
  position: absolute; inset: 0;
  background: rgba(10,10,15,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-content { position: relative; z-index: 1; padding: 0 16px; height: 100%; }

.header-top { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.logo-mini { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--gradient-gold); display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 900; color: #000;
}
.logo-text { font-size: 1.1rem; font-weight: 700; }

.header-actions { display: flex; gap: 4px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; color: var(--text-secondary);
}
.icon-btn:active { background: rgba(255,255,255,0.1); }

/* Search Bar */
.search-bar {
  position: absolute; top: var(--header-h); left: 0; right: 0;
  padding: 8px 16px 12px; background: rgba(10,10,15,0.95);
  backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255,255,255,0.06);
  animation: slide-down 0.25s ease;
}
@keyframes slide-down { from { opacity: 0; transform: translateY(-10px); } }

.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border-radius: var(--radius-md); padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.search-input-wrap svg { flex-shrink: 0; color: var(--text-muted); }
.search-input-wrap input {
  flex: 1; background: transparent; color: var(--text-primary); font-size: 0.95rem;
}
.search-input-wrap input::placeholder { color: var(--text-muted); }
.search-clear { color: var(--text-muted); font-size: 0.85rem; padding: 4px; }

/* ===== Tab Navigation ===== */
.tab-nav {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 99;
  background: rgba(10,10,15,0.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tab-scroll {
  display: flex; overflow-x: auto; scrollbar-width: none;
  padding: 0 8px; height: var(--tab-h);
}
.tab-scroll::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 6px 16px; font-size: 0.7rem; white-space: nowrap;
  color: var(--text-muted); transition: color 0.2s; flex: 1; min-width: 60px;
  position: relative;
}
.tab-btn.active { color: var(--accent-gold); }
.tab-btn.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2.5px; background: var(--gradient-gold); border-radius: 2px;
}
.tab-btn svg { width: 20px; height: 20px; }

/* ===== Main Content ===== */
.main-content {
  padding-top: calc(var(--header-h) + var(--tab-h));
  min-height: 100vh; padding-bottom: 40px;
}
.page { display: none; padding: 16px; animation: fade-in 0.3s ease; }
.page.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }

/* ===== Daily Card ===== */
.daily-card {
  position: relative; border-radius: var(--radius-xl); overflow: hidden;
  margin-bottom: 20px; min-height: 180px;
}
.daily-card-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1a1a3e 0%, #2d1b4e 50%, #1a2a3e 100%);
}
.daily-card-bg::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,215,0,0.15), transparent 60%);
}
.daily-card-content {
  position: relative; z-index: 1; padding: 24px 20px;
}
.daily-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 600; color: var(--accent-gold);
  background: rgba(255,215,0,0.12); padding: 4px 10px; border-radius: 20px;
  margin-bottom: 16px;
}
.daily-quote {
  font-size: 1.1rem; line-height: 1.7; font-weight: 500;
  margin-bottom: 12px; border-left: 3px solid var(--accent-gold); padding-left: 14px;
}
.daily-author { font-size: 0.85rem; color: var(--accent-amber); font-weight: 500; }
.daily-refresh {
  position: absolute; bottom: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: all 0.3s;
}
.daily-refresh:active { transform: rotate(180deg); background: rgba(255,215,0,0.2); color: var(--accent-gold); }

/* ===== Stats Row ===== */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 14px 8px; text-align: center;
  border: 1px solid rgba(255,255,255,0.05);
}
.stat-number {
  font-size: 1.4rem; font-weight: 800;
  background: var(--gradient-gold); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ===== Section Title ===== */
.section-title {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; margin-top: 8px;
}
.section-title h2 { font-size: 1.1rem; font-weight: 700; }
.section-badge {
  font-size: 0.65rem; padding: 2px 8px; border-radius: 10px;
  background: rgba(255,215,0,0.12); color: var(--accent-gold); font-weight: 600;
}

/* ===== Category Grid ===== */
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 24px; }
.category-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 18px 14px;
  border: 1px solid rgba(255,255,255,0.05); cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.category-card:active { transform: scale(0.97); border-color: rgba(255,215,0,0.3); }
.cat-icon { font-size: 1.8rem; margin-bottom: 8px; }
.cat-name { font-size: 0.9rem; font-weight: 600; margin-bottom: 3px; }
.cat-count { font-size: 0.72rem; color: var(--text-muted); }

/* ===== Era Timeline ===== */
.era-timeline { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 24px; scrollbar-width: none; }
.era-timeline::-webkit-scrollbar { display: none; }
.era-card {
  flex-shrink: 0; width: 140px; background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 16px 12px; border: 1px solid rgba(255,255,255,0.05); cursor: pointer;
  transition: transform 0.2s, border-color 0.3s;
}
.era-card:active { transform: scale(0.96); }
.era-emoji { font-size: 1.6rem; margin-bottom: 8px; }
.era-name { font-size: 0.85rem; font-weight: 600; margin-bottom: 3px; }
.era-desc { font-size: 0.7rem; color: var(--text-muted); line-height: 1.4; }

/* ===== Hot Tags ===== */
.hot-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.hot-tag {
  padding: 6px 14px; border-radius: 20px; font-size: 0.8rem;
  background: var(--bg-card); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.hot-tag:active { background: rgba(255,215,0,0.15); color: var(--accent-gold); border-color: rgba(255,215,0,0.3); }

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 14px;
  margin-bottom: 6px; scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px; font-size: 0.8rem;
  background: var(--bg-card); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.filter-chip.active {
  background: rgba(255,215,0,0.15); color: var(--accent-gold);
  border-color: rgba(255,215,0,0.4);
}

/* ===== Figure Cards ===== */
.figure-list { display: flex; flex-direction: column; gap: 12px; }
.figure-card {
  display: flex; gap: 14px; background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 16px; border: 1px solid rgba(255,255,255,0.05); cursor: pointer;
  transition: transform 0.2s, border-color 0.3s;
}
.figure-card:active { transform: scale(0.98); border-color: rgba(255,215,0,0.2); }
.figure-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; color: #000;
}
.figure-info { flex: 1; min-width: 0; }
.figure-name { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.figure-role { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.figure-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.figure-tag {
  font-size: 0.65rem; padding: 2px 8px; border-radius: 10px;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
}

/* ===== Wisdom Cards ===== */
.wisdom-list { display: flex; flex-direction: column; gap: 12px; }
.wisdom-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 18px 16px;
  border: 1px solid rgba(255,255,255,0.05); position: relative;
  transition: transform 0.2s;
}
.wisdom-card:active { transform: scale(0.98); }
.wisdom-quote {
  font-size: 0.95rem; line-height: 1.7; margin-bottom: 12px;
  border-left: 2px solid var(--accent-gold); padding-left: 12px;
}
.wisdom-footer { display: flex; align-items: center; justify-content: space-between; }
.wisdom-author { font-size: 0.8rem; color: var(--accent-amber); font-weight: 500; }
.wisdom-category { font-size: 0.7rem; color: var(--text-muted); }
.wisdom-bookmark {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); transition: all 0.2s; color: var(--text-muted);
}
.wisdom-bookmark.saved { color: var(--accent-gold); background: rgba(255,215,0,0.15); }
.wisdom-bookmark svg { width: 16px; height: 16px; }

/* ===== Story Cards ===== */
.story-list { display: flex; flex-direction: column; gap: 14px; }
.story-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 18px 16px;
  border: 1px solid rgba(255,255,255,0.05); cursor: pointer;
  transition: transform 0.2s;
}
.story-card:active { transform: scale(0.98); }
.story-type {
  display: inline-block; font-size: 0.7rem; padding: 3px 10px;
  border-radius: 10px; font-weight: 600; margin-bottom: 10px;
}
.story-type.success { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.story-type.failure { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.story-type.turning { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.story-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.story-person { font-size: 0.8rem; color: var(--accent-amber); margin-bottom: 8px; }
.story-excerpt { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.story-read-more {
  display: inline-block; margin-top: 10px; font-size: 0.8rem;
  color: var(--accent-gold); font-weight: 500;
}

/* ===== Advice Cards ===== */
.advice-list { display: flex; flex-direction: column; gap: 12px; }
.advice-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 18px 16px;
  border: 1px solid rgba(255,255,255,0.05);
  border-left: 3px solid; position: relative;
}
.advice-card.career { border-left-color: var(--accent-blue); }
.advice-card.mindset { border-left-color: var(--accent-purple); }
.advice-card.money { border-left-color: var(--accent-green); }
.advice-card.life { border-left-color: var(--accent-pink); }
.advice-card.growth { border-left-color: var(--accent-orange); }
.advice-topic {
  font-size: 0.7rem; font-weight: 600; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.advice-card.career .advice-topic { color: var(--accent-blue); }
.advice-card.mindset .advice-topic { color: var(--accent-purple); }
.advice-card.money .advice-topic { color: var(--accent-green); }
.advice-card.life .advice-topic { color: var(--accent-pink); }
.advice-card.growth .advice-topic { color: var(--accent-orange); }
.advice-text { font-size: 0.92rem; line-height: 1.7; margin-bottom: 10px; }
.advice-from { font-size: 0.78rem; color: var(--text-muted); }

/* ===== Bookmarks ===== */
.bookmarks-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.bookmarks-header h2 { font-size: 1.2rem; font-weight: 700; }
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state p { margin-top: 12px; font-size: 0.95rem; color: var(--text-secondary); }
.empty-state span { font-size: 0.8rem; display: block; margin-top: 4px; }

/* ===== Detail Modal ===== */
.detail-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); animation: fade-in 0.2s; }
.modal-content {
  position: relative; width: 100%; max-height: 85vh;
  background: var(--bg-secondary); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow-y: auto; animation: slide-up 0.3s ease;
  padding: 24px 20px 40px;
}
@keyframes slide-up { from { transform: translateY(100%); } }
.modal-close {
  position: sticky; top: 0; float: right;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); z-index: 1;
}
.modal-body h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 16px; padding-right: 40px; }
.modal-body h3 { font-size: 1rem; font-weight: 700; margin: 18px 0 8px; color: var(--accent-gold); }
.modal-body p { font-size: 0.9rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 10px; }
.modal-body .highlight {
  background: rgba(255,215,0,0.08); border-left: 3px solid var(--accent-gold);
  padding: 12px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0; font-style: italic;
}
.modal-body .tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.modal-body .modal-tag {
  font-size: 0.72rem; padding: 3px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
}

/* ===== Analysis Cards ===== */
.analysis-header { margin-bottom: 20px; }
.analysis-header h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.analysis-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }
.update-info {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; padding: 4px 12px; border-radius: 20px;
  background: rgba(16,185,129,0.12); color: var(--accent-green);
}
.update-info::before { content: '●'; font-size: 0.5rem; animation: blink 2s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.analysis-list { display: flex; flex-direction: column; gap: 14px; }
.analysis-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px 16px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.2s, border-color 0.3s;
}
.analysis-card:active { transform: scale(0.98); border-color: rgba(255,215,0,0.2); }
.analysis-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.analysis-icon { font-size: 1.5rem; }
.analysis-title { font-size: 1rem; font-weight: 700; }
.analysis-content { font-size: 0.88rem; line-height: 1.8; color: var(--text-secondary); }
.analysis-tags { display: flex; gap: 6px; margin-top: 10px; }
.analysis-tag {
  font-size: 0.68rem; padding: 2px 8px; border-radius: 10px;
  background: rgba(74,144,217,0.12); color: var(--accent-blue);
}

/* ===== Feeds ===== */
.feeds-header { margin-bottom: 14px; }
.feeds-header h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.feeds-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }
.feeds-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fetch-btn {
  padding: 6px 14px; border-radius: 20px; font-size: 0.78rem; font-weight: 600;
  background: rgba(255,215,0,0.12); color: var(--accent-gold);
  border: 1px solid rgba(255,215,0,0.25); cursor: pointer; transition: all 0.2s;
}
.fetch-btn:active { background: rgba(255,215,0,0.25); transform: scale(0.95); }
.fetch-btn.loading { opacity: 0.5; pointer-events: none; }

.feeds-list { display: flex; flex-direction: column; gap: 10px; }
.feed-card {
  background: var(--bg-card); border-radius: var(--radius-md); padding: 14px;
  border: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: all 0.2s;
}
.feed-card:active { transform: scale(0.98); border-color: rgba(255,215,0,0.2); }
.feed-source {
  display: inline-block; font-size: 0.65rem; padding: 2px 8px; border-radius: 10px;
  background: rgba(74,144,217,0.12); color: var(--accent-blue); margin-bottom: 6px;
}
.feed-title { font-size: 0.92rem; font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.feed-summary { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.feed-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.7rem; color: var(--text-muted); }

/* ===== AI Chat ===== */
.chat-header { margin-bottom: 14px; }
.chat-header h2 { font-size: 1.3rem; font-weight: 800; }
.chat-subtitle { font-size: 0.85rem; color: var(--text-muted); }

.chat-figure-select {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px;
  margin-bottom: 12px; scrollbar-width: none;
}
.chat-figure-select::-webkit-scrollbar { display: none; }
.chat-avatar-btn {
  flex-shrink: 0; width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; color: #000; cursor: pointer;
  border: 2px solid transparent; transition: all 0.2s; position: relative;
}
.chat-avatar-btn.active { border-color: var(--accent-gold); box-shadow: 0 0 12px rgba(255,215,0,0.3); }
.chat-avatar-btn .av-name {
  position: absolute; bottom: -16px; font-size: 0.55rem; color: var(--text-muted);
  white-space: nowrap; font-weight: 500;
}

.chat-container {
  background: var(--bg-card); border-radius: var(--radius-lg);
  min-height: 320px; max-height: 400px; overflow-y: auto;
  padding: 16px; border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 12px;
}
.chat-welcome { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.chat-welcome-icon { font-size: 2.5rem; margin-bottom: 12px; }
.chat-welcome p { font-size: 0.95rem; color: var(--text-secondary); }
.chat-welcome span { font-size: 0.8rem; }

.chat-messages { display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; gap: 8px; max-width: 85%; animation: fade-in 0.3s ease; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: #000;
}
.chat-msg.user .chat-msg-avatar { background: var(--accent-blue); color: #fff; font-size: 0.7rem; }
.chat-msg-bubble {
  padding: 10px 14px; border-radius: 16px; font-size: 0.88rem; line-height: 1.6;
}
.chat-msg.bot .chat-msg-bubble {
  background: rgba(255,255,255,0.06); border-radius: 4px 16px 16px 16px;
  color: var(--text-primary);
}
.chat-msg.user .chat-msg-bubble {
  background: var(--accent-blue); color: #fff; border-radius: 16px 4px 16px 16px;
}
.typing-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted);
  animation: typing 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

.chat-input-area { padding-top: 4px; }
.chat-quick-questions {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none;
}
.chat-quick-questions::-webkit-scrollbar { display: none; }
.quick-q {
  flex-shrink: 0; padding: 6px 12px; border-radius: 16px; font-size: 0.78rem;
  background: rgba(255,215,0,0.1); color: var(--accent-gold);
  border: 1px solid rgba(255,215,0,0.2); cursor: pointer; white-space: nowrap;
  transition: all 0.2s;
}
.quick-q:active { background: rgba(255,215,0,0.2); }

.chat-input-wrap {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg-card); border-radius: var(--radius-md); padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.chat-input-wrap input {
  flex: 1; background: transparent; color: var(--text-primary); font-size: 0.9rem;
}
.chat-input-wrap input::placeholder { color: var(--text-muted); }
.chat-send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-gold); display: flex; align-items: center; justify-content: center;
  color: #000; transition: transform 0.2s;
}
.chat-send-btn:active { transform: scale(0.9); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ===== Responsive ===== */
@media (min-width: 480px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .main-content { max-width: 480px; margin: 0 auto; }
}
