/* 凡人修仙传 - 公共样式 */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #dc2626, #f59e0b);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #b91c1c, #d97706);
}

/* 选择文本样式 */
::selection {
    background: rgba(220, 38, 38, 0.3);
    color: white;
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(45deg, #dc2626, #f59e0b, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 卡片样式 */
.immortal-card {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.1), rgba(124, 58, 237, 0.1));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* 自定义动画 */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.floating-animation {
    animation: float 6s ease-in-out infinite;
}

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

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

/* 发光效果 */
.mystical-glow {
    box-shadow: 0 0 30px rgba(139, 69, 19, 0.3), inset 0 0 30px rgba(139, 69, 19, 0.1);
}

.immortal-glow {
    box-shadow: 
        0 0 20px rgba(220, 38, 38, 0.3),
        0 0 40px rgba(245, 158, 11, 0.2),
        0 0 60px rgba(124, 58, 237, 0.1);
}

/* 文字发光 */
.ancient-text {
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.text-glow-red {
    text-shadow: 0 0 10px #dc2626, 0 0 20px #dc2626, 0 0 30px #dc2626;
}

.text-glow-gold {
    text-shadow: 0 0 10px #f59e0b, 0 0 20px #f59e0b, 0 0 30px #f59e0b;
}

/* 颜色类 */
.immortal-red { color: #dc2626; }
.immortal-gold { color: #f59e0b; }
.immortal-blue { color: #1e40af; }
.immortal-purple { color: #7c3aed; }
.immortal-cyan { color: #06b6d4; }

/* 响应式设计 */
@media (max-width: 768px) {
    /* 文字大小调整 */
    .gradient-text {
        font-size: 1.75rem !important;
    }
    
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    /* 导航栏优化 - 关键修改 */
    nav {
        padding: 0 !important; /* 移除nav本身的padding */
        min-height: 60px; /* 减小最小高度 */
        height: auto; /* 自动高度适应内容 */
    }
    
    /* 减小导航栏内部container的padding */
    nav .container {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* 主内容区域顶部间距 - 避免被导航栏遮挡 */
    section:first-of-type,
    main > section:first-child,
    main > div:first-child {
        padding-top: 75px !important; /* 调整到合适的间距 */
    }
    
    nav .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* 导航栏链接 - 重点优化 - 修正：只针对 desktop-menu 下的链接，避免误伤标题 */
    nav .desktop-menu .space-x-3,
    nav .desktop-menu .space-x-4,
    nav .desktop-menu .space-x-6,
    nav .desktop-menu .space-x-8 {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.4rem !important;
        margin: 0 !important;
    }
    
    nav .desktop-menu a {
        margin: 0 !important;
        padding: 0.4rem 0.6rem !important;
        background: rgba(255, 255, 255, 0.15) !important;
        border-radius: 0.375rem !important;
        backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
        transition: all 0.3s ease !important;
        line-height: 1.2 !important;
    }
    
    nav .desktop-menu a:hover {
        background: rgba(255, 255, 255, 0.25) !important;
        transform: translateY(-1px);
    }

    /* 标题区域强制修复 - 确保并排且无背景 */
    nav .container > .flex > .flex.items-center.space-x-4 {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0.5rem !important;
        background: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    nav .container > .flex > .flex.items-center.space-x-4 > * {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
        backdrop-filter: none !important;
        display: inline-block !important;
    }

    /* 确保图标和文字有正确间距 */
    nav .container > .flex > .flex.items-center.space-x-4 > i {
        margin-right: 0.5rem !important;
    }
    
    /* 导航栏标题优化 */
    nav h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        font-weight: 700 !important;
    }
    
    /* 确保图标和标题横向排列 */
    nav .flex.items-center {
        flex-direction: row !important;
        align-items: center !important;
    }
    
    nav .flex.items-center.space-x-4 {
        gap: 0.75rem !important;
    }
    
    nav i {
        font-size: 1.5rem !important;
    }
    
    /* 容器内边距 */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* 卡片网格 */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* 间距调整 */
    .space-y-8 > * + * {
        margin-top: 1.5rem !important;
    }
    
    .gap-3 {
        gap: 0.5rem !important;
    }
    
    .gap-4 {
        gap: 0.75rem !important;
    }
    
    .gap-6 {
        gap: 1rem !important;
    }
    
    .gap-8 {
        gap: 1rem !important;
    }
    
    .gap-12 {
        gap: 1.5rem !important;
    }
    
    /* 内边距调整 */
    .p-5 {
        padding: 1.25rem !important;
    }
    
    .p-6 {
        padding: 1.25rem !important;
    }
    
    .p-8 {
        padding: 1.5rem !important;
    }
    
    .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .px-8 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    .py-12 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .py-16 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .pt-24 {
        padding-top: 5rem !important;
    }
    
    .pt-32 {
        padding-top: 5rem !important;
    }
    
    /* Margin 调整 */
    .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    .mb-6 {
        margin-bottom: 1rem !important;
    }
    
    .mb-8 {
        margin-bottom: 1.25rem !important;
    }
    
    .mb-12 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-16 {
        margin-bottom: 2rem !important;
    }
    
    /* 隐藏移动端不需要的元素 */
    .md\\:hidden {
        display: block !important;
    }
    
    .hidden.md\\:flex {
        display: none !important;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕优化 */
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* 导航栏进一步优化 */
    nav {
        padding: 0 !important; /* 移除nav本身的padding */
        min-height: 60px; /* 减小最小高度 */
        height: auto; /* 自动高度适应内容 */
    }
    
    /* 减小导航栏内部container的padding */
    nav .container {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* 主内容区域顶部间距 - 避免被导航栏遮挡 */
    section:first-of-type,
    main > section:first-child,
    main > div:first-child {
        padding-top: 75px !important; /* 调整到合适的间距 */
    }
    
    nav .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    nav h1 {
        font-size: 1.25rem !important;
        font-weight: 700 !important;
    }
    
    /* 确保图标和标题横向排列 */
    nav .flex.items-center {
        flex-direction: row !important;
        align-items: center !important;
    }
    
    nav .flex.items-center.space-x-4 {
        gap: 0.5rem !important;
    }
    
    nav .space-x-3 > *,
    nav .space-x-4 > *,
    nav .space-x-6 > *,
    nav .space-x-8 > * {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    nav i {
        font-size: 1.25rem !important;
    }
    
    /* 文字大小 */
    .gradient-text {
        font-size: 1.5rem !important;
    }
    
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
    
    .text-4xl {
        font-size: 1.5rem !important;
    }
    
    .text-5xl {
        font-size: 1.75rem !important;
    }
    
    .text-6xl {
        font-size: 2rem !important;
    }
    
    .text-7xl {
        font-size: 2.25rem !important;
    }
    
    .text-8xl {
        font-size: 2.5rem !important;
    }
    
    .text-xl {
        font-size: 1rem !important;
    }
    
    .text-2xl {
        font-size: 1.25rem !important;
    }
    
    .text-3xl {
        font-size: 1.5rem !important;
    }
    
    /* 按钮和标签 */
    .px-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .px-6 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* 卡片内边距 */
    .p-5 {
        padding: 0.875rem !important;
    }
    
    .p-6 {
        padding: 1rem !important;
    }
    
    .p-8 {
        padding: 1rem !important;
    }
    
    /* 间距 */
    .gap-3 {
        gap: 0.4rem !important;
    }
    
    .gap-4 {
        gap: 0.5rem !important;
    }
    
    .gap-6 {
        gap: 0.75rem !important;
    }
    
    .gap-8 {
        gap: 0.75rem !important;
    }
    
    .mb-3 {
        margin-bottom: 0.5rem !important;
    }
    
    .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    .mb-6 {
        margin-bottom: 0.875rem !important;
    }
    
    .mb-8 {
        margin-bottom: 1rem !important;
    }
    
    .mb-12 {
        margin-bottom: 1.25rem !important;
    }
    
    .mb-16 {
        margin-bottom: 1.5rem !important;
    }
    
    .pt-24 {
        padding-top: 4.5rem !important;
    }
    
    .pt-32 {
        padding-top: 4.5rem !important;
    }
}

/* 视差背景 */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* 魔封样式 */
.demon-seal {
    background: radial-gradient(circle, rgba(220, 20, 60, 0.2) 0%, rgba(139, 0, 0, 0.1) 70%);
    border: 2px solid rgba(220, 20, 60, 0.3);
}

/* 分隔线 */
.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    margin: 3rem 0;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 移动端菜单样式 */
.mobile-menu-btn {
    display: none; /* 默认隐藏 */
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
    z-index: 50; /* 确保按钮在最上层 */
    position: relative;
}

/* 增强点击区域 */
.mobile-menu-btn::before {
    content: '';
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: -10px;
    right: -10px;
}

.mobile-menu-btn:hover, .mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-menu-btn .menu-icon {
    font-size: 1.25rem;
    color: white;
    pointer-events: none; /* 让图标不拦截点击事件 */
    display: block; /* 确保图标块级显示 */
}

.mobile-menu {
    display: none; /* 默认隐藏 */
    position: fixed;
    top: 60px; /* 对应导航栏最小高度 */
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: none; /* 默认无边框 */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, border-bottom 0.3s ease; /* 添加边框过渡 */
    z-index: 40;
}

.mobile-menu.active {
    max-height: 500px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* 展开时才显示边框 */
}

.mobile-menu-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-content a {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.mobile-menu-content a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* 桌面端菜单 - 默认显示 */
.desktop-menu {
    display: flex !important;
    align-items: center;
}

/* 移动端样式 */
@media (max-width: 768px) {
    /* 移动端显示汉堡按钮 */
    .mobile-menu-btn {
        display: block !important;
    }
    
    /* 移动端启用下拉菜单 */
    .mobile-menu {
        display: block !important;
    }
    
    /* 移动端隐藏桌面菜单 - 强制隐藏 */
    .desktop-menu {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* 导航栏标题优化 - 增强可读性 */
    nav h1.gradient-text {
        /* 使用实色文字而不是渐变透明 */
        background: none !important;
        -webkit-text-fill-color: #fbbf24 !important;
        color: #fbbf24 !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(251, 191, 36, 0.5);
        font-size: 1.5rem !important;
        font-weight: 700 !important;
    }
    
    /* 导航栏背景加深 */
    nav {
        background: rgba(0, 0, 0, 0.9) !important;
        backdrop-filter: blur(20px) !important;
        border-bottom: none !important; /* 移除底部边框线 */
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); /* 改用柔和阴影 */
    }
}
