/* ============================================================
 * FAQ 卡片页面样式（3 列网格 + 答案折叠展开）
 * 统一使用 common.css 中定义的 CSS 变量和字体栈
 * 与首页 / 产品列表页风格保持一致
 * ============================================================ */

/* ---------- 基础 ---------- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Noto Sans SC', 'PingFang SC', sans-serif;
    background: var(--pearl-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- FAQ 页头 ---------- */
.faq-section {
    background: var(--pearl-white);
    padding: 3rem 0 4rem;
}

.faq-header {
    text-align: center;
    margin-bottom: 3rem;
}

.faq-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--deep-gray);
    margin: 0 0 0.75rem;
    letter-spacing: -0.5px;
}

.faq-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---------- FAQ 卡片列表：每行 1 个 ---------- */
.faq-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

/* ---------- 单个 FAQ 大卡片 ---------- */
.faq-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.faq-card:hover {
    box-shadow: 0 10px 30px rgba(93, 173, 236, 0.22);
    transform: translateY(-6px);
}

.faq-card.is-open {
    box-shadow: 0 6px 24px rgba(93, 173, 236, 0.15);
}

/* ---------- 问题栏（可点击，双色相间：奇数行淡蓝 / 偶数行白） ---------- */
.faq-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding: 22px 24px 18px;
    background: #ffffff;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background-color 0.25s ease;
}

.faq-card:nth-child(odd) .faq-card-header {
    background: #eaf4fd;
}

.faq-card-header:hover {
    background: rgba(92, 171, 236, 0.10);
}

.faq-card:nth-child(odd) .faq-card-header:hover {
    background: #dceefb;
}

.faq-card-header:focus {
    outline: 2px solid var(--silver-blue);
    outline-offset: -2px;
}

.faq-q-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--silver-blue);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.faq-card:hover .faq-q-icon,
.faq-card.is-open .faq-q-icon {
    transform: scale(1.1) rotate(-6deg);
    background: var(--tech-blue);
}

.faq-q-text {
    flex: 1;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--deep-gray);
    line-height: 1.4;
    word-break: break-word;
    transition: color 0.3s ease;
}

.faq-card:hover .faq-q-text,
.faq-card.is-open .faq-q-text {
    color: var(--tech-blue);
}

/* 展开/收起图标 —— 圆形徽章 + 箭头：收起向右，展开时旋转向下 */
.faq-toggle-icon {
    flex-shrink: 0;
    margin-left: auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(92, 171, 236, 0.12);
    color: var(--silver-blue);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    align-self: center;
}

.faq-card-header:hover .faq-toggle-icon {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(93, 173, 236, 0.3);
}

/* 箭头徽章底色随行相间：偶数行淡蓝 / 奇数行淡青 */
.faq-card:nth-child(odd) .faq-toggle-icon {
    background: rgba(46, 134, 171, 0.15);
}

.faq-toggle-icon .icon-chevron {
    transition: transform 0.3s ease;
}

/* 展开状态：徽章实心蓝色，箭头旋转向下 */
.faq-card.is-open .faq-toggle-icon {
    background: var(--tech-blue);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(93, 173, 236, 0.35);
}
.faq-card.is-open .faq-toggle-icon .icon-chevron {
    transform: rotate(90deg);
}

/* ---------- 答案区（默认折叠，JS 控制展开高度） ---------- */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-card-body {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 24px 24px;
}

.faq-a-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--deep-gray);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    border-radius: 8px;
    margin-top: 2px;
}

.faq-a-content {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.75;
    /* FAQ 原始 content 有内联 font-family，覆盖它 */
    font-family: inherit !important;
}

/* ---------- 答案富文本排版 ---------- */
.faq-a-content p {
    margin: 0 0 14px;
}

.faq-a-content p:last-child {
    margin-bottom: 0;
}

.faq-a-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.faq-a-content ul,
.faq-a-content ol {
    margin: 0 0 14px;
    padding-left: 20px;
}

.faq-a-content li {
    margin-bottom: 6px;
}

.faq-a-content strong,
.faq-a-content b {
    font-weight: 600;
    color: var(--deep-gray);
}

.faq-a-content em,
.faq-a-content i {
    font-style: italic;
}

.faq-a-content a {
    color: var(--tech-blue);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.faq-a-content a:hover {
    color: var(--silver-blue);
}

.faq-a-content h1,
.faq-a-content h2,
.faq-a-content h3,
.faq-a-content h4 {
    margin: 16px 0 10px;
    font-weight: 600;
    color: var(--deep-gray);
    line-height: 1.3;
}

.faq-a-content h2 { font-size: 18px; }
.faq-a-content h3 { font-size: 16px; }

.faq-a-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 14px;
}

.faq-a-content table td,
.faq-a-content table th {
    border: 1px solid #e5e5e5;
    padding: 10px 14px;
    text-align: left;
}

/* FAQ 原始内联样式清理 */
.faq-a-content * {
    font-family: inherit !important;
    font-size: inherit !important;
}

.faq-a-content div,
.faq-a-content span,
.faq-a-content p {
    font-size: inherit !important;
    font-family: inherit !important;
    color: inherit !important;
    background-color: transparent !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* ---------- 移动端响应式 ---------- */
@media (max-width: 992px) {
    .faq-title {
        font-size: 30px;
    }
    .faq-section {
        padding: 2.5rem 0 3rem;
    }
}

@media (max-width: 768px) {
    .faq-title {
        font-size: 26px;
    }
    .faq-subtitle {
        font-size: 15px;
    }
    .faq-list {
        gap: 12px;
    }
    .faq-card {
        border-radius: 12px;
    }
    .faq-card-header {
        padding: 16px 18px 14px;
        gap: 12px;
    }
    .faq-card-body {
        padding: 14px 18px 18px;
        gap: 12px;
    }
    .faq-q-icon {
        width: 28px;
        height: 28px;
        font-size: 13px;
        border-radius: 7px;
    }
    .faq-q-text {
        font-size: 15px;
        font-weight: 600;
    }
    .faq-toggle-icon {
        width: 26px;
        height: 26px;
    }
    .faq-toggle-icon svg {
        width: 14px;
        height: 14px;
    }
    .faq-a-icon {
        width: 28px;
        height: 28px;
        font-size: 13px;
        border-radius: 7px;
    }
    .faq-a-content {
        font-size: 14px;
        line-height: 1.7;
    }
    .faq-a-content table {
        display: block;
        overflow-x: auto;
    }
    .faq-section {
        padding: 2rem 0 2.5rem;
    }
    .faq-header {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .faq-title {
        font-size: 22px;
    }
    .faq-subtitle {
        font-size: 14px;
    }
    .faq-card-header {
        padding: 14px 14px 12px;
        gap: 10px;
    }
    .faq-card-body {
        padding: 12px 14px 16px;
    }
    .faq-q-text {
        font-size: 14.5px;
    }
    .faq-a-content {
        font-size: 13.5px;
    }
    .faq-a-content p {
        margin-bottom: 10px;
    }
}
