/* 导航系统主样式 - 现代酷炫设计 */
:root {
    --nav-primary-color: #ED1C24;
    --nav-secondary-color: #000000;
    --nav-accent-color: #FFFFFF;
    --nav-text-color: #FFFFFF;
    --nav-text-hover: #FFD700;
    --nav-dropdown-bg: rgba(0, 0, 0, 0.9);
    --nav-transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --nav-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --nav-glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --nav-glass-bg: rgba(237, 28, 36, 0.6);
}

/* 主导航栏样式 */
.main-header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: var(--nav-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--nav-shadow);
    transition: var(--nav-transition);
    animation: headerGlow 8s ease infinite;
}

.main-header.scrolled {
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Logo样式 */
.logo-container {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text h1 {
    font-size: 2.0rem;
    font-weight: 700;
    color: var(--nav-text-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin: 0;
    letter-spacing: -0.5px;
    font-family: 'Noto Serif SC', serif;
}

.logo-text .ba-character {
    font-size: 1.5em;
    display: inline-block;
    transform: translateY(0.05em);
}

.logo-text .slogan {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin-top: 3px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;    /* 确保文字居中 */
}

/* 主导航菜单 */
.main-nav {
    position: relative;
    margin-left: auto;
    z-index: 100;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.nav-item {
    position: relative;
    margin: 0 10px;
}

.nav-link {
    color: var(--nav-text-color);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 20px 15px;
    position: relative;
    text-decoration: none;
    transition: var(--nav-transition);
    display: flex;
    align-items: center;
    flex-direction: column;
    z-index: 2;
}

.nav-text {
    margin-top: 5px;
    transition: transform 0.3s ease;
}

.nav-underline {
    display: none;
}

.nav-link i {
    font-size: 1.2em;
    transition: var(--nav-transition);
}

/* 新的悬停效果 - 背景光晕 */
.nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, currentColor 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: -1;
}

.nav-item:hover .nav-link::before {
    width: 150px;
    height: 150px;
    opacity: 0.2;
}

/* 文字放大效果 */
.nav-text {
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.nav-item:hover .nav-text {
    transform: scale(1.15);
    text-shadow: 0 0 8px currentColor;
}

/* 图标旋转效果 */
.nav-link i {
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-item:hover .nav-link i {
    transform: rotate(15deg) scale(1.2);
}

/* 面包屑导航中文样式 */
.breadcrumb-item a {
    font-family: 'Noto Serif SC', serif;
    
}
/* 五行对应的导航项颜色 */
.nav-item[data-wuxing="wood"] .nav-link { color: #FFFFFF; }
.nav-item[data-wuxing="fire"] .nav-link { color: #FFFFFF; }
.nav-item[data-wuxing="earth"] .nav-link { color: #FFFFFF; }
.nav-item[data-wuxing="metal"] .nav-link { color: #FFFFFF; }
.nav-item[data-wuxing="water"] .nav-link { color: #FFFFFF; }

/* 更新五行颜色效果 */
.nav-item[data-wuxing="wood"] .nav-link:hover { color: #d0ffb6; }  /* 淡绿，亮且对比强 */
.nav-item[data-wuxing="fire"] .nav-link:hover { color: #ffffff; }  /* 白色，红底上最清晰 */
.nav-item[data-wuxing="earth"] .nav-link:hover { color: #ffe9b3; } /* 米黄色，温和明亮 */
.nav-item[data-wuxing="metal"] .nav-link:hover { color: #b3e5ff; } /* 淡蓝偏银，干净明亮 */
.nav-item[data-wuxing="water"] .nav-link:hover { color: #bbdefb; } /* 浅蓝，与红色对比明显 */
.nav-item.golden .nav-link:hover { color: #ffd700; }

/* 修改洞察天机导航项为黄色 */
.nav-item[data-wuxing="water"] .nav-link { 
    color: #FFD700 !important; /* 金色 */
}

/* 修改洞察天机导航项悬停效果 */
.nav-item[data-wuxing="water"] .nav-link:hover { 
    color: #FFF200 !important; /* 更亮的黄色 */
    text-shadow: 0 0 10px #FFD700;
}

/* 修改洞察天机下拉菜单背景 */
.nav-item[data-wuxing="water"] .dropdown-menu {
    background: rgba(255, 215, 0, 0.2) !important; /* 金色半透明背景 */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 215, 0, 0.3) !important;
}

/* 修改洞察天机下拉菜单项 */
.nav-item[data-wuxing="water"] .dropdown-link {
    color: #FFD700 !important; /* 金色文字 */
    background: rgba(0, 0, 0, 0.5) !important; /* 深色背景增强对比 */
}

/* 修改洞察天机下拉菜单项悬停效果 */
.nav-item[data-wuxing="water"] .dropdown-link:hover {
    background: rgba(255, 215, 0, 0.3) !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 修改洞察天机激活状态 */
.nav-item[data-wuxing="water"] .nav-link.active {
    color: #FFD700 !important;
    text-shadow: 0 0 10px #FFD700;
}

.nav-item[data-wuxing="water"] .nav-link.active::after {
    background: #FFD700;
    box-shadow: 0 0 10px #FFD700;
}

/* 修改洞察天机下拉菜单活动项 */
.nav-item[data-wuxing="water"] .dropdown-link.active {
    background: rgba(255, 215, 0, 0.3) !important;
    color: #FFFFFF !important;
    border-left: 3px solid #FFFFFF;
}

/* 保持关于我们导航项为白色 */
.nav-item:last-child .nav-link { 
    color: #FFFFFF !important; /* 白色 */
}

/* 保持关于我们导航项悬停效果 */
.nav-item:last-child .nav-link:hover { 
    color: #FFFFFF !important; /* 白色 */
    text-shadow: 0 0 10px #FFFFFF;
}

/* 恢复关于我们的水行属性样式 */
.nav-item[data-wuxing="water"]:not(:last-child) .nav-link { 
    color: #FFD700 !important; /* 仅对非最后一个水行元素应用金色 */
}

.nav-item[data-wuxing="water"]:not(:last-child) .nav-link:hover { 
    color: #FFF200 !important; /* 仅对非最后一个水行元素应用金色悬停 */
}

/* 金色特殊项 */
.nav-item.golden .nav-link { color: #FFD700; }

/* 悬停效果 */
.nav-item:hover .nav-link {
    transform: translateY(-3px);
    text-shadow: 0 0 10px currentColor;
}

.nav-item:hover .nav-text {
    transform: scale(1.1);
}

.nav-item:hover .nav-underline {
    width: 60%;
}

.nav-item:hover .nav-link i {
    transform: scale(1.2) rotate(15deg);
}

/* 激活状态 */
.nav-link.active {
    font-weight: 700;
    color: #fff !important;
    position: relative;
}
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 0 10px #fff;
}

.nav-link.active i {
    color: #ffd700 !important;
    text-shadow: 0 0 10px #ffd700;
}

/* 下拉菜单活动项 */
.dropdown-link.active {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffd700 !important;
    font-weight: 600;
    border-left: 3px solid #ffd700;
}

.nav-link.active .nav-underline {
    width: 80%;
    height: 3px;
}

/* 下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: none !important; /* 强制去除边框 */
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    padding: 15px 12px; /* 调整内边距 */
    gap: 12px; /* 增加间距 */
    align-items: flex-start; /* 强制顶部对齐 */
    z-index: 1000;
    width: max-content;
}

/* 为特定菜单调整 */
.nav-item:nth-child(4) .dropdown-menu, /* 学习工具 */
.nav-item:nth-child(5) .dropdown-menu { /* 洞察天机 */
    align-items: flex-start !important;
    width: auto;
    left: 0;
    transform: translateX(0) translateY(10px);
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
    display: inline-block; /* 横向排列 */
}

.dropdown-link {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 3px;
    padding: 15px 8px; /* 增加内边距 */
    height: auto;
    min-height: 140px; /* 增加最小高度 */
    max-height: 160px; /* 增加最大高度 */
    min-width: 44px; /* 增加最小宽度 */
    display: flex;
    justify-content: center;
    align-items: center; 
    color: var(--nav-text-color);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px; /* 增加圆角 */
    transition: all 0.2s ease;
    margin: 2px; /* 增加外边距 */
    line-height: 1.8;
    box-sizing: border-box; /* 确保padding不影响总尺寸 */
}

/* 去除所有导航链接的下划线 */
.nav-link,
.dropdown-link,
.dropdown-link a,
.nav-link a,
.menu-item a {
    text-decoration: none !important;
}

/* 6个字的特殊处理 */
.dropdown-link.long-text {
    height: 150px; /* 与普通项同高 */
    font-size: 1.1rem !important; /* 强制相同字号 */
}

/* 去除圆点图标 */
.dropdown-link i {
    display: none !important;
}

/* 确保文字完整显示 */
.dropdown-link span {
    display: inline-block;
    transform: translateY(0); /* 重置位置 */
    word-break: keep-all; /* 禁止换行 */
}

/* 悬停效果 */
.dropdown-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--nav-text-hover);
    transform: scale(1.05);
    margin: 4px;
    padding: 16px 9px;
}

/* 移动端保持横排 */
@media (max-width: 992px) {
    .dropdown-menu {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }
    .dropdown-link {
        writing-mode: horizontal-tb;
        height: auto;
        padding: 12px 15px;
        justify-content: flex-start;
    }
}

/* 面包屑导航 */
.breadcrumb-container {
    padding: 10px 0;
    margin-top: 20px; /* 👈 新增：往下移 20px */
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.breadcrumb {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--nav-transition);
}

.breadcrumb-item a:hover {
    color: var(--nav-text-hover);
}

.breadcrumb-separator {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.5);
}

.breadcrumb-item.active {
    color: var(--nav-text-hover);
    font-weight: 500;
}

/* 修改面包屑导航中主目录项的样式 */
.breadcrumb-item.no-link {
    display: flex;
    align-items: center;
}

.breadcrumb-item.no-link span {
    display: flex;
    align-items: center;
}

.breadcrumb-item.no-link i {
    margin-right: 5px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 30px;
    height: 24px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 101;
}

.mobile-menu-btn .bar {
    height: 3px;
    width: 100%;
    background: var(--nav-text-color);
    transition: var(--nav-transition);
}

/* =============== 响应式设计 =============== */
@media (max-width: 992px) {
    .header-container {
        padding: 0 1.5rem;
    }
    
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease;
    }
    
    .main-nav.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    
    .nav-list {
        flex-direction: column;
        padding: 1rem 0;
    }
    
    .nav-item {
        margin: 0;
    }
    
    .nav-link {
        padding: 1rem 1.5rem;
    }
    
    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        display: none;
        padding: 0;
    }
    
    .nav-item:hover .submenu {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .breadcrumb-container {
        padding: 1rem 1.5rem;
        padding-top: 80px;
    }
}

/* 动画效果 */
@keyframes headerGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(237, 28, 36, 0.5); }
    50% { box-shadow: 0 0 20px rgba(237, 28, 36, 0.8); }
}

/* 最近浏览部分样式 */
.recent-pages-container {
    margin-top: 10px;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.recent-title {
    color: rgba(255, 255, 255, 0.7);
    margin-right: 8px;
    font-weight: 500;
}

.recent-pages-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.recent-page-item {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 2px 5px;
    border-radius: 3px;
}

.recent-page-item:hover {
    color: var(--nav-text-hover);
    background: rgba(255, 255, 255, 0.1);
}

.recent-separator {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
}

/* 最近浏览 - 底部样式（无背景） */
.recent-pages-footer {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 10px 20px;
    text-align: center;
    /* 移除背景色和阴影 */
}
.recent-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #555;
}

.recent-pages-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.recent-page-item {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s;
}

.recent-page-item:hover {
    color: #004499;
    text-decoration: underline;
}

.recent-separator {
    color: #999;
    margin: 0 5px;
}

@media (max-width: 768px) {
    .recent-pages-footer {
        padding: 10px;
    }
    
    .recent-pages-list {
        gap: 5px;
    }
}

.recent-pages-footer .recent-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #555;
}

.recent-pages-footer .recent-pages-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.recent-pages-footer .recent-page-item {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s;
}

.recent-pages-footer .recent-page-item:hover {
    color: #004499;
    text-decoration: underline;
}

.recent-pages-footer .recent-separator {
    color: #999;
    margin: 0 5px;
}

@media (max-width: 768px) {
    .recent-pages-footer {
        padding: 10px;
    }
    
    .recent-pages-footer .recent-pages-list {
        gap: 5px;
    }
}
