/* 基础变量 */
:root {
    --max-width: 1200px;
    --primary-color: #8a4fff;
    --primary-glow: rgba(138, 79, 255, 0.4);
    --accent-color: #00e5ff;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --bg-primary: #0a0a12;
    --bg-secondary: #151521;
    --glass-bg: rgba(20, 20, 30, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --primary-color: #7c4dff;
    --primary-glow: rgba(124, 77, 255, 0.2);
    --accent-color: #00bcd4;
    --text-primary: #1a1a2e;
    --text-secondary: rgba(26, 26, 46, 0.7);
    --bg-primary: #f8f9ff;
    --bg-secondary: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.1);
}

/* 导航条容器 */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: var(--max-width);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.navbar.scrolled {
    top: 10px;
    padding: 0 20px;
    border-radius: 12px;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-container a{
    text-decoration: none;
}

/* Logo区域 */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1002;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: conic-gradient(transparent, var(--accent-color), transparent 30%);
    animation: rotate 4s linear infinite;
}

.logo-icon i {
    position: relative;
    z-index: 1;
    font-size: 20px;
    color: white;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* 桌面导航菜单 */
.nav-menu {
    display: flex;
    gap: 4px;
    align-items: center;
    z-index: 1000;
}

.nav-link {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 12px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-color), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    pointer-events: none;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover::before {
    opacity: 0.1;
}

.nav-link.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, 
        rgba(138, 79, 255, 0.15), 
        rgba(0, 229, 255, 0.05));
    border: 1px solid rgba(138, 79, 255, 0.2);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 1px;
    pointer-events: none;
}

/* 故事章节指示器 */
.story-chapter {
    position: relative;
}

.chapter-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent-color);
    animation: pulse 2s infinite;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.dropdown-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-btn i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-btn i {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 170px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    box-shadow: var(--shadow);
    z-index: 100;
    white-space: nowrap;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 12px;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-content a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-content a i {
    width: 20px;
    font-size: 14px;
    color: var(--primary-color);
    display: none;
}

/* 为下拉菜单链接设置不同图标 */
.dropdown-content a::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    width: 20px;
    font-size: 14px;
    color: var(--primary-color);
}

/* 为前20个下拉菜单链接设置不同的免费动物图标（按指定顺序） */
.dropdown-content a:nth-child(1)::before { content: "\f6be"; } /* fas fa-cat */
.dropdown-content a:nth-child(2)::before { content: "\f6d3"; } /* fas fa-dog */
.dropdown-content a:nth-child(3)::before { content: "\f6d5"; } /* fas fa-dragon */
.dropdown-content a:nth-child(4)::before { content: "\e4d0"; } /* fas fa-bugs */
.dropdown-content a:nth-child(5)::before { content: "\f6c8"; } /* fas fa-cow */
.dropdown-content a:nth-child(6)::before { content: "\f520"; } /* fas fa-crow */
.dropdown-content a:nth-child(7)::before { content: "\f4ba"; } /* fas fa-dove */
.dropdown-content a:nth-child(8)::before { content: "\f52d"; } /* fas fa-feather */
.dropdown-content a:nth-child(9)::before { content: "\e4f2"; } /* fas fa-fish-fins */
.dropdown-content a:nth-child(10)::before { content: "\f52e"; } /* fas fa-frog */
.dropdown-content a:nth-child(11)::before { content: "\f6ed"; } /* fas fa-hippo */
.dropdown-content a:nth-child(12)::before { content: "\f6f0"; } /* fas fa-horse */
.dropdown-content a:nth-child(13)::before { content: "\f535"; } /* fas fa-kiwi-bird */
.dropdown-content a:nth-child(14)::before { content: "\e520"; } /* fas fa-locust */
.dropdown-content a:nth-child(15)::before { content: "\f700"; } /* fas fa-otter */
.dropdown-content a:nth-child(16)::before { content: "\e448"; } /* fas fa-shrimp */
.dropdown-content a:nth-child(17)::before { content: "\f717"; } /* fas fa-spider */
.dropdown-content a:nth-child(18)::before { content: "\e599"; } /* fas fa-worm */
.dropdown-content a:nth-child(19)::before { content: "\f1b0"; } /* fas fa-paw */
.dropdown-content a:nth-child(20)::before { content: "\e52b"; } /* fas fa-mosquito */

/* 功能按钮区域 */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.action-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    z-index: 1001;
}

.action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(138, 79, 255, 0.3);
}

/* 搜索区域 */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* 桌面端搜索框 */
.search-box {
    position: absolute;
    top: 50%;
    right: 60px;
    transform: translateY(-50%) scaleX(0);
    transform-origin: right;
    width: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    opacity: 0;
    transition: var(--transition);
    z-index: 1001;
    box-shadow: var(--shadow);
}

.search-box.active {
    width: 280px;
    transform: translateY(-50%) scaleX(1);
    opacity: 1;
    padding: 8px 12px;
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    font-size: 14px;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
}

/* 移动端菜单 */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-top: 8px;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 999;
}

/* 移动端二级菜单样式 */
.mobile-dropdown {
    margin-bottom: 8px;
    position: relative;
    z-index: 1000;
}

.mobile-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 12px;
    transition: var(--transition);
    background: transparent;
    border: none;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
}

/* 移动端菜单按钮图标 */
.mobile-nav-link i,
.mobile-dropdown-btn i:first-child {
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    font-size: 16px;
}

/* 移动端下拉菜单箭头 */
.mobile-dropdown-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.mobile-dropdown-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-dropdown-btn.active .mobile-dropdown-icon {
    transform: rotate(180deg);
}

.mobile-dropdown-content {
    display: none;
    margin-top: 8px;
    margin-left: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.mobile-dropdown-content.active {
    display: block;
}

.mobile-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 12px;
    transition: var(--transition);
    font-size: 14px;
    margin-bottom: 4px;
    position: relative;
}

.mobile-dropdown-content a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* 为移动端下拉菜单链接设置不同图标 */
.mobile-dropdown-content a::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    width: 20px;
    font-size: 14px;
    color: var(--primary-color);
    margin-right: 12px;
    text-align: center;
}

/* 为前20个移动端下拉菜单链接设置不同的免费动物图标（按指定顺序） */
.mobile-dropdown-content a:nth-child(1)::before { content: "\f6be"; } /* fas fa-cat */
.mobile-dropdown-content a:nth-child(2)::before { content: "\f6d3"; } /* fas fa-dog */
.mobile-dropdown-content a:nth-child(3)::before { content: "\f6d5"; } /* fas fa-dragon */
.mobile-dropdown-content a:nth-child(4)::before { content: "\e4d0"; } /* fas fa-bugs */
.mobile-dropdown-content a:nth-child(5)::before { content: "\f6c8"; } /* fas fa-cow */
.mobile-dropdown-content a:nth-child(6)::before { content: "\f520"; } /* fas fa-crow */
.mobile-dropdown-content a:nth-child(7)::before { content: "\f4ba"; } /* fas fa-dove */
.mobile-dropdown-content a:nth-child(8)::before { content: "\f52d"; } /* fas fa-feather */
.mobile-dropdown-content a:nth-child(9)::before { content: "\e4f2"; } /* fas fa-fish-fins */
.mobile-dropdown-content a:nth-child(10)::before { content: "\f52e"; } /* fas fa-frog */
.mobile-dropdown-content a:nth-child(11)::before { content: "\f6ed"; } /* fas fa-hippo */
.mobile-dropdown-content a:nth-child(12)::before { content: "\f6f0"; } /* fas fa-horse */
.mobile-dropdown-content a:nth-child(13)::before { content: "\f535"; } /* fas fa-kiwi-bird */
.mobile-dropdown-content a:nth-child(14)::before { content: "\e520"; } /* fas fa-locust */
.mobile-dropdown-content a:nth-child(15)::before { content: "\f700"; } /* fas fa-otter */
.mobile-dropdown-content a:nth-child(16)::before { content: "\e448"; } /* fas fa-shrimp */
.mobile-dropdown-content a:nth-child(17)::before { content: "\f717"; } /* fas fa-spider */
.mobile-dropdown-content a:nth-child(18)::before { content: "\e599"; } /* fas fa-worm */
.mobile-dropdown-content a:nth-child(19)::before { content: "\f1b0"; } /* fas fa-paw */
.mobile-dropdown-content a:nth-child(20)::before { content: "\e52b"; } /* fas fa-mosquito */

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 12px;
    transition: var(--transition);
}

.mobile-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-link.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, 
        rgba(138, 79, 255, 0.15), 
        rgba(0, 229, 255, 0.05));
}

/* 移动端搜索框 */
.mobile-search-box {
    display: none;
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: calc(100% - 48px);
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px;
    z-index: 1000;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-search-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mobile-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    margin-bottom: 0;
}

.mobile-search-input::placeholder {
    color: var(--text-secondary);
}

.mobile-search-close {
    display: flex;
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    background: var(--glass-bg);
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    cursor: pointer;
    z-index: 1001;
    padding: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.mobile-search-close:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
}

/* 动画 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .navbar {
        width: calc(100% - 32px);
        padding: 0 20px;
    }
    
    .nav-menu {
        gap: 2px;
    }
    
    .nav-link, .dropdown-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .search-box.active {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .navbar {
        width: calc(100% - 24px);
        padding: 0 16px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .nav-actions {
        gap: 8px;
    }
    
    .search-container .action-btn {
        display: flex;
    }
    
    .search-box {
        display: none;
    }
    
    .mobile-search-box {
        display: block;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0 12px;
        top: 10px;
    }
    
    .nav-container {
        height: 64px;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .nav-actions {
        gap: 6px;
    }
    
    .action-btn {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    
    .mobile-search-box {
        padding: 12px;
    }
    
    .mobile-search-input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .mobile-search-close {
        display: flex;
        position: absolute;
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 8px;
        color: var(--text-primary);
        cursor: pointer;
    }
}

/* goumai 类样式 - 盈利点设计 */
.goumai {
    position: relative;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
    color: white !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    overflow: visible;
    z-index: 1000;
}

.goumai::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
    border-radius: inherit;
}

.goumai:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.6);
    background: linear-gradient(135deg, #ee5a24, #ff6b6b) !important;
}

.goumai:hover::before {
    left: 100%;
}

/* 桌面端 goumai 按钮 */
.nav-link.goumai {
    padding: 14px 20px;
    border-radius: 12px;
}

/* 移动端 goumai 按钮 */
.mobile-nav-link.goumai {
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-nav-link.goumai i {
    color: white !important;
    font-size: 18px;
}

/* 限时特惠徽章 */
.goumai::after {
    content: '限时特惠';
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ffeb3b;
    color: #333;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(255, 235, 59, 0.6);
    animation: pulse 2s infinite;
    z-index: 9999;
    pointer-events: none;
}

/* 双排布局样式 */
.dropdown-content.twolist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 360px;
    white-space: normal;
}

.dropdown-content.twolist a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}