/**
 * 统一导航栏样式
 * AI格式通 - 全站导航栏CSS
 * 
 * 使用说明：
 * 1. 在页面 <head> 中引入此CSS文件
 * 2. 在页面 <body> 中添加导航栏HTML结构
 * 3. 确保引入了 Font Awesome 图标库
 */

/* ============================================
   基础变量定义
   ============================================ */
:root {
    --navbar-bg: white;
    --navbar-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --navbar-border: 1px solid rgba(0, 0, 0, 0.1);
    --navbar-z-index: 9999;
    --navbar-padding: 8px 24px;
    --navbar-min-height: 48px;
    
    --logo-width: 120px;
    --logo-opacity: 0.7;
    
    --btn-padding: 8px 16px;
    --btn-font-size: 14px;
    --btn-font-weight: 600;
    --btn-radius: 8px;
    --btn-gap: 16px;
    
    --color-primary: #28a745;
    --color-secondary: #667eea;
    --color-highlight: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    
    --transition-speed: 0.3s;
}

/* ============================================
   Logo 样式
   ============================================ */
.title-logo {
    height: 40px;
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
    background: transparent;
    opacity: var(--logo-opacity);
}

.header-left h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0;
    font-size: 24px;
    font-weight: normal;
}

/* ============================================
   导航栏容器
   ============================================ */
.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: var(--navbar-z-index) !important;
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0 0 12px 12px !important;
    padding: var(--navbar-padding) !important;
    margin-bottom: 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-shadow: var(--navbar-shadow) !important;
    border: var(--navbar-border) !important;
    min-height: var(--navbar-min-height);
}

/* ============================================
   导航栏四块布局
   ============================================ */
.header-section {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}

.header-section:first-child {
    justify-content: flex-start;
}

.header-section:nth-child(2) {
    justify-content: center;
}

.header-section:nth-child(3) {
    justify-content: center;
}

.header-section:nth-child(4) {
    justify-content: flex-end;
}

/* ============================================
   弹框样式
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #f0f4ff;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: rotate(90deg);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   导航按钮行
   ============================================ */
.nav-buttons-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--btn-gap);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-buttons-row::-webkit-scrollbar {
    display: none;
}

/* ============================================
   按钮链接基础样式
   ============================================ */
.btn-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px !important;
    font-weight: 600;
    cursor: pointer !important;
    transition: all 0.3s ease;
    text-decoration: none;
    background: transparent;
    color: #546e7a;
    white-space: nowrap;
    pointer-events: auto;
    flex-shrink: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif !important;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.btn-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer !important;
}

.btn-link i {
    font-size: 14px;
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', sans-serif !important;
}

/* 主色调按钮 */
.btn-primary-link {
    color: var(--color-primary);
}

.btn-primary-link:hover {
    background: rgba(40, 167, 69, 0.1);
    color: var(--color-primary);
}

/* 次色调按钮 */
.btn-secondary-link {
    color: var(--color-secondary);
}

.btn-secondary-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--color-secondary);
}

/* 当前激活状态 */
.btn-link.active,
.btn-primary-link.active {
    background: rgba(40, 167, 69, 0.15);
    color: var(--color-primary);
}

/* ============================================
   AI转Word 突出显示按钮
   ============================================ */
.highlight-link {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3) !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    padding: 10px 20px !important;
    border-radius: 25px !important;
    transition: all 0.3s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif !important;
}

.highlight-link:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4) !important;
}

.highlight-link i {
    color: white !important;
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', sans-serif !important;
}

/* ============================================
   用户操作区域
   ============================================ */
.auth-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   汉堡菜单按钮（移动端）
   ============================================ */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color var(--transition-speed) ease;
}

.mobile-menu-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* ============================================
   移动端菜单面板
   ============================================ */
.mobile-menu-panel {
    display: none;
    position: fixed;
    top: var(--navbar-min-height);
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    padding: 16px;
    flex-direction: column;
    gap: 8px;
    border-radius: 0 0 12px 12px;
}

.mobile-menu-panel.show {
    display: flex;
}

/* 移动端菜单遮罩层 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

.mobile-menu-overlay.show {
    display: block;
}

.mobile-menu-panel .btn-link {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
}

.mobile-menu-panel .highlight-link {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

/* ============================================
   响应式设计 - 平板和手机
   ============================================ */
@media (max-width: 1100px) {
    :root {
        --logo-width: 100px;
        --btn-gap: 8px;
    }
    
    .nav-buttons-row {
        gap: 6px;
        padding: 4px 0;
    }
    
    .btn-link {
        padding: 6px 10px !important;
        font-size: 13px !important;
    }
    
    .btn-link i {
        font-size: 12px !important;
    }
}

@media (max-width: 968px) {
    :root {
        --navbar-padding: 8px 16px;
    }
    
    /* 显示汉堡菜单按钮 */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    /* 隐藏桌面端导航 */
    .header-nav {
        display: none !important;
    }
    
    /* 调整第四块区域布局 */
    .header-section:nth-child(4) {
        display: none;
    }
    
    /* Logo 缩小 */
    :root {
        --logo-width: 90px;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-padding: 6px 12px;
        --navbar-min-height: 44px;
        --logo-width: 80px;
    }
    
    .header {
        border-radius: 0 !important;
    }
    
    .mobile-menu-panel {
        top: 44px;
        border-radius: 0;
    }
    
    /* 移动端菜单样式 */
    .mobile-menu-panel {
        padding: 12px;
        gap: 6px;
    }
    
    .mobile-menu-panel .btn-link {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .mobile-menu-panel .highlight-link {
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    :root {
        --logo-width: 70px;
    }
    
    .mobile-menu-btn {
        font-size: 20px;
        padding: 6px;
    }
    
    .btn-link {
        padding: 5px 10px !important;
        font-size: 12px !important;
    }
    
    .highlight-link {
        font-size: 12px !important;
    }
}

/* ============================================
   页面内容间距（避免被固定导航栏遮挡）
   ============================================ */
.page-content {
    padding-top: 80px !important;
}

@media (max-width: 768px) {
    .page-content {
        padding-top: 60px !important;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding-top: 54px !important;
    }
}

/* ============================================
   高对比度模式支持（无障碍）
   ============================================ */
@media (prefers-contrast: high) {
    .header {
        border: 2px solid #000 !important;
    }
    
    .btn-link {
        border: 1px solid currentColor;
    }
}

/* ============================================
   减少动画模式（无障碍）
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .btn-link,
    .highlight-link,
    .header,
    .mobile-menu-btn,
    .mobile-menu-panel {
        transition: none;
    }
    
    .btn-link:hover {
        transform: none;
    }
    
    .highlight-link:hover {
        transform: none;
    }
}

/* ============================================
   打印样式
   ============================================ */
@media print {
    .header,
    .mobile-menu-btn,
    .mobile-menu-panel {
        display: none !important;
    }
    
    .page-content {
        padding-top: 0 !important;
    }
}
