/* 导航栏组件样式 */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --secondary: #10b981;
    --accent: #8b5cf6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --background: #ffffff;
    --background-alt: #f9fafb;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 强制统一的导航栏样式 - 使用!important确保最高优先级 */
.navbar,
.header {
    background: var(--background) !important;
    box-shadow: var(--shadow) !important;
    padding: 0 40px !important; /* 垂直padding设为0，由height控制高度 */
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    /* fixed 保证始终停留在视口顶部，不随滚动切换 */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    box-sizing: border-box !important;
    /* 移除 overflow: hidden 以允许下拉菜单显示 */
    overflow: visible !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    border: none !important;
    /* 允许过渡动画 */
    transition: var(--transition) !important;
    /* 确保在所有浏览器中渲染一致 */
    backface-visibility: hidden !important;
    will-change: transform !important;
    transform: translateZ(0) !important;
}

/* 导航栏标志 - 强制统一样式 */
.navbar-logo,
.logo {
    font-size: 24px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    min-width: auto !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important; /* 填满导航栏高度 */
    min-height: 64px !important;
    max-height: 64px !important;
    line-height: 64px !important; /* 垂直居中 */
    box-sizing: border-box !important;
    overflow: visible !important;
    font-family: var(--font-display) !important;
}

/* 导航链接 - 强制统一样式 */
.navbar-links,
.nav-links {
    display: flex !important;
    gap: 16px !important;
    align-items: center !important; /* 垂直居中 */
    justify-content: center !important; /* 水平居中 */
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    height: 100% !important; /* 填满导航栏高度 */
    min-height: 64px !important;
    max-height: 64px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

.navbar-link,
.nav-link {
    text-decoration: none !important;
    color: var(--text-primary) !important;
    font-weight: 500 !important;
    padding: 10px 16px !important;
    border-radius: var(--radius) !important;
    transition: var(--transition) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-width: auto !important;
    width: auto !important;
    max-width: none !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    border: none !important;
    line-height: 1 !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
    word-break: keep-all !important;
    word-wrap: normal !important;
    overflow-wrap: normal !important;
    font-family: var(--font-sans) !important;
}

/* 激活状态 - 强制统一样式 */
.navbar-link.active,
.nav-link.active {
    background: white !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary-light) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15) !important;
    transform: translateY(-1px) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-width: auto !important;
    width: auto !important;
    max-width: none !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    line-height: 1 !important;
    font-size: 14px !important;
    border-radius: var(--radius) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
    word-break: keep-all !important;
    word-wrap: normal !important;
    overflow-wrap: normal !important;
}

/* 让激活项中的图标获得独立的圆形蓝色背景，视觉上与示例一致 */
.navbar-link.active i,
.nav-link.active i {
    background: var(--primary) !important;
    color: white !important;
    padding: 6px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3) !important;
    margin-right: 8px !important;
}

/* 悬停状态 - 强制统一样式 */
.navbar-link:hover,
.nav-link:hover {
    background: var(--background-alt) !important;
    color: var(--text-primary) !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    transform: translateY(-1px) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-width: auto !important;
    width: auto !important;
    max-width: none !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    line-height: 1 !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
    word-break: keep-all !important;
    word-wrap: normal !important;
    overflow-wrap: normal !important;
}

/* 固定导航占用空间后，避免被遮挡的全局补偿 */
body {
    padding-top: 64px; /* 与 .navbar 高度一致 */
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--background);
}

/* 未登录提示条：统一固定在导航栏下方 */
.login-notice {
    position: fixed;
    top: 64px; /* 导航栏高度 */
    left: 0;
    right: 0;
    z-index: 1001; /* 高于工具分类(998) */
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-bottom: 1px solid #f0d78c;
    height: 52px; /* 固定高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

/* 当登录提示条显示时，工具分类自动下移 */
body.has-login-notice .top-tools-nav {
    top: 116px; /* 导航栏64px + 提示条52px */
}



.login-notice-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #856404;
    font-weight: 500;
    font-family: var(--font-sans);
}

.login-notice-content i {
    color: #f39c12;
    font-size: 16px;
}

.login-notice-btn {
    background: #856404;
    color: white;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-left: 8px;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(133, 100, 4, 0.2);
}

.login-notice-btn:hover {
    background: #6d5303;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(133, 100, 4, 0.3);
}

/* 当显示未登录提示条时，调整body的padding */
body.has-login-notice {
    padding-top: 116px; /* 64px导航栏 + 52px提示条 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    .login-notice {
        height: auto;
        min-height: 48px;
        padding: 10px 16px;
    }
    
    .login-notice-content {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 8px;
    }
    
    .login-notice-btn {
        margin-left: 0;
        padding: 4px 12px;
        font-size: 12px;
    }
    
    body.has-login-notice {
        padding-top: 60px; /* 移动端提示条不固定，不需要额外padding */
    }
}

/* 防止登录/注册按钮在页面切换时短暂闪现导致布局抖动：
- 初始状态保持占位但不可见（visibility:hidden 保留布局）
- JS 在初始化后会显式设置可见性和 display，避免闪烁 */
.user-area {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    min-width: 140px !important; /* 预留右侧用户/登录区域宽度 */
    height: 100% !important; /* 填满导航栏高度 */
    min-height: 64px !important;
    max-height: 64px !important;
    box-sizing: border-box !important;
}

.login-buttons {
    display: flex !important; /* 保持占位和布局 */
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    min-width: 120px !important;
    height: 100% !important;
    min-height: 64px !important;
    max-height: 64px !important;
}

.user-dropdown {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    min-height: 64px !important;
    max-height: 64px !important;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: static !important;
    z-index: 1002 !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

.user-dropdown .user-profile {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    padding: 8px 15px !important;
    border-radius: var(--radius) !important;
    background: var(--background-alt) !important;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    height: 44px !important; /* 固定高度 */
    min-height: 44px !important;
    max-height: 44px !important;
    box-sizing: border-box !important;
}

.user-dropdown .user-profile:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.user-dropdown .avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
    color: white;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600;
    background-size: cover !important;
    background-position: center !important;
    box-sizing: border-box !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-dropdown .user-name {
    min-width: 60px !important;
    white-space: nowrap !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    line-height: 1 !important;
    font-family: var(--font-sans) !important;
}

.user-dropdown .dropdown-arrow {
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.user-dropdown .user-profile:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.user-dropdown .dropdown-menu {
    position: fixed;
    top: 74px;
    right: 20px;
    width: 320px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
    pointer-events: none; /* 默认情况下禁用指针事件，只在显示时启用 */
}

.user-dropdown .dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.user-dropdown .dropdown-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
}

/* 确保头像区域在加载时有固定尺寸 */
.user-dropdown .avatar, 
.user-dropdown .dropdown-avatar {
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown .dropdown-avatar {
    min-width: 56px;
    min-height: 56px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    background-size: cover !important;
    background-position: center !important;
    box-shadow: var(--shadow);
}

.user-dropdown .dropdown-user-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
    margin: 0 0 5px 0;
    font-family: var(--font-sans);
}

.user-dropdown .dropdown-user-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    font-family: var(--font-sans);
}

.user-dropdown .dropdown-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.user-dropdown .dropdown-stat {
    text-align: center;
    padding: 12px;
    background: var(--background-alt);
    border-radius: var(--radius);
    transition: var(--transition);
}

.user-dropdown .dropdown-stat:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.user-dropdown .dropdown-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 3px;
}

.user-dropdown .dropdown-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-dropdown .dropdown-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-dropdown .dropdown-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.user-dropdown .dropdown-action:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(4px);
}

.user-dropdown .dropdown-action i {
    width: 20px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.user-dropdown .dropdown-action:hover i {
    color: var(--primary);
}

.user-dropdown .logout-action {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    color: #ef4444;
}

.user-dropdown .logout-action:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* 登录按钮 */
.btn-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: var(--radius-full) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: var(--transition) !important;
    border: none !important;
    cursor: pointer !important;
    height: 44px !important; /* 固定高度 */
    min-height: 44px !important;
    max-height: 44px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2) !important;
    font-family: var(--font-sans) !important;
}

.btn-login:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-1px) !important;
}

.btn-login i {
    font-size: 14px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar,
    .header {
        padding: 0 20px !important;
        flex-direction: row !important; /* 保持水平排列 */
        gap: 10px !important;
        height: 64px !important; /* 保持固定高度 */
        min-height: 64px !important;
        max-height: 64px !important;
    }

    .navbar-links,
    .nav-links {
        width: auto !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
        height: 100% !important;
        gap: 12px !important;
    }
    
    /* 移动端隐藏部分导航链接，只保留关键元素 */
    .navbar-link[data-page="help"],
    .navbar-link[data-page="feedback"],
    .navbar-link[data-page="history"] {
        display: none !important;
    }

    .navbar-link,
    .nav-link {
        font-size: 13px !important;
        padding: 8px 12px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }

    .navbar-link.active,
    .nav-link.active {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }

    .notification-panel {
        position: fixed;
        top: 74px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: 95vw;
    }

    .user-dropdown .dropdown-menu {
        position: fixed;
        top: 74px;
        right: 10px;
        left: 10px;
        transform: translateY(-10px);
        width: 95%;
        max-width: 320px;
        will-change: transform, opacity;
        backface-visibility: hidden;
    }

    .user-dropdown:hover .dropdown-menu,
    .user-dropdown .dropdown-menu.show {
        transform: translateY(0);
    }

    .btn-login {
        font-size: 13px !important;
        padding: 8px 16px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }

    .user-dropdown .user-profile {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        padding: 6px 12px !important;
    }

    .user-dropdown .avatar {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }

    .user-dropdown .user-name {
        font-size: 13px !important;
        min-width: 50px !important;
    }
}

/* 性能优化 */



/* 页脚样式 */
.footer {
    text-align: center;
    padding: 40px 20px 30px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: auto;
    flex-shrink: 0;
    background: white;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
    text-align: left;
}

.footer-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section h3 i {
    color: var(--primary-color);
    font-size: 20px;
}

.footer-section p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 14px;
}

.footer-link:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

.footer-link i {
    width: 16px;
    text-align: center;
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 25px;
    text-align: center;
}

.footer-bottom p {
    margin: 5px 0;
}

.footer-bottom .footer-copyright {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-bottom .footer-tagline {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* 页脚响应式调整 */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 30px;
    }
    
    .footer-section h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .footer-section h3 i {
        font-size: 18px;
    }
    
    .footer-link {
        font-size: 13px;
    }
    
    .social-link {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 30px 15px 20px;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-bottom: 20px;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section h3 {
        justify-content: center;
    }
    
    .footer-links {
        align-items: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-bottom {
        padding-top: 20px;
    }
    
    .footer-copyright {
        font-size: 12px;
    }
    
    .footer-tagline {
        font-size: 13px;
    }
}
.notification-panel,
.user-dropdown .dropdown-menu {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* 全局覆盖样式 - 确保导航栏内所有子元素垂直居中 */
.navbar > *,
.header > * {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

/* 确保导航链接高度一致 */
.navbar-link,
.nav-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}
