/* 基本样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部样式 */
header {
    background-color: #2c3e50;
    color: #fff;
    padding: 20px;
    text-align: center;
}

header h1 {
    margin-bottom: 20px;
    font-size: 28px;
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
}

#searchInput {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 30px;
    outline: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

#searchInput:focus {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 主内容区域样式 */
main {
    padding: 20px;
}

/* 搜索结果样式 */
.category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 22px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
    margin-bottom: 15px;
}

.question-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.question-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.question {
    font-size: 18px;
    font-weight: bold;
    color: #34495e;
    margin-bottom: 10px;
}

.answer {
    font-size: 16px;
    color: #555;
    line-height: 1.8;
}

.answer br {
    display: block;
    margin: 5px 0;
    content: "";
}

.highlight {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 40px 0;
    color: #7f8c8d;
    font-size: 18px;
}

/* 加载状态样式 */
.loading {
    text-align: center;
    padding: 40px 0;
    color: #2c3e50;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误信息样式 */
.error-message {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff3f3;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 5px solid #e74c3c;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-message p {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.6;
}

.error-message p:first-child {
    font-size: 20px;
    font-weight: bold;
    color: #c0392b;
}

.error-message p:last-child {
    background-color: #fff8e1;
    padding: 15px;
    border-radius: 6px;
    color: #333;
    font-weight: 500;
    border: 1px solid #ffd54f;
    margin-top: 20px;
}

/* 类别筛选样式 */
.category-filter {
    max-width: 600px;
    margin: 15px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-filter label {
    color: #ecf0f1;
    margin-right: 10px;
    font-weight: 500;
}

.category-filter select {
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    outline: none;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

.category-filter select:focus {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 加载指示器样式 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* 页脚样式 */
footer {
    margin-top: auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #ecf0f1;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: 8px;
    color: #7f8c8d;
    font-size: 14px;
}

.footer-content a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-content a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.version {
    font-size: 12px;
    color: #95a5a6;
    margin-top: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 24px;
    }
    
    #searchInput {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .category-title {
        font-size: 20px;
    }
    
    .question {
        font-size: 16px;
    }
    
    .answer {
        font-size: 14px;
    }
    
    .category-filter {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 20px;
    }
    
    .category-title {
        font-size: 18px;
    }
}