/* 图片切割工具专用样式 */

.btn:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}

#uploadArea {
    border: 2px dashed #e5e6eb;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
    background: #fff;
}

#uploadArea:hover {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.03);
}

#uploadArea .upload-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

#uploadArea h3 {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

#uploadArea p {
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
}

#uploadArea .upload-btn {
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    border: none;
    color: white;
    padding: 12px 40px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

#uploadArea .upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

#fileInput {
    display: none;
}

#previewSection {
    border: 2px dashed #00d4ff;
    border-radius: 12px;
    padding: 20px;
    background: #fff;
    position: relative;
}

#previewSection .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #ff4d4d;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#previewSection .close-btn:hover {
    background: #ff3333;
    transform: scale(1.1);
}

#imagePreview {
    max-width: 100%;
    max-height: 400px;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    background: #f8f9fa;
}

.status-bar {
    background: #dcfce7;
    border-radius: 8px;
    padding: 12px 20px;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: #166534;
    font-weight: 500;
}

.status-bar.error {
    background: #fee2e2;
    border-color: rgba(239, 68, 68, 0.3);
}

.status-bar.info {
    background: #dbeafe;
    border-color: rgba(59, 130, 246, 0.3);
}

.progress-container {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f1f5;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s;
}

.region-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.region-section h3 {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.region-section h3 span {
    font-weight: 400;
    color: #999;
    font-size: 13px;
}

.select-all-btn {
    padding: 6px 14px;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}

.select-all-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.region-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.region-item {
    background: #fff;
    border: 1px solid #e5e6eb;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.region-item:hover {
    border-color: #667eea;
}

.region-item.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.region-item.selected::after {
    content: '✓';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.region-item img {
    max-width: 100%;
    max-height: 70px;
    border-radius: 8px;
    background: #f8f9fa;
}

.region-item .region-name {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.settings-area {
    margin-top: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f1f5;
}

.settings-area h3 {
    font-size: 15px;
    color: #222;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f1f5;
    position: relative;
}

.settings-area h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
    border-radius: 2px;
}

.settings-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.settings-row label {
    font-size: 14px;
    color: #555;
    min-width: 100px;
    font-weight: 500;
}

.settings-row input[type="text"],
.settings-row input[type="number"] {
    padding: 11px 15px;
    border: 1.5px solid #e5e6eb;
    border-radius: 10px;
    font-size: 14px;
    min-width: 160px;
    background: #fff;
    transition: all 0.25s;
}

.settings-row input[type="text"]:focus,
.settings-row input[type="number"]:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.settings-row input[type="range"] {
    flex: 1;
    min-width: 200px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e6eb;
    border-radius: 3px;
    cursor: pointer;
}

.settings-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
}

.settings-row span.value {
    min-width: 45px;
    text-align: right;
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.filename-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.filename-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filename-item label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.filename-item input[type="text"] {
    padding: 11px 14px;
    border: 1.5px solid #e5e6eb;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    transition: all 0.25s;
}

.filename-item input[type="text"]:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.same-size-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.25s;
}

.same-size-card:hover {
    border-color: #cbd5e1;
}

.size-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.same-size-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.same-size-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00d4ff;
    transition: all 0.2s;
}

.same-size-label input[type="checkbox"]:hover {
    transform: scale(1.05);
}

.same-size-label .label-text {
    font-size: 14px;
    color: #2d3748;
    font-weight: 500;
}

#sizeInputs {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

#sizeInputs input {
    width: 75px;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
    transition: all 0.25s;
}

#sizeInputs input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

#sizeInputs .size-separator {
    font-size: 15px;
    color: #94a3b8;
    font-weight: 600;
}

#sizeInputs .size-unit {
    font-size: 13px;
    color: #94a3b8;
    margin-left: 4px;
    font-weight: 500;
}

.bg-color-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.bg-color-display span.label {
    font-size: 13px;
    color: #666;
}

.bg-color-display span.value {
    font-size: 13px;
    color: #22c55e;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.success-modal {
    max-width: 400px;
    text-align: center;
}

.success-header {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    padding: 24px;
    border-radius: 12px 12px 0 0;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.success-header h3 {
    font-size: 20px;
    color: #22c55e;
    margin: 0;
}

.success-content {
    padding: 20px 24px;
}

.success-content p {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.success-hint {
    font-size: 13px;
    color: #999;
    margin-bottom: 20px !important;
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.qr-code {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-icon {
    font-size: 50px;
}

.qr-label {
    font-size: 12px;
    color: #999;
}

.success-actions {
    display: flex;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e6eb;
}

.success-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-secondary {
    border: 1px solid #e5e6eb;
    background: #fff;
    color: #666;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #999;
}

.modal-content {
    padding: 20px;
}

.modal-content img {
    max-width: 100%;
    max-height: 350px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    background: #f8f9fa;
    border: 1px solid #e5e6eb;
}

.modal-tools {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.tool-btn {
    padding: 12px 24px;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    transition: all 0.2s;
}

.tool-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.tool-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.modal-actions .btn-cancel {
    border: 1px solid #e5e6eb;
    background: #fff;
    color: #666;
}

.modal-actions .btn-cancel:hover {
    background: #f8f9fa;
}

.modal-actions .btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.modal-actions .btn-download {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
}

#editCanvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: block;
    margin: 0 auto;
    cursor: crosshair;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.edit-modal {
    width: 680px;
    max-width: 96%;
    height: 700px;
    max-height: 96vh;
    position: relative;
    box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.25);
}

.edit-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e6eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.edit-modal .modal-header h3 {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.edit-modal .modal-close {
    width: 34px;
    height: 34px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 17px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.edit-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.edit-modal .modal-content {
    padding: 14px 20px;
    height: calc(100% - 58px);
    overflow-y: auto;
}

.canvas-container {
    width: 100%;
    height: 360px;
    overflow: auto;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #e5e6eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
}

.canvas-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.canvas-container::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.canvas-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.canvas-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.edit-tools {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.edit-tools .tool-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.edit-tools .tool-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.edit-tools .tool-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.brush-settings {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e6eb;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.brush-settings label {
    font-size: 12px;
    color: #555;
    font-weight: 500;
    min-width: 55px;
}

.brush-settings input[type="range"] {
    flex: 1;
    height: 6px;
    background: #e5e6eb;
    border-radius: 3px;
    appearance: none;
    cursor: pointer;
}

.brush-settings input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.3);
    transition: transform 0.15s;
}

.brush-settings input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.brush-settings span {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

.zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e6eb;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.zoom-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

#zoomValue {
    font-size: 12px;
    color: #555;
    font-weight: 600;
    min-width: 55px;
    text-align: center;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.edit-modal .modal-actions {
    display: flex;
    gap: 8px;
}

.edit-modal .modal-actions button {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.edit-modal .btn-cancel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #666;
    border: 1px solid #e5e6eb;
}

.edit-modal .btn-cancel:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.edit-modal .btn-download {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.edit-modal .btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.4);
}

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

.edit-modal .btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}