/**
 * 网站Logo系统 - 统一的品牌标识设计
 * 突出特色：详细代码注释，帮助初学者学习
 */

/* ===========================================
   Logo 核心设计系统
=========================================== */

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    order: 1; /* Logo在第一位 */
}

.site-logo:hover {
    transform: translateY(-2px);
}

/* Logo 图标部分 */
.logo-icon {
    position: relative;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    font-size: 18px;
    color: white;
}

/* 为不同页面定制图标 */
.logo-icon.html-page::before {
    content: '<>';
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.logo-icon.css-page::before {
    content: '{}';
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.logo-icon.js-page::before {
    content: 'JS';
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
}

.logo-icon.roadmap-page::before {
    content: '🗺️';
    font-size: 20px;
}

.logo-icon.practice-page::before {
    content: '🚀';
    font-size: 20px;
}

/* Logo 文字部分 */
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 11px;
    color: #7f8c8d;
    font-weight: 500;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 特色标签 - 突出"详细注释"特色 */
.feature-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===========================================
   导航栏整体设计
=========================================== */

.enhanced-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.enhanced-nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px; /* 确保元素之间有足够间距 */
    flex-wrap: wrap; /* 小屏幕时允许换行 */
    position: relative; /* 为绝对定位的移动端菜单提供定位上下文 */
}

/* 特色宣传区域 */
.site-features {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #6c757d;
    flex-shrink: 0; /* 防止被压缩 */
    order: 2; /* 特色宣传在第二位 */
}

.feature-highlight {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    font-weight: 500;
    color: #5c6bc0;
    animation: glow-feature 3s ease-in-out infinite alternate;
}

.feature-highlight i {
    font-size: 12px;
}

@keyframes glow-feature {
    0% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.2); }
    100% { box-shadow: 0 0 15px rgba(102, 126, 234, 0.4); }
}

/* ===========================================
   页面横幅设计
=========================================== */

.hero-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 60px 20px;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 30px;
    font-weight: 400;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 40px;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
}

.hero-feature i {
    font-size: 18px;
    color: #ffd93d;
}

/* ===========================================
   导航菜单样式增强
=========================================== */

/* 确保所有导航容器有正确的定位上下文 */
.enhanced-nav,
.navigation,
.nav-container {
    position: relative;
}

/* 确保导航菜单正确显示 - 兼容所有导航容器 */
.enhanced-nav .nav-menu,
.navigation .nav-menu,
.nav-container .nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
    align-items: center;
    width: 100%;
    order: 3; /* 将导航菜单放在第三行（实际显示为第二行） */
    margin-top: 10px; /* 与上方元素保持间距 */
}

.enhanced-nav .nav-menu li,
.navigation .nav-menu li,
.nav-container .nav-menu li {
    margin: 0;
}

.enhanced-nav .nav-menu a,
.navigation .nav-menu a,
.nav-container .nav-menu a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.enhanced-nav .nav-menu a:hover,
.navigation .nav-menu a:hover,
.nav-container .nav-menu a:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #5c6bc0;
    transform: translateY(-2px);
}

.enhanced-nav .nav-menu a i,
.navigation .nav-menu a i,
.nav-container .nav-menu a i {
    font-size: 16px;
}

/* 移动端菜单按钮样式 - 兼容所有导航容器 */
.enhanced-nav .menu-toggle,
.navigation .menu-toggle,
.nav-container .menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    gap: 4px;
    order: 4; /* 菜单按钮在最后 */
}

.enhanced-nav .menu-toggle span,
.navigation .menu-toggle span,
.nav-container .menu-toggle span {
    width: 25px;
    height: 3px;
    background: #495057;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ===========================================
   响应式设计
=========================================== */

@media (max-width: 1024px) {
    .site-features {
        display: none; /* 中等屏幕隐藏特色宣传，优先显示导航 */
    }
    
    .enhanced-nav .nav-menu {
        gap: 15px;
    }
    
    .enhanced-nav .nav-menu a {
        padding: 6px 12px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .site-logo {
        gap: 8px;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .logo-title {
        font-size: 18px;
    }
    
    .logo-subtitle {
        font-size: 10px;
    }
    
    .site-features {
        display: none; /* 移动端隐藏特色宣传 */
    }
    
    /* 移动端导航菜单 - 兼容所有导航容器 */
    .enhanced-nav .nav-menu,
    .navigation .nav-menu,
    .nav-container .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 20px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        display: none;
        z-index: 1000;
    }
    
    .enhanced-nav .nav-menu.active,
    .navigation .nav-menu.active,
    .nav-container .nav-menu.active {
        display: flex;
    }
    
    .enhanced-nav .nav-menu a,
    .navigation .nav-menu a,
    .nav-container .nav-menu a {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        border-bottom: 1px solid #f1f3f4;
    }
    
    .enhanced-nav .menu-toggle,
    .navigation .menu-toggle,
    .nav-container .menu-toggle {
        display: flex;
    }
    
    .hero-title {
        font-size: 2em;
    }
    
    .hero-features {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .enhanced-nav {
        padding: 10px 15px;
    }
    
    .logo-title {
        font-size: 16px;
    }
    
    .hero-banner {
        padding: 40px 15px;
    }
}

/* ===========================================
   特殊效果和动画
=========================================== */

/* Logo hover 效果 */
.site-logo:hover .logo-icon {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.site-logo:hover .logo-title {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 代码风格装饰 */
.code-decoration {
    position: relative;
}

.code-decoration::before {
    content: '/* 初学者友好 */';
    position: absolute;
    top: -20px;
    left: 0;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #28a745;
    opacity: 0.7;
}

.code-decoration::after {
    content: '// 详细注释';
    position: absolute;
    bottom: -20px;
    right: 0;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #007bff;
    opacity: 0.7;
}

/* ===========================================
   JavaScript 功能支持
=========================================== */

/* 确保导航栏在sticky状态下有正确的z-index */
.enhanced-header {
    position: relative;
    z-index: 999;
}

/* 移动端菜单动画效果 - 兼容所有导航容器 */
.enhanced-nav .menu-toggle.active span:nth-child(1),
.navigation .menu-toggle.active span:nth-child(1),
.nav-container .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.enhanced-nav .menu-toggle.active span:nth-child(2),
.navigation .menu-toggle.active span:nth-child(2),
.nav-container .menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.enhanced-nav .menu-toggle.active span:nth-child(3),
.navigation .menu-toggle.active span:nth-child(3),
.nav-container .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}