:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --gradient-start: #6366f1;
    --gradient-end: #8b5cf6;
    
    /* 分类颜色 */
    --color-design: #a855f7;
    --color-math: #10b981;
    --color-netdev: #3b82f6;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 20%);
}

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

/* 顶部标题栏 */
header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-md);
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 32px;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.search-bar {
    width: 100%;
    padding: 16px 24px 16px 52px;
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background-color: white;
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    color: var(--text-main);
}

.search-bar:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-lg);
}

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

.search-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 12px;
    opacity: 0.7;
}

/* 分类区块样式 */
.category-section {
    margin-bottom: 60px;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.category-section:nth-child(2) { animation-delay: 0.1s; }
.category-section:nth-child(3) { animation-delay: 0.2s; }
.category-section:nth-child(4) { animation-delay: 0.3s; }

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.category-title {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 8px 0;
    position: relative;
}

.category-title i {
    margin-right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: white;
}

.design-section .category-title i { background-color: var(--color-design); }
.math-section .category-title i { background-color: var(--color-math); }
.netdev-section .category-title i { background-color: var(--color-netdev); }

.category-count {
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: 12px;
}

/* 网格布局 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* 工具卡片样式 */
.tool-card {
    background: var(--card-bg);
    padding: 28px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--hover-color), var(--hover-color-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--hover-color);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--hover-bg), var(--hover-bg-light));
    color: var(--hover-color);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.tool-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.tool-card h3 {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.tool-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex-grow: 1;
}

.tool-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.tool-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: #f8fafc;
    color: var(--hover-color);
}

.arrow-icon {
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.3s ease;
}

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

/* 针对不同分类的颜色修饰 */
.design-section { 
    --hover-color: var(--color-design); 
    --hover-color-light: #c084fc;
    --hover-bg: #f5f3ff;
    --hover-bg-light: #faf5ff;
}

.math-section { 
    --hover-color: var(--color-math); 
    --hover-color-light: #34d399;
    --hover-bg: #ecfdf5;
    --hover-bg-light: #f0fdf9;
}

.netdev-section { 
    --hover-color: var(--color-netdev); 
    --hover-color-light: #60a5fa;
    --hover-bg: #eff6ff;
    --hover-bg-light: #f5f9ff;
}

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

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid #e2e8f0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .container {
        padding: 32px 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .category-title {
        font-size: 1.3rem;
    }
}

/* 加载动画 */
.loading {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loaded {
    opacity: 1;
}


h1 {
    position: relative;
    display: table; /* 关键：既能限制宽度，又支持 margin 居中 */
    margin: 0 auto; /* 水平居中 */
    font-size: 3rem;
    color: #333;
    padding-bottom: 10px;
}
