/* 全局样式 */
* {
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主要内容 */
.main {
    padding-bottom: 4rem;
}

/* 通用卡片样式 */
section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
}

section h2 {
    color: #4a5568;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 导入方式选择 */
.import-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: #718096;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* 直接粘贴区域 */
.paste-area {
    margin-bottom: 1rem;
}

#chatTextarea {
    width: 100%;
    min-height: 300px;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#chatTextarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.paste-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.paste-info p {
    margin: 0;
    color: #0369a1;
    font-size: 0.9rem;
}

/* 文件上传区域 */
.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #ebf8ff;
}

.upload-content i {
    font-size: 3rem;
    color: #a0aec0;
    margin-bottom: 1rem;
}

.upload-content p {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.upload-hint {
    color: #a0aec0 !important;
    font-size: 0.9rem !important;
}

.upload-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.3s ease;
}

.upload-btn:hover {
    background: #5a67d8;
}

/* 导出教程样式 */
.guide-content h3 {
    color: #2d3748;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.3rem;
}

.guide-steps {
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.step-number {
    background: #667eea;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.step-content h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.step-content p {
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

.guide-tips {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 1.5rem;
}

.guide-tips h4 {
    color: #92400e;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-tips ul {
    margin: 0;
    padding-left: 1.5rem;
}

.guide-tips li {
    color: #78350f;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 文件信息 */
.file-info {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.file-info p {
    margin-bottom: 0.5rem;
    color: #4a5568;
}

/* 分析控制 */
.analysis-controls {
    text-align: center;
}

.analyze-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.analyze-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.analyze-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    box-shadow: none;
}

/* 进度条 */
.progress-container {
    margin-top: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #4a5568;
    font-weight: 500;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.stat-card h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

/* 分析结果 */
.analysis-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.result-card {
    background: #f7fafc;
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
}

.result-card h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 历史记录 */
.history-controls {
    margin-bottom: 1rem;
}

.clear-history-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.clear-history-btn:hover {
    background: #c53030;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.no-history {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 2rem;
}

.history-item {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: background 0.3s ease;
}

.history-item:hover {
    background: #edf2f7;
}

/* 底部 */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* 用户排行样式 */
.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s ease;
}

.ranking-item:hover {
    transform: translateX(5px);
}

.rank {
    font-weight: bold;
    color: #667eea;
    min-width: 30px;
}

.user {
    flex: 1;
    margin: 0 1rem;
    font-weight: 500;
}

.count {
    color: #718096;
    font-size: 0.9rem;
}

/* 关键词标签样式 */
.keyword-tag {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.4rem 0.8rem;
    margin: 0.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.keyword-tag:hover {
    transform: scale(1.05);
}

/* AI总结样式 */
.ai-summary {
    line-height: 1.8;
    color: #4a5568;
}

.ai-summary p {
    margin-bottom: 1rem;
}

.ai-summary strong {
    color: #2d3748;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .container {
        padding: 0 15px;
    }

    section {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .analysis-results {
        grid-template-columns: 1fr;
    }

    .ranking-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .user {
        margin: 0;
    }
}
