.designer-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--glass-border);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(10px);
}

.designer-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.designer-title p {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.designer-main {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.field-types-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-body {
    padding: 0.75rem;
}

.field-type-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.5rem 0.25rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

.field-type-group-label:first-child {
    margin-top: 0;
    border-top: none;
}

.field-type-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.field-type-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s;
}

.field-type-item:hover::before {
    left: 100%;
}

.field-type-item:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.05));
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.field-type-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.3s;
}

.field-type-item:hover .field-type-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.field-type-info {
    flex: 1;
    min-width: 0;
}

.field-type-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.field-type-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.preview-area {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.preview-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.05));
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-header h3 i {
    color: var(--primary);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding: 1.5rem;
    min-height: 400px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02), rgba(236, 72, 153, 0.01));
}

@media (max-width: 1100px) {
    .preview-grid {
        grid-template-columns: 1fr;
    }
}

.preview-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.preview-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.preview-panel:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
}

.preview-panel:hover::before {
    transform: scaleX(1);
}

.preview-panel.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 8px 24px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.preview-panel.selected::before {
    transform: scaleX(1);
}

.preview-panel-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-panel-header .panel-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-panel-actions {
    display: flex;
    gap: 0.25rem;
}

.preview-panel-actions button {
    width: 26px;
    height: 26px;
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.preview-panel-actions button:hover {
    background: rgba(255,255,255,0.35);
    transform: scale(1.1);
}

.preview-panel-actions button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.preview-panel-actions button.delete:hover {
    background: rgba(220, 53, 69, 0.9);
    transform: scale(1.15);
}

.preview-panel.field-hidden {
    opacity: 0.6;
    border-style: dashed;
}

.preview-panel.field-hidden .preview-panel-header {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.3), rgba(75, 85, 99, 0.2));
}

.preview-panel.field-readonly {
    border-left: 3px solid var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(236, 72, 153, 0.02));
}

.preview-panel.field-readonly .preview-panel-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.1));
}

.preview-panel-body {
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
}

.preview-panel-body::-webkit-scrollbar {
    width: 6px;
}

.preview-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.preview-panel-body::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

.preview-panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

.preview-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    margin-bottom: 0.3rem;
    background: var(--glass-bg);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.preview-option:hover {
    border-color: var(--primary);
}

.preview-option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.preview-option-icon {
    width: 20px;
    text-align: center;
    font-size: 0.85rem;
}

.preview-empty-slot {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.preview-empty-slot:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.preview-empty-slot i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.props-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-top: 1rem;
    overflow: hidden;
}

.props-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.05));
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.props-header i {
    color: var(--primary);
}

.props-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    padding: 1.25rem;
}

@media (max-width: 1400px) {
    .props-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .props-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .designer-main {
        grid-template-columns: 1fr;
    }
    .props-grid {
        padding: 1rem;
        gap: 1rem;
    }
}

.props-group {
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    min-width: 0; /* 防止内容溢出 */
}

.props-group:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.props-group-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.props-field {
    margin-bottom: 0.6rem;
}

.props-field:last-child {
    margin-bottom: 0;
}

.props-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.props-field input,
.props-field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s;
    min-width: 0; /* 防止溢出 */
    box-sizing: border-box;
}

.props-field input:focus,
.props-field select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.props-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}

.props-checkbox input {
    width: auto;
}

.options-editor {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    max-height: 120px;
    overflow-y: auto;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.option-row.category-row {
    background: var(--glass-bg-hover);
    font-weight: 600;
    padding: 0.6rem 0.75rem;
}

.option-row.item-row {
    padding-left: 2rem;
    background: rgba(255, 255, 255, 0.02);
}

.option-icon-input {
    width: 80px;
    min-width: 80px;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.75rem;
}

.option-label-input {
    flex: 1;
    min-width: 120px;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.8rem;
}

.option-row:last-child {
    border-bottom: none;
}

.option-row input.option-input {
    flex: 1;
    min-width: 120px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.option-row button {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.option-row button:hover {
    color: var(--danger);
}

.add-option-btn {
    width: 100%;
    padding: 0.4rem;
    border: 1px dashed var(--glass-border);
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.4rem;
}

.add-option-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.designer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-top: 1rem;
}

.no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
}

.no-selection i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* 浮动图标大全按钮 - 改为右上角 */
.icon-helper-btn {
    position: fixed;
    top: 1rem;
    right: calc(var(--sidebar-width, 260px) + 1rem);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.icon-helper-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.6);
}

/* 侧边栏折叠时的适配 */
.sidebar-collapsed .icon-helper-btn {
    right: calc(var(--sidebar-collapsed-width, 72px) + 1rem);
}

/* 图标大全面板 - 改为从右上角展开 */
.icon-helper-panel {
    position: fixed;
    top: 4rem;
    right: calc(var(--sidebar-width, 260px) + 1rem);
    width: 600px;
    max-height: calc(100vh - 5rem);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    z-index: 997;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

/* 侧边栏折叠时的适配 */
.sidebar-collapsed .icon-helper-panel {
    right: calc(var(--sidebar-collapsed-width, 72px) + 1rem);
}

.icon-helper-panel.show {
    display: flex;
}

.icon-helper-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.icon-helper-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}

.icon-helper-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-helper-close:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.icon-helper-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

/* 图标分类标签 */
.icon-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.icon-cat-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    background: var(--glass-bg);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-cat-btn:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.icon-cat-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: var(--primary);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    overflow-y: auto;
    padding: 0.5rem;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    position: relative;
}

.icon-item:hover {
    border-color: var(--primary);
    background: var(--glass-bg-hover);
    transform: translateY(-2px);
}

.icon-item.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.05));
}

.icon-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.icon-item .icon-name {
    font-size: 0.65rem;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.2;
}

.icon-item.copied {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.icon-item.copied::after {
    content: '已复制';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--success);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    z-index: 10;
}

@media (max-width: 768px) {
    .icon-helper-panel {
        width: calc(100vw - 2rem);
        right: 1rem !important;
        top: 4rem;
        max-height: calc(100vh - 5rem);
    }
    
    .icon-helper-btn {
        right: 1rem !important;
        top: 1rem;
    }
}