/* PDF打印工具样式 */

/* 紧凑布局样式 - 参考svg_editor */
.component { 
    padding: 12px 16px; 
    max-width: 1400px; 
    margin: 0 auto; 
}

.bar-panel { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 12px; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    padding: 10px 16px; 
    border-radius: 8px; 
    box-shadow: 0 2px 12px rgba(102,126,234,0.3);
}

.bar { 
    font-size: 20px; 
    font-weight: 600; 
    color: #fff; 
    margin: 0; 
}

.tool-number { 
    font-size: 11px; 
    color: rgba(255,255,255,0.9); 
    background: rgba(255,255,255,0.2); 
    padding: 3px 8px; 
    border-radius: 12px; 
    font-weight: 500;
}

/* PDF打印容器 */
.pdf-print-container { 
    background: #fff; 
    border-radius: 8px; 
    padding: 16px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
}

/* 错误消息 */
.error-message { 
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border: 1px solid #fcc; 
    color: #c33; 
    padding: 10px 14px; 
    border-radius: 6px; 
    margin-bottom: 12px; 
    display: none; 
    font-size: 13px; 
    animation: shake 0.3s ease;
}

.error-message.show { 
    display: block; 
}

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

/* 表单区域 */
.print-form { 
    margin-bottom: 16px; 
}

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

.form-section label { 
    display: block; 
    font-size: 13px; 
    font-weight: 600; 
    color: #334155; 
    margin-bottom: 6px; 
}

/* 文件上传区域 */
.file-upload-area { 
    border: 2px dashed #cbd5e1; 
    border-radius: 8px; 
    padding: 30px; 
    text-align: center; 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
}

.file-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102,126,234,0.1), transparent);
    transition: left 0.5s;
}

.file-upload-area:hover::before {
    left: 100%;
}

.file-upload-area:hover { 
    border-color: #667eea; 
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.file-upload-area.drag-over { 
    border-color: #667eea; 
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    transform: scale(1.02); 
    box-shadow: 0 8px 24px rgba(102,126,234,0.25);
}

.upload-icon { 
    font-size: 36px; 
    margin-bottom: 8px; 
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.upload-text { 
    font-size: 13px; 
    color: #64748b; 
}

.upload-hint {
    font-size: 12px;
    color: #9ca3af;
    display: inline-block;
    margin-top: 4px;
}

.file-input { 
    display: none; 
}

.file-info { 
    display: none; 
    background: #f0fdf4; 
    border: 1px solid #86efac; 
    padding: 10px 14px; 
    border-radius: 6px; 
    margin-top: 10px; 
    align-items: center; 
    justify-content: space-between; 
}

.file-info.show { 
    display: flex; 
}

.file-name { 
    font-size: 13px; 
    color: #15803d; 
    font-weight: 500; 
    flex: 1; 
}

.file-remove { 
    background: #ef4444; 
    color: #fff; 
    border: none; 
    padding: 4px 12px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 12px; 
    transition: background 0.2s; 
}

.file-remove:hover { 
    background: #dc2626; 
}

/* 表单行 */
.form-row { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
}

/* 输入框 */
.input-field, .select-field { 
    width: 100%; 
    padding: 8px 12px; 
    border: 1px solid #cbd5e1; 
    border-radius: 6px; 
    font-size: 13px; 
    transition: all 0.2s; 
    box-sizing: border-box; 
    background: #fff;
}

.input-field:hover, .select-field:hover {
    border-color: #94a3b8;
}

.input-field:focus, .select-field:focus { 
    outline: none; 
    border-color: #667eea; 
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1); 
    transform: translateY(-1px);
}

.input-field.error {
    border-color: #ef4444;
    animation: shake 0.3s ease;
}

.input-field:disabled, .select-field:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 按钮组 */
.button-group { 
    display: flex; 
    gap: 10px; 
    margin-top: 16px; 
}

.btn { 
    flex: 1; 
    padding: 10px 16px; 
    border: none; 
    border-radius: 6px; 
    font-size: 13px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
}

.btn-primary { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    color: #fff; 
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

.btn-primary:hover:not(:disabled) { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 16px rgba(102,126,234,0.4); 
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 100%);
}

.btn-secondary { 
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569; 
    border: 1px solid #cbd5e1; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-secondary:hover:not(:disabled) { 
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-reset { 
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e; 
    border: 1px solid #fcd34d; 
    box-shadow: 0 1px 3px rgba(245,158,11,0.2);
}

.btn-reset:hover:not(:disabled) { 
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}

/* 加载状态 */
.loading { 
    display: none; 
    text-align: center; 
    padding: 30px; 
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px; 
    margin-top: 16px; 
    border: 1px solid #e2e8f0;
}

.loading.show { 
    display: block; 
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.spinner { 
    border: 3px solid #e2e8f0; 
    border-top: 3px solid #667eea; 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    animation: spin 1s linear infinite; 
    margin: 0 auto 12px; 
}

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

.loading p {
    color: #64748b;
    font-size: 13px;
    margin: 0;
}

/* 预览区域 */
.preview-section { 
    display: none; 
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); 
    border: 1px solid #86efac; 
    padding: 14px; 
    border-radius: 8px; 
    margin-top: 16px; 
    box-shadow: 0 2px 12px rgba(16,185,129,0.15);
}

.preview-section.show { 
    display: block; 
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 8px; 
}

.preview-title { 
    font-size: 14px; 
    font-weight: 600; 
    color: #065f46; 
}

.preview-hint {
    color: #065f46;
    font-size: 13px;
    margin: 8px 0 0 0;
    line-height: 1.6;
}

.print-link { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff; 
    padding: 8px 16px; 
    border-radius: 6px; 
    text-decoration: none; 
    font-size: 13px; 
    font-weight: 600; 
    transition: all 0.2s; 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

.print-link:hover { 
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px); 
    box-shadow: 0 6px 16px rgba(16,185,129,0.4); 
}

/* 提示区域 */
.tips-section { 
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); 
    border-left: 4px solid #667eea; 
    padding: 12px 14px; 
    border-radius: 6px; 
    margin-top: 10px; 
    box-shadow: 0 1px 3px rgba(102,126,234,0.1);
}

.tips-section h4 { 
    font-size: 14px; 
    color: #3730a3; 
    margin: 0 0 8px 0; 
}

.tips-section ul { 
    margin: 6px 0; 
    padding-left: 20px; 
}

.tips-section li { 
    font-size: 12px; 
    color: #4338ca; 
    line-height: 1.8; 
    margin: 3px 0; 
}

.tips-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left-color: #10b981;
    box-shadow: 0 1px 3px rgba(16,185,129,0.1);
}

.tips-success h4 {
    color: #065f46;
}

.tips-success li {
    color: #047857;
}

.tips-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: #f59e0b;
    box-shadow: 0 1px 3px rgba(245,158,11,0.1);
}

.tips-warning h4 {
    color: #92400e;
}

.tips-warning li {
    color: #b45309;
}

/* Toast消息 */
.toast { 
    position: fixed; 
    top: 20px; 
    right: 20px; 
    background: #334155; 
    color: #fff; 
    padding: 12px 18px; 
    border-radius: 8px; 
    font-size: 13px; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.2); 
    z-index: 10000; 
    display: none; 
    animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(4px);
}

.toast.show { 
    display: block; 
}

.toast.success { 
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 24px rgba(16,185,129,0.3);
}

.toast.error { 
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 24px rgba(239,68,68,0.3);
}

@keyframes slideIn { 
    from { 
        transform: translateX(400px) scale(0.8);
        opacity: 0; 
    } 
    to { 
        transform: translateX(0) scale(1);
        opacity: 1; 
    } 
}

/* 复选框组 */
.checkbox-group { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 12px; 
}

.checkbox-item { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: #f1f5f9;
}

.checkbox-item input[type="checkbox"] { 
    width: 16px; 
    height: 16px; 
    cursor: pointer; 
    accent-color: #667eea;
}

.checkbox-item label { 
    font-size: 13px; 
    color: #475569; 
    cursor: pointer; 
    font-weight: normal; 
    margin: 0; 
    user-select: none;
}

/* 响应式 */
@media (max-width: 1024px) {
    .component {
        padding: 10px 12px;
    }
    
    .pdf-print-container {
        padding: 14px;
    }
}

@media (max-width: 768px) {
    .form-row { 
        grid-template-columns: 1fr; 
    }
    .button-group { 
        flex-direction: column; 
    }
    
    .bar-panel {
        padding: 8px 12px;
    }
    
    .file-upload-area {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .component {
        padding: 8px;
    }
    
    .pdf-print-container {
        padding: 12px;
        border-radius: 6px;
    }
    
    .bar {
        font-size: 18px;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .print-link {
        width: 100%;
        justify-content: center;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}
