.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.category-card.disabled {
    opacity: 0.6;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.category-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.category-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-info .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

.category-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


.category-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.category-actions .btn {
    flex: 1;
    min-width: 90px;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.category-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-actions .btn i {
    font-size: 0.9rem;
}

.add-category-card {
    border: 2px dashed var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    cursor: pointer;
    color: var(--text-muted);
}

.add-category-card:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.add-category-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.section-header .d-flex {
    flex-wrap: wrap;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-body .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-left: 0;
}

.modal-body .form-check-input {
    width: 1.1em;
    height: 1.1em;
    margin: 0;
    margin-top: 0.1em;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid var(--glass-border);
    border-radius: 0.25rem;
    background-color: var(--glass-bg);
    transition: all 0.2s ease;
}

.modal-body .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

.modal-body .form-check-input:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb, 0, 123, 255), 0.25);
}

.modal-body .form-check-label {
    margin-bottom: 0;
    margin-left: 0;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.icon-picker {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

/* 深色主题下的图标选择器 */
[data-bs-theme="dark"] .icon-picker,
.modal[data-bs-theme="dark"] .icon-picker {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .icon-option,
.modal[data-bs-theme="dark"] .icon-option {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .icon-option:hover,
.modal[data-bs-theme="dark"] .icon-option:hover {
    background: rgba(99, 102, 241, 0.2);
}

[data-bs-theme="dark"] .icon-option.selected,
.modal[data-bs-theme="dark"] .icon-option.selected {
    background: var(--primary);
    color: white;
}

.icon-option {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.icon-option:hover {
    background: var(--glass-bg-hover);
}

.icon-option.selected {
    background: var(--primary);
    color: white;
}


/* 浮动图标大全按钮 */
.icon-helper-floating-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1050;
    transition: all 0.3s;
}

.icon-helper-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: var(--primary-hover, #0056b3);
}

/* 浮动图标大全面板 */
.icon-helper-panel-floating {
    position: fixed;
    bottom: 90px;
    right: 2rem;
    width: 600px;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 120px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 1049;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

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

.icon-helper-panel-floating .icon-helper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

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

@media (max-width: 768px) {
    .icon-helper-panel-floating {
        width: calc(100vw - 2rem);
        right: 1rem;
        bottom: 80px;
        max-height: calc(100vh - 100px);
    }
    
    .icon-helper-floating-btn {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

.icon-helper-panel-floating .icon-helper-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
}

.icon-helper-panel-floating .icon-helper-close:hover {
    color: var(--text-primary);
}

.icon-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

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

.icon-cat-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    padding: 0.5rem 0;
}

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

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

.icon-item.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.icon-item i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.icon-item .icon-name {
    font-size: 0.7rem;
    text-align: center;
    word-break: break-all;
}

/* 深色主题下的图标选择器 */
[data-bs-theme="dark"] .icon-picker,
.modal[data-bs-theme="dark"] .icon-picker {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .icon-option,
.modal[data-bs-theme="dark"] .icon-option {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .icon-option:hover,
.modal[data-bs-theme="dark"] .icon-option:hover {
    background: rgba(99, 102, 241, 0.2);
}

[data-bs-theme="dark"] .icon-option.selected,
.modal[data-bs-theme="dark"] .icon-option.selected {
    background: var(--primary);
    color: white;
}

/* 深色主题下的表单复选框 */
[data-bs-theme="dark"] .modal-body .form-check-input,
.modal[data-bs-theme="dark"] .modal-body .form-check-input {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-bs-theme="dark"] .modal-body .form-check-input:checked,
.modal[data-bs-theme="dark"] .modal-body .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
