/* 选择器主布局 */
.picker-layout {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.picker-left {
    flex: 1 1 320px;
    min-width: 0;
}
.picker-right {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
/* HSV 面板 */
.sv-panel {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 0.75rem;
    cursor: crosshair;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    touch-action: none;
    user-select: none;
}
.sv-panel .sv-white {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #fff, transparent);
    pointer-events: none;
}
.sv-panel .sv-black {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000, transparent);
    pointer-events: none;
}
.sv-panel .sv-cursor {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: left, top;
}
/* 色相条 */
.hue-slider {
    position: relative;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(to right,
        #ff0000 0%, #ffff00 17%, #00ff00 33%,
        #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    touch-action: none;
    user-select: none;
    margin-top: 0.5rem;
}
.hue-slider .hue-cursor {
    position: absolute;
    top: 50%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: left;
}
/* 透明度条 */
.alpha-slider {
    position: relative;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    touch-action: none;
    user-select: none;
    margin-top: 0.5rem;
    overflow: hidden;
    /* 棋盘格背景 */
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
    background-color: #fff;
}
.alpha-slider .alpha-color-bar {
    position: absolute;
    inset: 0;
    border-radius: 10px;
}
.alpha-slider .alpha-cursor {
    position: absolute;
    top: 50%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: left;
    z-index: 2;
}
/* 右侧颜色预览 */
.color-preview-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    /* 棋盘格背景 */
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    background-color: #fff;
}
.color-preview-box .color-preview-fill {
    position: absolute;
    inset: 0;
}

/* 格式展示行（仿照截图样式） */
.format-display-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: #f8f9fa;
    border-radius: 0.35rem;
    margin-bottom: 0.5rem;
    transition: background-color 0.15s;
}
.format-display-row:hover {
    background-color: #e9ecef;
}
.format-display-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    min-width: 55px;
    flex-shrink: 0;
}
.format-display-value {
    flex: 1;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    color: #212529;
    word-break: break-all;
    user-select: all;
    cursor: text;
}
.format-display-row .btn-copy-icon {
    padding: 0.2rem;
    color: #6c757d;
    border: none;
    background: none;
    border-radius: 0.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.format-display-row .btn-copy-icon:hover {
    color: #0d6efd;
    background-color: #dee2e6;
}

/* 常用色板 */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.35rem;
}
.preset-swatch {
    aspect-ratio: 1 / 1;
    border-radius: 0.35rem;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #dee2e6;
    transition: transform 0.12s, box-shadow 0.12s;
}
.preset-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px #0d6efd, 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 1;
}
/* 历史记录 */
.history-swatches {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.history-swatch {
    width: 32px;
    height: 32px;
    border-radius: 0.4rem;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #dee2e6;
    transition: transform 0.12s;
    position: relative;
    overflow: hidden;
}
.history-swatch:hover {
    transform: scale(1.12);
    box-shadow: 0 0 0 2px #0d6efd;
}
/* 区块标题 */
.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
}
.section-title i {
    color: #0d6efd;
    margin-right: 0.4rem;
}
/* Toast 提示 */
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #212529;
    color: #fff;
    padding: 0.6rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
/* 工具描述 */
.tool-description {
    background-color: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    font-size: 0.95rem;
    color: #6c757d;
    border-left: 4px solid #0d6efd;
}
