/* index.css - 主页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #e1e5e9;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

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

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--secondary-color);
}

.logo img {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border-radius: var(--radius);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 搜索框 */
.search-container {
    flex: 1;
    max-width: 500px;
    min-width: 300px;
}

.search-form {
    display: flex;
    background: var(--light-bg);
    border-radius: 50px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.search-form:focus-within {
    border-color: var(--primary-color);
}

.search-form input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-color);
}

.search-form input:focus {
    outline: none;
}

.search-form button {
    padding: 12px 20px;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-form button:hover {
    background: #2980b9;
}

/* 头部按钮 */
.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-apply, .btn-admin {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-apply {
    background: var(--accent-color);
    color: white;
}

.btn-admin {
    background: var(--secondary-color);
    color: white;
}

.btn-apply:hover, .btn-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 分类导航 */
.category-nav {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid var(--border-color);
}

.category-nav ul {
    display: flex;
    list-style: none;
    overflow-x: auto;
    padding: 10px 0;
    gap: 2px;
}

.category-nav li {
    margin-right: 1px;
}

.category-nav a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: var(--radius);
    transition: all 0.3s;
    white-space: nowrap;
}

.category-nav li.active a,
.category-nav a:hover {
    background: var(--primary-color);
    color: white;
}

/* 公告区域 */
.announcement-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 0;
    margin: 20px 0;
    border-radius: var(--radius);
}

.announcement-carousel {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.announcement-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.announcement-icon {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-top: 2px;
}

.announcement-content {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* 广告轮播 */
.ad-carousel-section {
    margin: 30px 0;
}

.ad-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.ad-item {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.ad-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.ad-item:hover img {
    transform: scale(1.05);
}

/* 网站网格布局 */
.website-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 30px 0;
}

/* 网站卡片 */
.website-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.website-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.website-image {
    height: 180px;
    overflow: hidden;
}

.website-image img,
.image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.website-card:hover .website-image img {
    transform: scale(1.05);
}

.image-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.website-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.website-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.website-icon img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    object-fit: cover;
}

.website-title {
    flex: 1;
}

.website-title h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.website-level {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

/* 等级颜色 */
.level-10 { background: linear-gradient(45deg, #ff9500, #ff5e3a); }
.level-9 { background: linear-gradient(45deg, #ff5e3a, #ff2a68); }
.level-8 { background: linear-gradient(45deg, #ff2a68, #c644fc); }
.level-7 { background: linear-gradient(45deg, #c644fc, #5856d6); }
.level-6 { background: linear-gradient(45deg, #5856d6, #007aff); }
.level-5 { background: linear-gradient(45deg, #007aff, #34aadc); }
.level-4 { background: linear-gradient(45deg, #34aadc, #5ac8fa); }
.level-3 { background: linear-gradient(45deg, #5ac8fa, #4cd964); }
.level-2 { background: linear-gradient(45deg, #4cd964, #ffcc00); }
.level-1 { background: linear-gradient(45deg, #ffcc00, #ff9500); }

.website-description {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
}

.website-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.category-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.keyword {
    background: var(--light-bg);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-color);
}

.website-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-visit, .btn-detail {
    flex: 1;
    padding: 10px;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-visit {
    background: var(--primary-color);
    color: white;
}

.btn-detail {
    background: var(--light-bg);
    color: var(--text-color);
}

.btn-visit:hover {
    background: #2980b9;
}

.btn-detail:hover {
    background: #e9ecef;
}

/* 搜索信息 */
.search-info {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.search-info h2 {
    color: var(--secondary-color);
    margin-bottom: 10px;
}

/* 无结果 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.no-results i {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.no-results h3 {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.no-results a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.no-results a:hover {
    text-decoration: underline;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    gap: 10px;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 20px;
    background: white;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--primary-color);
    color: white;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

/* 页脚 */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section p {
    margin-bottom: 10px;
    opacity: 0.9;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.footer-section a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo a {
        justify-content: center;
    }
    
    .search-container {
        width: 100%;
        max-width: 100%;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .category-nav ul {
        justify-content: flex-start;
        padding-bottom: 10px;
    }
    
    .website-grid {
        grid-template-columns: 1fr;
    }
    
    .ad-carousel {
        grid-template-columns: 1fr;
    }
    
    .website-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .website-icon {
        margin-bottom: 10px;
    }
    
    .pagination {
        flex-direction: column;
    }
    
    .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .btn-apply, .btn-admin {
        width: 100%;
        justify-content: center;
    }
    
    .website-actions {
        flex-direction: column;
    }
    
    .announcement-item {
        flex-direction: column;
        text-align: center;
    }
}