/**
 * 浮动导航栏样式 — 配合 components/navbar/floating-navbar.js
 * 变量与 main.css 对齐（contact 等页先引 main.css 再引本文件）
 */
.navbar {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
    transition: all 0.2s ease;
}

[data-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.95);
    border-color: #334155;
}

.navbar .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.navbar-brand:hover {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    font-weight: 500;
    color: var(--light-text);
    text-decoration: none;
    font-size: 1.125rem;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9375rem;
    color: var(--dark-text);
    width: 180px;
    padding: 0;
}

.search-input::placeholder {
    color: #8899b3;
}

.search-button {
    background: transparent;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.search-button:hover {
    color: var(--primary-color);
}

.search-button i {
    font-size: 1.125rem;
}

.search-toggle {
    display: none;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--light-text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.125rem;
}

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

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-text);
    cursor: pointer;
    padding: 0.5rem;
}

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .navbar {
        top: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
    }

    .navbar .container {
        padding: 0.75rem 1rem;
    }

    .search-form {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 0.5rem;
        background: rgba(255, 255, 255, 0.98);
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    [data-theme="dark"] .search-form {
        background: rgba(15, 23, 42, 0.98);
    }

    .search-form.active {
        display: flex;
    }

    .search-input {
        width: 100%;
    }

    .search-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin-top: 0.5rem;
        background: rgba(255, 255, 255, 0.98);
        border-radius: 12px;
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    [data-theme="dark"] .nav-menu {
        background: rgba(15, 23, 42, 0.98);
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-toggle {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .search-form.active {
        display: flex !important;
    }
}
