/* ============================================================
   fx.css — 科技感增强 + 滚动交互样式
   与 style.css 解耦：所有新效果集中于此，按模块注释分区。
   依赖：html.js-fx（由 index.php 内联脚本按能力添加，
   不支持 IntersectionObserver 或开启"减弱动效"时自动降级，
   内容保持直接可见，动画一律不生效）。
   ============================================================ */

/* ---------- 0. 基础工具 ---------- */

.mono {
    font-family: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', Consolas, 'Courier New', monospace;
}

/* HUD 四角框线：8 段渐变拼出四个角，随父元素圆角裁切 */
.hud-corners {
    position: absolute;
    inset: 0;
    pointer-events: none;
    --hc: rgba(8, 145, 178, 0.55);
    --hs: 16px;
    --hw: 2px;
    background:
        linear-gradient(var(--hc), var(--hc)) left 0 top 0 / var(--hs) var(--hw),
        linear-gradient(var(--hc), var(--hc)) left 0 top 0 / var(--hw) var(--hs),
        linear-gradient(var(--hc), var(--hc)) right 0 top 0 / var(--hs) var(--hw),
        linear-gradient(var(--hc), var(--hc)) right 0 top 0 / var(--hw) var(--hs),
        linear-gradient(var(--hc), var(--hc)) left 0 bottom 0 / var(--hs) var(--hw),
        linear-gradient(var(--hc), var(--hc)) left 0 bottom 0 / var(--hw) var(--hs),
        linear-gradient(var(--hc), var(--hc)) right 0 bottom 0 / var(--hs) var(--hw),
        linear-gradient(var(--hc), var(--hc)) right 0 bottom 0 / var(--hw) var(--hs);
    background-repeat: no-repeat;
}

/* ---------- 1. HUD 风格标题（左对齐 + 编号眉标，打破居中对称） ---------- */

.hud-header {
    text-align: left;
    margin-bottom: 2.75rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.hud-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: min(340px, 62%);
    height: 1px;
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.55), transparent);
}

.hud-header .section-desc {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
}

.hud-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--primary);
    margin-bottom: 0.9rem;
    font-weight: 600;
}

.hud-tag::before {
    content: '';
    width: 22px;
    height: 1px;
    background: currentColor;
}

.hud-tag::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 1px;
}

.hud-tag-light { color: var(--primary-light); }

.section-desc-dark { color: rgba(255, 255, 255, 0.55) !important; }

/* ---------- 2. 顶部滚动进度条 ---------- */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 100;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

/* ---------- 3. 鼠标跟随光晕（仅桌面精确指针 + 未降级时） ---------- */

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.1), transparent 65%);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    will-change: transform;
}

.fx-pointer .cursor-glow { opacity: 1; }

/* ---------- 4. 进场动画（滚动驱动，data-reveal + --d 交错延迟） ---------- */

.js-fx [data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--d, 0ms);
    will-change: opacity, transform;
}

.js-fx [data-reveal="left"] { transform: translateX(-36px); }
.js-fx [data-reveal="right"] { transform: translateX(36px); }
.js-fx [data-reveal="fade"] { transform: none; }
.js-fx [data-reveal="scale"] { transform: scale(0.94); }

/* 显现后立即清掉延迟，避免后续 hover 等过渡被拖慢 */
.js-fx [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
    transition-delay: 0ms;
    will-change: auto;
}

/* ---------- 5. 连接线 / 时间线生长 ---------- */

.js-fx .tech-connector-line {
    transform: translateX(-50%) scaleY(0);
    transform-origin: top;
    transition: transform 1.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js-fx .tech-connector-line.is-grown {
    transform: translateX(-50%) scaleY(1);
}

.js-fx .timeline::before {
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s;
}

.js-fx .timeline.is-grown::before {
    transform: scaleY(1);
}

/* ---------- 6. Hero 增强 ---------- */

.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 15;
    pointer-events: none;
}

.hero-corners {
    --hc: rgba(255, 255, 255, 0.22);
    --hs: 34px;
    --hw: 2px;
    z-index: 16;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 1rem;
    border: 1px solid rgba(34, 211, 238, 0.3);
    background: rgba(8, 145, 178, 0.12);
    border-radius: 2px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 1.75rem;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-light);
    box-shadow: 0 0 8px var(--primary-light);
    animation: dot-blink 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    flex-shrink: 0;
}

@keyframes dot-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.badge-divider {
    width: 1px;
    height: 0.8rem;
    background: rgba(255, 255, 255, 0.25);
}

.hero-badge .mono {
    color: var(--primary-light);
    font-weight: 600;
    letter-spacing: 0.14em;
}

/* 滚动引导：鼠标轮廓 + 下落光点 */
.scroll-cue {
    position: absolute;
    bottom: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.scroll-cue-track {
    width: 22px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.scroll-cue-dot {
    width: 3px;
    height: 7px;
    border-radius: 2px;
    background: var(--accent-light);
    animation: cue-drop 1.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes cue-drop {
    0% { transform: translateY(0); opacity: 0; }
    25% { opacity: 1; }
    70% { transform: translateY(12px); opacity: 1; }
    100% { transform: translateY(12px); opacity: 0; }
}

.scroll-cue-text {
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.45);
    text-indent: 0.3em; /* 抵消 letter-spacing 造成的视觉偏移 */
}

@media (max-width: 767px) {
    .scroll-cue { display: none; }
}

/* ---------- 7. 行业痛点：不对称阶梯布局 ---------- */

.pain-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .pain-grid {
        grid-template-columns: repeat(12, 1fr);
        gap: 1.5rem;
        align-items: start;
    }

    .pain-grid .pain-card:nth-child(1) { grid-column: 1 / span 5; }
    .pain-grid .pain-card:nth-child(2) { grid-column: 6 / span 4; margin-top: 2.75rem; }
    .pain-grid .pain-card:nth-child(3) { grid-column: 10 / span 3; margin-top: 5.5rem; }
}

.pain-index {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    transition: color 0.3s;
}

.pain-card:hover .pain-index { color: var(--accent); }

/* ---------- 8. 卡片 3D 倾斜 + 光泽跟随（pointer-fx.js 写入 --rx/--ry/--mx/--my） ---------- */

.fx-tilt .tilt-card {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition:
        transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
        border-color 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

/* 悬停位移与倾斜合成，覆盖 style.css 里的单 translateY */
.fx-tilt .pain-card:hover {
    transform: perspective(900px) translateY(-8px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

/* 光泽：随鼠标移动的高光斑 */
.fx-tilt .tilt-card { position: relative; }

.fx-tilt .tilt-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(34, 211, 238, 0.13), transparent 45%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.fx-tilt .tilt-card:hover::after { opacity: 1; }

/* ---------- 9. 项目价值：横向数据带（阶梯缩进，去三卡片） ---------- */

.value-rows {
    border-top: 1px solid var(--border-light);
}

.value-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.75rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    transition: background 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.value-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.value-row:hover::before { transform: scaleY(1); }

.value-row:hover {
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.05), transparent 60%);
}

.value-index {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    transition: color 0.3s;
    flex-shrink: 0;
}

.value-row:hover .value-index { color: var(--accent); }

.value-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.12), rgba(34, 211, 238, 0.08));
    color: var(--primary);
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.value-row:hover .value-icon {
    transform: scale(1.08) rotate(-4deg);
}

.value-icon svg { width: 1.4rem; height: 1.4rem; }

.value-body { flex: 1; min-width: 0; }

.value-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.value-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.value-keyword {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--primary);
    border: 1px solid rgba(8, 145, 178, 0.35);
    padding: 0.25rem 0.7rem;
    border-radius: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.value-arrow {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), color 0.3s;
}

.value-row:hover .value-arrow {
    transform: translateX(6px);
    color: var(--accent);
}

/* 阶梯缩进：越往下越深，打破左右对齐 */
@media (min-width: 768px) {
    .value-rows .value-row:nth-child(2) { padding-left: 3rem; }
    .value-rows .value-row:nth-child(3) { padding-left: 6rem; }
}

@media (max-width: 639px) {
    .value-keyword, .value-arrow { display: none; }
    .value-row { gap: 1rem; padding: 1.4rem 0.5rem; }
}

/* ---------- 10. 技术架构：深色网格背景 + 脉冲计数器 ---------- */

.section-tech::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 78%);
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 78%);
}

@keyframes counter-pulse {
    0%, 100% { box-shadow: 0 0 18px rgba(249, 115, 22, 0.4); }
    50% { box-shadow: 0 0 34px rgba(249, 115, 22, 0.75); }
}

.tech-counter {
    animation: counter-pulse 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.tech-highlight-box {
    text-align: left;
    position: relative;
}

.tech-highlight-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.5rem;
    bottom: 1.5rem;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--primary));
    border-radius: 3px;
}

.tech-highlight-title {
    background: linear-gradient(135deg, var(--accent-light), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ---------- 11. 产品演示：不对称网格 ---------- */

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: 1.35fr 1fr;
        align-items: start;
    }

    .product-grid .product-card:last-child { margin-top: 3rem; }
}

/* ---------- 12. 导航 scrollspy 当前项 ---------- */

.nav-links-desktop a.nav-active {
    color: var(--accent-light);
}

.nav-links-desktop a.nav-active::after { width: 100%; }

/* ---------- 13. 按钮扫光 ---------- */

.btn-accent::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.btn-accent:hover::after { left: 120%; }

/* ---------- 14. 降级保护：减弱动效 / 无 JS 时一切直接可见 ---------- */

@media (prefers-reduced-motion: reduce) {
    .status-dot,
    .scroll-cue-dot,
    .tech-counter {
        animation: none;
    }
}
