/**
 * PDF水印工具 - 样式文件
 * 版本: 1.0.0
 * 作者: Inspiration Template
 */

* {
    box-sizing: border-box;
}

.pdf-watermark-container {
    padding: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

.watermark-form {
    background: linear-gradient(to bottom, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-section {
    margin-bottom: 12px;
}

.form-section label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    font-size: 12px;
}

.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    padding: 18px;
    text-align: center;
    background: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
    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(59, 130, 246, 0.1), transparent);
    transition: left 0.5s;
}

.file-upload-area:hover::before {
    left: 100%;
}

.file-upload-area:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.file-upload-area.dragover {
    border-color: #2563eb;
    background: #dbeafe;
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.upload-icon {
    font-size: 36px;
    color: #9ca3af;
    margin-bottom: 8px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.upload-text {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
}

.file-input {
    display: none;
}

.file-info {
    display: none;
    background: linear-gradient(135deg, #fff 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info.show {
    display: flex;
}

.file-name {
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}

.file-name::before {
    content: '📄 ';
}

.file-remove {
    background: linear-gradient(135deg, #fee 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    white-space: nowrap;
}

.file-remove:hover {
    background: #dc2626;
    color: #fff;
    transform: scale(1.05);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.input-field {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    background: #fff;
}

.input-field:hover {
    border-color: #9ca3af;
}

.input-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.textarea-field {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    resize: vertical;
    min-height: 60px;
    max-height: 120px;
    transition: all 0.2s;
    background: #fff;
    line-height: 1.4;
}

.textarea-field:hover {
    border-color: #9ca3af;
}

.textarea-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.select-field {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.select-field:hover {
    border-color: #9ca3af;
}

.select-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker {
    width: 50px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #e5e7eb 0%, #d1d5db 100%);
    border-radius: 3px;
    outline: none;
    transition: all 0.2s;
}

.slider:hover {
    background: linear-gradient(to right, #d1d5db 0%, #9ca3af 100%);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.4);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.4);
}

.slider-value {
    min-width: 45px;
    text-align: right;
    color: #374151;
    font-weight: 600;
    font-size: 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 3px 6px;
    border-radius: 3px;
    border: 1px solid #bfdbfe;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

@media (max-width: 640px) {
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn {
        width: 100%;
        justify-content: center;
    }
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-reset {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-reset:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-section {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
    display: none;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-section.show {
    display: block;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.preview-title {
    font-size: 14px;
    font-weight: 600;
    color: #065f46;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
}

.download-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.download-link:hover::before {
    left: 100%;
}

.download-link:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.loading {
    display: none;
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 6px;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading.show {
    display: block;
}

.loading p {
    color: #1e40af;
    font-weight: 500;
    font-size: 13px;
    margin: 0;
}

.spinner {
    border: 3px solid #dbeafe;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: linear-gradient(135deg, #fee 0%, #fecaca 100%);
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 10px;
    border-left: 3px solid #dc2626;
    display: none;
    animation: shake 0.5s ease;
    font-size: 12px;
    font-weight: 500;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-message.show {
    display: block;
}

.tips-section {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 3px solid #3b82f6;
    padding: 12px 14px;
    border-radius: 4px;
    margin-top: 12px;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

.tips-section:hover {
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
    transform: translateX(2px);
}

.tips-section h4 {
    color: #1e40af;
    margin: 0 0 6px 0;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tips-section ul {
    margin: 0;
    padding-left: 16px;
    color: #1e3a8a;
    font-size: 11px;
    line-height: 1.5;
}

.tips-section li {
    margin-bottom: 3px;
    padding-left: 3px;
}

.tips-section li::marker {
    color: #3b82f6;
}

.tips-section strong {
    color: #1e40af;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .pdf-watermark-container {
        padding: 10px;
    }
}

@media (max-width: 640px) {
    .watermark-form {
        padding: 14px;
    }
    
    .form-section {
        margin-bottom: 10px;
    }
    
    .file-upload-area {
        padding: 16px;
    }
    
    .upload-icon {
        font-size: 28px;
    }
}

/* 打印样式 */
@media print {
    .btn, .file-upload-area, .tips-section {
        display: none;
    }
}
