/* Header样式 */
.header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(18, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: 100px;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo a:hover {
    opacity: 0.8;
}

.logo-image {
    width: 131px;
    height: 45px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: #00d4aa;
}

.nav-links a.active {
    color: #00d4aa;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

.language-selector-container {
    position: relative;
    margin-right: 20px;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #b0b8c1;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s;
}

.language-selector:hover {
    color: white;
}

/* 语言下拉菜单 */
.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 120px;
    z-index: 1000;
    margin-top: 0.5rem;
}

.language-dropdown .dropdown-item {
    color: #333;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.language-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.language-dropdown .dropdown-item:hover {
    background: #f8f9fa;
}

.language-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(0.7);
    transition: filter 0.3s ease;
}

.language-selector:hover .language-icon {
    filter: brightness(0) invert(1);
}

.btn-login {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-login:hover {
    border-color: #00d4aa;
    color: #00d4aa;
}

.btn-signup {
    background: linear-gradient(45deg, #00d4aa, #00b894);
    border: none;
    color: white;
    padding: 0.6rem 1.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 212, 170, 0.3);
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 170, 0.4);
}

/* 仪表盘链接样式 */
.dashboard-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
    cursor: pointer;
    margin-right: 20px;
}

.dashboard-link:hover {
    color: #00d4aa;
}

.dashboard-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* 用户菜单样式（登录后显示） */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar-container {
    cursor: pointer;
    transition: opacity 0.3s;
}

.user-avatar-container:hover {
    opacity: 0.8;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #00d4aa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 1000;
    margin-top: 0.5rem;
}

.user-dropdown .dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.user-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown .dropdown-item:hover {
    background: #f8f9fa;
}

.user-name-item {
    color: #333;
    font-weight: 500;
    cursor: default;
}

.user-name-item:hover {
    background: transparent;
}

.logout-item {
    color: #dc3545;
    font-weight: 500;
}

.logout-item:hover {
    background: #fff5f5;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(18, 24, 39, 0.6);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.mobile-menu-toggle .bar {
    display: block;
    width: 20px;
    height: 2px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle:active {
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.4);
}

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 24, 39, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1200;
    display: flex;
    justify-content: flex-end;
}

.mobile-menu {
    width: min(320px, 80vw);
    background: rgba(18, 24, 39, 0.95);
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
    padding: 2rem 1.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.2);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.05em;
}

.mobile-menu-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-menu-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    transition: background 0.3s ease, color 0.3s ease;
    backdrop-filter: blur(4px);
}

.mobile-menu-nav a.active,
.mobile-menu-nav a:hover {
    background: rgba(0, 212, 170, 0.12);
    color: #00d4aa;
}

.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-menu-actions .mobile-primary,
.mobile-menu-actions .mobile-secondary {
    padding: 0.9rem 1.2rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mobile-menu-actions .mobile-primary {
    background: linear-gradient(45deg, #00d4aa, #00b894);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(0, 212, 170, 0.25);
}

.mobile-menu-actions .mobile-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 212, 170, 0.35);
}

.mobile-menu-actions .mobile-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.mobile-menu-actions .mobile-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
}

.mobile-menu-languages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

.mobile-language-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mobile-language-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.mobile-language-grid button {
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.mobile-language-grid button.active,
.mobile-language-grid button:hover {
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.6);
    color: #00d4aa;
}

@media (max-width: 1024px) {
    .header.dashboard-mobile-header {
        justify-content: space-between;
        padding: 0.75rem 1.5rem;
    }

    .header.dashboard-mobile-header .logo {
        margin-right: 0;
        gap: 0.75rem;
    }

    .header.dashboard-mobile-header .logo-image {
        width: 118px;
    }

    .header.dashboard-mobile-header .nav-links,
    .header.dashboard-mobile-header .header-right {
        display: none;
    }

    .header.dashboard-mobile-header .mobile-menu-toggle {
        display: flex;
    }

    .header .header-right {
        display: none;
    }

    .header.dashboard-mobile-header .mobile-menu-toggle {
        display: none;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        justify-content: space-between;
        padding: 0.75rem 1.25rem;
    }

    .nav-links,
    .header-right {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .logo {
        margin-right: 0;
        gap: 0.75rem;
    }
}
