/* navbar.css - 加强版，确保在独立加载时不会因为样式覆盖而错位 */
.navbar {
    background: var(--bg-navbar);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-navbar);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 48px;                /* 再次明确高度 */
    display: flex;
    align-items: center;        /* 垂直居中 */
    padding: 0 24px;            /* 左右内边距 */
    margin: 0;                  /* 防止被继承的margin影响 */
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 48px;               /* 与导航栏一致 */
}
.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #0d9488);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}
.nav-links {
    display: flex;
    gap: 2rem;
    margin: 0;                  /* 强制清除 */
    margin-left: 2rem;
    align-items: center;        /* 内部链接垂直居中 */
}
.nav-links a {
    text-decoration: none;
    font-weight: 500;
    color: var(--text-nav-link);
    transition: color 0.2s;
    line-height: 48px;          /* 强制高度以撑满 */
    display: flex;              /* flex */
    align-items: center;        /* 文字垂直居中 */
}
.nav-links a:hover {
    color: var(--color-primary);
}
.nav-links a.active {
    color: var(--color-primary);
}
.user-area {
    display: flex;
    align-items: center;
    gap: 20px;
}
.avatar {
    width: 32px;
    height: 32px;
    background: var(--avatar-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--avatar-text);
    cursor: pointer;
    background-size: cover;
    background-position: center;
}
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-search);
    border-radius: 40px;
    padding: 6px 16px;
    width: 260px;
}
.search-bar i {
    color: var(--text-muted);
    margin-right: 8px;
}
.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.search-bar input::placeholder {
    color: var(--text-placeholder);
}

/* 主题切换按钮 */
.theme-switch-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-nav-link);
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    margin: 0;
}
.theme-switch-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--color-primary);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .search-bar { width: 180px; }
    .navbar { padding: 0 12px; }
}
