/* 侧边栏 */
.editor-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid #dee2e6;
}

.sidebar-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-tabs .nav-tabs {
    flex-shrink: 0;
    border-bottom: 1px solid #dee2e6;
}

.sidebar-tabs .nav-link {
    border: none;
    border-radius: 0;
    padding: 0.75rem 1rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-tabs .nav-link.active {
    color: #d63384;
    background: #fff5f7;
    border-bottom: 2px solid #d63384;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
}

/* 元素库 */
.elements-category {
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.category-header:hover {
    background-color: #e9ecef;
}

.category-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.category-header i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.category-header.collapsed i {
    transform: rotate(-90deg);
}

.category-content {
    padding: 12px;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.category-content.collapsed {
    display: none;
}

/* 确保内联样式优先级 */
.category-content[style*="display: none"] {
    display: none !important;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.element-item {
    text-align: center;
    cursor: move;
    padding: 5px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.element-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
}

.element-preview {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2px;
    background: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
}

.text-preview {
    font-family: 'Noto Serif SC', serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

.wedding-title {
    font-size: 0.9rem;
    color: #d63384;
    font-weight: 600;
}

.wedding-subtitle {
    font-size: 0.7rem;
    color: #6c757d;
}

.couple-names {
    font-size: 0.7rem;
    color: #495057;
    font-weight: 500;
}

.wedding-date {
    font-size: 0.65rem;
    color: #495057;
}

.wedding-location {
    font-size: 0.65rem;
    color: #495057;
}

.element-name {
    font-size: 10px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 模板缩略图 */
.template-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.template-thumbnail {
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.template-thumbnail.active {
    border-color: #d63384;
}

.template-thumbnail:hover {
    border-color: #ffc8dd;
}

.thumbnail-preview {
    height: 80px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.thumbnail-name {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: #495057;
}

/* 左侧设计元素库滚动条样式 */
.editor-sidebar.sidebar-left {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    transition: scrollbar-color 0.3s ease;
}

/* 滚动时显示滚动条 */
.editor-sidebar.sidebar-left::-webkit-scrollbar {
    width: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 滚动时显示滚动条轨道 */
.editor-sidebar.sidebar-left::-webkit-scrollbar-track {
    background: transparent;
}

/* 滚动时显示滚动条滑块 */
.editor-sidebar.sidebar-left::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* 滚动时显示滚动条 */
.editor-sidebar.sidebar-left:hover::-webkit-scrollbar,
.editor-sidebar.sidebar-left:active::-webkit-scrollbar,
.editor-sidebar.sidebar-left:focus::-webkit-scrollbar {
    opacity: 1;
}

/* 滚动时显示滚动条滑块 */
.editor-sidebar.sidebar-left:hover::-webkit-scrollbar-thumb,
.editor-sidebar.sidebar-left:active::-webkit-scrollbar-thumb,
.editor-sidebar.sidebar-left:focus::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.4);
}

/* 滚动条自动隐藏 */
.editor-sidebar.sidebar-left {
    scrollbar-gutter: stable;
}