/* upload-content.css - 添加资料页面样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.upload-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 40px 80px;
}

/* ========== 顶部标题栏 ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.back-btn svg {
    width: 20px;
    height: 20px;
    color: #666;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
}

/* ========== 章节标题 ========== */
.section-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 15px;
    color: #666;
    margin-bottom: 24px;
}

/* ========== 上传方式选择 ========== */
.upload-methods {
    margin-bottom: 48px;
}

.methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.method-card {
    background: white;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e8e8e8;
}

.method-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.method-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.method-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.method-icon.pdf { background: #FE9603; }
.method-icon.image { background: #ec6575; }
.method-icon.link { background: #007BFD; }
.method-icon.text { background: #5A55D6; }
.method-icon.ai-card { background: #32C958; }
.method-icon.anki-import { background: #FE9603; }
.method-icon.xlsx-card { background: #1D6F42; }
.method-icon.xlsx-practice { background: #0B7285; }

.method-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.method-card p {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

/* ========== 上传区域 ========== */
.upload-section {
    margin-bottom: 48px;
}

.upload-dropzone {
    background: white;
    border: 2px dashed #d0d0d0;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-dropzone:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-dropzone.drag-over {
    border-color: #667eea;
    background: #f0f3ff;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: #999;
    margin: 0 auto 24px;
}

.upload-dropzone h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.upload-dropzone p {
    font-size: 15px;
    color: #999;
    margin-bottom: 24px;
}

.select-file-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.select-file-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========== 链接输入 ========== */
.link-input-box,
.text-input-box {
    background: white;
    border-radius: 16px;
    padding: 32px;
}

.link-input-box label,
.text-input-box label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.link-input-box input,
.text-input-box textarea {
    width: 100%;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    font-size: 15px;
    color: #333;
    transition: all 0.2s ease;
    font-family: inherit;
}

.link-input-box input:focus,
.text-input-box textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.text-input-box textarea {
    resize: vertical;
    min-height: 200px;
}

.submit-btn {
    margin-top: 20px;
    padding: 14px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========== 文件预览 ========== */
.file-preview {
    margin-top: 32px;
    background: white;
    border-radius: 16px;
    padding: 24px;
}

.file-preview h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: #667eea;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: #999;
}

.file-remove {
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: #ffebee;
    color: #dc3545;
}

/* ========== AI处理选项 ========== */
.ai-options {
    margin-bottom: 48px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.option-card {
    position: relative;
    cursor: pointer;
}

.option-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-content {
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
}

.option-card input:checked + .option-content {
    border-color: #667eea;
    background: #f8f9ff;
}

.option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.option-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.option-icon.cards { background: #30AEE8; }
.option-icon.notes { background: #5A55D6; }
.option-icon.practice { background: #FE9603; }
.option-icon.summary { background: #32C958; }

.option-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.option-content p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* ========== 操作按钮 ========== */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
}

.cancel-btn,
.process-btn {
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: white;
    border: 1px solid #e8e8e8;
    color: #666;
}

.cancel-btn:hover {
    background: #f8f9fa;
    border-color: #d0d0d0;
}

.process-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.process-btn svg {
    width: 20px;
    height: 20px;
}

/* ========== 仅上传模式 ========== */
.upload-only-section {
    margin-bottom: 48px;
}

.upload-only-content {
    background: white;
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
}

.upload-only-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-only-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.upload-only-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.upload-only-content p {
    font-size: 15px;
    color: #666;
    margin-bottom: 32px;
}

/* ========== 处理进度 ========== */
.processing-section {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
}

.processing-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 32px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.processing-content p {
    font-size: 15px;
    color: #666;
    margin-bottom: 32px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

/* ========== 处理方式选择 ========== */
.processing-mode {
    margin-top: 24px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
}

.processing-mode h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.mode-options {
    display: flex;
    gap: 12px;
}

.mode-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-option-content {
    padding: 16px;
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-option input:checked + .mode-option-content {
    border-color: #667eea;
    background: #f0f3ff;
}

.mode-option-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.mode-option-content p {
    font-size: 12px;
    color: #666;
}

/* ========== PDF转Anki按钮 ========== */
.pdf-to-anki-section {
    margin-top: 20px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #d0d0d0;
}

.divider span {
    padding: 0 16px;
    color: #999;
    font-size: 13px;
}

.pdf-to-anki-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #30AEE8 0%, #5A55D6 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(48, 174, 232, 0.3);
}

.pdf-to-anki-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(48, 174, 232, 0.4);
}

.pdf-to-anki-btn > svg:first-child {
    width: 32px;
    height: 32px;
    color: white;
    flex-shrink: 0;
}

.pdf-to-anki-btn .btn-content {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pdf-to-anki-btn .btn-title {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.pdf-to-anki-btn .btn-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.pdf-to-anki-btn .arrow-icon {
    width: 20px;
    height: 20px;
    color: white;
    flex-shrink: 0;
}

/* ========== 响应式设计 ========== */
@media (max-width: 1200px) {
    .methods-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .methods-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .upload-container {
        padding: 16px 20px 60px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .methods-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column-reverse;
    }
    
    .cancel-btn,
    .process-btn {
        width: 100%;
    }
    
    .upload-dropzone {
        padding: 40px 20px;
    }
    
    .mode-options {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .methods-grid {
        grid-template-columns: 1fr;
    }
}

