/* 通用样式文件 - 头部导航、底部菜单、主题系统等 */

/* CSS变量定义 */
:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --card-bg: #1f1f1f;
    --header-bg: rgba(15, 15, 15, 0.95);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent-orange: #ff6b35;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #22c55e;
    --accent-green-hover: #16a34a;
    --border-color: #4a4a4a;
    --hover-bg: #2a2a2a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
    --accent-gradient: linear-gradient(135deg, #ff6b35, #3b82f6);
}

/* 白天主题 - 柔色风格 */
html[data-theme="light"] {
    --primary-bg: #fafbfc;
    --secondary-bg: #f8fafc;
    --card-bg: #ffffff;
    --header-bg: rgba(250, 251, 252, 0.95);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-orange: #ff6b35;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --border-color: #e2e8f0;
    --hover-bg: #f1f5f9;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --accent-gradient: linear-gradient(135deg, #ff6b35, #3b82f6);
}

/* 主题切换 */
html {
    /* 无动画 */
}

.site-header,
.main-content,
.mobile-sidebar,
.mobile-top-nav {
    /* 无动画 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 取消所有链接的文字变色特效 */
a:hover,
a:focus,
a:active {
    color: inherit !important;
}

/* 白天主题下的悬停文字颜色调整 */
html[data-theme="light"] .mobile-filter-dropdown:hover,
html[data-theme="light"] .mobile-reset-button:hover,
html[data-theme="light"] .category-header:hover,
html[data-theme="light"] .subcategory-item:hover,
html[data-theme="light"] .filter-item:hover,
html[data-theme="light"] .mobile-nav-item:hover {
    color: var(--text-primary) !important;
}

html[data-theme="light"] .mobile-filter-dropdown:hover .mobile-filter-label,
html[data-theme="light"] .mobile-reset-button:hover {
    color: var(--text-primary) !important;
}

/* 白天主题下绿色背景必须使用白色文字 */
html[data-theme="light"] .nav-link.active,
html[data-theme="light"] .nav-link.active:hover,
html[data-theme="light"] .tag-item:hover,
html[data-theme="light"] .search-btn,
html[data-theme="light"] .search-btn:hover,
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-primary:hover {
    color: white !important;
}

/* 确保标签悬停时字体是白色 */
.tool-tag:hover {
    color: white !important;
}

/* 白天主题下标签悬停时字体必须是白色 */
html[data-theme="light"] .tool-tag:hover {
    color: white !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* 小屏幕下的容器padding调整 */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
}

/* ===== 头部导航样式 ===== */
.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
}

.navbar {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    position: relative;
}

.navbar-brand .logo {
    font-size: 1.8rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-right: 2rem;
}

.navbar-brand .logo .best {
    color: var(--accent-orange);
}

.navbar-brand .logo .directories {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex: 1;
    justify-content: center;
    margin: 0 auto;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.nav-link.active {
    background: var(--accent-green);
    color: white;
    font-weight: 600;
}

.nav-link.active:hover {
    background: var(--accent-green-hover);
    color: white;
}

/* 头部菜单下划线指示器 */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-green);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active::after {
    width: 80%;
    background: white;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    margin-left: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--hover-bg);
    color: var(--text-secondary);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* 语言切换按钮 */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.language-toggle:hover {
    background: var(--hover-bg);
    color: var(--text-secondary);
    border: 1px solid var(--accent-orange);
}

.language-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    min-width: 200px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.language-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.language-item:last-child {
    border-bottom: none;
}

.language-item:hover {
    background: var(--hover-bg);
}

.language-item[data-lang="en"] .bi-check {
    color: var(--accent-orange);
}

/* 移动端分类菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

.mobile-menu-toggle:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* 移动端顶部导航菜单 */
.mobile-top-nav {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    z-index: 1002;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.mobile-top-nav.show {
    left: 0;
}

.mobile-top-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.mobile-top-logo {
    font-size: 1.5rem;
    font-weight: 800;
}

.mobile-top-logo .best {
    color: var(--accent-orange);
}

.mobile-top-logo .directories {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-top-nav-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.mobile-top-nav-close:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.mobile-top-nav-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: var(--accent-green);
    color: white;
}

.mobile-nav-item i {
    font-size: 1.2rem;
    min-width: 20px;
}

/* 主题切换按钮 */
.theme-toggle {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-toggle:hover::before {
    opacity: 0.1;
}

.theme-toggle i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(15deg);
}

/* ===== 主要内容区域布局 ===== */
.main-content {
    padding: 2rem 0;
    background: var(--primary-bg);
}

/* ===== 底部菜单样式 ===== */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 3rem 0 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section {
    min-width: 0;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* 底部菜单组标题样式 */
.footer-section .footer-subtitle {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.footer-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .navbar-nav {
        display: none;
    }

    .navbar-brand {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .container {
        padding: 0 0 0 60px;
    }

    .main-content .container {
        padding: 0 20px;
    }
}

/* Footer响应式设计 */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .site-footer {
        margin-top: 2rem;
        padding: 2rem 0 0 0;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .footer-title {
        font-size: 1.25rem;
    }

    .footer-subtitle {
        font-size: 1rem;
    }

    .social-links {
        justify-content: center;
    }

    .footer-section {
        padding: 0 0.5rem;
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-section {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}
