
/* 编辑器左右布局 */
.clip-editor-layout {
    display: flex;
    gap: 25px;
    height: 600px;
}
.clip-editor-left {
    flex: 0 0 340px;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.clip-editor-right {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding-right: 5px;
}
.clip-editor-right::-webkit-scrollbar {
    width: 6px;
}
.clip-editor-right::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
.clip-editor-right::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}
.clip-editor-right::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
.clip-editor-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 6px;
}
.clip-editor-section-title i {
    font-size: 18px;
}
.clip-editor-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.clip-editor-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* 形状类型选项卡 */
.clip-shape-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: wrap;
}
.clip-shape-tab {
    padding: 10px 22px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.clip-shape-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.clip-shape-tab.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
.clip-shape-tab i {
    font-size: 18px;
}

/* 预览区域 */
.clip-preview-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    width: 100%;
    flex: 1;
}
.clip-preview-container {
    width: 100%;
    height: 100%;
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}
/* 棋盘格背景 */
.clip-preview-container.bg-light {
    background-color: #f0f0f0;
    background-image: linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
.clip-preview-container.bg-dark {
    background-color: #2c3e50;
    background-image: linear-gradient(45deg, #34495e 25%, transparent 25%),
    linear-gradient(-45deg, #34495e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #34495e 75%),
    linear-gradient(-45deg, transparent 75%, #34495e 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
.clip-preview-container.bg-image {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><rect fill="%234CAF50" width="300" height="300"/><circle fill="%23FF9800" cx="150" cy="150" r="80"/><rect fill="%232196F3" x="20" y="20" width="60" height="60"/><rect fill="%23E91E63" x="220" y="220" width="60" height="60"/><polygon fill="%23FFEB3B" points="150,30 180,90 120,90"/></svg>');
    background-size: cover;
}
.clip-preview-shape {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: clip-path 0.15s ease;
}
/* 多边形顶点拖拽点 */
.clip-vertex-point {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    cursor: grab;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: box-shadow 0.2s;
}
.clip-vertex-point:hover,
.clip-vertex-point.dragging {
    box-shadow: 0 0 0 4px rgba(33,150,243,0.3);
    cursor: grabbing;
}
.clip-vertex-point .clip-vertex-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
}

/* 背景切换按钮 */
.clip-bg-toggle-group {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
    margin-top: 10px;
}
.clip-bg-toggle-btn {
    padding: 6px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.3s;
}
.clip-bg-toggle-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.clip-bg-toggle-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 参数控制面板 */
.clip-params-panel {
    display: none;
}
.clip-params-panel.active {
    display: block;
}
.clip-param-row {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
}
.clip-param-label {
    width: 90px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
    flex-shrink: 0;
}
.clip-param-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    accent-color: #2196F3;
}
.clip-param-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.clip-param-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.clip-param-value {
    width: 55px;
    text-align: center;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    background: #e3f2fd;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* 多边形顶点列表 */
.clip-vertex-list {
    margin-top: 10px;
}
.clip-vertex-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #eee;
}
.clip-vertex-item .clip-vertex-index {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 700;
    width: 20px;
    flex-shrink: 0;
}
.clip-vertex-item input[type="number"] {
    width: 65px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    outline: none;
}
.clip-vertex-item input[type="number"]:focus {
    border-color: var(--primary-color);
}
.clip-vertex-item .clip-vertex-delete {
    width: 24px;
    height: 24px;
    border: none;
    background: #ffebee;
    color: #e53935;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.clip-vertex-item .clip-vertex-delete:hover {
    background: #e53935;
    color: white;
}
.clip-vertex-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.clip-vertex-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* 预设形状网格 */
.clip-presets-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 0;
}
.clip-preset-card {
    background: #f8f9fa;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}
.clip-preset-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33,150,243,0.15);
}
.clip-preset-card.active {
    border-color: var(--primary-color);
    background: #e3f2fd;
}
.clip-preset-preview {
    width: 50px;
    height: 50px;
    margin: 0 auto 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.clip-preset-name {
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

/* 代码输出区域 */
.clip-code-output {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    margin-top: 0;
    position: relative;
    min-height: 80px;
}
.clip-code-output pre {
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.clip-code-output .clip-code-property {
    color: #9cdcfe;
}
.clip-code-output .clip-code-value {
    color: #ce9178;
}
.clip-code-output .clip-code-punctuation {
    color: #d4d4d4;
}
.clip-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.clip-copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}
.clip-copy-btn.copied {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

/* 预览颜色选择 */
.clip-color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}
.clip-color-picker-row label {
    font-size: 13px;
    color: #555;
}
.clip-color-picker-row input[type="color"] {
    width: 36px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

/* 响应式补充 */
@media (max-width: 992px) {
    .clip-editor-layout {
    flex-direction: column;
    height: auto;
    }
    .clip-editor-left {
    flex: none;
    max-width: 100%;
    width: 100%;
    height: auto;
    }
    .clip-editor-right {
    overflow-y: visible;
    }
    .clip-preview-wrapper {
    flex: none;
    }
    .clip-preview-container {
    height: 340px;
    max-width: 360px;
    margin: 0 auto;
    }
}
@media (max-width: 768px) {
    .clip-presets-grid {
    grid-template-columns: repeat(3, 1fr);
    }
    .clip-shape-tabs {
    gap: 6px;
    }
    .clip-shape-tab {
    padding: 8px 14px;
    font-size: 13px;
    }
}
@media (max-width: 480px) {
    .clip-presets-grid {
    grid-template-columns: repeat(2, 1fr);
    }
    .clip-param-row {
    flex-wrap: wrap;
    }
    .clip-param-label {
    width: 80px;
    }
}