main.css 5.75 KB
:root {
  --primary-color: #000;
  --secondary-color: #06c;
  --background-color: #fff;
  --text-color: #1d1d1f;
  --card-background: #fbfbfd;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-wrapper {
  flex: 1;
  padding-top: 44px;
  padding-bottom: 20px;
}

header {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  padding: 0 5%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 44px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

main {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1rem 1rem;
}


.tools-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 0 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.tool-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  text-decoration: none;
  height: 100%;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

.tool-icon {
  width: 40px; /* 调整图标宽度 */
  height: 40px; /* 调整图标高度 */
  object-fit: contain;
  margin-right: 1rem; /* 缩小图标与文本之间的间距 */
}

.tool-content {
  display: flex;
  flex-direction: column;
}

.tool-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

.tool-description {
  font-size: 1rem;
  color: #4B5563;
  line-height: 1.5;
  margin: 0;
  font-weight: 400;
}

footer {
  background-color: var(--card-background);
  color: #86868b;
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
  
  .tool-card {
    flex-direction: column; /* 在小屏幕上堆叠图标和文本 */
    align-items: center; /* 居中对齐 */
    text-align: center;
    padding: 1rem;
  }
  
  .tool-icon {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .tool-title {
    margin-bottom: 0.25rem; /* 减少标题与描述之间的间距 */
  }
  
  .tool-description {
    line-height: 1.4; /* 保持一致的行高 */
  }
}

.language-selector {
  position: relative;
  display: inline-block;
}

.language-button {
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  color: #333;
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  list-style-type: none;
  padding: 0;
  margin: 4px 0 0;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  min-width: 120px;
}

.language-dropdown li {
  padding: 8px 16px;
  cursor: pointer;
}

.language-dropdown li:hover {
  background-color: #f5f5f5;
}

@media (max-width: 768px) {
  .language-dropdown {
    right: auto;
    left: 0;
  }
}

.footer-separator {
  display: inline-block;
  width: 1px;
  height: 1em;
  background-color: #ccc;
  margin: 0 8px;
  vertical-align: middle;
}

.footer-link {
  text-decoration: none;
  color: inherit;
}

.footer-link:hover {
  text-decoration: none;
}

.footer a {
  text-decoration: none;
  color: inherit;
}

.footer a:hover {
  text-decoration: none;
}

.category-group {
  margin-bottom: 1rem;
  margin-top: 6rem;
}

.category-group:first-child {
  margin-top: 0;
}

/* 添加网格背景效果 */
.tools-section {
  position: relative;
  padding: 1rem 0;
  background: 
    linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
    linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 20px 20px, 20px 20px;
}

/* 移动端适配基础设置 */
@media screen and (max-width: 768px) {
  :root {
    font-size: 14px; /* 调整基础字体大小 */
  }

  main {
    padding: 1rem;
    margin-top: 3.5rem; /* 为固定导航栏留出空间 */
  }

  .tools-section {
    padding: 1rem 0;
  }

  .tools-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem;
  }

  .tool-card {
    padding: 1.2rem;
  }

  .tool-icon {
    width: 35px;
    height: 35px;
  }

  .tool-title {
    font-size: 1.2rem;
  }

  .tool-description {
    font-size: 0.95rem;
  }
}

/* 针对更小屏幕的优化 */
@media screen and (max-width: 480px) {
  .tools-section h2 {
    font-size: 1.8rem;
  }

  .tool-card {
    padding: 1rem;
  }

  .tool-icon {
    width: 30px;
    height: 30px;
  }
}

/* 针对横屏模式的优化 */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}