:root {
    --primary-color: #2563eb;
    --sidebar-width: 250px;
    --header-height: 56px;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: #f8fafc;
}

.navbar {
    background-color: var(--primary-color);
    padding: 0.5rem 1rem;
    height: var(--header-height);
}

.navbar-brand {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-brand:hover {
    color: rgba(255, 255, 255, 0.9);
}

.btn-light {
    font-weight: 500;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    position: fixed;
    left: 0;
    top: var(--header-height);
    background: white;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    padding: 1rem;
}

.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    margin-top: 20px;
}

/* 导航链接样式 */
.nav-link {
    color: #4b5563;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.nav-link.active {
    background: #e0e7ff;
    color: var(--primary-color);
}

/* 用户下拉菜单样式 */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-dropdown-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.user-dropdown-menu.show {
    display: block;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s;
}

.user-dropdown-item:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}

.user-dropdown-item i {
    margin-right: 0.5rem;
    width: 1.25rem;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

/* 响应式侧边栏控制 */
.sidebar-toggle {
    display: none;
    color: white;
    padding: 0.5rem;
    margin-left: 1rem;
    cursor: pointer;
    border: none;
    background: none;
}

/* 未登录状态的主内容区样式 */
.not-logged-in .main-content {
    margin-left: 0;
}

/* 响应式布局 */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1030;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
    }
}

/* 知识库分类看板样式 */
.categories-section {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    display: flex;
    align-items: center;
    margin: 0.25rem 0;
    min-height: 32px;
    width: 100%;
}

.category-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    margin-right: 0.25rem;
    flex-shrink: 0;
}

.category-name {
    color: #4b5563;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    display: inline-block;
    min-width: 140px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-name:hover {
    background: #f3f4f6;
    color: var(--primary-color);
}

.category-name.active {
    background: #e0e7ff;
    color: var(--primary-color);
    font-weight: 500;
}

.subcategories {
    margin-left: 1.5rem;
    width: calc(100% - 1.5rem);
}

/* 添加工具提示样式 */
.category-name[title] {
    position: relative;
}

.category-name[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    white-space: nowrap;
    margin-top: 5px;
}

/* 知识库卡片网格布局 */
.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.kb-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    transition: all 0.2s;
}

.kb-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transform: translateY(-2px);
}

.kb-uuid {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kb-uuid span {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    font-size: 0.75rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .kb-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-section {
        margin-bottom: 1.5rem;
        padding: 1rem;
    }
} 