/* =========================================================
   Ark Global Interactions
   全站通用动态交互系统
========================================================= */

/* 页面滚动进度条 */
#ark-global-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #2f6b3f, #9fd8aa);
    box-shadow: 0 0 18px rgba(47, 107, 63, 0.35);
    transition: width 0.12s linear;
}

body.admin-bar #ark-global-scroll-progress {
    top: 32px;
}

/* 顶部导航滚动玻璃感 */
.site-header {
    transition:
        padding 0.24s ease,
        box-shadow 0.24s ease,
        background 0.24s ease,
        border-color 0.24s ease,
        backdrop-filter 0.24s ease;
}

.site-header.ark-header-scrolled {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(18px);
    border-bottom-color: rgba(229, 231, 235, 0.72);
    box-shadow: 0 14px 38px rgba(17, 24, 39, 0.08);
}

/* 滚动出现动画 */
.ark-reveal {
    opacity: 0;
    transform: translateY(38px);
    filter: blur(8px);
    transition:
        opacity 0.78s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.78s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.78s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--ark-delay, 0ms);
}

.ark-reveal.ark-in-view {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* 通用卡片交互 */
.ark-card {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease,
        border-color 0.28s ease,
        background 0.28s ease;
}

.ark-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at var(--ark-x, 50%) var(--ark-y, 50%),
            rgba(47, 107, 63, 0.12),
            transparent 38%
        );
    opacity: 0;
    transition: opacity 0.24s ease;
    pointer-events: none;
}

.ark-card:hover::before {
    opacity: 1;
}

.ark-card > * {
    position: relative;
    z-index: 2;
}

.ark-card.ark-tilt {
    transform:
        perspective(900px)
        rotateX(var(--ark-rx, 0deg))
        rotateY(var(--ark-ry, 0deg))
        translateY(var(--ark-lift, 0));
}

.ark-card.ark-tilt:hover {
    --ark-lift: -8px;
}

/* 通用按钮 */
.ark-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.ark-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.24), transparent);
    transform: translateX(-120%);
    transition: transform 0.55s ease;
    z-index: -1;
}

.ark-btn:hover::before {
    transform: translateX(120%);
}

.ark-btn-ripple {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    transform: translate(-50%, -50%) scale(0);
    animation: arkRipple 0.72s ease-out forwards;
    pointer-events: none;
}

@keyframes arkRipple {
    to {
        transform: translate(-50%, -50%) scale(18);
        opacity: 0;
    }
}

/* 图片轻微漂浮 */
.ark-image-float {
    animation: arkImageFloat 6.5s ease-in-out infinite;
}

@keyframes arkImageFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* 标签微光 */
.ark-shine-label {
    position: relative;
    overflow: hidden;
}

.ark-shine-label::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
    transform: skewX(-24deg);
    animation: arkLabelShine 4.8s ease-in-out infinite;
}

@keyframes arkLabelShine {
    0%, 68% {
        left: -60%;
    }

    100% {
        left: 130%;
    }
}

/* 板块光晕背景 */
.ark-section-glow {
    position: relative;
    overflow: hidden;
}

.ark-section-glow::before {
    content: "";
    position: absolute;
    right: -180px;
    top: -220px;
    width: 480px;
    height: 480px;
    border-radius: 999px;
    background: rgba(47, 107, 63, 0.08);
    pointer-events: none;
}

.ark-section-glow::after {
    content: "";
    position: absolute;
    left: -220px;
    bottom: -260px;
    width: 540px;
    height: 540px;
    border-radius: 999px;
    background: rgba(47, 107, 63, 0.06);
    pointer-events: none;
}

.ark-section-glow > * {
    position: relative;
    z-index: 2;
}

/* FAQ 手风琴 */
.ark-faq-accordion .ark-faq-item {
    cursor: pointer;
}

.ark-faq-accordion .ark-faq-item h3,
.ark-faq-accordion .ark-faq-item .ark-faq-question {
    position: relative;
    padding-right: 42px;
}

.ark-faq-accordion .ark-faq-item h3::after,
.ark-faq-accordion .ark-faq-item .ark-faq-question::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e7f3e8;
    color: #2f6b3f;
    font-size: 20px;
    line-height: 1;
    transition:
        transform 0.24s ease,
        background 0.24s ease,
        color 0.24s ease;
}

.ark-faq-accordion .ark-faq-item p,
.ark-faq-accordion .ark-faq-item .ark-faq-answer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transition:
        max-height 0.34s ease,
        opacity 0.24s ease,
        margin-top 0.24s ease;
}

.ark-faq-accordion .ark-faq-item.ark-faq-open {
    border-color: #c8ddce;
    box-shadow: 0 24px 58px rgba(47, 107, 63, 0.09);
}

.ark-faq-accordion .ark-faq-item.ark-faq-open h3::after,
.ark-faq-accordion .ark-faq-item.ark-faq-open .ark-faq-question::after {
    content: "−";
    background: #2f6b3f;
    color: #ffffff;
    transform: rotate(180deg);
}

.ark-faq-accordion .ark-faq-item.ark-faq-open p,
.ark-faq-accordion .ark-faq-item.ark-faq-open .ark-faq-answer {
    max-height: 320px;
    opacity: 1;
    margin-top: 12px;
}

/* 链接箭头 */
.ark-arrow-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ark-arrow-link::after {
    content: "→";
    transition: transform 0.2s ease;
}

.ark-arrow-link:hover::after {
    transform: translateX(5px);
}

/* 数字渐变 */
.ark-gradient-number {
    background: linear-gradient(135deg, #2f6b3f, #5a9d68);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 首屏视觉浮层 */
.ark-hero-media-wrap {
    position: relative;
}

.ark-hero-media-wrap::before {
    content: "";
    position: absolute;
    inset: -22px;
    border-radius: 42px;
    background: linear-gradient(135deg, rgba(47, 107, 63, 0.16), rgba(255, 255, 255, 0));
    opacity: 0.75;
    filter: blur(4px);
    z-index: -1;
}

.ark-hero-media-wrap::after {
    content: "";
    position: absolute;
    right: -18px;
    bottom: -18px;
    width: 130px;
    height: 130px;
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 24px 54px rgba(17, 24, 39, 0.12);
    backdrop-filter: blur(16px);
    z-index: 3;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .ark-reveal,
    .ark-image-float,
    .ark-shine-label::after {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

@media (max-width: 900px) {
    body.admin-bar #ark-global-scroll-progress {
        top: 46px;
    }

    .ark-hero-media-wrap::after {
        width: 96px;
        height: 96px;
        right: -10px;
        bottom: -10px;
        border-radius: 26px;
    }
}