:root {
    --primary-blue: #1e3a8a;
    --primary-blue-light: #3b82f6;
    --primary-blue-dark: #1e40af;
    --accent-teal: #0d9488;
    --accent-teal-light: #14b8a6;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

/* 头部样式 */
.support-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.support-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.support-nav a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.support-nav a:hover {
    opacity: 0.8;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

/* 百科英雄区域 */
.encyclopedia-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 4rem 1rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
}

/* 搜索区域 */
.search-section {
    max-width: 800px;
    margin: -2rem auto 3rem;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
}

.search-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    position: relative;
    width: 100%;
}

.search-box {
    display: flex;
    margin-bottom: 1rem;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

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

.search-button {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    transition: background 0.2s;
}

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

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-tag {
    background: #f1f5f9;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.search-tag:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

/* 主要内容布局 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

/* 知识分类网格 */
.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.knowledge-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

.knowledge-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-blue-light);
}

.knowledge-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-blue);
}

.knowledge-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.knowledge-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.knowledge-links {
    list-style: none;
}

.knowledge-links li {
    margin-bottom: 0.5rem;
}

.knowledge-links a {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

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

.knowledge-links a::before {
    content: "›";
    margin-right: 0.5rem;
    font-weight: bold;
}

/* AI助手区域 */
.ai-assistant {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.ai-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-teal));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 1rem;
}

.ai-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.ai-chat {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 1rem;
    height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
}

.ai-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    max-width: 85%;
}

.ai-message.user {
    background: var(--primary-blue);
    color: white;
    margin-left: auto;
}

.ai-message.bot {
    background: white;
    border: 1px solid var(--border-light);
}

.ai-input-area {
    display: flex;
}

.ai-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius) 0 0 var(--radius);
    outline: none;
}

.ai-send {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

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

.doc-list li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.doc-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.doc-list a {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.doc-list a:hover {
    color: var(--primary-blue);
}

.doc-list a::before {
    content: "📄";
    margin-right: 0.5rem;
}

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

.update-list li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.update-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.update-list a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
    display: block;
}

.update-list a:hover {
    color: var(--primary-blue);
    /* text-decoration: underline; */
}

.update-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.update-title {
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px; /* 控制标题和计数之间的间距 */
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

.modal-article-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.modal-article-list li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s;
}

.modal-article-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.modal-article-list li:hover {
    background-color: #f8fafc;
    border-radius: 4px;
}

.article-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s;
}

.article-link:hover {
    color: var(--primary-blue);
}

.article-title {
    font-weight: 500;
    flex: 1;
}

.article-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 1rem;
}

.article-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 搜索下拉框样式 */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.search-results-content {
    padding: 8px 0;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f6f8fa;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none;
    color: inherit;
}

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

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

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.search-result-title {
    font-weight: 600;
    color: #24292f;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.search-result-category {
    background: #ddf4ff;
    color: #0969da;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    margin-left: 8px;
    white-space: nowrap;
}

.search-result-snippet {
    font-size: 13px;
    color: #656d76;
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    
    /* 多行文本截断 - 兼容性写法 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2; /* 标准属性，未来支持 */
    box-orient: vertical;
}

.search-result-meta {
    font-size: 11px;
    color: #8c959f;
    display: flex;
    gap: 12px;
}

.search-highlight {
    background-color: #fff8c5;
    padding: 1px 2px;
    border-radius: 3px;
    font-weight: 600;
}

.search-no-results {
    padding: 20px 16px;
    text-align: center;
    color: #656d76;
}

.search-no-results h4 {
    margin: 0 0 8px 0;
    color: #24292f;
}

.search-loading {
    padding: 16px;
    text-align: center;
    color: #656d76;
}

/* 搜索统计 */
.search-stats {
    padding: 8px 16px;
    border-bottom: 1px solid #f6f8fa;
    font-size: 12px;
    color: #8c959f;
    background: #f6f8fa;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .knowledge-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .support-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .support-nav a {
        margin-left: 0;
        margin-right: 1rem;
    }

    .modal-content {
        max-width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .article-link {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-date {
        margin-left: 0;
        margin-top: 0.25rem;
    }
}