/* ============================================================
   faq.css —— FAQ 页面专属样式
   依赖加载顺序：fonts.css → framework.css → common.css → 本文件
   ------------------------------------------------------------
   注意：顶部导航为公共组件，其结构/样式/交互脚本统一维护在
   css/common.css 与 js/common.js 中，请勿在页面级 CSS 重复定义。
   ============================================================ */

/* ============================================================
   1. 第一屏：Hero 横幅（对齐设计稿 1920×600）
   ------------------------------------------------------------
   - 背景 faq.webp + 左向深蓝渐变遮罩（90deg, rgba(0,48,86,.8)→0）
   - 内容左缘 160px 与导航 logo 对齐；徽标 / 标题 / 描述自下排布
   - 入场：徽标 → 标题 → 描述自下错峰淡入上移
   ============================================================ */
.first {
    position: relative;
    height: 6rem;
    overflow: hidden;
    background: url("../assets/images/faq/faq.webp") center / cover no-repeat;
}

.first__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    height: 100%;
    padding: 0 1.6rem 0.87rem;
}

/* ---------- 入场动画 ---------- */
@keyframes first-hero-in {
    from {
        opacity: 0;
        transform: translateY(0.3rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.first__badge,
.first__title,
.first__desc {
    opacity: 0;
    animation: first-hero-in 0.7s var(--ease-out) forwards;
}

.first__badge {
    animation-delay: 0.1s;
}

.first__title {
    animation-delay: 0.25s;
}

.first__desc {
    animation-delay: 0.4s;
}

/* ---------- 徽标胶囊 ---------- */
.first__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0.81rem;
    height: 0.34rem;
    border: 0.01rem solid rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    color: #fff;
    font-size: 0.16rem;
    font-weight: 500;
}

/* ---------- 标题 / 描述 ---------- */
.first__title {
    max-width: 10.14rem;
    margin-top: 0.2rem;
    color: #fff;
    font-size: 0.48rem;
    font-weight: 600;
    line-height: 1.2;
}

.first__desc {
    max-width: 9.36rem;
    margin-top: 0.23rem;
    color: #fff;
    font-size: 0.16rem;
    font-weight: 500;
    line-height: 1.5;
}

html[data-mode="h5"] .first {
    height: auto;
    min-height: 3.6rem;
}

html[data-mode="h5"] .first__inner {
    max-width: none;
    padding: 1.1rem 0.4rem 0.6rem;
    height: 5rem;
}

html[data-mode="h5"] .first__badge {
    min-width: max-content;
    padding: 0 0.2rem;
    height: 0.48rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .first__title {
    max-width: 100%;
    margin-top: 0.24rem;
    font-size: 0.44rem;
}

html[data-mode="h5"] .first__desc {
    max-width: 100%;
    margin-top: 0.24rem;
    font-size: 0.32rem;
    display: none;
}

/* ============================================================
   2. 第二屏：分类模块（对齐设计稿 519×48 胶囊组）
   ------------------------------------------------------------
   - .second 内边距 68 / 100 / 100，分类模块居右，模块下边距 60
   - 末项 .is-active 为选中态（#0265B2 底 + 白字）
   - 入场：胶囊自右错峰滑入；悬浮：蓝色色块扫入 + 上浮投影
   ============================================================ */
.second {
    padding: 0.68rem 1.6rem 1rem;
}

.second__cats {
    display: flex;
    justify-content: flex-end;
    gap: 0.1rem;
    margin-bottom: 0.6rem;
    list-style: none;
}

/* ============================================================
   2.1 主体问答模块（左文案 + 右手风琴，对齐设计稿 1600×814）
   ------------------------------------------------------------
   - 左栏 465px：标题 40px/600 + 说明 16px/400 #666
   - 右栏 1014px：条目上边框 #D9D9D9，间距 30px，末条带下边框
   - Q 徽标 #0265B2 / A 徽标 #FC0200，展开问句加粗 600
   - 手风琴：grid-template-rows 0fr→1fr 展开动画
   - 入场：左栏与各条目自下错峰淡入
   ============================================================ */
.second__body {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
}

/* ---------- 左：标题与说明 ---------- */
.second__intro {
    flex: 0 0 4.65rem;
    margin-top: 0.34rem;
}

.second__heading {
    color: #333;
    font-size: 0.4rem;
    font-weight: 600;
    line-height: 1.25;
}

.second__sub {
    max-width: 4.65rem;
    margin-top: 0.4rem;
    color: #666;
    font-size: 0.16rem;
    font-weight: 400;
    line-height: 1.5;
}

/* ---------- 右：手风琴 ---------- */
.second__faq {
    flex: 0 1 10.14rem;
    min-width: 0;
}

.second__faq-item {
    border-top: 0.01rem solid #d9d9d9;
    padding: 0.3rem 0 0.29rem;
}

.second__faq-item:last-child {
    margin-bottom: 0;
    border-bottom: 0.01rem solid #d9d9d9;
}

/* 问句行 */
.second__faq-q {
    display: flex;
    align-items: flex-start;
    width: 100%;
    gap: 0.35rem;
    text-align: left;
    cursor: pointer;
}

.second__faq-badge {
    flex: 0 0 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.3rem;
    height: 0.3rem;
    color: #fff;
    font-size: 0.2rem;
    font-weight: 500;
    line-height: 1;
}

.second__faq-badge--q {
    background: #0265B2;
}

.second__faq-badge--a {
    background: #FC0200;
}

.second__faq-q-text {
    flex: 1;
    color: #333;
    font-size: 0.2rem;
    font-weight: 500;
    line-height: 1.25;
    transition: color 0.3s ease;
}

.second__faq-q:hover .second__faq-q-text {
    color: #0265B2;
}

/* 展开态：问句加粗 + 箭头转向（右 → 下）变蓝 */
.second__faq-item.is-open .second__faq-q-text {
    font-weight: 600;
}

.second__faq-arrow {
    flex: 0 0 0.24rem;
    width: 0.24rem;
    height: 0.24rem;
    margin-top: 0.03rem;
    fill: none;
    stroke: #666;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.35s var(--ease-out), stroke 0.3s ease;
}

.second__faq-item.is-open .second__faq-arrow {
    transform: rotate(90deg);
    stroke: #0265B2;
}

/* 答案区：0fr → 1fr 展开动画 */
.second__faq-a {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s var(--ease-out);
}

.second__faq-item.is-open .second__faq-a {
    grid-template-rows: 1fr;
}

.second__faq-a-inner {
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.second__faq-item.is-open .second__faq-a-inner {
    padding-top: 0.28rem;
}

.second__faq-a-text {
    flex: 1;
    max-width: 8.49rem;
    color: #666;
    font-size: 0.16rem;
    font-weight: 500;
    line-height: 1.5;
}

/* ---------- 入场动画 ---------- */
@keyframes faq-block-in {
    from {
        opacity: 0;
        transform: translateY(0.3rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.second__intro,
.second__faq-item {
    opacity: 0;
    animation: faq-block-in 0.6s var(--ease-out) forwards;
}

.second__intro {
    animation-delay: 0.1s;
}

.second__faq-item:nth-child(1) {
    animation-delay: 0.2s;
}

.second__faq-item:nth-child(2) {
    animation-delay: 0.3s;
}

.second__faq-item:nth-child(3) {
    animation-delay: 0.4s;
}

.second__faq-item:nth-child(4) {
    animation-delay: 0.5s;
}

.second__faq-item:nth-child(5) {
    animation-delay: 0.6s;
}

.second__faq-item:nth-child(6) {
    animation-delay: 0.7s;
}

/* ---------- 入场动画（加在 li 上，避免与 a 的 hover 位移冲突） ---------- */
@keyframes second-cat-in {
    from {
        opacity: 0;
        transform: translateX(0.5rem);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.second__cat-item {
    opacity: 0;
    display: flex;
    animation: second-cat-in 0.6s var(--ease-out) forwards;
}

.second__cat-item:nth-child(1) {
    animation-delay: 0.05s;
}

.second__cat-item:nth-child(2) {
    animation-delay: 0.15s;
}

.second__cat-item:nth-child(3) {
    animation-delay: 0.25s;
}

.second__cat-item:nth-child(4) {
    animation-delay: 0.35s;
}

/* ---------- 胶囊 ---------- */
.second__cat {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 0.48rem;
    padding: 0 0.4rem;
    overflow: hidden;
    background: #f6f6f6;
    border-radius: 0.1rem;
    color: #333;
    font-size: 0.16rem;
    font-weight: 500;
    white-space: nowrap;
    /* 建立层叠上下文，保证 ::before 色块垫在文字之下 */
    isolation: isolate;
    transition: color 0.35s ease, transform 0.35s var(--ease-out), box-shadow 0.35s ease;
}

/* 悬浮：蓝色色块自左扫入 */
.second__cat::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: #0265B2;
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.4s var(--ease-out);
}

.second__cat:hover {
    color: #fff;
    transform: translateY(-0.04rem);
    box-shadow: 0 0.08rem 0.2rem rgba(2, 101, 178, 0.35);
}

.second__cat:hover::before {
    transform: scaleX(1);
}

/* ---------- 选中态（设计稿末项 Faq） ---------- */
.second__cat.is-active {
    background: #0265B2;
    color: #fff;
}

/* 选中项不再播放扫入色块，仅保留轻微上浮 */
.second__cat.is-active::before {
    display: none;
}

.second__cat.is-active:hover {
    color: #fff;
    transform: translateY(-0.04rem);
    box-shadow: 0 0.1rem 0.24rem rgba(2, 101, 178, 0.45);
}

/* ============================================================
   4. H5 适配（750 设计稿基准）
   ============================================================ */
html[data-mode="h5"] .first {
    height: auto;
    min-height: 3.6rem;
}

html[data-mode="h5"] .first__inner {
    max-width: none;
    padding: 0.8rem 0.4rem 0.6rem;
}

html[data-mode="h5"] .first__badge {
    min-width: 1.2rem;
    height: 0.48rem;
    font-size: 0.24rem;
}

html[data-mode="h5"] .first__title {
    max-width: 100%;
    margin-top: 0.24rem;
    font-size: 0.44rem;
}

html[data-mode="h5"] .first__desc {
    max-width: 100%;
    margin-top: 0.24rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second {
    padding: 0.3rem 0.4rem 0.5rem;
}

html[data-mode="h5"] .second__cats {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.16rem;
    margin-bottom: 0.4rem;
}

/* ---------- 问答模块 H5：上下堆叠 ---------- */
html[data-mode="h5"] .second__body {
    flex-direction: column;
    gap: 0;
}

html[data-mode="h5"] .second__intro {
    flex: none;
    margin-top: 0;
}

html[data-mode="h5"] .second__heading {
    font-size: 0.44rem;
}

html[data-mode="h5"] .second__sub {
    max-width: 100%;
    margin-top: 0.2rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__faq {
    flex: none;
    width: 100%;
    margin-top: 0.5rem;
}

html[data-mode="h5"] .second__faq-item {
    padding: 0.24rem 0;
}

html[data-mode="h5"] .second__faq-q {
    gap: 0.24rem;
}

html[data-mode="h5"] .second__faq-badge {
    flex-basis: 0.4rem;
    width: 0.4rem;
    height: 0.4rem;
    font-size: 0.24rem;
}

html[data-mode="h5"] .second__faq-q-text {
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__faq-arrow {
    flex-basis: 0.32rem;
    width: 0.32rem;
    height: 0.32rem;
    margin-top: 0.04rem;
}

html[data-mode="h5"] .second__faq-a-inner {
    gap: 0.24rem;
}

html[data-mode="h5"] .second__faq-a-text {
    max-width: none;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__cat {
    height: 0.64rem;
    padding: 0 0.36rem;
    border-radius: 0.12rem;
    font-size: 0.32rem;
}

html[data-mode="h5"] .second__cat-item {
    animation-duration: 0.5s;
}

html[data-mode="h5"] .second__cat-item:nth-child(1) {
    animation-delay: 0.04s;
}

html[data-mode="h5"] .second__cat-item:nth-child(2) {
    animation-delay: 0.12s;
}

html[data-mode="h5"] .second__cat-item:nth-child(3) {
    animation-delay: 0.2s;
}

html[data-mode="h5"] .second__cat-item:nth-child(4) {
    animation-delay: 0.28s;
}

