/* 通用工具布局样式 */
.tool-title-bar {
    margin-bottom: 24px;
    text-align: center;
}

.tool-title-bar h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px 0;
}

.tool-title-bar p {
    font-size: 16px;
    color: var(--text-light);
    margin: 0;
}

.member-notice {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
    color: #856404;
}

.member-notice i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
}

.left-panel, .right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-section, .upload-section, .preview-section, .actions-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.settings-section h3, .upload-section h3, .preview-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-section h3 {
    justify-content: space-between;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    color: var(--text);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.range-control {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    outline: none;
}

.range-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102,126,234,0.3);
}

.range-value {
    display: inline-block;
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: var(--primary);
    margin-left: 8px;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker {
    width: 50px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.btn-info {
    background: #4299e1;
    color: white;
}

.btn-info:hover {
    background: #3182ce;
}

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

.btn-secondary:hover {
    background: #4a5568;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 上传区域 */
.upload-area {
    border: 3px dashed var(--border);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
    position: relative;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(102,126,234,0.05);
}

.upload-area i {
    font-size: 48px;
    color: #cbd5e0;
    margin-bottom: 12px;
    display: block;
}

.upload-area h3 {
    font-size: 18px;
    margin: 0 0 8px 0;
    color: var(--text);
}

.upload-area p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 形状网格 */
.shape-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.shape-card {
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.shape-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.shape-card.active {
    border-color: var(--primary);
    background: rgba(102,126,234,0.05);
}

.shape-preview {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.shape-card span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

/* 预览区域 */
.preview-container {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed var(--border);
    overflow: hidden;
}

/* 图片形状裁剪特定样式 */
.image-shape-crop-container {
    max-width: 1200px;
    margin: 0 auto;
}

.crop-workspace {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 30px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    min-height: 600px;
}

.upload-panel, .tools-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e9ecef;
}

.canvas-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f6fa;
    border-radius: 15px;
    border: 2px dashed #dee2e6;
    position: relative;
    min-height: 500px;
}

.upload-zone {
    border: 2px dashed #007bff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    margin-bottom: 20px;
}

.upload-zone:hover {
    border-color: #0056b3;
    background: #f0f8ff;
}

.upload-zone.dragover {
    border-color: #28a745;
    background: #d4edda;
}

.shape-selector {
    margin-bottom: 25px;
}

.shape-btn {
    aspect-ratio: 1;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
}

.shape-btn:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

.shape-btn.active {
    border-color: #007bff;
    background: #e3f2fd;
    color: #007bff;
}

.shape-btn .shape-name {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #666;
}

.crop-canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.controls-section {
    margin-bottom: 20px;
}

.controls-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.premium-notice {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

.slider-control {
    margin-bottom: 15px;
}

.slider-control label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.slider {
    width: 100%;
    margin-bottom: 10px;
}

.operation-tips {
    margin-top: 15px;
    padding: 12px;
    background: #f0f8ff;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.operation-tips h4 {
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .crop-workspace {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .upload-panel, .tools-panel {
        order: 1;
    }

    .canvas-area {
        order: 2;
        min-height: 400px;
    }
}
