/*!
 * 雷九AI导航 - 前端样式
 * 
 * 前端用户界面的样式文件，包含现代化设计和响应式布局。
 * 
 * @author 雷九AI导航团队
 * @version 1.0.0
 * @copyright Copyright (c) 2023-2024 雷九AI导航
 * @link https://lei9.cn
 * @license MIT License
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #9d4edd;
    --secondary-color: #00f5d4;
    
    /* Dark Theme (Default) */
    --bg-main: #10111A;
    --text-color: #E0E0E0;
    --text-light: #a0a0b0;
    --text-hero: #ffffff;
    --text-active: #ffffff;
    --border-color: rgba(255, 255, 255, 0.15);
    --glass-bg: rgba(27, 28, 42, 0.6);

    --sidebar-width: 260px;
    --border-radius: 12px;
}

body.light-theme {
    /* Light Theme */
    --bg-main: #f0f2f5;
    --text-color: #333333;
    --text-light: #666666;
    --text-hero: #000000;
    --text-active: #ffffff;
    --border-color: #e0e0e0;
    --glass-bg: rgba(255, 255, 255, 0.7);
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-color);
    margin: 0;
    overflow-x: hidden;
}

/* Aurora背景画布 */
#aurora-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    pointer-events: none;
}

#aurora-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.8; }

.page-container { margin-left: var(--sidebar-width); }

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--glass-bg);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    display: flex; align-items: center; justify-content: center;
    padding: 0 25px; height: 80px; flex-shrink: 0;
}
.logo { font-size: 28px; font-weight: 700; color: var(--text-hero); white-space: nowrap; }

.sidebar-menu { list-style: none; padding: 15px; margin: 0; flex-grow: 1; overflow-y: auto; overflow-x: hidden; }
.sidebar-menu li a { display: flex; align-items: center; height: 50px; padding: 0 20px; color: var(--text-light); text-decoration: none; border-radius: var(--border-radius); font-weight: 500; transition: all 0.2s; white-space: nowrap; }
.sidebar-menu li a:hover { color: var(--text-color); background: rgba(128,128,128,0.1); }
.sidebar-menu li.active a { color: var(--text-active); background: var(--primary-color); box-shadow: 0 0 15px rgba(157, 78, 221, 0.5); }
.sidebar-menu i { font-size: 18px; min-width: 30px; text-align: center; }
.sidebar-menu span { margin-left: 15px; }

.sidebar-footer { padding: 20px; border-top: 1px solid var(--border-color); }
.sidebar-footer a { display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text-light); font-weight: 500; padding: 10px; border-radius: var(--border-radius); transition: all 0.2s; white-space: nowrap; }
.sidebar-footer a:hover { color: var(--text-color); background: rgba(128,128,128,0.1); }

.theme-toggle-btn {
    position: fixed;
    top: 25px;
    right: 30px;
    z-index: 1001; /* Ensure it's above other content */
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    color: var(--text-active);
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.theme-toggle-btn .fa-sun { display: none; }
.theme-toggle-btn .fa-moon { display: block; } /* Show moon in dark mode */

body.light-theme .theme-toggle-btn .fa-sun { display: block; } /* Show sun in light mode */
body.light-theme .theme-toggle-btn .fa-moon { display: none; }


/* --- Main Content --- */
.main-content { padding: 0 60px; }
.hero-section { text-align: center; padding: 80px 0; }

/* Gradient text for hero section, with a fallback for light theme */
.hero-section h1 {
    font-size: 4rem; margin: 0 0 10px 0; font-weight: 700;
    color: var(--text-hero);
}
body:not(.light-theme) .hero-section h1 {
    background: linear-gradient(45deg, #fff, #a0a0b0); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
}

.hero-section p { font-size: 1.2rem; color: var(--text-light); margin: 0 0 40px 0; }

/* 增强搜索容器 */
.enhanced-search-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 18px;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.4s ease;
}

.search-box:hover {
    box-shadow: 0 12px 40px rgba(157, 78, 221, 0.15);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 25px;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
    z-index: 2;
}

.search-box input {
    width: 100%;
    padding: 24px 80px 24px 60px;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--text-color);
    outline: none;
    transition: all 0.3s;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #8539d0;
    transform: translateY(-50%) scale(1.05);
}

.search-clear-btn {
    position: absolute;
    right: 65px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
}

/* 搜索引擎选择器 */
.search-engines {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.search-engine {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
}

.search-engine:hover {
    background: rgba(157, 78, 221, 0.15);
    transform: translateY(-2px);
}

.search-engine.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.3);
}

.search-engine i {
    font-size: 16px;
}

.search-engine span {
    font-size: 14px;
    font-weight: 500;
}

/* 响应式搜索框 */

/* 搜索通知 */
.search-notification {
    background: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.search-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.2);
    z-index: -1;
}

.links-section { padding: 40px 0; }
.category-group { margin-bottom: 60px; }
.category-group h2 { font-size: 1.8rem; font-weight: 500; margin-bottom: 25px; color: var(--text-color); }

.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px; }

.link-card { background: var(--glass-bg); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 20px; text-decoration: none; color: var(--text-color); transition: all 0.4s ease; transform-style: preserve-3d; cursor: pointer; }
.link-card:hover { transform: perspective(1000px) translateY(-5px) rotateX(4deg) rotateY(-2deg); box-shadow: 0 20px 40px rgba(0,0,0,0.1), 0 0 20px rgba(157, 78, 221, 0.2); border-color: rgba(157, 78, 221, 0.5); }

.link-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.favicon { width: 22px; height: 22px; border-radius: 4px; }
.link-title { margin: 0; font-size: 1.1rem; font-weight: 500; color: var(--text-color); }
.link-description { font-size: 0.9rem; color: var(--text-light); line-height: 1.6; margin: 0; }
.no-links { color: var(--text-light); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

.logo-image {
    max-width: 80%;
    max-height: 60px;
    object-fit: contain;
}

