/* ═══════════════════════════════════════════════
   永恒陪伴 · Eternal Companion
   设计主题：晨曦微光 · 温暖明亮
   ═══════════════════════════════════════════════ */

:root {
  /* ── 主色：日落珊瑚 → 暖桃 ── */
  --primary: #ff6b6b;
  --primary-light: #ff8e8e;
  --primary-dark: #ee5a5a;
  --primary-glow: rgba(255,107,107,.18);

  /* ── 辅助色：温柔蓝 ── */
  --secondary: #4ecdc4;
  --secondary-light: #7eddd6;
  --secondary-dark: #3dbdb5;

  /* ── 强调色：暖金 ── */
  --accent: #ffd93d;
  --accent-light: #ffe98a;
  --accent-dark: #f0c929;

  /* ── 语义色 ── */
  --success: #2ecc71;
  --success-bg: #eafaf1;
  --danger: #e74c3c;
  --danger-bg: #fdedec;
  --warning: #f39c12;
  --warning-bg: #fef5e7;
  --info: #3498db;
  --info-bg: #ebf5fb;

  /* ── 表面与背景 ── */
  --bg: #fefcf9;
  --bg-warm: #fff8f5;
  --bg-surface: #ffffff;
  --bg-elevated: #fdf8f6;
  --bg-card: #ffffff;
  --border: #f0e8e3;
  --border-light: #f5f0ed;
  --divider: #f3eeea;

  /* ── 文字 ── */
  --text: #2d2420;
  --text-secondary: #7a6e68;
  --text-muted: #b8a9a0;
  --text-inverse: #ffffff;

  /* ── 形状 ── */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-full: 9999px;

  /* ── 阴影 ── */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
  --shadow: 0 4px 16px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 8px 30px rgba(0,0,0,.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.1);
  --shadow-glow: 0 0 30px var(--primary-glow);
  --shadow-card: 0 2px 12px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
  --shadow-card-hover: 0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);

  /* ── 过渡 ── */
  --transition: .25s cubic-bezier(.4,0,.2,1);
  --transition-spring: .45s cubic-bezier(.34,1.56,.64,1);
  --transition-smooth: .35s cubic-bezier(.4,0,0,1);
}

/* ═══════════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── 柔和背景渐变 ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 15% -10%, rgba(255,107,107,.06), transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 80%, rgba(78,205,196,.05), transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255,217,61,.04), transparent 60%);
  pointer-events: none;
}

/* Selection */
::selection { background: rgba(255,107,107,.2); color: var(--text); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e8ddd5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #d4c7bd; }

/* ═══════════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════════ */

h1, h2, h3, h4 { font-weight: 750; letter-spacing: -.015em; line-height: 1.3; }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ═══════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════ */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 28px;
}

/* ═══════════════════════════════════════════════
   Navigation
   ═══════════════════════════════════════════════ */

.nav {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.01em;
}

.nav-logo .logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  box-shadow: 0 2px 10px rgba(255,107,107,.2);
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 550;
  transition: var(--transition);
  padding: 6px 12px;
  border-radius: 8px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: rgba(255,107,107,.06);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--text-secondary);
  padding: 6px 14px;
  background: var(--bg-warm);
  border-radius: 20px;
  border: 1px solid var(--border-light);
}

.nav-quota {
  display: inline-flex;
  align-items: center;
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
  padding: 5px 12px;
  background: rgba(255,107,107,.08);
  border-radius: 20px;
  border: 1px solid rgba(255,107,107,.15);
}

.nav-quota-low {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

/* ═══════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  gap: 8px;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: .01em;
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b6b, #ff5252);
  color: #fff;
  box-shadow: 0 2px 12px rgba(255,107,107,.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255,107,107,.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255,107,107,.2);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: #fff;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(78,205,196,.25);
}

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: rgba(255,107,107,.03);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 2px 12px rgba(255,217,61,.25);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255,217,61,.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(0,0,0,.03);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
  box-shadow: 0 4px 14px rgba(231,76,60,.25);
}

.btn-sm { padding: 6px 14px; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn-xl { padding: 16px 44px; font-size: 1.1rem; border-radius: var(--radius); }

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
}

.card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-card-hover);
}

.card-hover {
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-4px);
}

.card-accent {
  border-color: #ffe8e0;
  background: linear-gradient(135deg, #fff9f7, #fff5f3);
}

/* ═══════════════════════════════════════════════
   Forms
   ═══════════════════════════════════════════════ */

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: all var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(255,107,107,.1);
  background: #fff;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.7;
}

.form-group input[type="range"] {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  height: 6px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-group input[type="range"]:focus {
  box-shadow: none;
}

.form-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ═══════════════════════════════════════════════
   Hero Section
   ═══════════════════════════════════════════════ */

.hero {
  text-align: center;
  padding: 90px 28px 70px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255,107,107,.06), transparent 65%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--border-light);
  font-size: .85rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  box-shadow: var(--shadow-xs);
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(46,204,113,.4);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 850;
  letter-spacing: -.04em;
  line-height: 1.2;
  margin-bottom: 22px;
  color: var(--text);
}

.hero h1 .highlight {
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.18rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.hero-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-top: 64px;
}

.hero-stat {
  text-align: center;
}

.hero-stat .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.02em;
}

.hero-stat .label {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════
   Features
   ═══════════════════════════════════════════════ */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 20px 0 60px;
}

.feature-card {
  padding: 40px 28px;
  text-align: center;
  border: 1px solid var(--border-light);
}

.feature-card .icon-ring {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  background: linear-gradient(135deg, #fff5f3, #fef0eb);
  border: 1px solid #ffe8e0;
  transition: all var(--transition-spring);
}

.feature-card:hover .icon-ring {
  transform: scale(1.08);
  box-shadow: 0 4px 20px rgba(255,107,107,.1);
  border-color: var(--primary-light);
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 240px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════
   Auth Pages
   ═══════════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 48px 44px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
}

.auth-card h2 {
  font-size: 1.65rem;
  margin-bottom: 6px;
}

.auth-card .subtitle {
  color: var(--text-secondary);
  font-size: .92rem;
  margin-bottom: 32px;
}

.auth-link {
  text-align: center;
  margin-top: 22px;
  font-size: .9rem;
  color: var(--text-secondary);
}

.auth-link a {
  color: var(--primary);
  font-weight: 600;
}

.auth-link a:hover {
  color: var(--primary-dark);
}

.verify-code-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.verify-code-row input {
  flex: 1;
  min-width: 0;
}

.verify-code-btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding-left: 14px;
  padding-right: 14px;
}

.verify-code-hint {
  margin: 8px 0 0;
  font-size: .82rem;
}

/* ═══════════════════════════════════════════════
   Dashboard
   ═══════════════════════════════════════════════ */

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 14px;
}

.dash-header h1 {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 22px;
}

.char-card {
  cursor: pointer;
  position: relative;
}

.char-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.char-card-wrap:hover {
  transform: translateY(-4px);
}

.char-card-wrap:hover .char-card-enter {
  opacity: 1;
}

.char-card-stat {
  font-size: .78rem;
}

.char-card .char-avatar {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff0ed, #ffe4de);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 18px;
  color: var(--primary);
  border: 1px solid #ffe8e0;
  transition: all var(--transition-spring);
}

.char-card:hover .char-avatar {
  transform: scale(1.05);
  box-shadow: 0 4px 18px rgba(255,107,107,.15);
}

.char-card .char-name {
  font-size: 1.18rem;
  font-weight: 750;
  margin-bottom: 6px;
  color: var(--text);
}

.char-card .char-desc {
  font-size: .88rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
  line-height: 1.65;
}

.char-card .char-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.char-card .char-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .76rem;
  font-weight: 650;
}

.badge-active {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #d5f5e3;
}

.badge-inactive {
  background: #f5f5f5;
  color: var(--text-muted);
  border: 1px solid #eee;
}

.badge-bound {
  background: #fef0eb;
  color: var(--primary);
  border: 1px solid #ffe8e0;
}

.badge-default {
  background: var(--bg-warm);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ═══════════════════════════════════════════════
   Form Page
   ═══════════════════════════════════════════════ */

.form-page {
  max-width: 680px;
  margin: 0 auto;
}

.form-page h1 {
  font-size: 1.5rem;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ═══════════════════════════════════════════════
   Bind Page
   ═══════════════════════════════════════════════ */

.bind-card {
  text-align: center;
  max-width: 540px;
  margin: 40px auto;
}

.bind-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.bind-code {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--primary);
  background: #fff5f3;
  padding: 22px 40px;
  border-radius: var(--radius);
  display: inline-block;
  margin: 24px 0;
  border: 2px dashed #ffe0d5;
}

.bind-steps {
  text-align: left;
  margin: 16px 0;
  counter-reset: step;
  list-style: none;
}

.bind-steps li {
  counter-increment: step;
  margin-bottom: 14px;
  font-size: .9rem;
  padding-left: 38px;
  position: relative;
  line-height: 1.65;
}

.bind-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bind-steps li strong {
  color: var(--primary);
}

.bind-success {
  text-align: center;
  padding: 28px;
  background: var(--success-bg);
  border: 1px solid #d5f5e3;
  border-radius: var(--radius);
  margin: 20px 0;
}

.bind-success .check-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

#qrcode {
  display: inline-block;
  padding: 18px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  margin: 8px 0;
}

#qrcode img { display: block; }

/* ═══════════════════════════════════════════════
   Chat Page
   ═══════════════════════════════════════════════ */

.chat-page {
  max-width: 760px;
  margin: 0 auto;
}

.chat-header {
  margin-bottom: 22px;
}

.chat-header h2 {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header .char-avatar-sm {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff0ed, #ffe4de);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary);
  border: 1px solid #ffe8e0;
}

.chat-header .char-info {
  font-size: .84rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.chat-box {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  height: 500px;
  overflow-y: auto;
  padding: 28px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.02);
}

.chat-box::-webkit-scrollbar {
  width: 5px;
}

/* Chat bubbles */
.chat-msg {
  max-width: 78%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: .92rem;
  line-height: 1.65;
  word-break: break-word;
  position: relative;
  animation: msgIn .35s cubic-bezier(.16,1,.3,1);
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #ff6b6b, #ff5252);
  color: #fff;
  border-bottom-right-radius: 8px;
  box-shadow: 0 2px 10px rgba(255,107,107,.2);
}

.chat-msg.assistant {
  align-self: flex-start;
  background: #f8f6f4;
  border: 1px solid #f0e8e3;
  border-bottom-left-radius: 8px;
}

.chat-msg.assistant.typing {
  opacity: .55;
}

.chat-input-wrap {
  display: flex;
  gap: 12px;
}

.chat-input-wrap textarea {
  flex: 1;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-family: inherit;
  resize: none;
  background: #fff;
  color: var(--text);
  min-height: 52px;
  max-height: 130px;
  transition: all var(--transition);
}

.chat-input-wrap textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(255,107,107,.08);
}

.chat-input-wrap textarea::placeholder {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   Empty States
   ═══════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 70px 28px;
}

.empty-state .icon {
  font-size: 3.5rem;
  margin-bottom: 22px;
  display: inline-block;
  animation: float 3.5s ease-in-out infinite;
}

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

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text);
}

.empty-state p {
  color: var(--text-secondary);
  font-size: .92rem;
  margin-bottom: 26px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ═══════════════════════════════════════════════
   Toast / Notifications
   ═══════════════════════════════════════════════ */

.toast {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 550;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
}

.toast-error {
  border-color: #f5c6cb;
  color: var(--danger);
  background: #fff5f5;
}

.toast-success {
  border-color: #c3e6cb;
  color: var(--success);
  background: #f0faf3;
}

.toast-warning {
  border-color: #ffeeba;
  color: var(--warning);
  background: #fffdf0;
}

.toast-info {
  border-color: #bee5eb;
  color: var(--info);
  background: #f0f9ff;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px) scale(.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ═══════════════════════════════════════════════
   Loading
   ═══════════════════════════════════════════════ */

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.loading-dark {
  border-color: rgba(255,107,107,.15);
  border-top-color: var(--primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-dots {
  display: inline-flex;
  gap: 5px;
}

.loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dotBounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: .16s; }
.loading-dots span:nth-child(3) { animation-delay: .32s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(.5); opacity: .3; }
  40% { transform: scale(1); opacity: 1; }
}

/* ═══════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════ */

.footer {
  text-align: center;
  padding: 44px 28px;
  color: var(--text-muted);
  font-size: .82rem;
  border-top: 1px solid var(--border-light);
  margin-top: 80px;
}

.footer a {
  color: var(--text-secondary);
}

.footer a:hover {
  color: var(--primary);
}

/* ═══════════════════════════════════════════════
   404 Page
   ═══════════════════════════════════════════════ */

.not-found {
  text-align: center;
  padding: 100px 28px;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.not-found .icon {
  font-size: 6rem;
  margin-bottom: 24px;
  animation: float 4s ease-in-out infinite;
}

.not-found h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.not-found p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 1rem;
}

/* ═══════════════════════════════════════════════
   Utility
   ═══════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-dark); }
.text-primary { color: var(--primary); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 12px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.w-full { width: 100%; }

/* ═══════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
  .hero { padding: 50px 20px 40px; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: .95rem; }

  .features {
    grid-template-columns: 1fr;
    padding: 10px 0 40px;
  }

  .char-grid { grid-template-columns: 1fr; }

  .chat-box { height: 400px; padding: 18px; }
  .chat-msg { max-width: 88%; }

  .nav-links { gap: 8px; }

  .auth-card { padding: 36px 28px; }

  .hero-stats { gap: 30px; flex-wrap: wrap; }

  .dash-header { flex-direction: column; align-items: flex-start; }

  .container { padding: 28px 18px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.7rem; }
  .hero-btns { flex-direction: column; }
  .hero-btns .btn { width: 100%; }

  .card { padding: 22px; }

  .chat-input-wrap { flex-direction: column; }
  .chat-input-wrap .btn { width: 100%; }
}

/* ═══════════════════════════════════════════════
   Accessibility
   ═══════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: 3px;
}
