.kcp-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.kcp-container {
    font-family: "Arial", sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.kcp-container.kcp-active {
    opacity: 1;
    visibility: visible;
}

.kcp-color-picker {
    width: 300px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    padding: 10px;
    position: relative;
}

.kcp-color-gradient {
    width: 100%;
    height: 150px;
    margin-bottom: 15px;
    position: relative;
    border-radius: 5px;
    overflow: hidden;
}

.kcp-color-cursor {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 1px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.kcp-picker-tools {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.kcp-color-selector {
    width: 100%;
    height: 20px;
    background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
    border-radius: 3px;
    overflow: hidden;
}

.kcp-transparency-bar {
    width: 100%;
    height: 20px;
    background-image: 
        linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%),
        repeating-conic-gradient(#808080 0% 25%, #c0c0c0 0% 50%);
    background-size: 100% 100%, 10px 10px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
    border-radius: 3px;
    overflow: hidden;
}

.kcp-selector-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    background-color: white;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.kcp-opacity-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    background-color: transparent;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.kcp-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.kcp-color-dropper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    background-color: #f0f0f0;
    position: relative;
}

.kcp-color-dropper svg {
    width: 20px;
    height: 20px;
}

.kcp-color-dropper.kcp-active {
    background-color: #e0e0e0;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.2);
}

.kcp-color-preview {
    width: 52px;
    height: 52px;
    border: 1px solid #ddd;
    background-color: #ff0000;
    border-radius: 3px;
}

.kcp-hex-input {
    display: flex;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.kcp-hex-input span {
    padding: 5px 10px;
    background-color: #f0f0f0;
    border-right: 1px solid #ddd;
    font-weight: bold;
}

.kcp-hex-input input {
    flex-grow: 1;
    border: none;
    padding: 5px 10px;
    outline: none;
}

.kcp-rgba-inputs {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 5px;
}

.kcp-rgba-inputs div {
    text-align: center;
    width: 24%;
}

.kcp-rgba-inputs input {
    width: 100%;
    padding: 8px 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    font-size: 16px;
}

.kcp-rgba-inputs span {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

.kcp-action-buttons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.kcp-action-buttons button {
    padding: 5px;
    border: none;
    background-color: #f0f0f0;
    border-radius: 3px;
    cursor: pointer;
}

.kcp-action-buttons button:first-child {
    width: 100%;
}

.kcp-color-presets {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-gap: 5px;
    margin-bottom: 10px;
}

.kcp-preset-color {
    aspect-ratio: 1;
    border-radius: 3px;
    cursor: pointer;
}

.kcp-preset-color:hover {
    transform: scale(1.1);
}

.kcp-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 20px;
    cursor: pointer;
    color: #999;
}

.kcp-close-btn:hover {
    color: #333;
}

.kcp-color-button {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

.kcp-button-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

.kcp-confirm-button {
    padding: 8px 15px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
}

.kcp-cancel-button {
    padding: 8px 15px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 表单集成的颜色选择器样式 */
.kcp-color-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.kcp-color-input-preview {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.kcp-color-input-preview:hover {
    transform: translateY(-50%) scale(1.1);
}

/* 修改input样式 */
input.kcp-color {
    padding-right: 35px;
}

/* 表单中的颜色相关样式 */
.color-item {
    position: relative;
    margin-bottom: 10px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .kcp-color-picker {
        width: 90%;
        max-width: 300px;
    }
    
    .kcp-rgba-inputs {
        flex-wrap: wrap;
    }
    
    .kcp-rgba-inputs div {
        width: 48%;
        margin-bottom: 5px;
    }
} 