:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --border-color: #dee2e6;
}
* {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--secondary-color);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.logo p {
    font-size: 14px;
    color: var(--gray-color);
}

.search-form {
    display: flex;
    margin: 0 20px;
    flex-grow: 1;
    max-width: 600px;
}

.search-form input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 2px solid var(--primary-color);
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    outline: none;
}

.search-form button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-form button:hover {
    background-color: var(--secondary-color);
}

.main-nav a {
    margin-left: 20px;
    font-weight: 500;
    color: var(--dark-color);
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* 主内容区 */
.hero {
    text-align: center;
    padding: 60px 0;
    background: linear-gradient(135deg, #3498db, #8e44ad);
    color: white;
    border-radius: 8px;
    margin: 30px 0;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
}

.hero-search {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
}

.hero-search input {
    flex-grow: 1;
    padding: 15px;
    font-size: 16px;
    border: none;
    border-radius: 4px 0 0 4px;
}

.hero-search button {
    padding: 15px 30px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.hero-search button:hover {
    background-color: #c0392b;
}

/* 分类网格 */
.categories {
    margin: 40px 0;
}

.categories h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: var(--dark-color);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 15px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    color: var(--dark-color);
}

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

.category-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.category-card h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.category-card p {
    color: var(--gray-color);
    font-size: 14px;
}

/* 问题部分 */
.question-section {
    margin: 40px 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.section-header h2 {
    font-size: 24px;
    color: var(--dark-color);
}

.section-header a {
    font-size: 14px;
    color: var(--gray-color);
}

.section-header a:hover {
    color: var(--primary-color);
}

.question-list {
    display: flex;
    flex-direction: column;
}

.question-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

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

.category-tag {
    background-color: #eaf2f8;
    color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    margin-right: 15px;
    white-space: nowrap;
}

.question-item a {
    font-size: 16px;
    color: var(--dark-color);
    flex-grow: 1;
}

.question-item a:hover {
    color: var(--primary-color);
}

/* 列表页样式 */
.list-header {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin: 30px 0;
}

.list-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.list-header p {
    color: var(--gray-color);
    margin-bottom: 20px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

.sort-options a {
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #f1f1f1;
    color: var(--gray-color);
}

.sort-options a.active {
    background-color: var(--primary-color);
    color: white;
}

.question-list-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.question-card {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.question-card:last-child {
    border-bottom: none;
}

.question-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.question-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.question-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--gray-color);
}

.no-results {
    text-align: center;
    padding: 40px 20px;
}

.no-results h3 {
    font-size: 22px;
    margin-bottom: 15px;
}

.no-results p {
    color: var(--gray-color);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--dark-color);
    font-size: 14px;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 内容页样式 */
.content-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 30px 0;
}

@media (min-width: 992px) {
    .content-container {
        grid-template-columns: 2fr 1fr;
    }
}

.question-detail {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.question-header {
    margin-bottom: 25px;
}

.question-header h1 {
    font-size: 28px;
    margin: 15px 0;
}

.question-content h2 {
    font-size: 22px;
    margin: 25px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.question-text, .answer-text {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 10px;
}

.answer-text {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.related-questions {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    align-self: start;
}

.related-questions h3 {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.related-questions ul {
    list-style: none;
}

.related-questions li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.related-questions li:last-child {
    border-bottom: none;
}

.related-questions a {
    display: block;
    color: #444;
    padding: 8px 0;
}

.related-questions a:hover {
    color: var(--primary-color);
}

/* 底部样式 */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-links a {
    color: #ddd;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    font-size: 14px;
    color: #aaa;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.copyright p {
    margin-bottom: 5px;
}

.copyright a {
    color: #aaa;
}

.copyright a:hover {
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-form {
        width: 100%;
        margin: 15px 0;
    }
    
    .main-nav {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .hero h2 {
        font-size: 28px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .list-header {
        padding: 15px;
    }
    
    .list-header h1 {
        font-size: 24px;
    }
    
    .sort-options {
        flex-wrap: wrap;
    }
    
    .question-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}
