/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 根变量 */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --bg-primary: #f7fafc;
    --bg-secondary: #ffffff;
    --border-color: #e2e8f0;
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-light);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 2rem;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 搜索框样式 */
.search-container {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--bg-secondary);
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* 主要内容 */
.main-content {
    padding: 2rem 0;
}

/* 分类样式 */
.category-section {
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.category-title i {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* 网站网格 */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* 网站卡片 */
.site-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.site-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-color);
}

.site-card:hover::before {
    opacity: 0.05;
}

.site-card:hover .site-icon i {
    transform: scale(1.1);
    color: var(--primary-color);
}

.site-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    color: white;
    font-size: 1.25rem;
}

.site-icon i {
    transition: var(--transition);
}

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

.site-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 底部样式 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    margin-top: 2rem;
}

/* 隐藏样式 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .category-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .category-title {
        font-size: 1.25rem;
    }
    
    .sites-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .site-card {
        padding: 1rem;
    }
    
    .site-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .site-info h3 {
        font-size: 1rem;
    }
    
    .site-info p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .category-section {
        padding: 1rem;
    }
    
    .site-card {
        padding: 0.875rem;
        gap: 0.75rem;
    }
    
    .site-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

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

.category-section {
    animation: fadeInUp 0.6s ease-out;
}

.site-card {
    animation: fadeInUp 0.6s ease-out;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* 选中文本样式 */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* 搜索高亮样式 */
mark {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* 回到顶部按钮样式 */
.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

/* 主题切换按钮样式 */
.theme-toggle:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* 加载状态样式 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 0.875rem;
}

/* 搜索建议样式 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.search-suggestion {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-suggestion:hover {
    background: var(--bg-primary);
}

.search-suggestion:last-child {
    border-bottom: none;
}

/* 快捷键提示样式 */
.keyboard-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* 状态指示器样式 */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: absolute;
    top: 8px;
    right: 8px;
}

.status-online {
    background: #48bb78;
}

.status-offline {
    background: #f56565;
}

.status-unknown {
    background: #ed8936;
}

/* 深色主题样式 */
.dark-theme {
    --text-primary: #f7fafc;
    --text-secondary: #a0aec0;
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --border-color: #4a5568;
}

.dark-theme body {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

.dark-theme .header {
    background: rgba(45, 55, 72, 0.95);
}

.dark-theme .category-section {
    background: rgba(45, 55, 72, 0.95);
}

.dark-theme .footer {
    background: rgba(45, 55, 72, 0.95);
}

/* 响应式搜索框 */
@media (max-width: 480px) {
    .search-input {
        padding: 0.625rem 0.875rem 0.625rem 2.5rem;
        font-size: 0.875rem;
    }
    
    .search-icon {
        left: 0.875rem;
        font-size: 0.875rem;
    }
} 