/* 导航页面专用样式 */

/* 导航页面头部 */
.navigation-header {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.navigation-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.1)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.navigation-header .container {
    position: relative;
    z-index: 2;
}

.navigation-header h1,
.navigation-header p {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 搜索区域样式 */
.search-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-top: -3rem;
    position: relative;
    z-index: 3;
}

.search-engines {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-engine-btn {
    background: white;
    border: 3px solid;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-engine-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.05);
}

.search-engine-btn.active {
    background: var(--primary-color);
    color: white !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* 自定义搜索引擎说明 */
.search-customize-info {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* 分类自定义图标样式 */
.category-custom-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    margin-right: 10px;
}

/* 分类自定义图标说明部分样式 */
.category-customize-info-section {
    background-color: #f8f9fa;
}

.category-customize-info {
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-customize-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.category-customize-info pre {
    font-size: 14px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.category-customize-info code {
    background-color: #f1f3f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* 网站项目自定义图标样式 */
.site-custom-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 4px;
    border: 1px solid #e9ecef;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* 自定义图标样式 */
.custom-engine-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
}

.search-box {
    margin-top: 1.5rem;
}

.search-box .form-control {
    border-radius: 50px;
    border: 2px solid #e9ecef;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.search-box .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-box .btn {
    border-radius: 50px;
    padding: 1rem 2rem;
    margin-left: 0.5rem;
}

.search-history {
    margin-top: 1rem;
}

.search-history-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-history-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-history-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 分类卡片样式 */
.category-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.category-header {
    padding: 1.5rem;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
}

.category-header .category-title {
    margin: 0.5rem 0 0 0;
    font-size: 1.25rem;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.category-body {
    padding: 1.5rem;
}

.sites-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.site-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.site-link:hover {
    text-decoration: none;
    color: inherit;
}

.site-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.site-item:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.site-icon {
    width: 40px;
    height: 40px;
    background: white;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
    border: 1px solid #e9ecef;
}

.site-info {
    flex: 1;
    min-width: 0;
}

.site-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-desc {
    font-size: 0.875rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 快速工具样式 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.tool-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.tool-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tool-item i {
    margin-bottom: 0.5rem;
    display: block;
}

.tool-item span {
    font-weight: 500;
    font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-container {
        margin-top: -2rem;
        padding: 1.5rem;
    }
    
    .search-engines {
        gap: 0.25rem;
    }
    
    .search-engine-btn {
        width: 40px;
        height: 40px;
    }
    
    .search-box .form-control {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .search-box .btn {
        padding: 0.75rem 1.5rem;
    }
    
    .category-header {
        padding: 1rem;
    }
    
    .category-body {
        padding: 1rem;
    }
    
    .site-item {
        padding: 0.5rem;
    }
    
    .site-icon {
        width: 35px;
        height: 35px;
        margin-right: 0.5rem;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .tool-item {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .search-container {
        margin-top: -1rem;
        padding: 1rem;
        border-radius: 0.5rem;
    }
    
    .navigation-header h1 {
        font-size: 2rem;
    }
    
    .category-header .category-title {
        font-size: 1rem;
    }
    
    .site-name {
        font-size: 0.875rem;
    }
    
    .site-desc {
        font-size: 0.75rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card {
    animation: slideInUp 0.6s ease-out;
}

.category-card:nth-child(2) {
    animation-delay: 0.1s;
}

.category-card:nth-child(3) {
    animation-delay: 0.2s;
}

.category-card:nth-child(4) {
    animation-delay: 0.3s;
}

.category-card:nth-child(5) {
    animation-delay: 0.4s;
}

.category-card:nth-child(6) {
    animation-delay: 0.5s;
}

.tool-item {
    animation: slideInUp 0.6s ease-out;
}

.tool-item:nth-child(2) {
    animation-delay: 0.1s;
}

.tool-item:nth-child(3) {
    animation-delay: 0.2s;
}

.tool-item:nth-child(4) {
    animation-delay: 0.3s;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .search-container {
        background: #2d3748;
        color: white;
    }
    
    .category-card {
        background: #2d3748;
        color: white;
    }
    
    .site-item {
        background: #4a5568;
        border-color: #4a5568;
        color: white;
    }
    
    .site-item:hover {
        background: #2d3748;
    }
    
    .tool-item {
        background: #2d3748;
        border-color: #4a5568;
        color: white;
    }
    
    .search-engine-btn {
        background: #4a5568;
        color: white;
    }
    
    .search-engine-btn:hover {
        background: #2d3748;
    }
}

/* 强制浅色主题，确保文字清晰可见 */
.navigation-page {
    background: #f8f9fa !important;
}

.navigation-page .category-card {
    background: white !important;
    color: #2c3e50 !important;
}

.navigation-page .site-item {
    background: #fafafa !important;
    color: #2c3e50 !important;
}

.navigation-page .site-name {
    color: #2c3e50 !important;
}

.navigation-page .site-desc {
    color: #6c757d !important;
}

.navigation-page .tool-item {
    background: white !important;
    color: #2c3e50 !important;
}

.navigation-page .search-container {
    background: white !important;
    color: #2c3e50 !important;
}

.navigation-page .search-engine-btn {
    background: #f8f9fa !important;
    color: #6c757d !important;
}

.navigation-page .search-engine-btn:hover {
    background: #e9ecef !important;
    color: #495057 !important;
}

.navigation-page .search-engine-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
}
