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

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========== 背景动画 ========== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

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

/* ========== 头部 ========== */
.header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 0 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    font-size: 42px;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
}

.logo h1 {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 28px;
}

/* ========== 搜索框 ========== */
.search-box {
    position: relative;
    max-width: 460px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: #ffffff;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    opacity: 0.5;
}

/* ========== 分类导航 ========== */
.category-nav {
    position: relative;
    z-index: 1;
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(12px);
}

.category-list {
    display: flex;
    gap: 8px;
    list-style: none;
    justify-content: center;
    flex-wrap: wrap;
}

.category-list a {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
}

.category-list a:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
    background: #ffffff;
}

.category-list a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

/* ========== 工具网格 ========== */
.main-content {
    position: relative;
    z-index: 1;
    padding: 20px 0 60px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* ========== 工具卡片 ========== */
.tool-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.4s ease both;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card:hover .tool-arrow {
    transform: translateX(4px);
    opacity: 1;
}

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

.tool-icon {
    font-size: 32px;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1);
}

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

.tool-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-desc {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-arrow {
    font-size: 20px;
    color: var(--text-secondary);
    opacity: 0;
    transition: all 0.3s ease;
}

/* ========== 无结果提示 ========== */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.no-results p {
    font-size: 16px;
}

/* ========== 页脚 ========== */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
}

.footer-tip {
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.7;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .header {
        padding: 40px 0 20px;
    }

    .logo h1 {
        font-size: 28px;
    }

    .logo-icon {
        font-size: 34px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .category-list {
        gap: 4px;
    }

    .category-list a {
        padding: 6px 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .tool-card {
        padding: 14px 16px;
    }
}
