/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* 修改配色方案 */
:root {
    --primary-color: #1e88e5;    /* 恢复为亮蓝色主题色 */
    --secondary-color: #1565c0;  /* 深蓝色 */
    --accent-color: #42a5f5;     /* 浅蓝色 */
    --bg-color: #ffffff;         /* 纯白背景 */
}

/* 修改导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.05); /* 更透明的白色背景 */
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);           /* 毛玻璃效果 */
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 40px;
    width: 40px;  /* 确保宽高相等，呈现完美圆形 */
    border-radius: 50%;  /* 圆形裁剪 */
    object-fit: cover;   /* 确保图片填充整个空间 */
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);  /* 恢复为蓝色 */
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background-color: #1e88e5;
    color: white;
}

/* 横幅区域样式 */
.hero {
    height: 50vh;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
                url('../images/home_bg.png') center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 2rem;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s 0.3s forwards;
}

/* 添加横幅按钮样式 */
.hero-button {
    margin-top: 2rem;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s 0.6s forwards;
}

.hero-button:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

/* 工具列表区域样式 */
.tools-section {
    padding: 4rem 2rem;
    max-width: 1800px;  /* 增加最大宽度以容纳更多卡片 */
    margin: 0 auto;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 改为一行5个卡片 */
    gap: 1rem; /* 减小间距使卡片更紧凑 */
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 80px 1fr; /* 左侧固定宽度图片，右侧自适应内容 */
    gap: 1rem;
    opacity: 0;  /* 默认是透明的 */
    transform: translateX(-30px);
    transition: all 0.5s ease;
    border: 1px solid rgba(44, 62, 80, 0.1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    align-items: center; /* 垂直居中对齐 */
}

.tool-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.tool-card:hover {
    transform: translateY(-5px) translateX(0);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--accent-color);
}

.tool-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.tool-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.tool-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow: hidden; /* 防止长文本溢出 */
}

.tool-info h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
    color: var(--primary-color);
    white-space: nowrap; /* 标题单行显示 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-info p {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 描述最多显示2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-button {
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);  /* 使用亮蓝色 */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.tool-button:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

/* 页脚样式 */
footer {
    background: #f8fafc;  /* 浅灰色背景 */
    color: #333;         /* 深色文字 */
    padding: 2rem;
    text-align: center;
}

.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    margin: 0 1rem;
    color: #666;
    text-decoration: none;
}

.contact-email {
    color: var(--primary-color);  /* 蓝色邮箱链接 */
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.contact-email:hover {
    color: var(--secondary-color);
}

/* 动画 */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }

}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tool-card {
        grid-template-columns: 60px 1fr; /* 小屏幕下缩小图片 */
    }
    
    .tool-image {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* 添加语言切换按钮样式 */
.language-switch {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    z-index: 1001;
}

.language-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

@media (max-width: 768px) {
    .language-switch {
        right: 1rem;
    }
}

/* 添加分类标题样式 */
.category-title {
    margin: 0 0 2rem 0;
    padding-left: 1rem;
    font-size: 1.5rem;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-title i {
    font-size: 1.2em;
    opacity: 0.8;
}