/* 知识库专用样式 - ABTIDE */

/* ===== 搜索区域 ===== */
.knowledge-search {
    background: linear-gradient(135deg, var(--bg-navy) 0%, var(--bg-navy-light) 100%);
    padding: 60px 20px 80px;
    text-align: center;
}

.knowledge-search h1 {
    color: #fff;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 12px;
}

.knowledge-search .subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    margin-bottom: 40px;
}

.search-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 20px 60px 20px 28px;
    font-size: 18px;
    border: none;
    border-radius: 50px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
}

.search-input::placeholder {
    color: #999;
}

.search-icon {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--brand-red);
}

.search-hints {
    margin-top: 20px;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

.search-hints span {
    margin: 0 8px;
}

/* 搜索结果 */
.search-results {
    max-width: 700px;
    margin: 20px auto 0;
    text-align: left;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f8f8f8;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item .category {
    font-size: 12px;
    color: var(--brand-red);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.search-result-item .question {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.search-result-item .preview {
    font-size: 14px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-no-results {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

/* ===== 主题分类导航 ===== */
.topic-nav {
    background: #fff;
    padding: 24px 20px;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.topic-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.topic-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-gray);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.topic-tag:hover {
    background: var(--brand-red);
    color: #fff;
}

.topic-tag.active {
    background: var(--brand-red);
    color: #fff;
}

.topic-tag .icon {
    font-size: 18px;
}

/* ===== 知识分类区块 ===== */
.knowledge-categories {
    padding: 60px 20px;
    background: var(--bg-gray);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-title p {
    font-size: 18px;
    color: var(--text-secondary);
}

.category-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.category-card {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-red);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.category-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.category-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.category-count {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-gray);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== 精选问答 ===== */
.featured-qa {
    padding: 80px 20px;
    background: #fff;
}

.qa-list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qa-item {
    background: var(--bg-gray);
    border-radius: 16px;
    overflow: hidden;
}

.qa-question {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    cursor: pointer;
    user-select: none;
}

.qa-q-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.qa-question h4 {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.qa-toggle {
    font-size: 24px;
    color: var(--brand-red);
    transition: transform 0.3s;
}

.qa-item.active .qa-toggle {
    transform: rotate(45deg);
}

.qa-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.qa-item.active .qa-answer {
    max-height: 500px;
}

.qa-answer-content {
    padding: 0 28px 24px 72px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.qa-answer-content p {
    margin-bottom: 16px;
}

.qa-answer-content strong {
    color: var(--brand-red);
    font-weight: 600;
}

.qa-answer-content ul {
    margin: 16px 0;
    padding-left: 24px;
}

.qa-answer-content li {
    margin-bottom: 8px;
}

/* ===== 专题页面 ===== */
.knowledge-hero {
    background: linear-gradient(135deg, var(--bg-navy) 0%, var(--bg-navy-light) 100%);
    padding: 80px 20px 60px;
    text-align: center;
}

.knowledge-hero h1 {
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
}

.knowledge-hero .description {
    color: rgba(255,255,255,0.8);
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
}

.knowledge-breadcrumb {
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.knowledge-breadcrumb-inner {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 14px;
    color: var(--text-secondary);
}

.knowledge-breadcrumb a {
    color: var(--brand-red);
    text-decoration: none;
}

.knowledge-breadcrumb a:hover {
    text-decoration: underline;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .knowledge-search h1 {
        font-size: 28px;
    }

    .search-input {
        padding: 16px 50px 16px 20px;
        font-size: 16px;
    }

    .section-title h2 {
        font-size: 28px;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        padding: 24px;
    }

    .knowledge-hero h1 {
        font-size: 32px;
    }

    .topic-nav {
        padding: 16px;
    }

    .topic-tag {
        padding: 8px 16px;
        font-size: 13px;
    }

    .qa-question {
        padding: 20px;
    }

    .qa-question h4 {
        font-size: 16px;
    }

    .qa-answer-content {
        padding: 0 20px 20px 20px;
    }
}

/* ===== 页面加载动画 ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 回到顶部 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--brand-red);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(230, 0, 18, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(230, 0, 18, 0.4);
}
