* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --dark-gradient: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
  --light-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --text-primary: #333;
  --text-secondary: #666;
  --text-light: #999;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--gray-100);
  overflow-x: hidden;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

nav .container {
  width: 90%;
}

/* 导航栏 */
nav {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  margin-left: 25px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: #667eea;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background: var(--primary-gradient);
  transition: var(--transition);
}

/* 工具头部样式优化 */
.tool-header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease-out;
  box-shadow: var(--shadow-md);
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 30px 20px; /* 添加内边距 */
}

.tool-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap; /* 允许在小屏幕上换行 */
}

.tool-icon {
  font-size: 2.5rem;
}

.tool-title {
  font-size: 2.5rem;
  color: var(--white); /* 修改为实体颜色，移除渐变 */
  background: none;
  -webkit-background-clip: none;
  -webkit-text-fill-color: var(--white);
}

.tool-description {
  font-size: 1.1rem;
  color: var(--white); /* 修改为文本次要颜色 */
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.5;
}

.nav-links a:hover::after {
  width: 100%;
}

/* 头部区域 */
header {
  background: var(--primary-gradient);
  color: white;
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

header h1 {
  font-size: 4rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header p {
  font-size: 1.3rem;
  opacity: 0.9;
  margin-bottom: 30px;
  font-weight: 300;
}

.cta-button {
  display: inline-block;
  padding: 15px 30px;
  background-color: white;
  color: #667eea;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.cta-button:active {
  transform: translateY(-1px);
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.6s;
}

.cta-button:hover::before {
  left: 100%;
}

/* 主要内容区域 */
main {
  padding: 60px 0;
}

/* 工具部分 */
.section-title {
  text-align: center;
  margin-bottom: 50px;
  position: relative;
}

.section-title h2 {
  font-size: 2.5rem;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 3px;
}

.section-title p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* 工具网格 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

/* 工具卡片 */
.tool-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  border-top: 4px solid transparent;
  /* 添加卡片悬停时的渐变边框效果 */
  background-clip: padding-box;
}

.tool-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-top-color: #667eea;
}

/* 添加工具卡片分类颜色标识 */
.tool-card.calculation {
  border-left: 4px solid #667eea;
}

.tool-card.conversion {
  border-left: 4px solid #f5576c;
}

.tool-card.time {
  border-left: 4px solid #38a169;
}

.tool-card.text {
  border-left: 4px solid #d69e2e;
}

.tool-card.security {
  border-left: 4px solid #e53e3e;
}

.tool-card.design {
  border-left: 4px solid #805ad5;
}

.tool-card.utilities {
  border-left: 4px solid #3182ce;
}

.tool-card a {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.tool-card-img {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

/* 为不同工具类别添加不同的背景色 */
.calculation .tool-card-img {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.conversion .tool-card-img {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.time .tool-card-img {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.text .tool-card-img {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.security .tool-card-img {
  background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.design .tool-card-img {
  background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.utilities .tool-card-img {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.tool-card:hover .tool-card-img {
  transform: scale(1.1);
}

.tool-card-content {
  padding: 25px;
}

.tool-card h3 {
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 600;
}

.tool-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 15px;
  line-height: 1.5;
}

.tool-tag {
  display: inline-block;
  background-color: var(--gray-200);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-right: 5px;
  margin-bottom: 5px;
}

/* 分类部分 */
.categories-section {
  background-color: var(--white);
  padding: 80px 0;
  margin: 80px 0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.category-card {
  text-align: center;
  padding: 30px 20px;
  background-color: var(--gray-100);
  border-radius: var(--border-radius);
  transition: var(--transition);
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  background-color: white;
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  display: block;
}

.category-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* 特性部分 */
.features-section {
  padding: 80px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.feature-card {
  text-align: center;
  padding: 40px 20px;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.feature-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  color: #667eea;
}

.feature-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.feature-desc {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 页脚 */
footer {
  background: var(--dark-gradient);
  color: white;
  padding: 80px 0 40px;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.footer-content {
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 50px;
}

.footer-column h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-column h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background-color: white;
  opacity: 0.5;
}

.footer-column p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 15px;
  line-height: 1.7;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer-links a:hover {
  color: white;
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  transition: var(--transition);
  font-size: 1.2rem;
}

.social-links a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
  header h1 {
    font-size: 3.5rem;
  }

  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  header {
    padding: 80px 0 60px;
  }

  header h1 {
    font-size: 2.8rem;
  }

  header p {
    font-size: 1.1rem;
  }

  .section-title h2 {
    font-size: 2rem;
  }

  .nav-links {
    display: none;
  }

  .footer-grid {
    gap: 30px;
  }

  .tool-title {
    font-size: 2rem;
  }

  .tool-icon {
    font-size: 2rem;
  }

  .tool-description {
    font-size: 1rem;
  }

  .tool-header {
    padding: 20px 15px;
    margin-bottom: 30px;
  }

  .tool-header h1 {
    font-size: 1.5rem !important;
  }
}

@media (max-width: 576px) {
  header h1 {
    font-size: 2.2rem;
  }

  .section-title h2 {
    font-size: 1.8rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .cta-button {
    padding: 12px 25px;
    font-size: 1rem;
  }

  .tool-title {
    font-size: 1.8rem;
    text-align: center;
  }

  .tool-icon {
    font-size: 1.8rem;
  }

  .tool-description {
    font-size: 0.95rem;
  }

  .tool-info {
    gap: 10px;
    margin-bottom: 10px;
  }

  .tool-header {
    padding: 15px 10px;
    margin-bottom: 20px;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.pulse {
  animation: pulse 2s infinite;
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* 添加视差效果 */
.parallax {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 工具详情页面通用样式 */
.tool-header {
  background: var(--primary-gradient);
  color: white;
  padding: 40px 0;
  text-align: center;
}

.tool-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.tool-header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.tool-container {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 40px;
  margin-top: -40px;
  position: relative;
  z-index: 1;
}

/* 表单元素样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 工具按钮 */
.tool-btn {
  display: inline-block;
  padding: 12px 25px;
  background: var(--primary-gradient);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tool-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 结果显示 */
.result-container {
  background-color: var(--gray-100);
  border-radius: 8px;
  padding: 20px;
  margin-top: 25px;
  position: relative;
  border-left: 4px solid #667eea;
}

.result-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.result-value {
  font-size: 1.1rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* 工具操作按钮 */
.tool-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 8px 15px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  background-color: var(--gray-200);
  color: var(--text-secondary);
}

.action-btn:hover {
  background-color: var(--gray-300);
  transform: translateY(-1px);
}
