/* 编辑器工作区布局 */
.shadow-editor-workspace {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.shadow-editor-preview-side {
    flex: 0 0 42%;
    max-width: 42%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.shadow-editor-settings-side {
    flex: 0 0 58%;
    max-width: 58%;
}

/* 预览区域 */
.shadow-preview-container {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    transition: background-color 0.3s;
}

.shadow-preview-box {
    width: 120px;
    height: 120px;
    background: #2196F3;
    border-radius: 8px;
    transition: box-shadow 0.3s;
}

/* 代码输出区域 */
.shadow-code-output {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.shadow-code-output pre {
    color: #d4d4d4;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.shadow-code-output .code-keyword {
    color: #569cd6;
}

.shadow-code-output .code-value {
    color: #ce9178;
}

.shadow-code-output .code-property {
    color: #9cdcfe;
}

/* 按钮组 */
.shadow-btn-group {
    display: flex;
    gap: 10px;
}

/* 设置区域 */
.shadow-settings-section {
    margin-bottom: 20px;
}

.shadow-settings-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shadow-settings-section-title .material-icons {
    font-size: 18px;
    color: var(--primary-color);
}

/* 预设按钮网格 */
.shadow-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.shadow-preset-btn {
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-family: inherit;
    color: #555;
}

.shadow-preset-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #e3f2fd;
}

.shadow-preset-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

/* 阴影层卡片 */
.shadow-layers-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.shadow-layers-container::-webkit-scrollbar {
    width: 5px;
}

.shadow-layers-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.shadow-layers-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 5px;
}

.shadow-layer-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    background: #fafafa;
    transition: all 0.3s;
}

.shadow-layer-card:hover {
    border-color: #ccc;
}

.shadow-layer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.shadow-layer-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.shadow-layer-delete-btn {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.shadow-layer-delete-btn:hover {
    color: var(--danger-color);
    background: #ffebee;
}

.shadow-layer-delete-btn .material-icons {
    font-size: 18px;
}

/* 滑块+数字输入行 */
.shadow-slider-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.shadow-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shadow-slider-label {
    font-size: 12px;
    color: #777;
    min-width: 55px;
    white-space: nowrap;
}

.shadow-slider-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
    min-width: 0;
}

.shadow-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.shadow-slider-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.shadow-slider-row input[type="number"] {
    width: 55px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.shadow-slider-row input[type="number"]:focus {
    border-color: var(--primary-color);
}

/* 颜色选择器和内凹开关行 */
.shadow-layer-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.shadow-color-picker-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shadow-color-picker-group label {
    font-size: 12px;
    color: #777;
}

.shadow-color-picker-group input[type="color"] {
    width: 32px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.shadow-color-picker-group input[type="text"] {
    width: 100px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-family: "Consolas", "Monaco", monospace;
    outline: none;
    transition: border-color 0.3s;
}

.shadow-color-picker-group input[type="text"]:focus {
    border-color: var(--primary-color);
}

/* 内凹开关 */
.shadow-inset-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shadow-inset-toggle label {
    font-size: 12px;
    color: #777;
}

.shadow-toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

.shadow-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.shadow-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 20px;
    transition: all 0.3s;
}

.shadow-toggle-slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s;
}

.shadow-toggle-switch input:checked + .shadow-toggle-slider {
    background: var(--primary-color);
}

.shadow-toggle-switch input:checked + .shadow-toggle-slider::before {
    transform: translateX(20px);
}

/* 添加阴影层按钮 */
.shadow-add-layer-btn {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: #888;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.shadow-add-layer-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #e3f2fd;
}

.shadow-add-layer-btn .material-icons {
    font-size: 20px;
}

/* 颜色设置 */
.shadow-color-settings-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.shadow-color-setting-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shadow-color-setting-item label {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}

.shadow-color-setting-item input[type="color"] {
    width: 36px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

/* 响应式断点768px */
@media (max-width: 768px) {
    .shadow-editor-workspace {
        flex-direction: column;
    }

    .shadow-editor-preview-side,
    .shadow-editor-settings-side {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .shadow-preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shadow-slider-grid {
        grid-template-columns: 1fr;
    }

    .shadow-slider-row input[type="number"] {
        width: 50px;
    }
}