* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
    position: relative;
}

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

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

h1 {
    color: #2c3e50;
    margin: 20px 0;
}

h2 {
    color: #34495e;
    margin-bottom: 15px;
}

.upload-section, .extraction-section, .action-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.upload-container {
    text-align: center;
}

.workflow-status {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
}

.workflow-status h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
}

.workflow-providers {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.provider-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-size: 13px;
    position: relative;
}

.provider-status input[type="radio"] {
    margin-right: 5px;
}

.provider-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.provider-status input[type="radio"]:checked + .provider-label {
    font-weight: 600;
}

.provider-status input[type="radio"]:checked + .provider-label .provider-name {
    color: #3a6ea5;
}

.provider-name {
    font-weight: 600;
    color: #495057;
}

.status-indicator {
    font-size: 16px;
    line-height: 1;
}

.status-indicator.online {
    color: #28a745;
}

.status-indicator.offline {
    color: #dc3545;
}

.priority {
    color: #6c757d;
    font-size: 11px;
}

.workflow-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #3a6ea5;
    color: white;
}

.btn-primary:hover {
    background-color: #2d5a87;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-primary:disabled, .btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.upload-button {
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px 0;
}

.upload-button:hover {
    background-color: #2980b9;
}

.drop-zone {
    border: 2px dashed #bdc3c7;
    padding: 20px;
    text-align: center;
    margin: 10px 0;
    border-radius: 4px;
}

.drop-zone.dragover {
    background-color: #e8f4f8;
    border-color: #3498db;
}

.extraction-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.action-btn {
    background-color: #2ecc71;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px;
}

.action-btn:hover {
    background-color: #27ae60;
}

.action-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* Toast 通知样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 350px;
    font-size: 14px;
    line-height: 1.4;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.error {
    background-color: #f44336;
}

.toast.info {
    background-color: #2196F3;
}

/* 多语言表单样式 */
.multilingual-form {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3a6ea5;
    display: inline-block;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fafbfc;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #3a6ea5;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* 多语言输入框样式 */
.multilingual-field-container {
    margin-bottom: 18px;
}

.multilingual-input {
    margin-top: 8px;
}

.multilingual-input textarea,
.multilingual-input input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 44px;
    background-color: #fafbfc;
}

.multilingual-input textarea:focus,
.multilingual-input input[type="text"]:focus {
    outline: none;
    border-color: #3a6ea5;
    box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.1);
}

.lang-zh-en-input .input-group:first-child textarea,
.lang-zh-en-input .input-group:first-child input {
    border-bottom: 1px solid #e0e0e0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.lang-zh-en-input .input-group:last-child textarea,
.lang-zh-en-input .input-group:last-child input {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* 提升多语言输入框的可读性 */
.input-group {
    position: relative;
}

.input-label {
    background: #f8f9fa;
    padding: 8px 12px;
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    border: none;
    display: block;
    letter-spacing: 0.5px;
}

.lang-zh-en-input .input-group:first-child .input-label {
    border-bottom: 1px solid #e0e0e0;
}

/* 表单字段样式 */
.form-field {
    margin-bottom: 20px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.label-text {
    font-size: 16px;
}

.field-hint {
    font-size: 12px;
    color: #666;
    font-weight: 400;
    margin-left: 8px;
}

/* 表单控件通用样式 */
.form-input,
.form-textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fafbfc;
}

.form-input:focus,
.form-textarea:focus,
select:focus {
    outline: none;
    border-color: #3a6ea5;
    box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* 保存按钮样式 */
.save-button {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3a6ea5, #2c5aa0);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(58, 110, 165, 0.2);
}

.save-button:hover {
    background: linear-gradient(135deg, #2c5aa0, #1e3a6f);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 110, 165, 0.3);
}

.save-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(58, 110, 165, 0.2);
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

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

/* 头像选择弹窗样式 */
.avatar-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.avatar-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: none;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.close-modal:hover,
.close-modal:focus {
    color: black;
    text-decoration: none;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}


.upload-avatar-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.custom-avatar-upload {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.custom-avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 12px;
    text-align: center;
}

.custom-avatar-controls {
    flex: 1;
}

.avatar-upload-btn {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
}

/* 裁剪工具样式 */
.crop-container {
    margin-top: 15px;
    display: none;
}

.crop-canvas-container {
    position: relative;
    margin-bottom: 15px;
}

.crop-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.crop-slider {
    flex: 1;
}

/* 科目标签样式 */
.subjects-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.subject-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.subject-tag i {
    font-size: 14px;
}

/* 头像显示样式 */
.avatar-display {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px;
    border: 3px solid #3a6ea5;
    box-shadow: 0 4px 12px rgba(58, 110, 165, 0.3);
}

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

.avatar-change-btn {
    background: #6c757d;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    display: block;
    margin: 10px auto;
    transition: all 0.3s ease;
}

.avatar-change-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* 图片剪切器模态框样式 */
.image-cropper-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-cropper-modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.cropper-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.cropper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.cropper-header h3 {
    margin: 0;
    color: #333;
}

.cropper-close {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.cropper-upload-btn {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
}

.cropper-canvas-container {
    position: relative;
    display: inline-block;
    max-width: 500px;
    max-height: 400px;
}

.cropper-canvas {
    max-width: 100%;
    max-height: 400px;
    display: block;
}

.crop-overlay {
    position: absolute;
    border: 2px solid #3a6ea5;
    cursor: move;
    background: rgba(58, 110, 165, 0.1);
}

.crop-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #3a6ea5;
    border: 1px solid white;
    cursor: nw-resize;
}

.crop-handle.nw {
    top: -4px;
    left: -4px;
    cursor: nw-resize;
}

.crop-handle.ne {
    top: -4px;
    right: -4px;
    cursor: ne-resize;
}

.crop-handle.sw {
    bottom: -4px;
    left: -4px;
    cursor: sw-resize;
}

.crop-handle.se {
    bottom: -4px;
    right: -4px;
    cursor: se-resize;
}

.cropper-preview-container {
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cropper-actions {
    margin-top: 20px;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.cropper-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.cropper-btn.primary {
    background: #3a6ea5;
    color: white;
}

.cropper-btn.primary:hover {
    background: #2c5aa0;
}

.cropper-btn.secondary {
    background: #6c757d;
    color: white;
}

.cropper-btn.secondary:hover {
    background: #5a6268;
}

/* 头像相关的最小样式 - 只保留必要的hover效果 */
.avatar-crop-btn:hover {
    background: #2c5aa0 !important;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .multilingual-input textarea,
    .multilingual-input input[type="text"],
    .form-input {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .multilingual-field-container {
        margin-bottom: 15px;
    }

    .save-button {
        font-size: 18px;
        padding: 14px 20px;
    }
    
    .cropper-container {
        max-width: 95vw;
        padding: 15px;
    }
    
    .cropper-canvas-container {
        max-width: 100%;
    }
    
    .avatar-selection {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }
}

/* 上传选项样式 */
.upload-option {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.option-title {
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: left;
}

/* 分隔线样式 */
.option-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.option-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dee2e6;
    z-index: 1;
}

.option-divider span {
    position: relative;
    z-index: 2;
    background: white;
    padding: 0 15px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

/* URL输入容器样式 */
.url-input-container {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.url-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: white;
}

.url-input:focus {
    outline: none;
    border-color: #3a6ea5;
    box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.1);
}

.url-input::placeholder {
    color: #adb5bd;
}

.url-submit-button {
    background-color: #3a6ea5;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.url-submit-button:hover {
    background-color: #2c5aa0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(58, 110, 165, 0.2);
}

.url-submit-button:active {
    transform: translateY(0);
}

.url-submit-button i {
    font-size: 16px;
}

.url-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #6c757d;
    text-align: left;
    line-height: 1.5;
}

/* 上传按钮图标 */
.upload-button i {
    margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .upload-option {
        padding: 15px;
    }

    .url-input-container {
        flex-direction: column;
    }

    .url-submit-button {
        width: 100%;
        justify-content: center;
    }

    .option-title {
        font-size: 14px;
    }
}