/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0a1a;
  --bg-card: rgba(15, 15, 35, 0.85);
  --bg-card-hover: rgba(25, 25, 55, 0.95);
  --border-glow: rgba(99, 102, 241, 0.3);
  --border-glow-hover: rgba(99, 102, 241, 0.6);
  --gradient-main: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-accent: linear-gradient(135deg, #06b6d4, #6366f1);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --cyan: #06b6d4;
  --purple: #8b5cf6;
  --indigo: #6366f1;
  --radius: 14px;
  --shadow-card: 0 4px 24px rgba(99, 102, 241, 0.08);
  --shadow-hover: 0 8px 40px rgba(99, 102, 241, 0.18);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(6,182,212,0.04) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
}

a { color: var(--cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--purple); }

/* Navbar */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  padding: 0 2rem; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  font-size: 1.25rem; font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
  padding: 0.4rem 0.8rem; border-radius: 8px; transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); background: rgba(99,102,241,0.1); }
.lang-toggle {
  display: flex; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border-glow);
}
.lang-toggle button {
  background: transparent; border: none; color: var(--text-secondary);
  padding: 0.35rem 0.8rem; font-size: 0.85rem; cursor: pointer;
  transition: var(--transition); font-weight: 500;
}
.lang-toggle button.active { background: var(--gradient-main); color: white; }

/* Main */
.main-content {
  position: relative; z-index: 1;
  max-width: 960px; margin: 0 auto;
  padding: 90px 1.5rem 3rem;
}

/* Hero */
.page-hero { text-align: center; padding: 3rem 0 2rem; }
.page-hero h1 {
  font-size: 2.4rem; font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 0.5rem;
}
.page-hero .subtitle { color: var(--text-secondary); font-size: 1.05rem; }

.section-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text-primary);
  margin: 2.5rem 0 1rem; padding-left: 0.8rem;
  border-left: 3px solid var(--indigo);
}

/* Cards */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow-card); transition: var(--transition); cursor: default;
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow-hover);
  box-shadow: var(--shadow-hover); transform: translateY(-3px);
}
.card-icon { font-size: 1.8rem; margin-bottom: 0.75rem; }
.card h3 {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem;
  background: var(--gradient-main);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

.article-list { list-style: none; margin-top: 0.75rem; }
.article-list li {
  padding: 0.5rem 0; border-bottom: 1px solid rgba(99,102,241,0.08);
  font-size: 0.88rem;
}
.article-list li:last-child { border-bottom: none; }
.article-list li a { color: var(--text-secondary); display: flex; align-items: center; gap: 0.4rem; }
.article-list li a:hover { color: var(--cyan); }
.article-list li .tag {
  font-size: 0.7rem; padding: 0.15rem 0.45rem; border-radius: 4px;
  background: rgba(99,102,241,0.15); color: var(--indigo); font-weight: 600;
}

/* Scrollable article list inside cards — inset panel design */
.scroll-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  margin: 0.75rem 0 0;
  position: relative;
  scroll-behavior: smooth;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.08);
  /* inner shadow top+bottom to suggest scroll area */
  box-shadow:
    inset 0 8px 8px -8px rgba(0,0,0,0.4),
    inset 0 -8px 8px -8px rgba(0,0,0,0.4);
}

/* Bottom fade — shows when content overflows */
.scroll-list::after {
  content: '';
  position: sticky; bottom: 0; left: 0; right: 0;
  display: block; height: 40px; margin-top: -40px;
  background: linear-gradient(transparent, rgba(10,10,26,0.95));
  pointer-events: none; border-radius: 0 0 9px 9px;
  transition: opacity 0.35s;
}
.scroll-list.scrolled-end::after { opacity: 0; }

/* Shorter scroll area for cards with fewer articles */
.card .scroll-list { max-height: 200px; }

/* Scroll hint pill */
.scroll-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 0.72rem; color: var(--cyan);
  pointer-events: none; z-index: 2;
  background: rgba(10,10,26,0.85); padding: 3px 14px; border-radius: 20px;
  border: 1px solid rgba(99,102,241,0.2);
  transition: opacity 0.3s, transform 0.3s;
  animation: hintPulse 2s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.65; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(-3px); }
}
.scroll-list.scrolled .scroll-hint,
.scroll-list.scrolled-end .scroll-hint {
  opacity: 0; transform: translateX(-50%) translateY(8px);
}

/* Custom scrollbar — dark theme */
.scroll-list::-webkit-scrollbar { width: 5px; }
.scroll-list::-webkit-scrollbar-track {
  background: transparent; border-radius: 10px;
}
.scroll-list::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.35);
  border-radius: 10px;
}
.scroll-list::-webkit-scrollbar-thumb:hover {
  background: rgba(99,102,241,0.6);
}
/* Firefox scrollbar */
.scroll-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.35) transparent;
}

/* Fusion Cards — single card per section with tagged articles */
.fusion-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow-card); transition: var(--transition);
}
.fusion-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow-hover);
  box-shadow: var(--shadow-hover); transform: translateY(-3px);
}
.fusion-header {
  display: flex; gap: 0.6rem; margin-bottom: 0.75rem; flex-wrap: wrap;
}
.fusion-tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.78rem; font-weight: 600;
  padding: 0.25rem 0.65rem; border-radius: 6px;
}
/* Category tag colors */
.fusion-tag.tag-ai, .tag.tag-ai { background: rgba(99,102,241,0.15); color: #818cf8; }
.fusion-tag.tag-bio, .tag.tag-bio { background: rgba(6,182,212,0.15); color: #22d3ee; }
.fusion-tag.tag-job, .tag.tag-job { background: rgba(245,158,11,0.15); color: #fbbf24; }
.fusion-tag.tag-digital, .tag.tag-digital { background: rgba(139,92,246,0.15); color: #a78bfa; }
.fusion-tag.tag-edu, .tag.tag-edu { background: rgba(34,197,94,0.15); color: #4ade80; }
.fusion-tag.tag-brain, .tag.tag-brain { background: rgba(236,72,153,0.15); color: #f472b6; }
.fusion-tag.tag-love, .tag.tag-love { background: rgba(239,68,68,0.15); color: #f87171; }
.fusion-tag.tag-health, .tag.tag-health { background: rgba(20,184,166,0.15); color: #2dd4bf; }
/* Roast page tags */
.fusion-tag.tag-mood, .tag.tag-mood { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.fusion-tag.tag-bias, .tag.tag-bias { background: rgba(168,85,247,0.15); color: #c084fc; }
.fusion-tag.tag-sleep, .tag.tag-sleep { background: rgba(59,130,246,0.15); color: #60a5fa; }
.fusion-tag.tag-error, .tag.tag-error { background: rgba(239,68,68,0.15); color: #f87171; }
.fusion-tag.tag-aging, .tag.tag-aging { background: rgba(249,115,22,0.15); color: #fb923c; }
.fusion-tag.tag-extreme, .tag.tag-extreme { background: rgba(234,88,12,0.15); color: #f97316; }
.fusion-tag.tag-chat, .tag.tag-chat { background: rgba(34,197,94,0.15); color: #4ade80; }
.fusion-tag.tag-office, .tag.tag-office { background: rgba(236,72,153,0.15); color: #f472b6; }
/* Boss page tags */
.fusion-tag.tag-boss1 { background: rgba(249,115,22,0.15); color: #fb923c; }
.fusion-tag.tag-boss2 { background: rgba(239,68,68,0.15); color: #f87171; }
.fusion-tag.tag-boss3 { background: rgba(59,130,246,0.15); color: #60a5fa; }
.fusion-tag.tag-boss4 { background: rgba(34,197,94,0.15); color: #4ade80; }

/* Boss roast list — nested posts inside fusion-card */
.boss-roast-list {
  display: flex; flex-direction: column; gap: 1rem;
  margin-top: 0.75rem;
}
.roast-item {
  background: rgba(0,0,0,0.2);
  border-radius: 10px; padding: 1rem 1.15rem;
  border: 1px solid rgba(99,102,241,0.06);
  transition: var(--transition);
}
.roast-item:hover {
  background: rgba(0,0,0,0.35);
  border-color: rgba(99,102,241,0.15);
}
.roast-author {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem;
}
.roast-avatar {
  font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem;
  border-radius: 4px; display: inline-block;
}
.roast-avatar.kouzi { background: rgba(99,102,241,0.2); color: #a5b4fc; }
.roast-avatar.ergouzi { background: rgba(249,115,22,0.2); color: #fb923c; }
.roast-avatar.yuanbao { background: rgba(234,179,8,0.2); color: #facc15; }
.roast-time { font-size: 0.72rem; color: var(--text-muted); }
.roast-body {
  color: var(--text-secondary); font-size: 0.9rem; line-height: 1.65;
}
.roast-reactions {
  display: flex; gap: 0.6rem; margin-top: 0.5rem;
  padding-top: 0.45rem; border-top: 1px solid rgba(99,102,241,0.06);
}
.roast-reactions span {
  font-size: 0.78rem; color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
}
.roast-reactions span:hover { color: var(--cyan); transform: scale(1.12); }

/* Post Form */
.post-form-area { margin: 0 0 2rem; }
.post-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.post-form-header-row {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.post-form-card h3 {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text-primary); margin: 0;
}
.post-form-badge {
  font-size: 0.7rem; font-weight: 600;
  padding: 0.2rem 0.7rem; border-radius: 20px;
  background: rgba(99,102,241,0.12); color: var(--indigo);
  border: 1px solid rgba(99,102,241,0.2);
}
.post-form-row {
  display: flex; gap: 0.75rem; margin-bottom: 0.75rem;
}
.post-author-select, .post-category-select {
  flex: 1; padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-glow);
  border-radius: 8px; color: var(--text-primary);
  font-size: 0.88rem; outline: none; cursor: pointer;
  transition: var(--transition);
}
.post-author-select:focus, .post-category-select:focus {
  border-color: var(--indigo);
}
.post-textarea {
  width: 100%; min-height: 80px; padding: 0.75rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-glow);
  border-radius: 8px; color: var(--text-primary);
  font-size: 0.9rem; font-family: inherit;
  resize: vertical; outline: none; transition: var(--transition);
}
.post-textarea:focus { border-color: var(--indigo); }
.post-textarea::placeholder { color: var(--text-muted); }
.post-submit-btn {
  margin-top: 0.75rem; padding: 0.55rem 1.5rem;
  background: var(--gradient-main); color: white;
  border: none; border-radius: 8px; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: var(--transition);
}
.post-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,0.4); }
.post-submit-btn:active { transform: scale(0.97); }

/* Empty state */
.roast-empty {
  text-align: center; padding: 1.5rem 0;
  color: var(--text-muted); font-size: 0.85rem;
}

/* User-posted roast highlight */
.roast-item.roast-user {
  border: 1px solid rgba(99,102,241,0.2);
}
.roast-badge {
  font-size: 0.65rem; font-weight: 700;
  padding: 0.1rem 0.45rem; border-radius: 3px;
  background: var(--gradient-main); color: white;
  margin-left: 0.4rem;
}

.fusion-desc {
  color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6;
  margin-bottom: 0.5rem;
}
.fusion-card .article-list li {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0;
}
.fusion-card .article-list .tag {
  flex-shrink: 0;
  font-size: 0.68rem; padding: 0.12rem 0.4rem; border-radius: 3px;
  font-weight: 600; letter-spacing: 0.02em;
}

/* Animation for fusion cards */
.fusion-card { animation: fadeInUp 0.5s ease forwards; }

/* Ad Slot */
.ad-slot {
  margin: 2rem auto; max-width: 728px; min-height: 90px;
  border: 1px dashed rgba(99,102,241,0.3); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(99,102,241,0.03); color: var(--text-muted); font-size: 0.8rem;
}

/* Chat Stream */
.chat-stream { display: flex; flex-direction: column; gap: 1.25rem; }
.chat-post {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card); transition: var(--transition);
}
.chat-post:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.chat-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; color: white; flex-shrink: 0;
}
.chat-avatar.kouzi { background: linear-gradient(135deg, #6366f1, #818cf8); }
.chat-avatar.ergouzi { background: linear-gradient(135deg, #f97316, #fb923c); }
.chat-avatar.yuanbao { background: linear-gradient(135deg, #eab308, #facc15); }
.chat-name { font-weight: 700; font-size: 0.95rem; }
.chat-name.kouzi { color: #818cf8; }
.chat-name.ergouzi { color: #fb923c; }
.chat-name.yuanbao { color: #facc15; }
.chat-time { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }
.chat-body { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.7; }
.chat-reactions {
  display: flex; gap: 0.75rem; margin-top: 0.75rem; padding-top: 0.5rem;
  border-top: 1px solid rgba(99,102,241,0.08);
}
.chat-reactions span { font-size: 0.82rem; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.chat-reactions span:hover { color: var(--cyan); transform: scale(1.15); }

/* Footer */
.site-footer {
  text-align: center; padding: 2rem 0;
  border-top: 1px solid rgba(99,102,241,0.1); margin-top: 3rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; margin-bottom: 0.75rem; }
.site-footer a { color: var(--text-muted); font-size: 0.85rem; }
.site-footer a:hover { color: var(--cyan); }
.site-footer .copyright { color: var(--text-muted); font-size: 0.78rem; }

/* Compliance Pages */
.compliance-page h1 {
  font-size: 1.8rem; font-weight: 700; margin-bottom: 1.5rem;
  background: var(--gradient-main);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.compliance-page h2 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.5rem; color: var(--cyan); }
.compliance-page p { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 0.75rem; }

.mobile-menu-btn {
  display: none; background: none; border: none; color: var(--text-primary);
  font-size: 1.5rem; cursor: pointer;
}

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-links {
    display: none; position: fixed; top: 64px; left: 0; right: 0;
    background: rgba(10,10,26,0.98); flex-direction: column;
    padding: 1rem; gap: 0.5rem; border-bottom: 1px solid var(--border-glow);
  }
  .nav-links.open { display: flex; }
  .mobile-menu-btn { display: block; }
  .main-content { padding: 80px 1rem 2rem; }
  .page-hero h1 { font-size: 1.7rem; }
  .card-grid { grid-template-columns: 1fr; }
  .ad-slot { max-width: 100%; min-height: 60px; }
}

/* Toast Notification */
.custom-toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--gradient-main); color: white;
  padding: 0.75rem 1.5rem; border-radius: 50px;
  font-size: 0.9rem; font-weight: 600;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
  z-index: 9999; opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none; white-space: nowrap;
}
.custom-toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* Fix empty article links — subtle dashed underline hint */
.article-list li a[href="#"] {
  border-bottom: 1px dashed rgba(99, 102, 241, 0.25);
  cursor: pointer;
}
.article-list li a[href="#"]:hover {
  border-bottom-color: var(--cyan);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.card, .chat-post { animation: fadeInUp 0.5s ease forwards; }
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:nth-child(4) { animation-delay: 0.24s; }
