/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto Mono', monospace;
    background: transparent; /* 改为透明 */
    color: #e0e0e0;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative; /* 添加相对定位 */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    padding: 2.5rem 0;
    text-align: center;
    border-bottom: 1px solid rgba(64, 224, 208, 0.2);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(32, 152, 255, 0.1) 0%, transparent 70%);
    z-index: -1;
}

.header-content h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #40e0d0, #20b2aa, #00ced1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(64, 224, 208, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: #a0a0c0;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* 搜索引擎容器 */
.search-engine-container {
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* 搜索引擎选择器样式 */
.search-engine-box {
    margin-bottom: 2rem;
    text-align: center;
}

.engine-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.engine-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 25px;
    color: #a0a0c0;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    min-width: 120px;
    justify-content: center;
}

.engine-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-2px);
}

.engine-btn.active {
    border-color: #40e0d0;
    background: rgba(64, 224, 208, 0.15);
    color: #40e0d0;
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.3);
}

.engine-btn i {
    font-size: 1.1rem;
}

/* Google按钮特定样式 */
.engine-btn[data-engine="google"].active {
    border-color: #4285f4;
    background: rgba(66, 133, 244, 0.15);
    color: #4285f4;
    box-shadow: 0 0 15px rgba(66, 133, 244, 0.3);
}

/* 百度按钮特定样式 */
.engine-btn[data-engine="baidu"].active {
    border-color: #5e64d3;
    background: rgba(41, 50, 225, 0.15);
    color: #5e64d3;
    box-shadow: 0 0 15px rgba(41, 50, 225, 0.3);
}

/* Bing按钮特定样式 */
.engine-btn[data-engine="bing"].active {
    border-color: #00a4ef;
    background: rgba(0, 164, 239, 0.15);
    color: #00a4ef;
    box-shadow: 0 0 15px rgba(0, 164, 239, 0.3);
}

.search-input-group {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

#webSearchInput {
    flex: 1;
    padding: 15px 25px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1rem;
    font-family: 'Roboto Mono', monospace;
}

#webSearchInput::placeholder {
    color: #a0a0c0;
}

#webSearchInput:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
}

#webSearchBtn {
    padding: 0 30px;
    border: none;
    background: linear-gradient(90deg, #20b2aa, #00ced1);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#webSearchBtn:hover {
    background: linear-gradient(90deg, #00ced1, #20b2aa);
}

#webSearchBtn .btn-text {
    display: inline;
}

.search-hint {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #8080a0;
}

/* 站内搜索包装器 */
.site-search-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1.5rem;
    gap: 15px;
}

.time-display {
    display: flex;
    gap: 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: #40e0d0;
    text-shadow: 0 0 10px rgba(64, 224, 208, 0.5);
    order: 1; /* 时间在上方 */
}

.site-search-container {
    position: relative;
    order: 2; /* 搜索在下方 */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

/* 站内搜索切换按钮 */
.site-search-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(64, 224, 208, 0.1);
    border: 2px solid rgba(64, 224, 208, 0.3);
    border-radius: 25px;
    color: #40e0d0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-family: 'Roboto Mono', monospace;
    min-width: 120px;
    justify-content: center;
}

.site-search-toggle:hover {
    background: rgba(64, 224, 208, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(64, 224, 208, 0.2);
}

.toggle-text {
    font-weight: 500;
}

/* 站内搜索框 */
.site-search-box {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px) scaleY(0);
    transform-origin: top;
    width: 100%;
    max-width: 400px;
    opacity: 0;
    display: flex;
    background: rgba(30, 30, 46, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(64, 224, 208, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 100;
    margin-top: 10px;
}

.site-search-box.active {
    opacity: 1;
    transform: translateX(-50%) translateY(10px) scaleY(1);
}

#siteSearchInput {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 0.95rem;
    font-family: 'Roboto Mono', monospace;
    min-width: 0;
}

#siteSearchInput::placeholder {
    color: #a0a0c0;
}

#siteSearchInput:focus {
    outline: none;
}

#siteSearchBtn {
    padding: 0 20px;
    border: none;
    background: rgba(64, 224, 208, 0.2);
    color: #40e0d0;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#siteSearchBtn:hover {
    background: rgba(64, 224, 208, 0.3);
}

.site-search-close {
    padding: 0 20px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: #a0a0c0;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.site-search-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff4d4d;
}

/* 搜索框动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(0) scaleY(0);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(10px) scaleY(1);
    }
}

.site-search-box.active {
    animation: slideDown 0.3s ease forwards;
}

/* 无搜索结果提示 */
.no-results {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 100, 100, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.no-results p {
    color: #ff6b6b;
    font-size: 1.1rem;
    margin: 0;
}

.no-results:before {
    content: '🔍';
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

/* 分类卡片样式 */
.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.category-card {
    background: rgba(30, 30, 46, 0.7);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }
.category-card:nth-child(5) { animation-delay: 0.5s; }
.category-card:nth-child(6) { animation-delay: 0.6s; }

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

.category-header {
    padding: 1.5rem;
    border-bottom: 2px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #a0a0c0;
}

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

/* 网站卡片样式 */
.site-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--hover-color, rgba(64, 224, 208, 0.1)), transparent);
    transition: left 0.6s ease;
}

.site-card:hover::before {
    left: 100%;
}

.site-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.site-icon {
    margin-right: 1.2rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.site-icon img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(0.95);
}

.site-card:hover .site-icon {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--hover-color, rgba(64, 224, 208, 0.3));
    transform: scale(1.05);
}

.site-card:hover .site-icon img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

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

.site-info h3 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
    color: #fff;
}

.site-url {
    font-size: 0.9rem;
    color: #a0a0c0;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-action {
    color: #a0a0c0;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.site-card:hover .site-action {
    color: var(--hover-color, #40e0d0);
}

/* 页脚样式 */
footer {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(64, 224, 208, 0.2);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-info p {
    margin-bottom: 0.5rem;
    color: #a0a0c0;
}

#totalSites {
    color: #40e0d0;
    font-weight: bold;
}

.tech-stack {
    font-size: 0.9rem;
    color: #8080a0;
}

.tech-stack i {
    margin: 0 5px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #a0a0c0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #40e0d0;
}

/* 模态框样式 */
.add-site-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(64, 224, 208, 0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(64, 224, 208, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.modal-header h3 {
    font-family: 'Orbitron', sans-serif;
    color: #40e0d0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    color: #a0a0c0;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ff4d4d;
}

.modal-body {
    padding: 2rem;
    color: #c0c0e0;
}

.modal-body pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    border-left: 3px solid #40e0d0;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(64, 224, 208, 0.2);
    display: flex;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(64, 224, 208, 0.3);
    color: #a0a0c0;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(64, 224, 208, 0.1);
    color: #40e0d0;
}

/* 模态框标签页样式 */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid rgba(64, 224, 208, 0.2);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    color: #a0a0c0;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #40e0d0;
    border-bottom-color: #40e0d0;
}

.tab-btn:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #c0c0e0;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(64, 224, 208, 0.3);
    border-radius: 5px;
    color: #fff;
    font-family: 'Roboto Mono', monospace;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #40e0d0;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 10px rgba(64, 224, 208, 0.2);
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #8080a0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary {
    padding: 10px 25px;
    background: linear-gradient(90deg, #20b2aa, #00ced1);
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #00ced1, #20b2aa);
    box-shadow: 0 5px 15px rgba(32, 178, 170, 0.3);
}

.hidden {
    display: none !important;
}

/* 生成的JSON样式 */
#generatedJson {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid #40e0d0;
}

#jsonOutput {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.loaded .category-card {
    animation: fadeInUp 0.5s ease forwards;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2.5rem;
    }
    
    .search-engine-container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .engine-btn {
        min-width: 100px;
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .search-input-group {
        max-width: 100%;
    }
    
    #webSearchBtn .btn-text {
        display: none;
    }
    
    #webSearchBtn {
        padding: 0 20px;
    }
    
    .site-search-wrapper {
        margin-top: 1rem;
    }
    
    .time-display {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 1rem;
        text-align: center;
    }
    
    .site-search-toggle {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-width: 100px;
    }
    
    .toggle-text {
        display: none;
    }
    
    .site-search-toggle {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
    
    .site-search-box {
        max-width: 300px;
    }
    
    .site-search-box.active {
        transform: translateX(-50%) translateY(5px) scaleY(1);
    }
    
    .categories-container {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .engine-btn {
        min-width: 90px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .site-search-box {
        max-width: 250px;
    }
    
    #siteSearchInput {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    #siteSearchBtn,
    .site-search-close {
        padding: 0 15px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 30, 46, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #40e0d0, #20b2aa);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #20b2aa, #40e0d0);
}

/* 添加渐变覆盖层，确保内容可读 */
.container {
    position: relative;
    z-index: 1;
    background: rgba(10, 10, 15, 0.4); /* 半透明背景确保内容可读 */
    min-height: 100vh;
    border-radius: 0;
}

/* 增强头部和卡片背景透明度 */
header {
    background: rgba(10, 10, 15, 0.6);
}

.category-card {
    background: rgba(30, 30, 46, 0.8); /* 增加透明度 */
    backdrop-filter: blur(15px); /* 增强模糊效果 */
}

/* 添加发光效果到卡片 */
.category-card:hover {
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(64, 224, 208, 0.2); /* 添加蓝色发光 */
}

/* 增强搜索框效果 */
.search-input-group {
    background: rgba(20, 20, 35, 0.7);
    backdrop-filter: blur(10px);
}

/* 模态框背景增强 */
.modal-content {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
}

/* 添加光晕动画效果 */
@keyframes glow {
    0%, 100% { 
        box-shadow: 
            0 0 5px rgba(64, 224, 208, 0.3),
            0 0 10px rgba(64, 224, 208, 0.2); 
    }
    50% { 
        box-shadow: 
            0 0 10px rgba(64, 224, 208, 0.5),
            0 0 20px rgba(64, 224, 208, 0.3); 
    }
}

/* 应用到特定元素 */
.search-input-group:focus-within {
    animation: glow 2s infinite;
}

.engine-btn.active {
    animation: glow 2s infinite;
}

/* 添加扫描线效果 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(64, 224, 208, 0.03) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

/* 添加科技感加载完成效果 */
@keyframes techFadeIn {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

body.loaded .container {
    animation: techFadeIn 1s ease-out;
}

/* 添加流光边框效果 */
@keyframes borderFlow {
    0% {
        border-image-source: linear-gradient(90deg, 
            transparent, 
            #40e0d0, 
            transparent);
    }
    50% {
        border-image-source: linear-gradient(90deg, 
            transparent, 
            #20b2aa, 
            transparent);
    }
    100% {
        border-image-source: linear-gradient(90deg, 
            transparent, 
            #40e0d0, 
            transparent);
    }
}

.category-card {
    border: 2px solid transparent;
    border-image: linear-gradient(90deg, 
        transparent, 
        rgba(64, 224, 208, 0.3), 
        transparent) 1;
    animation: borderFlow 3s infinite;
}