/* 全局样式重置与基础设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

body {
  background: linear-gradient(to right bottom, #f0f7ff, #e6f3ff);
  color: #333;
  min-height: 100vh;
  display: flex;
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  background-color: #4a90e2;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 侧边栏样式 */
.sidebar {
  width: 240px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.08);
  height: 100vh;
  padding-top: 25px;
  position: fixed;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 1000;
}

.sidebar h2 {
  text-align: center;
  color: #4a90e2;
  margin-bottom: 30px;
  padding: 0 15px;
  font-size: 1.4rem;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  padding: 12px 20px;
  color: #555;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar li:hover {
  background-color: #f0f7ff;
  color: #4a90e2;
}

.sidebar li.active {
  background-color: #e6f0ff;
  color: #4a90e2;
  border-left: 3px solid #4a90e2;
}

.sidebar li i {
  width: 20px;
  text-align: center;
}

/* 主内容区样式 */
.main-content {
  flex: 1;
  margin-left: 240px;
  transition: margin-left 0.3s ease;
}

/* 顶部导航样式 */
.top-nav {
  padding: 20px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.top-nav .logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #4a90e2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-nav .logo i {
  font-size: 1.8rem;
}

.top-nav .nav-links {
  display: flex;
  gap: 25px;
}

.top-nav .nav-links a {
  text-decoration: none;
  color: #666;
  transition: all 0.3s ease;
  font-weight: 500;
  padding: 5px 0;
  position: relative;
}

.top-nav .nav-links a:hover {
  color: #4a90e2;
}

.top-nav .nav-links a.active {
  color: #4a90e2;
}

.top-nav .nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #4a90e2;
  border-radius: 2px;
}

/* 搜索栏区域样式 */
.search-section {
  padding: 30px;
  background-color: #f9fbff;
}

.search-section .tabs {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.search-section .tabs span {
  cursor: pointer;
  color: #666;
  padding: 8px 0;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
}

.search-section .tabs span:hover {
  color: #4a90e2;
}

.search-section .tabs span.active {
  color: #4a90e2;
}

.search-section .tabs span.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #4a90e2;
  border-radius: 2px;
}

.search-container {
  display: flex;
  justify-content: center;
  position: relative;
}

.search-section .search-input {
  width: 60%;
  min-width: 300px;
  padding: 12px 20px 12px 40px;
  border: 1px solid #ddd;
  border-radius: 30px;
  outline: none;
  font-size: 15px;
  transition: all 0.3s ease;
}

.search-section .search-input:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-btn {
  position: absolute;
  left: calc(20% + 15px);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  transition: color 0.3s ease;
}

.search-btn:hover {
  color: #4a90e2;
}

/* 推荐工具区域 */
.featured-section {
  padding: 0 30px 30px;
}

.featured-section h3 {
  margin: 30px 0 20px;
  color: #333;
  font-size: 1.3rem;
}

/* 功能卡片区域样式 */
.cards-section {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.card {
  flex: 1 1 calc(25% - 20px);
  min-width: 180px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
  text-align: center;
  padding: 25px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #4a90e2, #5cb85c);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card:hover::before {
  transform: scaleX(1);
}

.card .card-icon {
  width: 60px;
  height: 60px;
  background-color: #f0f7ff;
  color: #4a90e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  font-size: 24px;
  transition: all 0.3s ease;
}

.card:hover .card-icon {
  background-color: #4a90e2;
  color: white;
  transform: scale(1.1);
}

.card p {
  color: #333;
  font-weight: 500;
  font-size: 16px;
}

/* 工具列表区域 */
.tools-section {
  padding: 0 30px 30px;
}

.tools-section h3 {
  margin: 30px 0 20px;
  color: #333;
  font-size: 1.3rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tool-item {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tool-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.tool-icon {
  width: 40px;
  height: 40px;
  background-color: #f0f7ff;
  color: #4a90e2;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.tool-title {
  font-weight: 600;
  color: #333;
}

.tool-desc {
  color: #666;
  font-size: 14px;
  margin-bottom: 15px;
  line-height: 1.5;
}

.tool-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #999;
}

.tool-rating {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tool-rating i {
  color: #ffc107;
}

/* 底部广告区域样式 */
.ad-section {
  padding: 0 30px 30px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.ad-section .ad-item {
  flex: 1;
  min-width: 300px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.07);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.ad-section .ad-item:hover {
  transform: translateY(-3px);
}

.ad-section .ad-item i {
  width: 50px;
  height: 50px;
  background-color: #f0f7ff;
  color: #4a90e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.ad-item h4 {
  color: #333;
  margin-bottom: 5px;
}

.ad-item p {
  color: #666;
  font-size: 14px;
}

/* 页脚样式 */
.footer {
  background-color: #fff;
  padding: 30px;
  text-align: center;
  border-top: 1px solid #eee;
  margin-top: 30px;
}

.footer p {
  color: #666;
  margin-bottom: 15px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #4a90e2;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .card {
    flex: 1 1 calc(33.333% - 20px);
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .card {
    flex: 1 1 calc(50% - 20px);
  }
  
  .top-nav {
    padding: 15px 20px;
  }
  
  .top-nav .nav-links {
    gap: 15px;
  }
  
  .search-section .search-input {
    width: 80%;
  }
  
  .search-btn {
    left: calc(10% + 15px);
  }
}

@media (max-width: 576px) {
  .card {
    flex: 1 1 100%;
  }
  
  .top-nav .nav-links {
    display: none;
  }
  
  .search-section .tabs {
    gap: 15px;
  }
  
  .search-section .search-input {
    width: 100%;
  }
  
  .search-btn {
    left: 15px;
  }
  
  .ad-section .ad-item {
    min-width: 100%;
  }
}
