:root {
  --bg-color: #FFFFFF;
  --header-color:#0099e5
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: #f3f3f4;
}
main {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: #333333;
  background-color: var(--bg-color);
}

header {
  background-color: #f3f3f4;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: .5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  background-color: var(--header-color);
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333333;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-logo img {
  width: 36px;
  height: 36px;
  margin-right: 0.5rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin-right: 2rem;
}

.nav-menu a {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  text-transform: uppercase;
}

.nav-menu a:hover {
  color: #FFFFFF;
  border-bottom: 4px solid #ffbe02;
}

.hamburger {
  position: absolute;
  
  right: 4rem;
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 0.3rem;
}
.nav-search{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: .5rem;
  margin-top: .5rem;
}
.hamburger span {
  width: 25px;
  height: 3px;
  background-color: #333333;
  transition: all 0.3s ease;
}

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

.hero {
  text-align: center;
  padding: 4rem 2rem;
  background-color: #FFFFFF;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: bold;
  color: #333333;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  color: #666666;
  max-width: 600px;
  margin: 0 auto;
}

.section-title {
  font-size: 2rem;
  font-weight: bold;
  color: #333333;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0f0f0;
}



.post-card {
  background-color: #FFFFFF;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
  text-decoration: none;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.post-card:hover .post-card-content .post-card-title{
  text-decoration: underline;
  color: var(--header-color);
}
.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: #f0f0f0;
}

.post-card-content {
  padding: 1rem;
}

.post-card-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: #333333;
  margin-bottom: 0.75rem;
  line-height: 1.4;
   display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  
  /* 可选：确保元素不因内容撑开而破坏布局 */
  word-break: break-word;
}

.post-card-date {
  font-size: 0.875rem;
  color: #999999;
}

.post-card-description {
  font-size: 1rem;
  color: #666666;
  line-height: 1.6;
}

.post-card-description img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

footer {
  background-color: #FFFFFF;
  border-top: 1px solid #f0f0f0;
  padding: 2rem;
  margin-top: 0rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-nav {
  margin-top: .75em;
  display: flex;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #666666;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-nav span {
  color: #999999;
  opacity: .85;
}

.footer-nav a:hover {
  color: #666666;
}

.footer-content p {
  color: #999999;
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .nav-container {
    padding: 1rem;
  }

  .nav-menu {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: #0099e5;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-150%);
    transition: transform 0.3s ease;
    
  }
  .nav-search{
    margin-top: 0.2rem;
  }
  .nav-menu.active {
    transform: translateY(0);
  }

  .hamburger {
    display: flex;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-card-image {
    height: 150px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .posts-grid {
    gap: 1rem;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .post-card-content {
    padding: 1rem;
  }

  .post-card-title {
    font-size: 1.1rem;
  }
}
