/**
 * OneCode Pro - Frontend Main CSS
 * Phase 8: Advanced Interactive & Animation Engine Styles
 */

/* Header Styles */
.site-header {
  height: var(--oc-header-height);
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--oc-border);
}

.site-header.scrolled {
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}

/* Primary Button (Guaranteed Stitch Brand Blue) */
.btn-primary,
a.bg-primary,
button.bg-primary {
  color: #ffffff !important;
  background-color: var(--oc-primary) !important;
}

.btn-primary:hover,
a.bg-primary:hover,
button.bg-primary:hover {
  background-color: var(--oc-primary-dark) !important;
  color: #ffffff !important;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  font-weight: 600;
  font-size: 14px;
  color: #ffffff !important;
  background-color: var(--oc-primary) !important;
  border: 1px solid transparent;
  border-radius: var(--oc-radius-button);
  box-shadow: 0 1px 3px rgba(0, 74, 198, 0.16);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--oc-primary-dark) !important;
  box-shadow: 0 4px 12px rgba(0, 74, 198, 0.25);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* Secondary Button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  font-weight: 600;
  font-size: 14px;
  color: var(--oc-text) !important;
  background-color: #ffffff;
  border: 1px solid var(--oc-border);
  border-radius: var(--oc-radius-button);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background-color: var(--oc-border-subtle);
  border-color: #cbd5e1;
}

/* Card Geometry */
.oc-card {
  background-color: var(--oc-surface);
  border: 1px solid var(--oc-border);
  border-radius: var(--oc-radius-card);
  padding: 24px;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.oc-card:hover {
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

/* Layout Utilities handled by tailwind.min.css - removed redundant non-responsive overrides that broke .lg:flex-row */

/* ========================================================================= */
/* PHASE 8: 1. SCROLL REVEAL ENGINE STYLES                                   */
/* ========================================================================= */
.oc-reveal {
  opacity: 0;
  transform: translateY(26px);
  transition-property: opacity, transform;
  transition-duration: 0.7s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.oc-reveal.is-revealed {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

.oc-reveal[data-reveal="fade-down"] {
  transform: translateY(-26px);
}
.oc-reveal[data-reveal="fade-left"] {
  transform: translateX(32px);
}
.oc-reveal[data-reveal="fade-right"] {
  transform: translateX(-32px);
}
.oc-reveal[data-reveal="zoom-in"] {
  transform: scale(0.92);
}
.oc-reveal[data-reveal="fade-in"] {
  transform: none;
}

/* Stagger Delay Utilities */
.oc-reveal[data-delay="100"] { transition-delay: 100ms; }
.oc-reveal[data-delay="150"] { transition-delay: 150ms; }
.oc-reveal[data-delay="200"] { transition-delay: 200ms; }
.oc-reveal[data-delay="250"] { transition-delay: 250ms; }
.oc-reveal[data-delay="300"] { transition-delay: 300ms; }
.oc-reveal[data-delay="400"] { transition-delay: 400ms; }
.oc-reveal[data-delay="500"] { transition-delay: 500ms; }

/* ========================================================================= */
/* PHASE 8: 2. HOVER SPOTLIGHT & 3D TILT STYLES                              */
/* ========================================================================= */
.spotlight-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(37, 99, 235, 0.08), transparent 45%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.spotlight-card:hover::before {
  opacity: 1;
}

.spotlight-card-dark::before {
  background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(59, 130, 246, 0.15), transparent 45%);
}

.tilt-element {
  transform-style: preserve-3d;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}

/* ========================================================================= */
/* PHASE 8: 3. ACCORDION EXPANSION STYLES                                    */
/* ========================================================================= */
.oc-accordion-item {
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(8px);
  color: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.oc-accordion-item.is-active {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 4px 24px -2px rgba(0, 74, 198, 0.25);
  background: rgba(30, 41, 59, 0.95);
}

.oc-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  color: #ffffff;
}

.oc-accordion-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.oc-accordion-icon {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #94a3b8;
}

.oc-accordion-item.is-active .oc-accordion-icon {
  transform: rotate(180deg);
  color: #60a5fa;
}

.oc-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.35s ease;
  opacity: 0;
  padding: 0 1.5rem;
  color: #cbd5e1;
}

.oc-accordion-item.is-active .oc-accordion-body {
  max-height: 500px;
  opacity: 1;
  padding: 0 1.5rem 1.25rem 1.5rem;
}

/* ========================================================================= */
/* PHASE 8: 4. RADAR & FLIGHT LINE ANIMATIONS                                */
#anti-diversion-radar-box {
  position: relative;
  height: 360px !important;
  min-height: 360px !important;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: rgba(2, 6, 23, 0.75);
}

@keyframes radarSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.radar-sweep-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 380px;
  height: 380px;
  margin-top: -190px;
  margin-left: -190px;
  border-radius: 50%;
  background: conic-gradient(from 0deg at 50% 50%, rgba(59, 130, 246, 0.25) 0deg, rgba(59, 130, 246, 0) 70deg);
  animation: radarSweep 6s linear infinite;
  pointer-events: none;
}

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

.radar-node-pulse {
  animation: pulseGlow 2s infinite ease-out;
}

@keyframes alertDashFlow {
  to { stroke-dashoffset: -16; }
}

.radar-alert-flow {
  animation: alertDashFlow 1.2s linear infinite;
}

/* Radar Tooltip */
.radar-node-tooltip {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #ffffff;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.radar-node-group:hover .radar-node-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================================================= */
/* PHASE 8: 5. POPUP MODAL SYSTEM STYLES                                     */
/* ========================================================================= */
.oc-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

.oc-modal.is-open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 99999 !important;
}

.oc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.oc-modal-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--oc-border);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Obsidian Terminal Modal (防窜存证工单与科技大屏深色模态弹窗) */
.oc-modal-container.oc-modal-dark,
#diversion-case-modal .oc-modal-container,
.oc-modal-container.bg-slate-900 {
  background-color: #0f172a !important;
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

#diversion-case-modal .oc-modal-container * {
  box-sizing: border-box;
}

.oc-modal.is-open .oc-modal-container {
  transform: scale(1) translateY(0);
}

/* ========================================================================= */
/* PHASE 8: 6. MOBILE DRAWER NAVIGATION STYLES                               */
/* ========================================================================= */
.mobile-drawer-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--oc-border);
  z-index: 90;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.08);
}

.mobile-drawer-sheet.is-open {
  transform: translateX(0);
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 80;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* ========================================================================= */
/* ENTERPRISE MULTI-LEVEL DROPDOWN NAVIGATION SYSTEM                         */
/* ========================================================================= */
.nav-item-has-children {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 10px;
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.2s;
  pointer-events: none;
  z-index: 60;
}

/* 隐形悬浮桥 (Invisible Hover Bridge): 彻底根除鼠标移动闪退顽疾 */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-item-has-children:hover > .nav-dropdown-menu,
.nav-item-has-children:focus-within > .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* 右侧边界防溢出保护：靠近右端的下拉菜单靠右对齐 */
.nav-item-has-children:last-child > .nav-dropdown-menu,
.nav-item-has-children:nth-last-child(2) > .nav-dropdown-menu {
  left: auto;
  right: 0;
}

.nav-dropdown-inner {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12),
              0 1px 3px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #0f172a;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-dropdown-item:hover {
  background-color: #f8fafc;
  color: #004ac6;
  transform: translateX(3px);
}

.nav-dropdown-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background-color: #eff6ff;
  color: #004ac6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.nav-dropdown-item:hover .nav-dropdown-icon {
  background-color: #004ac6;
  color: #ffffff;
  transform: scale(1.05);
}

.nav-dropdown-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
  transition: color 0.15s ease;
}

.nav-dropdown-item:hover .nav-dropdown-title {
  color: #004ac6;
}

.nav-dropdown-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.3;
  margin-top: 2px;
}

/* Arrow indicator rotation */
.nav-item-has-children .nav-arrow-icon {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s;
}

.nav-item-has-children:hover .nav-arrow-icon {
  transform: rotate(180deg);
  color: #004ac6;
}

/* Wide Dropdown for Product Matrix & Solution Matrix */
.nav-dropdown-menu.dropdown-wide {
  min-width: 580px;
  max-width: calc(100vw - 32px);
}

.nav-dropdown-menu.dropdown-wide .nav-dropdown-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
}

/* Mobile Drawer Accordion Submenu Styles */
.mobile-nav-group {
  margin-bottom: 2px;
}

.mobile-submenu-toggle .submenu-arrow {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-submenu-toggle.is-active .submenu-arrow {
  transform: rotate(180deg);
  color: #004ac6;
}

/* ==========================================================================
   Phase 14: Performance & Rendering Optimizations
   ========================================================================== */

/* Long-page layout optimization: skip off-screen layout & paint */
.onecode-section-optimized,
.oc-lazy-section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 600px;
}

/* Image aspect ratio preservation to eradicate CLS */
.onecode-aspect-ratio-box {
  position: relative;
  overflow: hidden;
}

/* Reduced Motion: respect user OS accessibility and low-power settings */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Flagship Bento - Cyber Terminal (方案 B 黑曜石数据大屏专属样式)
   ========================================================================== */
.cyber-terminal-board {
  background-color: #091a13 !important;
  border: 2px solid rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 25px 50px -12px rgba(6, 78, 59, 0.45), 0 0 40px -10px rgba(16, 185, 129, 0.15) !important;
  position: relative;
  overflow: hidden;
}

.cyber-terminal-glow {
  position: absolute;
  top: -6rem;
  right: -6rem;
  width: 16rem;
  height: 16rem;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0) 70%);
  border-radius: 9999px;
  pointer-events: none;
}

.cyber-metric-tile {
  background-color: rgba(17, 42, 32, 0.94) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cyber-metric-tile:hover {
  border-color: rgba(52, 211, 153, 0.8) !important;
  box-shadow: 0 12px 28px -4px rgba(16, 185, 129, 0.35) !important;
  transform: translateY(-2px);
}

.cyber-metric-num {
  color: #6ee7b7 !important;
  text-shadow: 0 0 20px rgba(110, 231, 183, 0.35);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ==========================================================================
   Icon & Spinner Display Protection (C8 Fix)
   ========================================================================== */
.material-symbols-outlined.hidden,
.btn-lead-spinner.hidden,
.btn-demo-spinner.hidden {
  display: none !important;
}

.hidden {
  display: none;
}

@media (min-width: 768px) {
  .site-header .site-nav-container,
  .site-nav-container,
  .site-header .md\:flex {
    display: flex !important;
  }
}

/* ==========================================================================
   Legal Document & Enterprise Entry Content Typography
   ========================================================================== */
.entry-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid #004ac6;
  line-height: 1.4;
}

.entry-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.entry-content p {
  color: #334155;
  line-height: 1.75;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.entry-content ul,
.entry-content ol {
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: #334155;
  font-size: 0.9375rem;
  line-height: 1.75;
}

.entry-content ul {
  list-style-type: disc;
}

.entry-content ol {
  list-style-type: decimal;
}

.entry-content li {
  margin-bottom: 0.375rem;
}

.entry-content li::marker {
  color: #004ac6;
}

.entry-content a {
  color: #004ac6;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.entry-content a:hover {
  color: #1d4ed8;
}

.legal-document-header {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

