/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 页面头部 */
.header {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

/* 查询区域 */
.query-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.query-box {
    margin-bottom: 20px;
}

.query-label {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.label-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

.query-input {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s;
}

.query-input:focus {
    outline: none;
    border-color: #667eea;
}

.query-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-size: 0.95rem;
    color: #666;
}

.top-k-select {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.top-k-select:focus {
    outline: none;
    border-color: #667eea;
}

.query-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.query-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.query-btn:active {
    transform: translateY(0);
}

.query-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.2rem;
}

/* 示例问题 */
.examples {
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
}

.examples-title {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 10px;
}

.example-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.example-tag {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.example-tag:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 加载动画 */
.loading-indicator {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 结果区域 */
.results-section {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
}

.title-icon {
    font-size: 1.8rem;
    margin-right: 10px;
}

/* AI回答 */
.answer-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.answer-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #444;
}

.answer-content h2,
.answer-content h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
}

.answer-content h2 {
    font-size: 1.3rem;
}

.answer-content h3 {
    font-size: 1.1rem;
}

.answer-content ul,
.answer-content ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.answer-content li {
    margin-bottom: 8px;
}

.answer-content strong {
    color: #667eea;
}

.answer-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
    font-style: italic;
}

/* 法条列表 */
.articles-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.article-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.article-number {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
}

.article-score {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-label {
    font-weight: 600;
    color: #999;
}

.content-section {
    margin-top: 15px;
}

.content-toggle {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 15px;
    transition: background 0.3s;
}

.content-toggle:hover {
    background: #5568d3;
}

.content-text {
    background: white;
    border-left: 4px solid #667eea;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    line-height: 1.8;
    color: #444;
}

.content-text.collapsed {
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.content-text.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, transparent, white);
}

.content-label {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
    display: block;
}

.no-content {
    color: #999;
    font-style: italic;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.9rem;
}

.footer strong {
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .stats {
        flex-direction: column;
        gap: 15px;
    }

    .query-controls {
        flex-direction: column;
        gap: 15px;
    }

    .query-btn {
        width: 100%;
        justify-content: center;
    }

    .article-header {
        flex-direction: column;
        gap: 10px;
    }

    .article-meta {
        flex-direction: column;
        gap: 8px;
    }
}
