/* ================= FAQ 页面样式 ================= */
:root {
    --faq-navy: #1B2A4A;
    --faq-blue: #6366F1;
    --faq-blue-d: #4F46E5;
    --faq-violet: #8B5CF6;
    --faq-ink: #33405c;
    --faq-muted: #6b7891;
    --faq-line: #e9e9f6;
    --faq-bg: #f7f7fd;
    --faq-radius: 16px;
    --faq-shadow: 0 10px 34px rgba(80, 70, 180, .10);
}

.faq-page {
    padding: 46px 0 70px;
    background: var(--faq-bg);
}

.faq-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 352px;
    gap: 26px;
    align-items: start;
}

/* ---------- 检索卡片 ---------- */
.faq-search-card {
    background: #fff;
    border: 1px solid var(--faq-line);
    border-radius: var(--faq-radius);
    box-shadow: var(--faq-shadow);
    padding: 18px 20px 16px;
    margin-bottom: 18px;
}

.faq-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f7f7fd;
    border: 1px solid var(--faq-line);
    border-radius: 12px;
    padding: 10px 14px;
    transition: border-color .2s, box-shadow .2s;
}
.faq-search-row:focus-within {
    border-color: var(--faq-blue);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.faq-search-row .icon_search {
    color: var(--faq-muted);
    font-size: 17px;
    flex: none;
}
.faq-search-input {
    flex: 1;
    border: 0;
    background: none;
    outline: none;
    font-size: 15px;
    color: var(--faq-navy);
    min-width: 0;
}
.faq-search-input::placeholder { color: #9aa7bd; }
.faq-search-clear {
    border: 0;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: #9aa7bd;
    cursor: pointer;
    padding: 0 2px;
    display: none;
}
.faq-search-clear:hover { color: var(--faq-navy); }
.faq-search-clear.show { display: block; }

/* 分类 chips */
.faq-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.faq-chip {
    border: 1px solid var(--faq-line);
    background: #fff;
    color: var(--faq-ink);
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 30px;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.faq-chip:hover {
    border-color: var(--faq-blue);
    color: var(--faq-blue);
}
.faq-chip.is-active {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .28);
}
.faq-chip-n {
    font-size: 11.5px;
    font-weight: 700;
    opacity: .68;
}

/* 热门标签 */
.faq-tags-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--faq-line);
}
.faq-tags-label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--faq-muted);
    flex: none;
    padding-top: 6px;
}
.faq-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.faq-tag {
    border: 1px solid var(--faq-line);
    background: #f7f7fd;
    color: var(--faq-muted);
    font-size: 12.5px;
    padding: 5px 11px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .18s;
}
.faq-tag:hover {
    background: #edecfe;
    color: var(--faq-blue);
    border-color: #d5d0f2;
}
.faq-tag.is-active {
    background: var(--faq-blue);
    border-color: var(--faq-blue);
    color: #fff;
}

.faq-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 4px 14px;
}
.faq-stat {
    font-size: 13.5px;
    color: var(--faq-muted);
}
.faq-toggle-all {
    flex: none;
    border: 1px solid var(--faq-line);
    background: #fff;
    color: var(--faq-blue);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all .2s;
}
.faq-toggle-all:hover {
    background: var(--faq-blue);
    border-color: var(--faq-blue);
    color: #fff;
}

/* ---------- 分类分组 ---------- */
.faq-group { margin-bottom: 26px; }
.faq-group[hidden] { display: none; }

.faq-group-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 14px;
}
.faq-group-icon {
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(99,102,241,.06));
    color: var(--faq-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.faq-group-head h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--faq-navy);
    letter-spacing: -.01em;
}
.faq-group-head p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--faq-muted);
}

/* ---------- 单条问答 ---------- */
.faq-list { display: flex; flex-direction: column; gap: 10px; }

.faq-item {
    background: #fff;
    border: 1px solid var(--faq-line);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow .22s, border-color .22s;
}
.faq-item[hidden] { display: none; }
.faq-item:hover { border-color: #dcd9f5; box-shadow: 0 6px 20px rgba(80,70,180,.08); }
.faq-item.is-open {
    border-color: var(--faq-blue);
    box-shadow: 0 8px 24px rgba(99,102,241,.12);
}

.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: none;
    border: 0;
    text-align: left;
    padding: 16px 18px;
    cursor: pointer;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--faq-navy);
    line-height: 1.45;
}
.faq-q-text { flex: 1; }
.faq-q-arrow {
    flex: none;
    font-size: 13px;
    color: var(--faq-muted);
    transition: transform .28s ease, color .2s;
}
.faq-item.is-open .faq-q-arrow {
    transform: rotate(180deg);
    color: var(--faq-blue);
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
}
.faq-item.is-open .faq-a { max-height: 3200px; }
.faq-a-inner { overflow: hidden; }
.faq-a-body {
    padding: 0 18px 4px;
    font-size: 14.6px;
    line-height: 1.85;
    color: var(--faq-ink);
    white-space: pre-line;
}
.faq-a-body strong { color: var(--faq-navy); font-weight: 700; }
.faq-a-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 12px 18px 16px;
}
.faq-tag-static {
    font-size: 12px;
    color: var(--faq-blue);
    background: #eef5fc;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: default;
}

.faq-empty {
    text-align: center;
    padding: 54px 20px;
    background: #fff;
    border: 1px dashed var(--faq-line);
    border-radius: var(--faq-radius);
    color: var(--faq-muted);
    font-size: 15px;
}

/* ---------- AI 助手侧栏 ---------- */
.faq-side {
    position: sticky;
    top: 92px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.faq-ai {
    background: #fff;
    border: 1px solid var(--faq-line);
    border-radius: var(--faq-radius);
    box-shadow: var(--faq-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 130px);
}

.faq-ai-head {
    position: relative;
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 18px 20px;
    background: linear-gradient(130deg, #6366F1 0%, #7C5CF0 48%, #A855F7 100%);
    overflow: hidden;
}
.faq-ai-head::before,
.faq-ai-head::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.faq-ai-head::before {
    top: -46px; right: -28px;
    width: 132px; height: 132px;
    background: rgba(255,255,255,.15);
}
.faq-ai-head::after {
    bottom: -54px; right: 46px;
    width: 92px; height: 92px;
    background: rgba(255,255,255,.09);
}
.faq-ai-badge {
    position: relative;
    z-index: 1;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgba(255,255,255,.17);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.faq-ai-badge svg { width: 23px; height: 23px; display: block; }
.faq-ai-head h4 {
    position: relative; z-index: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .01em;
}
.faq-ai-head p {
    position: relative; z-index: 1;
    margin: 3px 0 0;
    font-size: 12.8px;
    font-weight: 500;
    color: rgba(255,255,255,.93);
    line-height: 1.45;
}

.faq-ai-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    min-height: 168px;
    max-height: 46vh;
    background: #fbfcfe;
    scroll-behavior: smooth;
}

.faq-ai-msg { margin-bottom: 12px; }
.faq-ai-bubble {
    font-size: 13.6px;
    line-height: 1.7;
    padding: 11px 14px;
    border-radius: 14px;
    white-space: pre-line;
}
.faq-ai-bot .faq-ai-bubble {
    background: #f1f1fd;
    color: var(--faq-ink);
    border-bottom-left-radius: 4px;
}
.faq-ai-user { text-align: right; }
.faq-ai-user .faq-ai-bubble {
    display: inline-block;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    border-bottom-right-radius: 4px;
    text-align: left;
    max-width: 92%;
}

/* AI 返回的 FAQ 结果卡 */
.faq-ai-results { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.faq-ai-card {
    background: #fff;
    border: 1px solid var(--faq-line);
    border-radius: 11px;
    padding: 11px 13px;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
}
.faq-ai-card:hover {
    border-color: var(--faq-blue);
    box-shadow: 0 4px 14px rgba(99,102,241,.16);
}
.faq-ai-card-q {
    font-size: 13.6px;
    font-weight: 700;
    color: var(--faq-navy);
    line-height: 1.45;
    margin-bottom: 5px;
}
.faq-ai-card-a {
    font-size: 12.8px;
    color: var(--faq-muted);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.faq-ai-card-meta {
    margin-top: 7px;
    font-size: 11.5px;
    color: var(--faq-blue);
    font-weight: 600;
}
.faq-ai-rel {
    margin-top: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--faq-navy);
}
.faq-ai-rel button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: #f2f1fe;
    color: var(--faq-ink);
    font-size: 12.6px;
    padding: 8px 11px;
    border-radius: 9px;
    margin-top: 6px;
    cursor: pointer;
    line-height: 1.45;
}
.faq-ai-rel button:hover { background: #e9e7fd; color: var(--faq-blue); }

.faq-ai-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 16px 0;
}
.faq-ai-qchip {
    border: 1px solid var(--faq-line);
    background: #f7f7fd;
    color: var(--faq-muted);
    font-size: 12.2px;
    padding: 6px 11px;
    border-radius: 20px;
    cursor: pointer;
    transition: all .18s;
}
.faq-ai-qchip:hover {
    background: var(--faq-blue);
    border-color: var(--faq-blue);
    color: #fff;
}

.faq-ai-form {
    display: flex;
    gap: 8px;
    padding: 12px 16px 16px;
}
.faq-ai-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--faq-line);
    background: #f7f7fd;
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 13.5px;
    outline: none;
    color: var(--faq-navy);
    transition: border-color .2s, box-shadow .2s;
}
.faq-ai-form input:focus {
    border-color: var(--faq-blue);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
    background: #fff;
}
.faq-ai-form button {
    flex: none;
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    cursor: pointer;
    transition: opacity .2s;
}
.faq-ai-form button:hover { opacity: .9; }

.faq-contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--faq-line);
    border-radius: 14px;
    padding: 15px 18px;
    text-decoration: none;
    box-shadow: var(--faq-shadow);
    transition: border-color .2s, transform .2s;
}
.faq-contact-card:hover {
    border-color: var(--faq-blue);
    transform: translateY(-2px);
    text-decoration: none;
}
.faq-contact-card i {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, #f1f0fe, #e6e4fc);
    color: var(--faq-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}
.faq-contact-card strong {
    display: block;
    font-size: 14px;
    color: var(--faq-navy);
}
.faq-contact-card span {
    font-size: 12.6px;
    color: var(--faq-muted);
}

/* 右侧联系顾问盒子（多方式） */
.faq-contact-box {
    background: #fff;
    border: 1px solid var(--faq-line);
    border-radius: 14px;
    padding: 16px;
    box-shadow: var(--faq-shadow);
}
.faq-contact-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--faq-navy);
    margin-bottom: 12px;
}
.faq-contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: background .2s;
}
.faq-contact-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.faq-contact-row:first-of-type {
    padding-top: 0;
}
.faq-contact-row:hover {
    text-decoration: none;
}
.faq-contact-icon {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.faq-contact-icon svg { width: 18px; height: 18px; }
.faq-contact-icon.faq-wa { background: #25d366; }
.faq-contact-icon.faq-email { background: #ff485f; }
.faq-contact-icon.faq-phone { background: #22c1e0; }
.faq-contact-text {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--faq-navy);
    word-break: break-all;
}

/* 高亮搜索词 */
.faq-hl {
    background: #ffe9a8;
    border-radius: 3px;
    padding: 0 1px;
}

/* 面包屑副标题 */
.breadcrumb_part .breadcrumb_iner .breadcrumb_sub {
    color: rgba(255,255,255,.9);
    font-size: 16px;
    line-height: 1.6;
    margin: 14px auto 0;
    max-width: 760px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 991.98px) {
    .faq-layout { grid-template-columns: 1fr; }
    .faq-side { position: static; order: -1; }
    .faq-ai { max-height: none; }
    .faq-ai-body { max-height: 40vh; }
}
@media (max-width: 576px) {
    .faq-page { padding: 30px 0 50px; }
    .faq-search-card { padding: 14px 14px 12px; }
    .faq-group-head h3 { font-size: 17px; }
    .faq-q { font-size: 14.6px; padding: 14px 15px; }
    .faq-a-body { font-size: 14px; padding: 0 15px 4px; }
    .faq-a-tags { padding: 10px 15px 14px; }
}
