/* =========================================
   faq.css — 常见问题页
   设计语言与 index / tutorial 对齐
========================================= */

html {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    scroll-padding-top: 96px;
}
body {
    overflow: visible;
    height: auto;
    padding-top: 80px;
}

/* =========================================
   页顶 Hero
========================================= */
.faq-header {
    background: var(--color-black);
    padding: 64px 40px 72px;
    position: relative; overflow: hidden;
}
.faq-header-inner {
    max-width: 1200px; margin: 0 auto;
    position: relative; z-index: 1;
}
.faq-header-label {
    font-size: 12px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--brand-cyan); margin-bottom: 16px; display: block;
}
.faq-header-title {
    font-size: 64px; font-weight: 900;
    letter-spacing: -2.5px; line-height: 1.05;
    color: var(--color-white); margin-bottom: 16px;
}
.faq-header-desc {
    font-size: 16px; font-weight: 500;
    color: #71717A; line-height: 1.6;
    max-width: 540px; margin-bottom: 40px;
}

/* 快跳分类标签 */
.faq-cats {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.faq-cat-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 999px;
    background: #111113; border: 1px solid #232325;
    font-size: 13px; font-weight: 700; color: #A1A1AA;
    text-decoration: none; transition: var(--transition);
}
.faq-cat-pill i { font-size: 12px; }
.faq-cat-pill:hover {
    background: #1a1a1e; border-color: var(--brand-blue);
    color: var(--brand-blue);
}

/* =========================================
   主体布局
========================================= */
.faq-layout {
    max-width: 1200px; margin: 0 auto;
    padding: 56px 40px 100px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 56px; align-items: start;
}

/* ── 左侧目录 ── */
.faq-sidebar {
    position: sticky; top: 96px;
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow-y: auto; scrollbar-width: none;
}
.faq-sidebar::-webkit-scrollbar { display: none; }
.faq-sidebar-title {
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-secondary); margin-bottom: 16px;
}
.faq-nav { list-style: none; padding: 0; margin: 0; }
.faq-nav li + li { margin-top: 2px; }
.faq-nav a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    color: var(--text-secondary); text-decoration: none;
    transition: var(--transition);
}
.faq-nav a i { font-size: 11px; width: 14px; text-align: center; flex-shrink: 0; }
.faq-nav a:hover  { color: var(--brand-blue); background: #EFF6FF; }
.faq-nav a.active { color: var(--brand-blue); background: #EFF6FF; font-weight: 800; }

/* ── 右侧内容 ── */
.faq-content { min-width: 0; }

/* =========================================
   FAQ 分类区块
========================================= */
.faq-group {
    padding-bottom: 56px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 56px;
    scroll-margin-top: 96px;
}
.faq-group:last-child { border-bottom: none; margin-bottom: 0; }

.faq-group-header {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 28px;
}
.faq-group-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.faq-group-meta { flex: 1; min-width: 0; }
.faq-group-title {
    font-size: 26px; font-weight: 900;
    letter-spacing: -0.5px; color: var(--text-primary);
    margin: 0 0 4px;
}
.faq-group-desc {
    font-size: 14px; color: var(--text-secondary); font-weight: 500; margin: 0;
}

/* =========================================
   折叠问答条目
========================================= */
.faq-list { display: flex; flex-direction: column; gap: 8px; }

.faq-item {
    border: 1px solid var(--color-border);
    border-radius: 14px; overflow: hidden;
    background: white; transition: var(--transition);
}
.faq-item:hover { border-color: #CBD5E1; box-shadow: 0 4px 16px rgba(0,0,0,0.05); }
details[open].faq-item { border-color: var(--brand-blue); box-shadow: 0 4px 20px var(--brand-glow); }

.faq-q {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 18px 22px;
    font-size: 15px; font-weight: 700;
    color: var(--text-primary); cursor: pointer;
    list-style: none; user-select: none;
    transition: var(--transition);
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { background: #F8FAFC; }
details[open] .faq-q { color: var(--brand-blue); background: #F0F7FF; }

.faq-q-text { flex: 1; min-width: 0; }
.faq-q-icon {
    width: 24px; height: 24px; border-radius: 6px;
    background: var(--color-bg-alt); border: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: var(--transition);
}
.faq-q-icon i { font-size: 10px; color: var(--text-secondary); transition: var(--transition); }
details[open] .faq-q-icon { background: var(--brand-blue); border-color: transparent; }
details[open] .faq-q-icon i { color: white; transform: rotate(180deg); }

.faq-a {
    padding: 0 22px 20px;
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
    font-size: 14px; color: var(--text-secondary);
    line-height: 1.8; font-weight: 500;
}
.faq-a p { margin: 0 0 12px; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-a code {
    font-family: var(--font-mono); font-size: 12px;
    background: var(--color-bg-alt); border: 1px solid var(--color-border);
    padding: 2px 7px; border-radius: 5px; color: var(--brand-blue);
    word-break: break-all; /* 允许代码在任意字符处换行，避免撑出容器 */
}
.faq-a strong { font-weight: 800; color: var(--text-primary); }
.faq-a a { color: var(--brand-blue); font-weight: 700; text-decoration: none; }
.faq-a a:hover { text-decoration: underline; }

/* 步骤列表
   li 用 block + padding-left，让 <strong>/<code>/文本
   都作为普通行内内容流动，避免 flex 把它们变成独立子项导致排版混乱 */
.faq-steps {
    list-style: none; padding: 0; margin: 12px 0 0;
    display: flex; flex-direction: column; gap: 12px;
}
.faq-steps li {
    display: block;
    padding-left: 34px;
    position: relative;
    min-height: 22px;
    font-size: 13px; color: var(--text-secondary);
    line-height: 1.7; overflow-wrap: break-word;
}
.faq-steps li::before {
    content: attr(data-n);
    position: absolute; left: 0; top: 2px;
    width: 22px; height: 22px; border-radius: 6px;
    background: var(--brand-gradient);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 900; color: white;
}
.faq-steps li strong { color: var(--text-primary); }
/* 标签 */
.faq-tag {
    display: inline-block;
    padding: 2px 8px; border-radius: 5px;
    font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-right: 4px;
}
.faq-tag--blue   { background: #EFF6FF; color: var(--brand-blue); }
.faq-tag--green  { background: #F0FDF4; color: #16A34A; }
.faq-tag--yellow { background: #FFFBEB; color: #D97706; }
.faq-tag--red    { background: #FEF2F2; color: #DC2626; }

/* 提示框 */
.faq-tip {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 16px; border-radius: 10px;
    font-size: 13px; font-weight: 500; line-height: 1.6;
    margin: 12px 0 0;
}
.faq-tip i { font-size: 13px; margin-top: 1px; flex-shrink: 0; }
.faq-tip--info   { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.faq-tip--info i { color: #3B82F6; }
.faq-tip--warn   { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.faq-tip--warn i { color: #F59E0B; }

/* =========================================
   底部"没找到答案"CTA
========================================= */
.faq-contact {
    margin-top: 64px;
    background: var(--color-black);
    border-radius: 24px; padding: 48px 40px;
    text-align: center; position: relative; overflow: hidden;
}
.faq-contact-title {
    font-size: 32px; font-weight: 900;
    letter-spacing: -1px; color: white; margin-bottom: 12px;
}
.faq-contact-desc {
    font-size: 15px; color: #71717A; margin-bottom: 28px; font-weight: 500;
}
.faq-contact-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.faq-contact-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 10px;
    font-size: 14px; font-weight: 800;
    text-decoration: none; transition: var(--transition);
}
.faq-contact-btn--white {
    background: white; color: var(--color-black);
}
.faq-contact-btn--white:hover { background: #F1F5F9; transform: translateY(-2px); }
.faq-contact-btn--outline {
    background: transparent; color: #A1A1AA;
    border: 1px solid #3F3F46;
}
.faq-contact-btn--outline:hover { background: #111113; color: white; border-color: #52525B; }

/* =========================================
   Responsive — 1024px
========================================= */
@media (max-width: 1024px) {
    .faq-layout { grid-template-columns: 1fr; gap: 32px; padding: 40px 24px 80px; }
    .faq-sidebar { position: static; display: none; }
    .faq-header { padding: 48px 24px 56px; }
    .faq-header-title { font-size: 48px; }
}

/* =========================================
   Responsive — 768px
========================================= */
@media (max-width: 768px) {
    body { padding-top: 60px; }
    html { scroll-padding-top: 76px; }

    .faq-header { padding: 36px 20px 44px; }
    .faq-header-title { font-size: 30px; letter-spacing: -1.5px; margin-bottom: 12px; }
    .faq-header-desc  { font-size: 14px; margin-bottom: 24px; }
    .faq-cats { gap: 6px; }
    .faq-cat-pill { padding: 6px 12px; font-size: 12px; }

    .faq-layout { padding: 28px 20px 60px; }

    .faq-group { padding-bottom: 40px; margin-bottom: 40px; }
    .faq-group-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
    .faq-group-title { font-size: 20px; }
    .faq-group-desc { font-size: 13px; }

    .faq-q { padding: 14px 16px; font-size: 14px; gap: 12px; }
    .faq-a { padding: 14px 16px 16px; font-size: 13px; }

    .faq-contact { padding: 36px 24px; border-radius: 16px; margin-top: 40px; }
    .faq-contact-title { font-size: 24px; }
    .faq-contact-btns { flex-direction: column; align-items: center; }
    .faq-contact-btn { width: 100%; max-width: 300px; justify-content: center; }
}

@media (max-width: 480px) {
    .faq-header-title { font-size: 26px; }
    .faq-q { font-size: 13px; }
}
