/* 
 * Aeon Glass UI Theme - V2.5 (Grid Fixed)
 * Style: Mechanical / Cyber / Clean
 */

:root {
    /* 基础配色变量 */
    --primary-color: #f1404b;
    --bg-dark: #121212;
    --bg-light: #f0f2f5;
    
    /* 机械参数 */
    --glass-opacity: rgba(30, 30, 30, 0.65);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);
    --card-radius: 16px;
    --search-radius: 24px;
    
    /* 动画曲线 */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* --- 1. 全局基础 --- */
body {
    font-family: "SF Pro SC", "HanHei SC", "Microsoft YaHei", sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: color 0.3s;
    font-size: 14px;
}

/* 背景层 */
.bg-layer {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    transition: all 0.5s ease;
}

/* 核心容器 */
.main-container {
    max-width: 1600px; /* 加宽以适配 XXL 6列 */
    padding-top: 40px;
    padding-bottom: 40px;
    width: 95%; /* 左右留一点余地 */
    margin: 0 auto;
}

/* --- 2. 深色/浅色模式定义 --- */
body.theme-dark { color: #e0e0e0; }
body.theme-dark .bg-layer {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('../images/bg-dna.jpg');
    background-color: #121212;
}
body.theme-dark .glass-panel {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
body.theme-dark .search-input {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Light Mode */
body.theme-light { color: #333; }
body.theme-light .bg-layer {
    background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
}
body.theme-light .glass-panel {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
}
body.theme-light .search-input {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- 3. 通用毛玻璃面板类 --- */
.glass-panel {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--card-radius);
    transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s, border-color 0.3s;
}

/* --- 4. 搜索控制台 --- */
.search-console {
    padding: 30px;
    margin-bottom: 40px;
    border-radius: var(--search-radius);
    position: relative;
    overflow: visible;
    transition: all 0.4s var(--ease-out-expo);
    
    /* 限制搜索框最大宽度，避免在超大屏过长 */
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.search-console:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 45px rgba(0,0,0,0.2);
    border-color: rgba(255,255,255,0.3);
}

/* Tab 切换容器 */
.engine-tabs-wrapper {
    overflow-x: auto;
    white-space: nowrap;
    margin-bottom: 20px;
    text-align: center;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    justify-content: center;
}
.engine-tabs-wrapper::-webkit-scrollbar { display: none; }

.engine-tabs { display: flex; gap: 10px; }
.tab-item {
    padding: 6px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.6;
    border-radius: 20px;
    transition: all 0.3s;
    flex-shrink: 0;
}
.tab-item:hover { opacity: 1; }
.tab-item.active { 
    opacity: 1; 
    background: var(--primary-color); 
    color: #fff;
    box-shadow: 0 2px 10px rgba(241, 64, 75, 0.4);
}

/* 搜索输入区 */
.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
}
.search-input {
    width: 100%;
    height: 50px;
    border-radius: 50px;
    padding: 0 60px 0 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.search-input:focus {
    box-shadow: 0 0 0 2px rgba(241, 64, 75, 0.5), inset 0 2px 4px rgba(0,0,0,0.05);
}
.search-btn {
    position: absolute;
    right: 5px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.3s;
}
.search-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: rotate(15deg);
}

/* 搜索引擎 Radio (底部) */
.engine-radios {
    text-align: center;
    min-height: 30px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    display: flex;
    justify-content: center;
}
.engine-radios::-webkit-scrollbar { display: none; }

.radio-group { display: none; animation: fadeIn 0.3s ease; width: 100%; }
.radio-group.active { display: block; }
.radio-item {
    display: inline-block;
    margin: 0 6px;
    font-size: 13px;
    cursor: pointer;
    opacity: 0.6;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.radio-item:hover { opacity: 1; background: rgba(128,128,128,0.1); }
.radio-item.active {
    opacity: 1;
    color: var(--primary-color);
    border-color: rgba(241, 64, 75, 0.3);
    background: rgba(241, 64, 75, 0.1);
    font-weight: bold;
}

/* 搜索提示下拉 */
#search-suggestions {
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 700px;
    background: rgba(30,30,30,0.95);
    z-index: 999;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    display: none;
    text-align: left;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
body.theme-light #search-suggestions { background: rgba(255,255,255,0.95); }
#search-suggestions li {
    padding: 8px 25px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
#search-suggestions li:hover {
    background: rgba(128,128,128,0.15);
    color: var(--primary-color);
}

/* --- 5. 内容区域 --- */
.section-title {
    margin: 30px 0 15px;
    font-size: 18px;
    font-weight: 700;
    opacity: 0.9;
    display: flex;
    align-items: center;
}
.section-title i { margin-right: 8px; color: var(--primary-color); font-size: 20px; }

/* 卡片设计 */
.site-card {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 20px;
    text-decoration: none !important;
    color: inherit !important;
    height: 76px;
    position: relative;
    overflow: hidden;
}
.site-card:hover {
    transform: translateY(-4px);
    border-color: rgba(241, 64, 75, 0.5);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
/* 背景光晕 */
.site-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.03), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}
.site-card:hover::after { transform: translateX(100%); }

.site-icon {
    width: 40px; height: 40px;
    flex-shrink: 0;
    margin-right: 12px;
    background: rgba(128,128,128,0.1);
    border-radius: 10px;
    padding: 6px;
    transition: transform 0.3s;
}
.site-card:hover .site-icon { transform: rotate(10deg) scale(1.1); }
.site-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }

.site-info { flex-grow: 1; overflow: hidden; }
.site-info strong { display: block; font-size: 14px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-info p { margin: 0; font-size: 12px; opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 友情链接区域 */
.friend-links {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}
.friend-links a {
    color: inherit;
    opacity: 0.7;
    font-size: 13px;
    transition: 0.3s;
    padding: 5px 10px;
    border-radius: 8px;
}
.friend-links a:hover { 
    color: var(--primary-color); 
    opacity: 1; 
    background: rgba(128,128,128,0.1);
}

/* --- 6. 底部与工具 --- */
.main-footer {
    text-align: center;
    padding: 40px 0;
    font-size: 12px;
    opacity: 0.5;
}
.main-footer a { color: inherit; text-decoration: none; }
.main-footer a:hover { color: var(--primary-color); }

.fixed-tools {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}
.fixed-tools button {
    width: 45px; height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--glass-opacity);
    backdrop-filter: blur(10px);
    color: var(--primary-color);
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s;
}
.fixed-tools button:hover {
    transform: scale(1.15);
    background: var(--primary-color);
    color: #fff;
}
#go-top { display: none; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 7. 响应式栅格自定义 (Custom Grid) --- */

/* 5列布局 (xl: 1200px+) */
@media (min-width: 1200px) {
    .col-xl-5a {
        -ms-flex: 0 0 20%;
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* 6列布局 (xxl: 1600px+) */
@media (min-width: 1600px) {
    .col-xxl-6a {
        -ms-flex: 0 0 16.666667%;
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .main-container { 
        padding-top: 20px; 
        width: 100%; 
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .search-console { padding: 20px 15px; margin-bottom: 30px; }
    .search-input { padding-left: 15px; font-size: 14px; }
    
    .tab-item { padding: 5px 12px; font-size: 13px; flex-shrink: 0; }
    .radio-item { margin: 0 4px; font-size: 12px; }

    .row { margin-left: -5px; margin-right: -5px; }
    .col-6, .col-sm-4 { padding-left: 5px; padding-right: 5px; }
    
    .site-card { padding: 10px; height: 70px; margin-bottom: 10px; }
    .site-icon { width: 36px; height: 36px; margin-right: 10px; }
    .site-info strong { font-size: 13px; }
    .site-info p { font-size: 11px; }
    
    .fixed-tools { bottom: 20px; right: 15px; }
}

/* --- 补充样式 --- */
.icon-lg {
    font-size: 20px !important;
    vertical-align: -2px;
}