/* ==========================================================================
   PulseCTRM Shared Styles
   通用组件、动画、工具类
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* Smooth scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* --------------------------------------------------------------------------
   Mobile menu
   -------------------------------------------------------------------------- */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.mobile-menu.open { max-height: 400px; }

/* --------------------------------------------------------------------------
   Scroll reveal animation
   -------------------------------------------------------------------------- */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in-up-delay-1 { transition-delay: 0.1s; }
.fade-in-up-delay-2 { transition-delay: 0.2s; }
.fade-in-up-delay-3 { transition-delay: 0.3s; }
.fade-in-up-delay-4 { transition-delay: 0.4s; }

/* --------------------------------------------------------------------------
   Grid backgrounds
   -------------------------------------------------------------------------- */
.grid-bg {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.grid-bg-fine {
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25);
}

/* --------------------------------------------------------------------------
   Dashboard / data panel components
   -------------------------------------------------------------------------- */
.dash-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.dash-value {
  font-family: 'JetBrains Mono', monospace;
}

/* --------------------------------------------------------------------------
   Gradient text
   -------------------------------------------------------------------------- */
.gradient-text {
  background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-amber {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --------------------------------------------------------------------------
   Form input focus
   -------------------------------------------------------------------------- */
.input-focus:focus {
  outline: none;
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

/* --------------------------------------------------------------------------
   Pulse ring for CTA
   -------------------------------------------------------------------------- */
.pulse-ring { position: relative; }
.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid rgba(217, 119, 6, 0.3);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.08); opacity: 0; }
}

/* --------------------------------------------------------------------------
   Risk heatmap progress bars
   -------------------------------------------------------------------------- */
.risk-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.risk-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 1.2s ease-out;
}

/* --------------------------------------------------------------------------
   Counter animation helper
   -------------------------------------------------------------------------- */
.counter {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   AI Assistant / chat-like panels
   -------------------------------------------------------------------------- */
.ai-message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.875rem;
  line-height: 1.5;
}
.ai-message-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
}
.ai-message-text {
  color: #cbd5e1;
}
.ai-stream-list {
  position: relative;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Platform capability stack
   -------------------------------------------------------------------------- */
.platform-layer {
  position: relative;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.platform-layer:hover {
  transform: translateX(8px);
  border-color: rgba(217, 119, 6, 0.4);
}
.platform-layer::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -1.25rem;
  width: 2px;
  height: 1.25rem;
  background: linear-gradient(180deg, rgba(217,119,6,0.5), transparent);
  transform: translateX(-50%);
}
.platform-layer:last-child::after { display: none; }

/* --------------------------------------------------------------------------
   Agent collaboration flow
   -------------------------------------------------------------------------- */
.agent-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.agent-node::after {
  content: '\f063'; /* fa-arrow-down */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 50%;
  bottom: -1.5rem;
  transform: translateX(-50%);
  color: rgba(217, 119, 6, 0.5);
  font-size: 0.875rem;
}
.agent-node:last-child::after { display: none; }

/* --------------------------------------------------------------------------
   CEO Dashboard
   -------------------------------------------------------------------------- */
.ceo-metric {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.75rem;
  padding: 1rem;
  transition: border-color 0.3s ease;
}
.ceo-metric:hover {
  border-color: rgba(217, 119, 6, 0.3);
}

/* --------------------------------------------------------------------------
   Particles background
   -------------------------------------------------------------------------- */
.particles-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.particles-bg canvas {
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Comparison cards
   -------------------------------------------------------------------------- */
.compare-traditional { border-left: 3px solid #475569; }
.compare-ainative { border-left: 3px solid #d97706; }

/* --------------------------------------------------------------------------
   Methodology flow connector (kept for compatibility)
   -------------------------------------------------------------------------- */
.method-step { position: relative; }
.method-step::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -50%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(217,119,6,0.6), rgba(217,119,6,0.1));
  transform: translateY(-50%);
  z-index: 0;
}
@media (min-width: 1024px) {
  .method-step:nth-child(4n)::after,
  .method-step:last-child::after { display: none; }
}
@media (max-width: 1023px) {
  .method-step::after {
    top: auto;
    bottom: -24px;
    right: 50%;
    width: 2px;
    height: 48px;
    background: linear-gradient(180deg, rgba(217,119,6,0.6), rgba(217,119,6,0.1));
    transform: translateX(50%);
  }
  .method-step:last-child::after { display: none; }
}
