/* ------------------------------------------------------------------
 * YOOAN · About → 06 QUICK ANSWERS
 * 滚动驱动的 FAQ 折叠板（sticky pin + 逐条自动展开 + 答案气泡卡片）
 * 纯 CSS + 原生 JS，无 GSAP 依赖。配套脚本：assets/js/about-faq-scroll.js
 * ------------------------------------------------------------------ */

.ya-faq--scroll {
    --ya-faq-steps: 6;
    --ya-faq-step: clamp(210px, 28vh, 320px);
    padding-bottom: 0;
}

/* 滚动轨道：它的高度决定了“钉住”期间可以消耗多少滚动距离 */
.ya-faq__track {
    position: relative;
    height: auto;
}

.ya-faq--scroll.is-pinned .ya-faq__track {
    height: calc(100vh + var(--ya-faq-steps) * var(--ya-faq-step));
}

.ya-faq__stage {
    position: static;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ya-faq--scroll.is-pinned .ya-faq__stage {
    position: sticky;
    top: 0;
    min-height: 100vh;
    padding: clamp(48px, 6vh, 92px) 0;
}

/* 钉屏时压缩垂直节奏，保证整块内容在一屏内放得下 */
.ya-faq--scroll.is-pinned .ya-section__rule {
    margin-bottom: clamp(26px, 3.2vw, 52px);
}

@media (max-height: 880px) {
    .ya-faq--scroll.is-pinned .ya-faq__q {
        padding: 17px 0;
        font-size: clamp(17px, 1.6vw, 23px);
    }

    .ya-faq--scroll.is-pinned .ya-about .ya-faq__bubble,
    .ya-about .ya-faq--scroll.is-pinned .ya-faq__bubble {
        margin-bottom: 18px;
        padding: 17px 22px 19px;
        font-size: 14.5px;
    }
}

/* 左栏：标题 + 进度指示 ------------------------------------------- */

.ya-faq__progress {
    display: none;
    align-items: center;
    gap: 16px;
    margin-top: clamp(30px, 4vw, 48px);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .14em;
    color: var(--ya-muted);
}

.ya-faq--scroll.is-pinned .ya-faq__progress {
    display: flex;
}

.ya-faq__count em {
    font-style: normal;
    color: var(--ya-orange);
}

.ya-faq__bar {
    position: relative;
    flex: 1;
    max-width: 190px;
    height: 2px;
    background: var(--ya-line);
}

.ya-faq__bar i {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--ya-faq-progress, 16.6%);
    background: var(--ya-orange);
    transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

/* 右栏：问题条目 --------------------------------------------------- */

.ya-faq__item {
    border-bottom: 1px solid var(--ya-line);
}

.ya-faq__q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    width: 100%;
    padding: 23px 0;
    border: 0;
    background: none;
    text-align: left;
    color: #566080;
    font-family: YASchibsted, sans-serif;
    font-size: clamp(19px, 2vw, 28px);
    font-weight: 500;
    line-height: 1.16;
    letter-spacing: -.025em;
    cursor: pointer;
    transition: color .4s ease, transform .5s cubic-bezier(.22, 1, .36, 1);
}

.ya-faq__q:hover {
    color: var(--ya-ink);
}

.ya-faq__item.is-open .ya-faq__q {
    color: var(--ya-ink);
    transform: translateX(6px);
}

/* + / − 图标 */
.ya-faq__icon {
    position: relative;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
}

.ya-faq__icon::before,
.ya-faq__icon::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 1.5px;
    background: var(--ya-orange);
    transform: translateY(-50%);
    transition: transform .5s cubic-bezier(.22, 1, .36, 1);
}

.ya-faq__icon::after {
    transform: translateY(-50%) rotate(90deg);
}

.ya-faq__item.is-open .ya-faq__icon::after {
    transform: translateY(-50%) rotate(0deg);
}

/* 答案面板：默认全部展开（无 JS 时内容仍可读、可被抓取） */
.ya-faq__panel {
    display: grid;
    grid-template-rows: 1fr;
}

.ya-faq__panelInner {
    min-height: 0;
    overflow: hidden;
}

.ya-faq__list.is-ready .ya-faq__panel {
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows .55s cubic-bezier(.22, 1, .36, 1),
                opacity .3s ease,
                visibility .55s;
}

.ya-faq__list.is-ready .ya-faq__item.is-open .ya-faq__panel {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transition: grid-template-rows .55s cubic-bezier(.22, 1, .36, 1),
                opacity .4s ease .1s,
                visibility 0s;
}

/* 答案气泡卡片 */
.ya-about .ya-faq__bubble {
    max-width: 620px;
    margin: 4px 0 26px auto;
    padding: 21px 26px 23px;
    border-radius: 22px 22px 6px 22px;
    background: var(--ya-ink);
    color: var(--ya-cream);
    font-size: 15px;
    line-height: 1.62;
}

.ya-about .ya-faq__list.is-ready .ya-faq__bubble {
    transform: translateY(12px);
    transition: transform .55s cubic-bezier(.22, 1, .36, 1);
}

.ya-about .ya-faq__list.is-ready .ya-faq__item.is-open .ya-faq__bubble {
    transform: none;
}

/* 移动端 / 降级：不钉屏，回到普通点击折叠 ------------------------- */

@media (max-width: 980px) {
    .ya-faq--scroll {
        padding-bottom: var(--ya-space);
    }

    .ya-faq--scroll.is-pinned .ya-faq__track {
        height: auto;
    }

    .ya-faq--scroll.is-pinned .ya-faq__stage {
        position: static;
        min-height: 0;
        padding: 0;
    }

    .ya-faq--scroll.is-pinned .ya-faq__progress {
        display: none;
    }

    .ya-faq__item.is-open .ya-faq__q {
        transform: none;
    }

    .ya-about .ya-faq__bubble {
        max-width: none;
        margin-left: 0;
        border-radius: 20px 20px 20px 6px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ya-faq__list.is-ready .ya-faq__panel,
    .ya-faq__list.is-ready .ya-faq__bubble,
    .ya-faq__q,
    .ya-faq__icon::before,
    .ya-faq__icon::after,
    .ya-faq__bar i {
        transition-duration: .01ms;
    }
}
