/* ========== CSS Variables & Reset ========== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --border: #2a2a3e;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.3);
  --red: #ef4444;
  --orange: #f59e0b;
  --blue: #3b82f6;
  --purple: #a855f7;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition: all 0.3s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ========== Grid Background ========== */
.bg-grid {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ========== Glow Orbs ========== */
.glow-orb {
  position: fixed; border-radius: 50%; filter: blur(120px); opacity: 0.15;
  pointer-events: none; z-index: 0;
}
.glow-orb-1 { top: -200px; left: 10%; width: 500px; height: 500px; background: var(--accent); }
.glow-orb-2 { bottom: -200px; right: 10%; width: 400px; height: 400px; background: var(--purple); }
.glow-orb-3 { top: 50%; left: 50%; width: 300px; height: 300px; background: var(--blue); transform: translate(-50%, -50%); }

/* ========== Navbar ========== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 15, 0.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); padding: 0 24px;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 700; color: var(--text-primary);
}
.nav-logo .icon { font-size: 1.6rem; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { color: var(--text-secondary); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text-primary); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: var(--radius-sm); font-size: 0.95rem;
  font-weight: 500; cursor: pointer; transition: var(--transition);
  border: none; text-decoration: none; font-family: inherit;
}
.btn-primary {
  background: var(--accent); color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); color: white; }
.btn-outline {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-hover); background: rgba(99, 102, 241, 0.05); }
.btn-sm { padding: 6px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-green { background: var(--green); color: white; box-shadow: 0 0 20px var(--green-glow); }
.btn-red { background: var(--red); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { color: var(--text-primary); }

/* ========== Hero ========== */
.hero {
  position: relative; z-index: 1; padding: 160px 0 80px; text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 100px;
  background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--accent-hover); font-size: 0.85rem; margin-bottom: 24px;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero h1 {
  font-size: 3.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 20px;
  background: linear-gradient(135deg, #f0f0f5 0%, var(--accent-hover) 50%, var(--purple) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p {
  font-size: 1.15rem; color: var(--text-secondary); max-width: 620px;
  margin: 0 auto 36px; line-height: 1.8;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-visual {
  margin-top: 60px; position: relative;
  max-width: 900px; margin-left: auto; margin-right: auto;
}
.hero-dashboard {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow);
}
.hero-dashboard .mock-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
}
.hero-dashboard .mock-dot { width: 10px; height: 10px; border-radius: 50%; }
.hero-dashboard .mock-dot.red { background: var(--red); }
.hero-dashboard .mock-dot.orange { background: var(--orange); }
.hero-dashboard .mock-dot.green { background: var(--green); }
.hero-dashboard .mock-hits {
  display: flex; flex-direction: column; gap: 8px;
}
.hero-dashboard .mock-hit {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03); border-radius: var(--radius-sm);
  animation: slideIn 0.5s ease forwards; opacity: 0;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
.hero-dashboard .mock-hit .hit-tag {
  padding: 2px 8px; border-radius: 4px; font-size: 0.75rem;
}
.hero-dashboard .mock-hit .hit-tag.keyword { background: rgba(99, 102, 241, 0.2); color: var(--accent-hover); }
.hero-dashboard .mock-hit .hit-tag.group { background: rgba(34, 197, 94, 0.2); color: var(--green); }

/* ========== Sections ========== */
.section {
  position: relative; z-index: 1; padding: 80px 0;
}
.section-header {
  text-align: center; margin-bottom: 60px;
}
.section-header h2 {
  font-size: 2.5rem; font-weight: 700; margin-bottom: 12px;
}
.section-header p {
  font-size: 1.1rem; color: var(--text-secondary); max-width: 500px; margin: 0 auto;
}

/* ========== Feature Cards ========== */
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; transition: var(--transition);
  position: relative; overflow: hidden;
}
.feature-card:hover {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}
.feature-card .card-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 20px;
}
.feature-card .card-icon.purple { background: rgba(168, 85, 247, 0.15); color: var(--purple); }
.feature-card .card-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.feature-card .card-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.feature-card .card-icon.orange { background: rgba(245, 158, 11, 0.15); color: var(--orange); }
.feature-card .card-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.feature-card .card-icon.accent { background: rgba(99, 102, 241, 0.15); color: var(--accent-hover); }
.feature-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* ========== Pricing Cards ========== */
.pricing-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
}
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; text-align: center;
  transition: var(--transition); position: relative;
}
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 32px rgba(99, 102, 241, 0.2);
  transform: scale(1.05);
}
.pricing-card.featured:hover { transform: scale(1.05) translateY(-4px); }
.pricing-card .popular-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: white; padding: 4px 16px;
  border-radius: 100px; font-size: 0.8rem; font-weight: 600;
}
.pricing-card .plan-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.pricing-card .plan-price { font-size: 2.5rem; font-weight: 800; margin-bottom: 4px; }
.pricing-card .plan-price .currency { font-size: 1.2rem; }
.pricing-card .plan-period { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }
.pricing-card .plan-features { list-style: none; margin-bottom: 28px; text-align: left; }
.pricing-card .plan-features li {
  padding: 8px 0; font-size: 0.9rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.pricing-card .plan-features li .check { color: var(--green); font-size: 0.85rem; }

/* ========== Stats ========== */
.stats-row {
  display: flex; justify-content: center; gap: 60px; flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-item .stat-value { font-size: 2.5rem; font-weight: 800; color: var(--accent-hover); }
.stat-item .stat-label { color: var(--text-secondary); margin-top: 4px; }

/* ========== Testimonials ========== */
.testimonials-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.testimonial-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
}
.testimonial-card .quote { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.7; margin-bottom: 16px; }
.testimonial-card .author { display: flex; align-items: center; gap: 10px; }
.testimonial-card .author-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600;
}
.testimonial-card .author-name { font-weight: 600; font-size: 0.9rem; }
.testimonial-card .author-role { color: var(--text-muted); font-size: 0.8rem; }

/* ========== CTA ========== */
.cta-section {
  text-align: center; padding: 80px 0; position: relative; z-index: 1;
}
.cta-section h2 { font-size: 2.5rem; font-weight: 700; margin-bottom: 16px; }
.cta-section p { color: var(--text-secondary); margin-bottom: 32px; font-size: 1.1rem; }

/* ========== Footer ========== */
.footer {
  border-top: 1px solid var(--border); padding: 40px 0;
  position: relative; z-index: 1;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-copy { color: var(--text-muted); font-size: 0.85rem; }

/* ========== Modal ========== */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; width: 90%; max-width: 460px;
  box-shadow: var(--shadow); animation: scaleIn 0.2s ease;
}
@keyframes scaleIn { from { transform: scale(0.95); } to { transform: scale(1); } }
.modal h3 { font-size: 1.3rem; margin-bottom: 20px; }
.modal .form-group { margin-bottom: 16px; }
.modal .form-group label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
.modal .form-group input, .modal .form-group select, .modal .form-group textarea {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 0.95rem; font-family: inherit;
  transition: var(--transition);
}
.modal .form-group input:focus, .modal .form-group select:focus, .modal .form-group textarea:focus {
  outline: none; border-color: var(--accent);
}
.modal .form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ========== Dashboard Layout ========== */
.dashboard-layout {
  display: flex; min-height: 100vh; padding-top: 64px;
}
.sidebar {
  width: 240px; background: var(--bg-secondary); border-right: 1px solid var(--border);
  padding: 24px 0; position: fixed; top: 64px; bottom: 0; overflow-y: auto;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; }
.sidebar-nav a, .sidebar-nav button {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
  border: none; background: none; cursor: pointer; transition: var(--transition);
  text-decoration: none; width: 100%; text-align: left; font-family: inherit;
}
.sidebar-nav a:hover, .sidebar-nav button:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.sidebar-nav a.active, .sidebar-nav button.active {
  background: rgba(99, 102, 241, 0.1); color: var(--accent-hover);
}
.main-content {
  flex: 1; margin-left: 240px; padding: 32px;
}
.dashboard-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px;
}
.dashboard-header h1 { font-size: 1.5rem; font-weight: 700; }

/* ========== Stats Cards (Dashboard) ========== */
.stats-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat-card .stat-icon { font-size: 1.5rem; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }

/* ========== Tables ========== */
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.data-table th {
  text-align: left; padding: 12px 16px; font-size: 0.8rem;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.02); border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 16px; font-size: 0.9rem; border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ========== Badges ========== */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 100px;
  font-size: 0.75rem; font-weight: 500;
}
.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--orange); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: var(--purple); }

/* ========== Tabs ========== */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tab {
  padding: 10px 20px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: none; border: none; cursor: pointer; font-size: 0.9rem;
  color: var(--text-secondary); transition: var(--transition);
  font-family: inherit;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent-hover); background: rgba(99, 102, 241, 0.05); }

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

/* ========== Toast ========== */
.toast {
  position: fixed; top: 80px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: var(--radius-sm); font-size: 0.9rem;
  animation: slideInRight 0.3s ease; box-shadow: var(--shadow);
}
.toast-success { background: var(--green); color: white; }
.toast-error { background: var(--red); color: white; }
.toast-info { background: var(--blue); color: white; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .features-grid, .pricing-grid, .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 2.5rem; }
}
@media (max-width: 768px) {
  .features-grid, .pricing-grid, .testimonials-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero h1 { font-size: 2rem; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
}

/* ========== Page-specific ========== */
.page-content { position: relative; z-index: 1; padding-top: 100px; }

/* Panel card (for dashboard sections) */
.panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px;
}
.panel-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.panel-header h2 { font-size: 1.15rem; }
.panel-header .panel-actions { display: flex; gap: 8px; }

/* Inline form */
.inline-form {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
}
.inline-form .form-group { flex: 1; min-width: 150px; }

/* Chat preview */
.chat-preview {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; max-height: 400px; overflow-y: auto;
}
.chat-msg {
  display: flex; gap: 10px; margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}
.chat-msg .msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; color: white;
}
.chat-msg .msg-bubble {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px; font-size: 0.9rem;
  max-width: 80%; line-height: 1.5;
}
.chat-msg.self { flex-direction: row-reverse; }
.chat-msg.self .msg-bubble { background: rgba(99, 102, 241, 0.15); border-color: rgba(99, 102, 241, 0.3); }
.chat-msg .msg-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; text-align: right; }

/* Keyword tags */
.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 100px; font-size: 0.8rem;
}
.tag-primary { background: rgba(99, 102, 241, 0.15); color: var(--accent-hover); }
.tag-green { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.tag-remove { cursor: pointer; opacity: 0.6; font-size: 0.8rem; }

/* Hit feed */
.hit-feed {
  display: flex; flex-direction: column; gap: 8px;
}
.hit-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; background: var(--bg-secondary); border-radius: var(--radius-sm);
  border: 1px solid var(--border); transition: var(--transition);
}
.hit-item:hover { border-color: var(--accent); }
.hit-item.unread { border-left: 3px solid var(--accent); }
.hit-item .hit-content { flex: 1; }
.hit-item .hit-meta { display: flex; gap: 12px; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.hit-item .hit-text { font-size: 0.9rem; line-height: 1.5; }
