/**
 * FAQ系统样式
 * 提供现代化、响应式的FAQ界面设计
 */

/* FAQ部分基础样式 */
.faq-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.faq-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e9ecef" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') repeat;
    opacity: 0.3;
    pointer-events: none;
}

.faq-section .container {
    position: relative;
    z-index: 1;
}

/* 搜索区域样式 */
.faq-search {
    margin-bottom: 40px;
    text-align: center;
}

.search-container {
    display: inline-flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 8px;
    margin-bottom: 20px;
    max-width: 500px;
    width: 100%;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 20px;
    font-size: 16px;
    background: transparent;
    color: #333;
}

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

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 分类按钮样式 */
.faq-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.category-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.category-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* FAQ容器样式 */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

/* FAQ项目样式 */
.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.faq-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.faq-item.active {
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

/* FAQ问题样式 */
.faq-question {
    padding: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-question h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    flex: 1;
    padding-right: 20px;
}

.faq-toggle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.faq-toggle i {
    transition: transform 0.3s ease;
    font-size: 14px;
}

.faq-item.active .faq-toggle {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

/* FAQ答案样式 */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    background: #f8f9fa;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 24px 24px;
}

.faq-answer p {
    margin: 0 0 16px 0;
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

/* 关键词标签样式 */
.faq-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.keyword-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* 无结果样式 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.no-results i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.no-results h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    color: #333;
}

.no-results p {
    margin: 0 0 24px 0;
    color: #666;
    font-size: 16px;
}

/* 相关内容推荐样式 */
.related-content {
    margin-top: 60px;
    display: none;
}

.related-content h3 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    color: #333;
    position: relative;
}

.related-content h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.content-recommendations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

/* 推荐项目样式 */
.recommendation-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
}

.recommendation-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: #667eea;
}

.rec-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.rec-content {
    flex: 1;
}

.rec-content h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.rec-type {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.rec-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s ease;
    flex-shrink: 0;
    text-decoration: none;
}

.rec-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 搜索高亮样式 */
mark {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .faq-section {
        padding: 60px 0;
    }
    
    .search-container {
        margin: 0 20px 20px;
    }
    
    .faq-categories {
        padding: 0 20px;
    }
    
    .category-btn {
        font-size: 12px;
        padding: 6px 16px;
    }
    
    .faq-question {
        padding: 20px;
    }
    
    .faq-question h3 {
        font-size: 16px;
        padding-right: 16px;
    }
    
    .faq-answer {
        padding: 0 20px 20px;
    }
    
    .content-recommendations {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }
    
    .recommendation-item {
        padding: 16px;
    }
    
    .rec-content h4 {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .faq-question {
        padding: 16px;
    }
    
    .faq-question h3 {
        font-size: 15px;
    }
    
    .faq-toggle {
        width: 28px;
        height: 28px;
    }
    
    .faq-toggle i {
        font-size: 12px;
    }
    
    .keyword-tag {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .rec-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* 无障碍访问增强 */
@media (prefers-reduced-motion: reduce) {
    .faq-item,
    .faq-question,
    .faq-answer,
    .faq-toggle i,
    .search-btn,
    .category-btn,
    .recommendation-item {
        transition: none;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .faq-item {
        border: 2px solid #000;
    }
    
    .faq-question {
        border-bottom: 1px solid #000;
    }
    
    .search-input {
        border: 1px solid #000;
    }
    
    .category-btn {
        border-color: #000;
    }
}

/* 打印样式 */
@media print {
    .faq-search,
    .related-content {
        display: none;
    }
    
    .faq-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
        margin-bottom: 20px;
    }
    
    .faq-answer {
        max-height: none !important;
        padding: 16px !important;
    }
    
    .faq-toggle {
        display: none;
    }
}