/* FAQ页面共享样式 */
.faq-layout {
    display: flex;
    min-height: calc(100vh - 200px);
    margin-top: 1rem;
}

/* 左侧导航栏 */
.faq-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    position: sticky;
    top: 80px;
    height: calc(100vh - 100px);
    overflow-y: auto;
}

.faq-sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-dark);
    background: #f9fafb;
}

.faq-nav-section {
    border-bottom: 1px solid #e5e7eb;
}

.faq-nav-section:last-child {
    border-bottom: none;
}

.faq-nav-title {
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.faq-nav-title:hover {
    background: #f3f4f6;
}

.faq-nav-title svg {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.faq-nav-title .toggle-icon {
    margin-left: auto;
    transition: transform 0.2s;
}

.faq-nav-title.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.faq-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.faq-nav-list.collapsed {
    display: none;
}

.faq-nav-item {
    border-top: 1px solid #f3f4f6;
}

.faq-nav-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem 0.75rem 2.25rem;
    color: var(--text-medium);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.faq-nav-item a:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}

.faq-nav-item a.active {
    background: linear-gradient(90deg, rgba(0, 139, 139, 0.1) 0%, transparent 100%);
    color: var(--primary-color);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
}

.faq-nav-item .count {
    font-size: 0.75rem;
    background: #e5e7eb;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    color: var(--text-light);
}

.faq-nav-item a:hover .count,
.faq-nav-item a.active .count {
    background: var(--primary-color);
    color: white;
}

/* 子分类折叠箭头 */
.faq-nav-item.has-children .child-toggle {
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.faq-nav-item.has-children.collapsed .child-toggle {
    transform: rotate(-90deg);
}

/* 子分类 */
.faq-nav-children {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f9fafb;
}

.faq-nav-children.collapsed {
    display: none;
}

.faq-nav-children .faq-nav-item a {
    padding-left: 3rem;
    font-size: 0.8125rem;
}

.faq-nav-children .faq-nav-children .faq-nav-item a {
    padding-left: 3.75rem;
}

/* 产品项样式 */
.faq-nav-item.product-item a {
    padding-left: 3.5rem;
    font-size: 0.8125rem;
    color: var(--text-medium);
}

.faq-nav-children .faq-nav-item.product-item a {
    padding-left: 4rem;
}

.faq-nav-item.product-item a::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* 右侧主内容区 */
.faq-content {
    flex: 1;
    min-width: 0;
    padding: 0 2rem 2rem;
}

/* 搜索框 */
.faq-search {
    margin-bottom: 2rem;
}

.faq-search form {
    display: flex;
    max-width: 500px;
}

.faq-search input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.faq-search input:focus {
    border-color: var(--primary-color);
}

.faq-search button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.faq-search button:hover {
    background: var(--primary-hover);
}

/* 内容区域标题 */
.faq-content-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.faq-content-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.faq-content-header p {
    color: var(--text-medium);
    font-size: 1rem;
}

.faq-content-header .product-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-medium);
    font-size: 0.9375rem;
}

.faq-content-header .product-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.faq-content-header .product-info a:hover {
    text-decoration: underline;
}

/* FAQ分类区块 */
.faq-category-section {
    margin-bottom: 2rem;
}

.faq-category-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-category-title .count {
    font-size: 0.8125rem;
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

/* FAQ列表 */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: block;
}

.faq-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 139, 139, 0.1);
}

.faq-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.faq-card h3 svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--primary-color);
    margin-top: 2px;
}

.faq-card-preview {
    color: var(--text-medium);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.faq-card-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.faq-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.faq-card-products {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.faq-card-products a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-medium);
    text-decoration: none;
    transition: all 0.2s;
}

.faq-card-products a:hover {
    background: var(--primary-color);
    color: white;
}

/* 空状态 */
.faq-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.faq-empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

/* 响应式 */
@media (max-width: 992px) {
    .faq-layout {
        flex-direction: column;
    }

    .faq-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        margin-bottom: 1.5rem;
    }

    .faq-content {
        padding: 0 1rem 2rem;
    }
}

@media (max-width: 768px) {
    .faq-search form {
        flex-direction: column;
        max-width: none;
    }

    .faq-search input {
        border-right: 2px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }

    .faq-search button {
        border-radius: 8px;
    }
}

/* 分页器样式 */
.faq-pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.faq-pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.faq-pagination li a,
.faq-pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.625rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.faq-pagination li a {
    background: white;
    color: var(--text-dark);
    border: 1px solid #e5e7eb;
}

.faq-pagination li a:hover {
    background: #f3f4f6;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.faq-pagination li.active span {
    background: linear-gradient(135deg, #008B8B 0%, #20B2AA 100%);
    color: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 139, 139, 0.25);
}

.faq-pagination li.disabled span {
    background: #f9fafb;
    color: #d1d5db;
    border: 1px solid #e5e7eb;
    cursor: not-allowed;
}

.faq-pagination .prev-next a,
.faq-pagination .prev-next span {
    font-size: 0.8125rem;
    gap: 0.25rem;
}

.faq-pagination .prev-next svg {
    width: 14px;
    height: 14px;
}

.faq-page-info {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .faq-pagination li a,
    .faq-pagination li span {
        min-width: 32px;
        height: 32px;
        font-size: 0.8125rem;
    }
}
