/*
 * home-spotlight.css — 首页“聚光舞台”交互 + 黑金标准色号对齐（v1，2026-11-25）
 *
 * 叠加在 home-polish.css 之后，只作用于首页（body.home-page-shell main.xl-home）的深色主题。
 *   - 色号按《网站主视觉规范》（docs/mcp-site-main-visual-style.md）：卡片 #252524 → #1E1E1D，卡片边线 #4A4947，选中金边 #8B7B4D。
 *   - 鼠标移到工具卡：放大、上移、朝鼠标方向轻微倾斜、金边深阴影；同一分区其它卡片盖一层半透明暗色并略缩小。
 *   - 只动 transform / opacity / 颜色 / 阴影；不用 filter，不用 infinite 动画，不改布局尺寸；颜色全部先写实色。
 *   - 只对鼠标设备生效（hover: hover 且 pointer: fine）；触屏保持 home-polish.css 的按压反馈；“减少动态效果”时不位移。
 *   - 维护中的卡片不参与。
 *   - 页面滚动期间整套聚光暂停（见 4.2 的说明）。
 *   - 跟手倾斜由 js/home-spotlight.js 写入 --sp-* 变量；脚本没加载时仍有放大、上移、变暗（纯 CSS）。
 *   - 回滚：模板 web/index/view/index/index.html 中删除 home-spotlight.css 和 home-spotlight.js 两行即可完全恢复。
 */

/* ---------- 1. 色号对齐 ---------- */
html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tool-section .xl-tool-card {
  background-color: #222221 !important;
  background-image: linear-gradient(180deg, #252524 0%, #1e1e1d 100%) !important;
  border-color: #4a4947 !important;
}
html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tool-section .xl-tool-card.is-maintenance {
  border-color: #3f3e3c !important;
}

/* ---------- 2. 变暗遮罩（预先铺好，只做透明度渐变） ---------- */
html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card:not(.is-maintenance)::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 13px !important;
  background: #0b0b0b !important;
  opacity: 0 !important;
  transform: none !important;
  animation: none !important;
  pointer-events: none !important;
  z-index: 7 !important;
  transition: opacity 0.4s ease !important;
}

/* ---------- 3. “立即使用”按钮（图片区下沿浮出） ---------- */
html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card:not(.is-maintenance) .xl-tool-image::after {
  content: "立即使用  \2192" !important;
  display: block !important;
  position: absolute !important;
  top: auto !important;
  right: auto !important;
  bottom: 12px !important;
  left: 50% !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 6px 14px !important;
  border: 1px solid #e1c792 !important;
  border-radius: 999px !important;
  background-color: #c6a36a !important;
  background-image: linear-gradient(180deg, #e6ce9a 0%, #c6a36a 100%) !important;
  color: #28281c !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 16px !important;
  letter-spacing: 0.04em !important;
  white-space: nowrap !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5) !important;
  opacity: 0 !important;
  transform: translate(-50%, 10px) !important;
  animation: none !important;
  pointer-events: none !important;
  z-index: 6 !important;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) !important;
}
html[lang^="en"][data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card:not(.is-maintenance) .xl-tool-image::after {
  content: "Use now  \2192" !important;
}

/* ---------- 4. 鼠标设备：聚光舞台 ---------- */
@media (hover: hover) and (pointer: fine) {
  /* 4.1 过渡曲线：复位带一点回弹 */
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card:not(.is-maintenance) {
    transition:
      transform 0.6s cubic-bezier(0.2, 1.4, 0.4, 1),
      border-color 0.3s ease,
      box-shadow 0.35s ease,
      background-color 0.2s ease !important;
  }
  /* 跟手期间由脚本逐帧写入角度，这里不再叠加过渡；滚动一开始就恢复上面的过渡，避免卡片瞬间跳回 */
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card.is-spot-track:not(.is-maintenance) {
    transition:
      transform 0s linear,
      border-color 0.3s ease,
      box-shadow 0.35s ease,
      background-color 0.2s ease !important;
  }

  /* 4.2 焦点卡片：金边 + 深阴影 + 标题变金 + 按钮浮出 + 箭头转向
   *     页面滚动期间（html.home-is-scrolling，由首页延迟脚本在滚动时加上、停下 0.7 秒后去掉）整套聚光暂停，
   *     卡片退回 home-polish.css 的轻量悬停；实测否则滚轮滚动时卡片从指针下经过会反复触发放大和变暗，掉帧明显。 */
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card:not(.is-maintenance):hover {
    z-index: 5 !important;
    border-color: #8b7b4d !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.09),
      0 0 0 1px rgba(219, 193, 140, 0.3),
      0 34px 60px rgba(0, 0, 0, 0.72),
      0 0 54px rgba(219, 193, 140, 0.16) !important;
  }
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card:not(.is-maintenance):hover .xl-tool-copy h3 {
    color: #dbc18c !important;
  }
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card:not(.is-maintenance):hover .xl-tool-image::after {
    opacity: 1 !important;
    transform: translate(-50%, 0) !important;
  }
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card:not(.is-maintenance):hover .xl-tool-link-arrow svg {
    transform: rotate(-45deg) !important;
  }

  /* 4.3 同一分区的其它卡片：盖暗 */
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-tool-section .xl-tool-grid:hover a.xl-tool-card:not(.is-maintenance):not(:hover)::after {
    opacity: 0.54 !important;
  }

  /* 4.4 横幅：鼠标停留时缓慢推近 */
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-hero .xl-hero-photo {
    transition: transform 5s cubic-bezier(0.2, 0.6, 0.3, 1) !important;
  }

  /* 4.5 更新日志：整条右移 + 左侧金色竖条 */
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-notice-item {
    transition: transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1), background-color 0.2s ease, box-shadow 0.2s ease !important;
  }
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-notice-item:hover {
    box-shadow: inset 3px 0 0 #8b7b4d !important;
  }

  /* 4.6 签到按钮：实体按键 */
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tc-signin {
    transition: transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1), box-shadow 0.2s ease, background-color 0.2s ease !important;
  }
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tc-signin .xl-tc-signin-arrow {
    transition: transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) !important;
  }
}

/* 4.7 位移类效果：只在鼠标设备、且没有开启“减少动态效果”时启用 */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card:not(.is-maintenance):hover {
    transform: perspective(720px) translateY(var(--sp-ly, -9px)) rotateX(var(--sp-rx, 0deg)) rotateY(var(--sp-ry, 0deg)) scale(var(--sp-sc, 1.13)) !important;
  }
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card:not(.is-maintenance):hover:active {
    transform: perspective(720px) translateY(var(--sp-ly, -9px)) rotateX(var(--sp-rx, 0deg)) rotateY(var(--sp-ry, 0deg)) scale(var(--sp-sc, 1.06)) !important;
    transition-duration: 0.12s !important;
  }
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-tool-section a.xl-tool-card.is-spot-track:not(.is-maintenance):hover:active {
    transition-duration: 0s, 0.3s, 0.35s, 0.2s !important;
  }
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-tool-section .xl-tool-grid:hover a.xl-tool-card:not(.is-maintenance):not(:hover) {
    transform: scale(0.965) !important;
  }
  html[data-theme]:not([data-theme="light"]):not(.home-is-scrolling) body.home-page-shell main.xl-home .xl-hero:hover .xl-hero-photo {
    transform: scale(1.06) !important;
  }
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-notice-item:hover {
    transform: translateX(6px) !important;
  }
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-notice-item:hover .xl-notice-body {
    transform: none !important;
  }
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tc-signin:hover {
    transform: translateY(-2px) !important;
  }
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tc-signin:hover .xl-tc-signin-arrow {
    transform: translateX(5px) !important;
  }
  html[data-theme]:not([data-theme="light"]) body.home-page-shell main.xl-home .xl-tc-signin:active {
    transform: translateY(2px) scale(0.98) !important;
    transition-duration: 0.08s !important;
  }
}
