/* 全局样式重置 */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --secondary-light: #f472b6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #cbd5e1;
    --gray-dark: #334155;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f8fafc;
    background-image: 
        radial-gradient(var(--primary-light) 1px, transparent 1px),
        radial-gradient(var(--primary-light) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    background-attachment: fixed;
    overflow-x: hidden;
}

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

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 60px 0 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255,255,255,0.1) 0%, transparent 20%),
        radial-gradient(circle at 80% 60%, rgba(255,255,255,0.15) 0%, transparent 30%);
    pointer-events: none;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 800;
    position: relative;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    background: linear-gradient(to right, white, #e0e7ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

header p {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    font-weight: 500;
}

/* 主内容区域 */
.main-content {
    display: flex;
    gap: 30px;
    padding: 40px 0;
    position: relative;
}

/* 左侧分类导航 */
.category-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 40px;
    align-self: flex-start;
}

.category-list {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(203, 213, 225, 0.5);
}

.category-list h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--dark);
    font-weight: 700;
    position: relative;
    padding-bottom: 12px;
}

.category-list h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.category-item {
    margin-bottom: 10px;
}

.category-link {
    display: block;
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--gray);
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.03));
}

.category-link:hover {
    color: var(--primary);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.03));
    transform: translateX(5px);
}

.category-link.active {
    color: white;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.category-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* 右侧工具内容区 */
.tools-content {
    flex: 1;
    min-width: 0;
}

/* 最近使用工具区域 */
.recent-tools {
    margin-bottom: 40px;
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(203, 213, 225, 0.5);
}

.recent-tools h2 {
    color: var(--dark);
    margin-bottom: 24px;
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-tools h2::before {
    content: '🔥';
    font-size: 1.4rem;
}

/* 工具分类区域 */
.tool-category {
    margin-bottom: 40px;
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(203, 213, 225, 0.5);
    scroll-margin-top: 50px;
}

.tool-category h2 {
    color: var(--dark);
    margin-bottom: 24px;
    font-size: 1.6rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.tool-category h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

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

/* 工具卡片样式 */
.tool-card {
    background: white;
    border-radius: 12px;
    padding: 28px;
    text-decoration: none;
    color: var(--dark);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(203, 213, 225, 0.5);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-light);
}

.tool-card:hover::before {
    transform: translateX(0);
}

/* 最近使用的工具卡片特殊样式 */
.tool-card.recent {
    border-left: 4px solid var(--secondary);
}

/* 工具图标 */
.tool-icon {
    font-size: 2.8rem;
    margin-bottom: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

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

/* 工具名称 */
.tool-card h3 {
    font-size: 1.35rem;
    margin-bottom: 12px;
    color: var(--dark);
    text-align: center;
    font-weight: 700;
}

/* 工具描述 */
.tool-card p {
    font-size: 0.95rem;
    color: var(--gray);
    text-align: center;
    line-height: 1.6;
}

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 30% 70%, rgba(255,255,255,0.1) 0%, transparent 20%),
        radial-gradient(circle at 70% 30%, rgba(255,255,255,0.05) 0%, transparent 15%);
    pointer-events: none;
}

footer p {
    font-size: 1rem;
    opacity: 0.9;
    position: relative;
    font-weight: 500;
}

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

.tool-card {
    animation: fadeIn 0.5s ease forwards;
}

.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }
.tool-card:nth-child(5) { animation-delay: 0.5s; }
.tool-card:nth-child(6) { animation-delay: 0.6s; }
.tool-card:nth-child(7) { animation-delay: 0.7s; }
.tool-card:nth-child(8) { animation-delay: 0.8s; }

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        gap: 20px;
    }
    
    .category-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    /* 移动端导航菜单 */
    .category-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
        padding: 20px;
        overflow-y: auto;
    }
    
    .category-sidebar.open {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: var(--primary);
        color: white;
        border: none;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        font-size: 1.5rem;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        background: var(--primary-dark);
        transform: scale(1.1);
    }
    
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .overlay.show {
        opacity: 1;
        pointer-events: auto;
    }
    
    header {
        padding: 40px 0 30px;
    }
    
    header h1 {
        font-size: 2.4rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .main-content {
        flex-direction: column;
        padding: 30px 0;
    }
    
    .tools-content {
        width: 100%;
    }
    
    .tool-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .tool-card {
        padding: 24px;
    }
    
    .tool-icon {
        font-size: 2.4rem;
    }
    
    .tool-card h3 {
        font-size: 1.25rem;
    }
    
    .recent-tools, .tool-category {
        padding: 24px;
    }
    
    .recent-tools h2, .tool-category h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .category-sidebar {
        width: 250px;
    }
}

/* 工具定位高亮样式 */
.tool-card.highlighted {
    animation: highlight 1.5s ease-in-out;
}

@keyframes highlight {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
        border-color: rgba(203, 213, 225, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
        border-color: var(--primary);
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}