/* ==========================================================================
   1. 全局基础样式 & 浏览器兼容优化
   ========================================================================== */

/* 滚动条美化 (保留你的自定义设计) */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f8fafc;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* 文字选中背景色 (来自 H5BP，提升细节体验) */
::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/* ==========================================================================
   2. 你的自定义工具类 (Glassmorphism, Grid, Layout)
   ========================================================================== */

.glass-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tech-grid-bg {
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
  background-size: 32px 32px;
}

.glass-modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.no-scroll {
  overflow: hidden;
}

.hover-trigger {
  cursor: pointer;
}

/* 媒体容器样式 - 优化图片/视频显示 */
.media-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-container video,
.media-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* ==========================================================================
   3. 组件交互样式 (Cards, Tabs, Accordions)
   ========================================================================== */

/* --- 性能卡片 (Performance Card) --- */
.perf-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

@media (min-width: 768px) {
  .perf-card.active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.3);
  }

  .perf-card.active .perf-icon-bg {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
  }

  .perf-card.active p {
    color: rgba(255, 255, 255, 0.9);
  }

  .perf-card.active h3 {
    color: white;
  }
}

@media (max-width: 767px) {
  .perf-card.active {
    background-color: #eff6ff;
    border-color: #2563eb;
    border-bottom-color: transparent;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .perf-card.active h3 {
    color: #2563eb;
  }

  .perf-card.active .perf-icon-bg {
    background-color: #2563eb;
    color: white;
  }
}

/* --- 深度解析导航 (Deep Dive Nav) --- */
.dive-nav-card.active-dive .active-bg {
  opacity: 1;
  transform: scale(1);
}

.dive-nav-card.active-dive .active-indicator {
  opacity: 1;
}

.dive-nav-card.active-dive .icon-box {
  background-color: #eff6ff;
  color: #2563eb;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.dive-nav-card.active-dive h3 {
  color: #0f172a;
}

@media (max-width: 1024px) {
  .dive-accordion-btn {
    background-color: white;
    color: #0f172a;
  }

  .dive-accordion-btn.active-dive {
    background-color: #eff6ff;
    color: #2563eb;
    border-bottom-color: transparent;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
}

/* --- 标签切换按钮 (Tab Buttons) --- */
.tab-btn {
  transition: all 0.3s ease;
  cursor: pointer;
}

.feature-tab-btn.active-tab {
  background-color: #eff6ff;
  border-color: #2563eb;
}

@media (max-width: 1024px) {
  .feature-tab-btn.active-tab {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
  }
}

/* ==========================================================================
   4. 动画关键帧 (Animations & Keyframes)
   ========================================================================== */

/* 展开动画 */
@keyframes unfold-in {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    filter: blur(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.animate-unfold {
  opacity: 0;
  animation: unfold-in 1s cubic-bezier(0.3, 0, 0.2, 1) forwards;
}

/* 成功勾选动画 (Success Checkmark) */
.success-checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.check-icon {
  width: 80px;
  height: 80px;
  position: relative;
  border-radius: 50%;
  box-sizing: content-box;
  border: 4px solid #4caf50;
}

.check-icon::before {
  top: 3px;
  left: -2px;
  width: 30px;
  transform-origin: 100% 50%;
  border-radius: 100px 0 0 100px;
}

.check-icon::after {
  top: 0;
  left: 30px;
  width: 60px;
  transform-origin: 0 50%;
  border-radius: 0 100px 100px 0;
  animation: rotateCircle 4.25s ease-in;
}

.icon-line {
  height: 5px;
  background-color: #4caf50;
  display: block;
  border-radius: 2px;
  position: absolute;
  z-index: 10;
}

.line-tip {
  top: 46px;
  left: 14px;
  width: 25px;
  transform: rotate(45deg);
  animation: icon-line-tip 0.75s;
}

.line-long {
  top: 38px;
  right: 8px;
  width: 47px;
  transform: rotate(-45deg);
  animation: icon-line-long 0.75s;
}

.icon-circle {
  top: -4px;
  left: -4px;
  z-index: 10;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid rgba(76, 175, 80, 0.2);
  position: absolute;
  box-sizing: content-box;
}

@keyframes icon-line-tip {
  0% {
    width: 0;
    left: 1px;
    top: 19px;
  }

  54% {
    width: 0;
    left: 1px;
    top: 19px;
  }

  70% {
    width: 50px;
    left: -8px;
    top: 37px;
  }

  84% {
    width: 17px;
    left: 21px;
    top: 48px;
  }

  100% {
    width: 25px;
    left: 14px;
    top: 46px;
  }
}

@keyframes icon-line-long {
  0% {
    width: 0;
    right: 46px;
    top: 54px;
  }

  65% {
    width: 0;
    right: 46px;
    top: 54px;
  }

  84% {
    width: 55px;
    right: 0px;
    top: 35px;
  }

  100% {
    width: 47px;
    right: 8px;
    top: 38px;
  }
}

/* ==========================================================================
   5. 打印样式 (来自 H5BP，打印时生效)
   ========================================================================== */
@media print {

  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
/* --- PC端：浮窗逻辑 --- */
/* 确保父容器是定位基准，但不改变其 display 属性 */
.expert-item {
    position: relative; /* 必须！作为浮窗的定位参考 */
}

.expert-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    /* 定位在头像右侧：left 100% 表示从父容器右边缘开始，top 0 对齐顶部 */
    left: 100%;
    top: 0;
    margin-left: 20px; /* 离开头像一段距离，不挡脸 */
    width: 260px;
    z-index: 100;
    pointer-events: none; /* 关键：防止浮窗干扰移动端点击 */
    
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    transform: translateX(10px);
}

/* 仅在桌面端触发 Hover */
@media (min-width: 768px) {
    .expert-item:hover .expert-tooltip {
        visibility: visible;
        opacity: 1;
        transform: translateX(0);
    }
}

/* 如果是右侧最后一个专家，让框向左弹，防止出屏 */
.tooltip-left {
    left: auto !important;
    right: 105% !important;
    margin-left: 0 !important;
    margin-right: 20px !important;
    transform: translateX(-10px) !important;
}

/* --- 移动端：弹窗动画 --- */
@keyframes sheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.animate-sheet {
    animation: sheetUp 0.4s ease-out forwards;
}