/* style.css - AI Study Tool 样式 */

/* 基础重置 */
* {
    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;
    padding: 20px;
}

/* 容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

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

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 主要内容区域 */
.main-content {
    padding: 40px 30px;
}

/* 上传区域 */
.upload-section {
    border: 3px dashed #e2e8f0;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8fafc;
    margin-bottom: 30px;
}

.upload-section:hover {
    border-color: #4f46e5;
    background: #f0f4ff;
}

.upload-section.dragover {
    border-color: #4f46e5;
    background: #e0e7ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: #4f46e5;
    margin-bottom: 15px;
}

.upload-text h2 {
    color: #1e293b;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.upload-text p {
    color: #64748b;
    margin-bottom: 20px;
}

/* 文件输入 */
.file-input-wrapper {
    position: relative;
    display: inline-block;
    margin: 15px 0;
}

.file-input {
    position: absolute;
    left: -9999px;
}

.file-label {
    display: inline-block;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.file-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.file-name {
    margin-top: 10px;
    color: #64748b;
    font-size: 0.9rem;
}

/* 提交按钮 */
.submit-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    display: block;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 结果区域 */
.result-section {
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

.result-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.result-header h2 {
    color: #1e293b;
    font-size: 1.5rem;
}

.text-length {
    background: #4f46e5;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.result-content {
    background: #f8fafc;
    border-radius: 15px;
    padding: 25px;
    border-left: 4px solid #4f46e5;
    white-space: pre-wrap;
    line-height: 1.8;
    max-height: 500px;
    overflow-y: auto;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading p {
    color: #64748b;
    font-size: 1.1rem;
}

/* 错误消息 */
.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #dc2626;
    margin: 20px 0;
    animation: shake 0.5s ease;
}

/* 支持的文件类型 */
.supported-files {
    background: #f0f9ff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
    text-align: center;
}

.supported-files h3 {
    color: #0369a1;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.file-types {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.file-type {
    background: white;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-weight: 600;
    color: #475569;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 30px 20px;
    }
    
    .upload-section {
        padding: 30px 15px;
    }
    
    .file-types {
        flex-direction: column;
        gap: 10px;
    }
    
    .file-type {
        width: 100%;
    }
}

/* 滚动条样式 */
.result-content::-webkit-scrollbar {
    width: 8px;
}

.result-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}