/* ============== QA PAGE STYLES (SKYBOUND THEME) ============== */

.qa-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 48px 120px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 48px;
    align-items: start;
}

/* Sidebar */
.qa-sidebar {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 12px;
}
.qa-sidebar::-webkit-scrollbar { width: 3px; }
.qa-sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

.qa-nav-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.24em;
    color: var(--amber);
    text-transform: uppercase;
    margin-bottom: 12px;
    padding: 0 12px;
}
.qa-nav-label:not(:first-child) {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.qa-nav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    font-family: var(--serif-cn);
    font-size: 13px;
    color: var(--steel-2);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}
.qa-nav-item:hover {
    color: var(--bone);
    background: rgba(232, 168, 56, 0.04);
}
.qa-nav-item.active {
    color: var(--amber);
    border-left-color: var(--amber);
    background: rgba(232, 168, 56, 0.06);
}
.qa-nav-count {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--steel);
    letter-spacing: 0.08em;
}
.qa-nav-toggle {
    display: inline-block;
    width: 14px;
    font-size: 8px;
    transition: transform 0.2s;
    color: var(--steel);
}
.qa-nav-item.expanded .qa-nav-toggle { transform: rotate(90deg); }

.qa-nav-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.qa-nav-sub.expanded { max-height: 600px; }
.qa-nav-sub .qa-nav-item {
    padding-left: 28px;
    font-size: 12px;
}

/* Search */
.qa-search-wrap {
    position: relative;
    margin-bottom: 32px;
}
.qa-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: var(--steel-2);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}
.qa-search {
    width: 100%;
    padding: 12px 14px 12px 40px;
    background: rgba(244, 241, 234, 0.03);
    border: 1px solid var(--line);
    color: var(--bone);
    font-family: var(--serif-cn);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.qa-search::placeholder { color: var(--steel); font-size: 13px; }
.qa-search:focus { border-color: var(--amber); }
.qa-search-hint {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--mono);
    font-size: 10px;
    color: var(--steel);
    letter-spacing: 0.1em;
    pointer-events: none;
}

/* Main content area */
.qa-main-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}
.qa-section-marker {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--amber);
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.qa-section-marker::before {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--amber);
}
.qa-main-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.1;
    color: var(--bone);
    margin-bottom: 8px;
}
.qa-main-meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--steel-2);
    letter-spacing: 0.1em;
}

/* Document Cards */
.qa-doc-card {
    border: 1px solid var(--line);
    margin-bottom: 20px;
    background: rgba(244, 241, 234, 0.015);
    transition: border-color 0.3s;
}
.qa-doc-card:hover { border-color: rgba(232, 168, 56, 0.3); }

.qa-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    cursor: pointer;
    gap: 16px;
}
.qa-doc-cat {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: var(--amber);
    text-transform: uppercase;
    margin-bottom: 6px;
}
.qa-doc-title {
    font-family: var(--serif-cn);
    font-weight: 600;
    font-size: 17px;
    color: var(--bone);
    line-height: 1.4;
    margin-bottom: 6px;
}
.qa-doc-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--steel);
    letter-spacing: 0.1em;
}
.qa-doc-meta-row .has-img { color: var(--jade); }
.qa-doc-meta-row .qa-num { color: var(--amber); }

.qa-source-tag {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    padding: 4px 10px;
    text-transform: uppercase;
    white-space: nowrap;
}
.qa-source-tag.gemini {
    color: var(--jade);
    border: 1px solid rgba(74, 139, 111, 0.4);
    background: rgba(74, 139, 111, 0.08);
}
.qa-source-tag.yuanbao {
    color: var(--amber);
    border: 1px solid rgba(232, 168, 56, 0.3);
    background: rgba(232, 168, 56, 0.06);
}
.qa-expand-mark {
    font-size: 10px;
    color: var(--steel);
    transition: transform 0.3s;
    margin-top: 8px;
}
.qa-doc-card.collapsed .qa-expand-mark { transform: rotate(-90deg); }

/* QA content list */
.qa-list {
    border-top: 1px solid var(--line);
    transition: max-height 0.4s ease, opacity 0.3s;
}
.qa-doc-card.collapsed .qa-list {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    border-top: none;
}

.qa-block {
    padding: 24px;
    border-bottom: 1px solid var(--line-2);
}
.qa-block:last-child { border-bottom: none; }

.qa-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.qa-post {
    border: 1px solid var(--line);
    background: rgba(244, 241, 234, 0.02);
}

.qa-post-question {
    background: linear-gradient(180deg, rgba(232, 168, 56, 0.05), rgba(244, 241, 234, 0.015));
}

.qa-post-answer {
    margin-left: 28px;
    background: linear-gradient(180deg, rgba(74, 139, 111, 0.08), rgba(244, 241, 234, 0.015));
}

.qa-post-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.qa-post-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    flex-shrink: 0;
}

.qa-post-avatar.user {
    color: var(--amber);
    background: rgba(232, 168, 56, 0.12);
    border: 1px solid rgba(232, 168, 56, 0.35);
}

.qa-post-avatar.ai {
    color: var(--jade);
    background: rgba(74, 139, 111, 0.14);
    border: 1px solid rgba(74, 139, 111, 0.35);
}

.qa-post-head-main {
    min-width: 0;
}

.qa-post-role {
    font-family: var(--serif-cn);
    font-weight: 600;
    font-size: 15px;
    color: var(--bone);
}

.qa-post-meta {
    margin-top: 3px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--steel);
}

.qa-post-badge {
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid rgba(232, 168, 56, 0.32);
    background: rgba(232, 168, 56, 0.08);
    color: var(--amber);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    white-space: nowrap;
}

.qa-post-badge-answer {
    border-color: rgba(74, 139, 111, 0.35);
    background: rgba(74, 139, 111, 0.1);
    color: var(--jade);
}

.qa-post-body {
    padding: 18px;
}

.qa-post-body-question {
    font-family: var(--serif-cn);
    font-weight: 600;
    font-size: 16px;
    color: var(--bone);
    line-height: 1.8;
}

.qa-post-body-answer {
    padding-top: 16px;
}

.qa-post-body-question p:last-child,
.qa-post-body-answer p:last-child {
    margin-bottom: 0;
}

.a-content {
    font-family: var(--serif-cn);
    font-size: 14px;
    line-height: 1.85;
    color: var(--bone-2);
    min-width: 0;
}
.a-content p { margin-bottom: 12px; }
.a-content .rich-ol {
    list-style: none;
    padding: 0;
    counter-reset: ol-counter;
}
.a-content .rich-ol > li {
    counter-increment: ol-counter;
    padding: 12px 0 12px 0;
    border-bottom: 1px dashed var(--line-2);
}
.a-content .rich-ol > li:last-child { border-bottom: none; }
.a-content .li-title {
    font-weight: 600;
    color: var(--bone);
    margin-bottom: 6px;
}
.a-content .li-title::before {
    content: counter(ol-counter) ". ";
    color: var(--amber);
    font-family: var(--mono);
    font-size: 12px;
}
.a-content .li-body { color: var(--steel-2); margin-top: 4px; }
.a-content .sub-item {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 13px;
}
.a-content .sub-key {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--amber);
    flex-shrink: 0;
}
.a-content .sub-val { color: var(--steel-2); }

/* Images in answers */
.qa-post-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 0 18px 18px;
}
.a-image-wrap {
    position: relative;
    border: 1px solid var(--line);
    overflow: hidden;
    cursor: pointer;
    background: rgba(10, 14, 20, 0.6);
}
.a-image-wrap img {
    width: 100%;
    height: 190px;
    display: block;
    object-fit: contain;
    transition: transform 0.3s;
}
.a-image-wrap:hover img { transform: scale(1.03); }
.a-image-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    color: var(--amber);
    background: rgba(10, 14, 20, 0.85);
    padding: 2px 8px;
    z-index: 2;
}

/* Search highlight */
.a-content mark, .qa-post-body-question mark, .qa-doc-title mark {
    background: rgba(232, 168, 56, 0.25);
    color: var(--amber);
    padding: 1px 2px;
}

/* Lightbox */
.qa-lightbox {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(10, 14, 20, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.qa-lightbox.active { display: flex; }
.qa-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}
.qa-lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--steel-2);
    background: none;
    border: 1px solid var(--line);
    padding: 8px 16px;
    cursor: pointer;
    transition: color 0.2s;
}
.qa-lightbox-close:hover { color: var(--amber); border-color: var(--amber); }

/* Empty state */
.qa-empty {
    text-align: center;
    padding: 80px 0;
    color: var(--steel-2);
}
.qa-empty h3 {
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.18em;
    color: var(--steel);
    margin-bottom: 12px;
}
.qa-empty p { font-size: 14px; }

/* Scroll to top */
.qa-scroll-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: rgba(10, 14, 20, 0.9);
    color: var(--amber);
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s, border-color 0.2s;
    pointer-events: none;
    z-index: 50;
    backdrop-filter: blur(8px);
}
.qa-scroll-top.visible { opacity: 1; pointer-events: auto; }
.qa-scroll-top:hover { border-color: var(--amber); }

/* Responsive */
@media (max-width: 1024px) {
    .qa-layout {
        grid-template-columns: 1fr;
        padding: 0 24px 80px;
    }
    .qa-sidebar {
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--line);
        padding-bottom: 24px;
        margin-bottom: 24px;
    }
    .qa-post-answer {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .qa-block {
        padding: 20px 16px;
    }
    .qa-doc-header {
        padding: 18px 16px;
    }
    .qa-post-head {
        padding: 14px 16px;
        gap: 12px;
    }
    .qa-post-badge {
        display: none;
    }
    .qa-post-body {
        padding: 16px;
    }
    .qa-post-body-question {
        font-size: 15px;
    }
    .qa-post-gallery {
        grid-template-columns: 1fr;
        padding: 0 16px 16px;
    }
    .a-image-wrap img {
        height: 180px;
    }
}
