/* ==========================================================================
   FAQ section · GEO-ready  ·  2026-10-26  (r46)
   --------------------------------------------------------------------------
   设计要点：
   1. 默认展开（<details open>）—— GEO 要求答案初始可见可抓取
   2. 可折叠 —— 用户能收起，页面不会无限长
   3. 自带左右留白 —— FAQ 直接挂在 <main> 下，各页 main 的 class 不同
      （r9-page / r22 / r8-home / ml / ab），留白必须由本组件自己提供
   4. 排版参照站内既有编辑式风格（衬线标题 + 克制分隔线）

   类名统一 faq-* 前缀，避免与 r8-/r12-/r22-/ml-/od- 冲突。
   ========================================================================== */

.faq-section {
    --faq-gutter: clamp(20px, 5vw, 72px);
    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 68px var(--faq-gutter) 56px;
}

/* 标题区：标题左、切换按钮右 */
.faq-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.faq-eyebrow {
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .5;
    margin: 0 0 10px;
}

.faq-section .faq-head h2 {
    font-family: JingsDisplay, Georgia, serif;
    font-size: clamp(26px, 2.6vw, 36px);
    line-height: 1.14;
    letter-spacing: -.02em;
    font-weight: 400;
    margin: 0;
}

/* 分组 */
.faq-group { margin-top: 24px; }
.faq-group:first-of-type { margin-top: 16px; }

.faq-group-title {
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .45;
    font-weight: 500;
    margin: 0 0 4px;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(0, 0, 0, .16);
}

/* 单条问答 */
.faq-item {
    border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.faq-q {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 0;
    cursor: pointer;
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.42;
    letter-spacing: -.005em;
    list-style: none;
    transition: opacity .2s ease;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::marker { content: ""; }

.faq-q:hover { opacity: .72; }

/* 展开/收起指示（＋ / －） */
.faq-q i {
    flex: 0 0 auto;
    position: relative;
    width: 13px;
    height: 13px;
    margin-top: 4px;
    opacity: .5;
}
.faq-q i::before,
.faq-q i::after {
    content: "";
    position: absolute;
    background: currentColor;
    left: 50%;
    top: 50%;
}
.faq-q i::before {
    width: 13px; height: 1px;
    transform: translate(-50%, -50%);
}
.faq-q i::after {
    width: 1px; height: 13px;
    transform: translate(-50%, -50%);
    transition: opacity .25s ease;
}
details[open] > .faq-q i::after { opacity: 0; }

/* 答案 */
.faq-a {
    padding: 0 0 19px;
    max-width: 74ch;
}
.faq-a p {
    margin: 0;
    font-size: 14px;
    line-height: 1.72;
    opacity: .8;
}

/* 深色底适配（首页/quality 等深色段落） */
.faq-section[data-tone="dark"] .faq-group-title,
.faq-section[data-tone="dark"] .faq-item {
    border-color: rgba(255, 255, 255, .16);
}

/* 响应式 */
@media (max-width: 760px) {
    .faq-section {
        --faq-gutter: 20px;
        padding-top: 46px;
        padding-bottom: 38px;
    }
    .faq-q { font-size: 14.5px; padding: 15px 0; gap: 14px; }
    .faq-a p { font-size: 13.5px; line-height: 1.68; }
    .faq-a { padding-bottom: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    .faq-q, .faq-q i::after { transition: none !important; }
}

/* ==========================================================================
   全部展开 / 全部收起 按钮（2026-10-26 r49）
   --------------------------------------------------------------------------
   一个按钮控制整段 FAQ：有展开的 -> 点一下全收起；全收起 -> 点一下全展开。
   视觉参照站内既有的文字链按钮（下划线 + 箭头），不抢标题。
   ========================================================================== */

.faq-toggle {
    flex: 0 0 auto;
    font: inherit;
    font-size: 12.5px;
    line-height: 1;
    letter-spacing: .02em;
    color: inherit;
    background: none;
    border: 0;
    border-bottom: 1px solid currentColor;
    padding: 0 0 4px;
    margin-bottom: 6px;
    cursor: pointer;
    opacity: .7;
    white-space: nowrap;
    transition: opacity .2s ease;
}
.faq-toggle:hover { opacity: 1; }

/* 收起时按钮下方加一点视觉提示：所有条目都收起了 */
.faq-section[data-faq-state="closed"] .faq-item {
    border-bottom-color: rgba(0, 0, 0, .13);
}

/* 答案出现时的轻微淡入 */
@keyframes faq-reveal {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
details.faq-item[open] > .faq-a {
    animation: faq-reveal .28s cubic-bezier(.2,.7,.2,1);
}

/* 收起态问题行与展开态的下边距区分 */
details.faq-item:not([open]) > .faq-q { padding-bottom: 17px; }
details.faq-item[open] > .faq-q { padding-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
    .faq-toggle { transition: none !important; }
    details.faq-item[open] > .faq-a { animation: none !important; }
}

@media (max-width: 760px) {
    .faq-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .faq-toggle { margin-bottom: 0; font-size: 12px; }
}

/* ==========================================================================
   FAQ 视觉提升（2026-10-26 r52）
   --------------------------------------------------------------------------
   用户反馈「样式设计的美观一些」。当前问题：
     1. 标题与按钮在同一行但高度不齐，标题显得孤立
     2. 每条问题行之间只有细线，缺少层次
     3. 答案段落与问题贴得太近，读起来挤
     4. 整块没有边界感，浮在页面上

   改动：
     · 标题区加一条细横线 + 更大留白，形成明确分区
     · 问题行改为「编号 + 问题 + 加减」，有档案感
     · 答案区加浅底衬，与问题区分开
     · 收起/展开用更大的点击区，行高更舒展
   ========================================================================== */

/* 标题区：底部分隔线，让 FAQ 成为独立板块 */
.faq-head {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0, 0, 0, .18);
    margin-bottom: 8px;
}

.faq-eyebrow {
    font-size: 9.5px;
    letter-spacing: .16em;
    opacity: .45;
    margin-bottom: 8px;
}

.faq-section .faq-head h2 {
    font-size: clamp(28px, 2.8vw, 38px);
}

/* 切换按钮：更像按钮，不像文字链 */
.faq-toggle {
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 8px 14px;
    border: 1px solid rgba(0, 0, 0, .22);
    border-radius: 999px;
    opacity: .8;
    margin-bottom: 4px;
}
.faq-toggle:hover {
    opacity: 1;
    border-color: rgba(0, 0, 0, .45);
    background: rgba(0, 0, 0, .03);
}

/* 分组标题：更小、更克制，作为索引 */
.faq-group { margin-top: 30px; }
.faq-group:first-of-type { margin-top: 20px; }

.faq-group-title {
    font-size: 10px;
    letter-spacing: .14em;
    opacity: .42;
    font-weight: 500;
    margin: 0 0 2px;
    padding-bottom: 0;
    border-bottom: 0;
}

/* 单条：用计数器给编号，形成档案感 */
.faq-item {
    counter-increment: faqitem;
    border-bottom: 1px solid rgba(0, 0, 0, .09);
    position: relative;
}
/* 计数器在 section 上重置，分组不重置 -> 整段连续编号 */
.faq-section { counter-reset: faqitem; }
.faq-group { counter-reset: none; }

.faq-q {
    gap: 16px;
    padding: 20px 0;
    font-size: 15px;
    line-height: 1.5;
}

/* 问题前的编号 */
.faq-q > span:first-child::before {
    content: counter(faqitem, decimal-leading-zero);
    font-size: 10px;
    letter-spacing: .06em;
    font-variant-numeric: tabular-nums;
    opacity: .38;
    margin-right: 14px;
    font-weight: 400;
    vertical-align: 1px;
}

/* 加减号：更清晰的圆形 */
.faq-q i {
    width: 20px;
    height: 20px;
    margin-top: 0;
    border: 1px solid rgba(0, 0, 0, .22);
    border-radius: 999px;
    opacity: .55;
    transition: opacity .2s ease, background .2s ease, border-color .2s ease;
}
.faq-q i::before,
.faq-q i::after { background: currentColor; }
.faq-q i::before { width: 9px; height: 1px; }
.faq-q i::after  { width: 1px; height: 9px; }
.faq-q:hover i {
    opacity: 1;
    border-color: rgba(0, 0, 0, .4);
    background: rgba(0, 0, 0, .04);
}
details[open] > .faq-q i {
    opacity: .9;
    border-color: rgba(0, 0, 0, .45);
    background: rgba(0, 0, 0, .07);
}

/* 答案：加浅底衬 + 左侧细线，与问题区分 */
.faq-a {
    padding: 0 0 22px 38px;
    max-width: 72ch;
}
.faq-a p {
    font-size: 14px;
    line-height: 1.78;
    opacity: .76;
}

/* 深色段落适配 */
.faq-section[data-tone="dark"] .faq-head {
    border-bottom-color: rgba(255, 255, 255, .2);
}
.faq-section[data-tone="dark"] .faq-item {
    border-bottom-color: rgba(255, 255, 255, .1);
}
.faq-section[data-tone="dark"] .faq-toggle {
    border-color: rgba(255, 255, 255, .3);
    color: #eef1e7;
}
.faq-section[data-tone="dark"] .faq-toggle:hover {
    border-color: rgba(255, 255, 255, .6);
    background: rgba(255, 255, 255, .06);
}
.faq-section[data-tone="dark"] .faq-q i {
    border-color: rgba(255, 255, 255, .3);
}
.faq-section[data-tone="dark"] .faq-q:hover i {
    border-color: rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .08);
}

/* 响应式 */
@media (max-width: 760px) {
    .faq-head { padding-bottom: 14px; }
    .faq-section .faq-head h2 { font-size: 26px; }
    .faq-q { font-size: 14px; padding: 17px 0; gap: 12px; }
    .faq-q > span:first-child::before {
        font-size: 9px;
        margin-right: 10px;
    }
    .faq-q i { width: 18px; height: 18px; }
    .faq-a { padding-left: 24px; padding-bottom: 18px; }
    .faq-a p { font-size: 13.2px; line-height: 1.72; }
}
