:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #f1f5f9;
    --secondary-hover: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 1200px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

h1 {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-container {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    padding: 40px;
    margin-bottom: 30px;
}

.form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--secondary-color);
}

.form-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    background-color: #e0e7ff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.form-title {
    font-size: 1.6rem;
    color: var(--text-primary);
}

.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--secondary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.required::after {
    content: " *";
    color: var(--danger-color);
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s;
    background-color: var(--bg-white);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: flex-end;
}

.btn {
    padding: 14px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.preview-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    padding: 30px;
    text-align: center;
}

.preview-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.book-preview {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 25px;
    border-radius: var(--radius-lg);
    background-color: var(--bg-light);
    min-width: 250px;
}

.preview-cover {
    width: 150px;
    height: 200px;
    border-radius: 8px;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.2rem;
    overflow: hidden;
}

.preview-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-title-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.preview-author {
    color: var(--text-secondary);
}

.preview-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.success-message {
    background-color: #d1fae5;
    color: #065f46;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-top: 20px;
    display: none;
    align-items: center;
    gap: 10px;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 8px;
    display: none;
}

.image-upload {
    display: flex;
    gap: 15px;
    align-items: center;
}

.image-preview {
    width: 80px;
    height: 100px;
    border-radius: 6px;
    background-color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 25px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .form-container {
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 10px;
    }

    .form-container {
        padding: 15px;
    }

    .image-upload {
        flex-direction: column;
        align-items: flex-start;
    }
}

.upload-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.upload-header {
    background: linear-gradient(135deg, var(--primary), #6610f2);
    color: white;
    padding: 30px;
    text-align: center;
}

.upload-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.upload-header p {
    opacity: 0.9;
    margin-bottom: 20px;
}

.upload-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.upload-content {
    padding: 30px;
}

/* 上传区域 */
.upload-area {
    border: 3px dashed #dee2e6;
    border-radius: 10px;
    padding: 50px 20px;
    text-align: center;
    background: var(--light);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 25px;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(13, 110, 253, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(13, 110, 253, 0.1);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.upload-text h3 {
    color: var(--dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-text p {
    color: #6c757d;
    margin-bottom: 20px;
}

.security-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid var(--warning);
    padding: 15px;
    margin: 20px 0;
    text-align: left;
    border-radius: 0 8px 8px 0;
}

.security-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.security-list li {
    padding: 5px 0;
    color: #666;
}

.security-list li i {
    color: var(--warning);
    margin-right: 8px;
}

/* 文件列表 */
.files-section {
    margin-top: 30px;
}

.section-title {
    font-size: 1.3rem;
    color: var(--dark);
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.files-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.file-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.file-item:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.file-item.success {
    border-left: 4px solid var(--success);
}

.file-item.error {
    border-left: 4px solid var(--danger);
}

.file-item.uploading {
    border-left: 4px solid var(--primary);
}

.file-item.checking {
    border-left: 4px solid var(--warning);
}

.file-item.pending {
    border-left: 4px solid #6c757d;
}

.file-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-right: 15px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
    word-break: break-all;
}

.file-details {
    display: flex;
    gap: 15px;
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.file-progress {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.file-status {
    margin-left: 15px;
    font-weight: 500;
    min-width: 120px;
    text-align: right;
    flex-shrink: 0;
}

.status-checking {
    color: var(--warning);
}

.status-uploading {
    color: var(--primary);
}

.status-success {
    color: var(--success);
}

.status-error {
    color: var(--danger);
}

.status-pending {
    color: #6c757d;
}

.file-actions {
    margin-left: 15px;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #4361ee;
    border: none;
}

.btn-primary:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.btn-success {
    background: var(--success);
    border: none;
}

.btn-danger {
    background: var(--danger);
    border: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* 提示信息 */
.alert {
    border: none;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 15px;
    display: none;
}

.alert-success {
    background: rgba(25, 135, 84, 0.1);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid var(--warning);
}

/* 批量操作 */
.batch-actions {
    background: var(--light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    justify-content: space-between;
    align-items: center;
}

.selected-count {
    font-weight: 500;
    color: var(--dark);
}

/* 预览区域 */
.preview-container {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #dee2e6;
    display: none;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
}

/* 队列信息 */
.queue-info {
    background: rgba(13, 110, 253, 0.1);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

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

.files-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
    margin-right: 8px;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 768px) {
    .upload-header {
        padding: 20px;
    }

    .upload-content {
        padding: 20px;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .upload-stats {
        gap: 15px;
    }

    .stat-item {
        padding: 10px 15px;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .file-status {
        text-align: left;
        margin-left: 0;
        min-width: auto;
    }

    .file-actions {
        margin-left: 0;
        align-self: flex-end;
    }
}