/* ========== 网址导航 - 样式表 ========== */

:root {
    --primary-color: #c4a882;
    --primary-light: #f5efe7;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg-color: #f8f6f3;
    --card-bg: #ffffff;
    --border-color: #eee;
    --hover-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --tab-active: #c4a882;
    --tab-inactive: #888;
    --radius: 10px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

/* ===== 粒子背景 ===== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* 确保所有内容在粒子层上方 */
.header,
.nav-tabs,
.content,
.footer {
    position: relative;
    z-index: 1;
}

/* ===== 头部搜索区域 ===== */
.header {
    padding: 50px 20px 30px;
    text-align: center;
}

.site-title {
    font-size: 28px;
    font-weight: 300;
    color: var(--primary-color);
    margin-bottom: 0;
    letter-spacing: 4px;
}

/* ===== 分类标签 ===== */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 35px;
    padding: 15px 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.nav-tabs .tab-item {
    font-size: 15px;
    color: var(--tab-inactive);
    cursor: pointer;
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    user-select: none;
    white-space: nowrap;
}

.nav-tabs .tab-item:hover {
    color: var(--tab-active);
}

.nav-tabs .tab-item.active {
    color: var(--tab-active);
    border-bottom-color: var(--tab-active);
    font-weight: 500;
}

/* ===== 网站内容区域 ===== */
.content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.category-section {
    display: none;
}

.category-section.active {
    display: block;
}

/* ===== 网站网格 ===== */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.site-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.site-item:hover {
    background: var(--primary-light);
    transform: scale(1.02);
    z-index: 1;
    box-shadow: var(--hover-shadow);
}

.site-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: contain;
}

/* 默认图标（当没有上传图标时使用首字母） */
.site-icon-text {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.site-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* ===== 底部 ===== */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .sites-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 30px 15px 20px;
    }

    .site-title {
        font-size: 22px;
    }

    .nav-tabs {
        gap: 20px;
    }

    .sites-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .sites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .nav-tabs {
        gap: 15px;
    }

    .site-item {
        padding: 14px 12px;
    }
}

/* ===== 加载动画 ===== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 图标颜色方案 ===== */
.icon-color-0 { background: linear-gradient(135deg, #ff6b6b, #ee5a24); }
.icon-color-1 { background: linear-gradient(135deg, #4ecdc4, #44bd9e); }
.icon-color-2 { background: linear-gradient(135deg, #45aaf2, #2d98da); }
.icon-color-3 { background: linear-gradient(135deg, #fed330, #f7b731); }
.icon-color-4 { background: linear-gradient(135deg, #a55eea, #8854d0); }
.icon-color-5 { background: linear-gradient(135deg, #fd9644, #e67e22); }
.icon-color-6 { background: linear-gradient(135deg, #fc5c65, #eb3b5a); }
.icon-color-7 { background: linear-gradient(135deg, #26de81, #20bf6b); }
.icon-color-8 { background: linear-gradient(135deg, #778ca3, #4b6584); }
.icon-color-9 { background: linear-gradient(135deg, #d63031, #c0392b); }
