/* 无限精力部分 - 网络星座布局 */
.energy {
    background: linear-gradient(180deg, #0a1730 0%, #0d2144 55%, #0a1a38 100%);
    padding: clamp(45px, 4.688vw, 90px) 0 clamp(55px, 5.729vw, 110px);
    position: relative;
    overflow: hidden;
}

.energy .container { position: relative; z-index: 2; }
.energy .section-title {
    position: relative;
    z-index: 3;
    font-size: clamp(39px, 3.75vw, 46px);
    margin-bottom: 0;
    white-space: nowrap;
}

.energy .section-divider {
    margin-bottom: 0;
}

.energy .section-divider + .energy-layout {
    margin-top: 0;
}

/* 舞台容器 - 连接线网络作为居中背景 */
.energy-layout {
    position: relative;
    width: 100%;
    max-width: 1400px;
    height: 860px;
    margin: clamp(25px, 2.604vw, 50px) auto 0;
    background: none;
    isolation: isolate;
}

.energy-layout::before {
    content: "";
    position: absolute;
    inset: -2% -6% 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 48%, rgba(67, 128, 255, 0.26), transparent 33%),
        linear-gradient(rgba(91, 169, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 169, 255, 0.1) 1px, transparent 1px);
    background-size: 100% 100%, 64px 64px, 64px 64px;
    opacity: 0.62;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 0 66%, transparent 92%);
    mask-image: radial-gradient(ellipse at center, #000 0 66%, transparent 92%);
}

/* 卡片层 - 铺满舞台，作为绝对定位基准 */
/* SVG linework：取代原先的位图连线（该位图已于 2026-08-20 删除）。 */
.energy-linework {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    opacity: 0.86;
}

.energy-linework path {
    fill: none;
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.energy-wave-lines path {
    stroke: #57cfff;
    stroke-width: 1.4;
    opacity: 0.22;
    filter: drop-shadow(0 0 8px rgba(87, 207, 255, 0.28));
}

.energy-links-base path {
    stroke: url(#energy-link-gradient);
    stroke-width: 1.8;
    opacity: 0.5;
    filter: drop-shadow(0 0 9px rgba(99, 215, 255, 0.42));
}

.energy-links-base path:nth-child(4),
.energy-links-base path:nth-child(5),
.energy-links-base path:nth-child(9),
.energy-links-base path:nth-child(10) {
    opacity: 0.36;
}

.energy-links-flow path {
    stroke: #d8f8ff;
    stroke-width: 2.4;
    stroke-dasharray: 32 238;
    opacity: 0.44;
    animation: energyLineFlow 8.4s linear infinite;
    filter: drop-shadow(0 0 11px rgba(109, 221, 255, 0.66));
}

.energy-links-flow path:nth-child(2),
.energy-links-flow path:nth-child(5) {
    animation-delay: -2.7s;
}

.energy-links-flow path:nth-child(3),
.energy-links-flow path:nth-child(6) {
    animation-delay: -5.5s;
}

.energy-line-nodes circle {
    fill: #b7f0ff;
    opacity: 0.58;
    filter: drop-shadow(0 0 8px rgba(109, 221, 255, 0.7));
}

@keyframes energyLineFlow {
    to {
        stroke-dashoffset: -270;
    }
}

/* Card layer. */
.energy-cards {
    position: absolute;
    inset: 0;
    z-index: 3;
}

/* 中心 AI 面试官 */
.center-video {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(9px, 0.938vw, 18px);
    z-index: 5;
}
.video-frame {
    width: 100%;
    aspect-ratio: 16 / 10.5;
    border-radius: 18px;
    overflow: hidden;
    border: 3px solid rgba(120, 170, 255, 0.9);
    box-shadow:
        0 0 50px rgba(74, 125, 255, 0.75),
        0 0 110px rgba(74, 125, 255, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.55);
    background: #000;
}
.main-gif { width: 100%; height: 100%; object-fit: cover; display: block; }
.center-video-label {
    font-size: clamp(13px, 1vw, 17px);
    color: #ffffff;
    font-weight: 400;
    font-family: 'Source Han Sans CN', 'Noto Sans SC', sans-serif;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* 候选人卡片 - 绝对定位错落分布 */
.candidate-card {
    position: absolute;
    width: 132px;
    aspect-ratio: 720 / 1178;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    z-index: 4;
    background: url('../img/matching/8.webp') center / 100% 100% no-repeat;
    filter: drop-shadow(0 0 10px rgba(74, 125, 255, 0.45));
    animation: cardPulse 8.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
    animation-delay: calc(-1 * var(--d, 0s));
    transition:
        left 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        top 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.3s ease;
    will-change: transform, opacity;
}
.candidate-card:hover {
    filter: drop-shadow(0 0 22px rgba(120, 180, 255, 0.95));
}

.energy-cards .candidate-card {
    transition:
        left 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        top 0.9s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.3s ease;
}

.candidate-card.is-position-swapping {
    z-index: 7;
    filter: drop-shadow(0 0 22px rgba(121, 224, 255, 0.9));
}

@keyframes cardPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.35);
    }
    24% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.78);
    }
    58% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    82% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.04);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.1);
    }
}
.candidate-card:hover { z-index: 20; }

/* 视频放进上部圆角框；裁掉视频自带白边 */
.card-frame {
    position: absolute;
    top: 4.8%;
    left: 7%;
    right: 7%;
    height: 75.5%;
    overflow: hidden;
    border-radius: 14px;
}
.card-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 视频已在源文件裁掉白边（cropped/），仅需轻微放大消除 1-4px 残边 */
    transform: scale(1.02);
    z-index: 1;
}

/* 岗位文字放进下部蓝色横幅内 */
.card-label {
    position: absolute;
    bottom: 3%;
    left: 12%;
    right: 12%;
    height: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 9px;
    line-height: 1.1;
    color: #ffffff;
    font-family: 'Source Han Sans CN', 'Microsoft YaHei', sans-serif;
    letter-spacing: 0;
    white-space: nowrap;
    text-shadow: 0 0 6px rgba(30, 90, 200, 0.8);
}

/* ===== 卡片坐标：左侧 9 张、右侧 8 张 ===== */
.candidate-card:nth-of-type(1) { --x: 6%;  --y: 18%; --d: 0s; }
.candidate-card:nth-of-type(2) { --x: 6%;  --y: 48%; --d: 1.8s; }
.candidate-card:nth-of-type(3) { --x: 6%;  --y: 78%; --d: 3.6s; }
.candidate-card:nth-of-type(4) { --x: 18%; --y: 24%; --d: .45s; }
.candidate-card:nth-of-type(5) { --x: 18%; --y: 50%; --d: 2.25s; }
.candidate-card:nth-of-type(6) { --x: 18%; --y: 76%; --d: 4.05s; }
.candidate-card:nth-of-type(7) { --x: 30%; --y: 20%; --d: .9s; }
.candidate-card:nth-of-type(8) { --x: 30%; --y: 50%; --d: 2.7s; }
.candidate-card:nth-of-type(9) { --x: 30%; --y: 78%; --d: 4.5s; }
/* ===== 右侧 8 张 ===== */
.candidate-card:nth-of-type(10) { --x: 70%; --y: 20%; --d: .9s; }
.candidate-card:nth-of-type(11) { --x: 70%; --y: 48%; --d: 2.7s; }
.candidate-card:nth-of-type(12) { --x: 70%; --y: 76%; --d: 4.5s; }
.candidate-card:nth-of-type(13) { --x: 82%; --y: 31%; --d: .45s; }
.candidate-card:nth-of-type(14) { --x: 82%; --y: 61%; --d: 2.25s; }
.candidate-card:nth-of-type(15) { --x: 94%; --y: 18%; --d: 0s; }
.candidate-card:nth-of-type(16) { --x: 94%; --y: 48%; --d: 1.8s; }
.candidate-card:nth-of-type(17) { --x: 94%; --y: 78%; --d: 3.6s; }

/* Long labels need a little more room inside the narrow banner. */
.candidate-card:nth-of-type(8),
.candidate-card:nth-of-type(11) {
    width: 106px;
}

.candidate-card:nth-of-type(8) .card-label,
.candidate-card:nth-of-type(11) .card-label {
    font-size: 8px;
}

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
    .energy-layout { height: auto; display: flex; flex-wrap: wrap;
        justify-content: center; gap: 24px; background: none; }
    .energy-layout::before { display: none; }
    .energy-linework { display: none; }
    .energy-cards { position: static; display: contents; }
    .center-video { position: relative; left: auto; top: auto;
        transform: none; width: 100%; max-width: 560px; order: -1; }
    .candidate-card { position: relative; left: auto; top: auto;
        transform: none; width: 140px; animation: none; }
    .candidate-card:nth-of-type(8),
    .candidate-card:nth-of-type(11) { width: 112px; }
    .candidate-card:hover { transform: scale(1.06); }
}
@media (max-width: 480px) {
    .candidate-card { width: 44%; }
    .candidate-card:nth-of-type(8),
    .candidate-card:nth-of-type(11) { width: 36%; }
}

@media (prefers-reduced-motion: reduce) and (min-width: 1101px) {
    .energy-links-flow path {
        animation: none;
        stroke-dashoffset: 0;
    }

    .candidate-card {
        animation: none;
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}
