/* ==================== 知识库页面样式 ==================== */

/* 页面头部 */
.knowledge-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.knowledge-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300a86b' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.knowledge-hero h1 {
    color: #fff;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
}

.knowledge-hero p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    margin-bottom: 30px;
    position: relative;
}

.knowledge-search {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    position: relative;
}

.knowledge-search input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.knowledge-search button {
    padding: 16px 30px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.knowledge-search button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* 主要布局 */
.knowledge-main {
    padding: 60px 0;
    background: var(--bg-light);
    min-height: 60vh;
}

.knowledge-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

/* 侧边栏 */
.knowledge-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-section {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.sidebar-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-radius: 10px;
    color: var(--text-light);
    font-size: 14px;
    transition: all 0.3s ease;
}

.category-list a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.category-list a.active {
    background: var(--primary-color);
    color: #fff;
}

.category-list .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.category-list a.active .count {
    background: rgba(255, 255, 255, 0.2);
}

/* 热门文章 */
.hot-articles {
    list-style: none;
}

.hot-articles li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.hot-articles li:last-child {
    border-bottom: none;
}

.hot-articles a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.hot-articles a:hover {
    color: var(--primary-color);
}

.hot-articles .hot-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.hot-articles li:nth-child(1) .hot-num {
    background: #ff6b6b;
    color: #fff;
}

.hot-articles li:nth-child(2) .hot-num {
    background: #ffa502;
    color: #fff;
}

.hot-articles li:nth-child(3) .hot-num {
    background: #ffd43b;
    color: #333;
}

/* 快速链接 */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s ease;
}

.quick-link:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(5px);
}

.quick-link span {
    font-size: 18px;
}

/* 内容区 */
.knowledge-content {
    min-height: 500px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.results-info {
    color: var(--text-light);
    font-size: 14px;
}

.view-options select {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    outline: none;
}

/* 文章网格 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* 文章卡片 - 知识库页面专用 */
.article-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.article-card .article-cover {
    height: 160px;
    position: relative;
    overflow: hidden;
}

.article-card .article-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.3) 100%);
}

.article-card .article-cover.install { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.article-card .article-cover.repair { background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%); }
.article-card .article-cover.tech { background: linear-gradient(135deg, #4776E6 0%, #8E54E9 100%); }
.article-card .article-cover.news { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }

.article-card .cover-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    opacity: 0.95;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.article-card .article-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.article-card .article-body {
    padding: 24px;
}

.article-card .article-title {
    font-size: 17px;
    font-weight: 700;
    color: #232629;
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.article-card:hover .article-title {
    color: var(--primary-color);
}

/* 置顶文章样式 */
.article-card.is-top {
    border: 2px solid #ff4757;
    position: relative;
}

.article-card.is-top::before {
    content: '置顶';
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.4);
}

.article-card.is-top .article-title {
    color: #ff4757;
    font-weight: 700;
}

.article-card.is-top:hover .article-title {
    color: #ff6b81;
}

.article-card .article-summary {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.article-card .article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 加载状态 */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-state .empty-icon {
    font-size: 80px;
    display: block;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 10px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    padding: 20px;
}

.page-btn {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 8px;
}

.page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-num:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-num.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* 文章详情弹窗 - 全屏模式 */
.article-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.article-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 70%;
    max-width: 1000px;
    height: 100vh;
    background: #fff;
    overflow: hidden;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.modal-close {
    position: fixed;
    top: 20px;
    right: calc(70% + 20px);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    font-size: 28px;
    color: #333;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #fff;
    transform: scale(1.1);
}

.article-detail {
    height: 100vh;
    overflow-y: auto;
}

.article-detail .detail-header {
    position: relative;
    padding: 80px 50px 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.article-detail .detail-header.install { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.article-detail .detail-header.repair { background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%); }
.article-detail .detail-header.tech { background: linear-gradient(135deg, #4776E6 0%, #8E54E9 100%); }
.article-detail .detail-header.news { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.article-detail .detail-header.维修指南 { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.article-detail .detail-header.维修教程 { background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%); }
.article-detail .detail-header.故障诊断 { background: linear-gradient(135deg, #4776E6 0%, #8E54E9 100%); }
.article-detail .detail-header.运维知识 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }

.article-detail .detail-category {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    font-size: 14px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.article-detail .detail-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 25px;
}

.article-detail .detail-meta {
    display: flex;
    gap: 30px;
    font-size: 15px;
    opacity: 0.9;
}

.article-detail .detail-body {
    padding: 50px;
    background: #fff;
}

.article-detail .detail-content {
    font-size: 17px;
    line-height: 2;
    color: #333;
}

.article-detail .detail-content p {
    margin-bottom: 24px;
}

.article-detail .detail-content h2 {
    font-size: 24px;
    margin: 40px 0 20px;
    color: #1a1a2e;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.article-detail .detail-content h3 {
    font-size: 20px;
    margin: 30px 0 15px;
    color: #333;
}

.article-detail .detail-content ul,
.article-detail .detail-content ol {
    margin: 20px 0;
    padding-left: 25px;
}

.article-detail .detail-content li {
    margin-bottom: 10px;
}

/* 响应式 */
@media (max-width: 992px) {
    .knowledge-layout {
        grid-template-columns: 1fr;
    }

    .knowledge-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .sidebar-section:last-child {
        grid-column: 1 / -1;
    }

    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .knowledge-main {
        padding: 40px 0;
    }

    /* 弹窗响应式 */
    .modal-container {
        width: 85%;
    }

    .modal-close {
        right: calc(85% + 15px);
        width: 45px;
        height: 45px;
        font-size: 24px;
    }

    .article-detail .detail-header {
        padding: 60px 35px 40px;
    }

    .article-detail .detail-title {
        font-size: 28px;
    }

    .article-detail .detail-body {
        padding: 35px;
    }
}

@media (max-width: 768px) {
    .knowledge-hero {
        padding: 100px 15px 50px;
    }

    .knowledge-hero h1 {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .knowledge-hero p {
        font-size: 15px;
        margin-bottom: 25px;
    }

    .knowledge-search {
        flex-direction: column;
        padding: 0 10px;
    }

    .knowledge-search input {
        padding: 14px 20px;
        font-size: 15px;
    }

    .knowledge-search button {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }

    .knowledge-main {
        padding: 30px 0;
    }

    .knowledge-layout {
        gap: 25px;
    }

    .knowledge-sidebar {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .sidebar-section {
        padding: 20px;
        margin-bottom: 0;
        border-radius: 12px;
    }

    .sidebar-section h3 {
        font-size: 15px;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .category-list a {
        padding: 10px 12px;
        font-size: 13px;
    }

    .category-list .count {
        padding: 2px 8px;
        font-size: 11px;
    }

    .hot-articles a {
        font-size: 13px;
    }

    .hot-articles .hot-num {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }

    .quick-link {
        padding: 10px 12px;
        font-size: 13px;
    }

    .quick-link span {
        font-size: 16px;
    }

    /* 内容区 */
    .content-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 15px;
        border-radius: 10px;
        margin-bottom: 20px;
    }

    .results-info {
        font-size: 13px;
    }

    .view-options select {
        padding: 8px 12px;
        font-size: 13px;
        width: 100%;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* 文章卡片 */
    .article-card .article-cover {
        height: 150px;
    }

    .article-card .cover-icon {
        font-size: 40px;
    }

    .article-card .article-category {
        top: 12px;
        left: 12px;
        padding: 4px 10px;
        font-size: 11px;
    }

    .article-card .article-body {
        padding: 18px;
    }

    .article-card .article-title {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .article-card .article-summary {
        font-size: 13px;
        margin-bottom: 15px;
        -webkit-line-clamp: 3;
    }

    .article-card .article-meta {
        font-size: 12px;
        padding-top: 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 30px;
        padding: 15px 10px;
    }

    .page-btn {
        padding: 8px 15px;
        font-size: 13px;
    }

    .page-numbers {
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-num {
        width: 35px;
        height: 35px;
        font-size: 13px;
    }

    /* 弹窗 */
    .modal-container {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .article-detail {
        max-height: 100vh;
    }

    .article-detail .detail-header {
        padding: 60px 20px 25px;
    }

    .article-detail .detail-category {
        padding: 4px 12px;
        font-size: 12px;
        margin-bottom: 12px;
    }

    .article-detail .detail-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .article-detail .detail-meta {
        flex-wrap: wrap;
        gap: 15px;
        font-size: 13px;
    }

    .article-detail .detail-body {
        padding: 20px;
    }

    .article-detail .detail-content {
        font-size: 15px;
        line-height: 1.7;
    }

    .article-detail .detail-content p {
        margin-bottom: 15px;
    }

    .article-detail .detail-content h2,
    .article-detail .detail-content h3 {
        margin: 25px 0 12px;
        font-size: 18px;
    }

    /* 空状态 */
    .empty-state {
        padding: 50px 20px;
    }

    .empty-state .empty-icon {
        font-size: 60px;
        margin-bottom: 15px;
    }

    .empty-state h3 {
        font-size: 18px;
    }

    .empty-state p {
        font-size: 14px;
    }

    /* 加载状态 */
    .loading-state {
        padding: 50px 20px;
    }

    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

@media (max-width: 480px) {
    .knowledge-hero {
        padding: 90px 15px 40px;
    }

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

    .knowledge-hero p {
        font-size: 14px;
    }

    .knowledge-search input {
        padding: 12px 16px;
        font-size: 14px;
    }

    .knowledge-search button {
        padding: 12px 16px;
        font-size: 14px;
    }

    .knowledge-main {
        padding: 20px 0;
    }

    .sidebar-section {
        padding: 15px;
    }

    .sidebar-section h3 {
        font-size: 14px;
    }

    .article-card .article-cover {
        height: 130px;
    }

    .article-card .cover-icon {
        font-size: 35px;
    }

    .article-card .article-body {
        padding: 15px;
    }

    .article-card .article-title {
        font-size: 15px;
    }

    .article-card .article-summary {
        font-size: 12px;
    }

    /* 分页简化 */
    .page-numbers {
        display: none;
    }

    .pagination {
        justify-content: space-between;
    }

    .page-btn {
        flex: 1;
        max-width: 45%;
        text-align: center;
    }

    /* 弹窗 */
    .article-detail .detail-header {
        padding: 55px 15px 20px;
    }

    .article-detail .detail-title {
        font-size: 18px;
    }

    .article-detail .detail-meta {
        font-size: 12px;
        gap: 10px;
    }

    .article-detail .detail-body {
        padding: 15px;
    }

    .article-detail .detail-content {
        font-size: 14px;
    }
}
