html {
  scroll-behavior: smooth;
}
html, body {
  height: 100%;
  min-height: 100%; /* Ensure minimum height is 100% of viewport */
  width: 100%;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: #e0e0e0;
  background-color: #1a1a1a; /* Keep dark background */
  line-height: 1.6;
  font-size: 16px; /* Base font size */
  overflow-x: hidden; /* Prevent horizontal scrollbar */
}

/* 默认隐藏所有页面，只显示当前激活的页面 */
main > section {
  display: none;
}
main > section#home { /* 默认显示home页面 */
  display: block;
}

/* Header Styles */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  max-height: 56px;
  z-index: 100;
  background-color: rgba(33, 33, 33, 0.9); /* Semi-transparent dark background */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  padding: 0 20px;
  justify-content: space-between; /* Distribute items */
}

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

.logo {
  font-size: 2em; /* Slightly larger logo */
  font-weight: 700;
  color: #4CAF50; /* Accent color for logo */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  padding: 0; /* Remove original padding */
}

.main-nav {
  display: flex;
  gap: 30px; /* Increased spacing between nav items */
}

.nav-item {
  color: #e0e0e0;
  text-decoration: none;
  font-size: 1.15em; /* Slightly larger nav items */
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
  color: #4CAF50; /* Highlight active/hovered item */
}

.search-icon {
  cursor: pointer;
  color: #e0e0e0;
  transition: color 0.3s ease;
}

.search-icon:hover {
  color: #4CAF50;
}

/* Responsive Header */
@media (max-width: 768px) {
  .main-nav {
    display: none; /* Hide navigation on small screens */
  }
  header {
    justify-content: space-between;
    padding: 0 15px; /* Adjusted padding for smaller screens */
  }
  .logo {
    font-size: 1.5em;
  }
}
[data-ui-field="main-cover"] {
  background-image: url('images/teeworld_animated.gif');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  height: 80vh; /* Adjusted height for better content visibility */
  width: 100vw; /* Ensure it takes full width */
  background-attachment: fixed; /* Ensure background is fixed */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.hero-text {
  max-width: 900px; /* Increased max-width for more content */
  padding: 40px; /* Increased padding */
  background-color: rgba(0, 0, 0, 0.6); /* Slightly darker semi-transparent background for readability */
  border-radius: 12px; /* Slightly larger border-radius */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); /* Added shadow for depth */
}

.hero-text h1 {
  font-size: 4.5em; /* Larger font size for impact */
  margin-bottom: 20px; /* Increased margin */
  color: #4CAF50; /* Accent color */
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8); /* Stronger text shadow */
}

.hero-text p {
  font-size: 1.8em; /* Larger font size */
  margin-bottom: 40px; /* Increased margin */
  line-height: 1.6; /* Adjusted line height */
  color: #e0e0e0; /* Lighter text color for contrast */
}

.explore-button {
  display: inline-block;
  padding: 18px 35px; /* Increased padding */
  background-color: #00BFFF; /* Deep Sky Blue */
  color: white;
  text-decoration: none;
  border-radius: 10px; /* Slightly larger border-radius */
  font-size: 1.3em; /* Larger font size */
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4); /* Stronger initial shadow */
}

.explore-button:hover {
  background-color: #009ACD; /* Darker shade for hover */
  transform: translateY(-5px); /* More pronounced hover effect */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6); /* Stronger hover shadow */
}

.explore-button:active {
  transform: scale(0.94); /* More pronounced active scale */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

main {
  background-color: transparent; /* Ensure main does not hide main-cover background */
  min-height: calc(100vh - 56px - 100px); /* Adjust main height to fill space, considering header and footer height */
  /* 56px is header height, 100px is approximate footer height + margin */
  margin-left: 0; /* Removed margin-left */
  margin-right: 0; /* Removed margin-right */
  padding-left: 0; /* Removed padding-left */
  padding-right: 0; /* Removed padding-right */
}
.blog-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Adjusted column width for better responsiveness */
  gap: 40px; /* Increased spacing */
  max-width: 1600px; /* Increased max width */
  margin: 60px auto; /* Increased top/bottom margin */
  padding: 40px; /* Increased padding */
}
/* 确保游戏列表可见 */
section#gameList {
  display: grid;
}

.categories {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px; /* Increased gap */
  margin-bottom: 40px; /* Increased margin */
}

.category-title { /* Changed from h1 to category-title class */
  font-size: 3em; /* Larger font size */
  color: #ffffff;
  margin: 0;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px; /* Increased gap */
}

.category-button {
  background-color: #3a3a3a;
  color: #e0e0e0;
  border: none;
  padding: 12px 25px; /* Increased padding */
  border-radius: 25px; /* Slightly larger border-radius */
  cursor: pointer;
  font-size: 1.1em; /* Slightly larger font size */
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.category-button:hover {
  background-color: #4CAF50;
  color: white;
  transform: translateY(-2px); /* Subtle hover effect */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.category-button.active {
  background-color: #4CAF50;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.blog-post {
  background-color: #2a2a2a;
  border-radius: 20px; /* Increased border-radius */
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); /* Adjusted shadow */
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-width: 300px; /* Adjusted min width */
}
.blog-post:hover {
  transform: translateY(-10px) scale(1.03); /* Enhanced hover effect */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}
.blog-post:active {
  transform: scale(0.95); /* Adjusted active scale */
}
.blog-post img {
  width: 100%;
  height: 220px; /* Adjusted image height */
  object-fit: cover;
  border-top-left-radius: 20px; /* Match card border-radius */
  border-top-right-radius: 20px; /* Match card border-radius */
}

/* Add a subtle animation to the header on scroll */
header.scrolled {
  background-color: rgba(33, 33, 33, 1); /* Fully opaque when scrolled */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.blog-post-content {
  padding: 25px; /* Adjusted padding */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.blog-post-content h3 {
  margin-top: 0;
  margin-bottom: 15px; /* Adjusted margin */
  font-size: 1.6em; /* Adjusted font size */
  color: #ffffff;
}
.blog-post-content p {
  font-size: 1.1em; /* Slightly larger font size */
  color: #c0c0c0;
  line-height: 1.8; /* Adjusted line height */
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.blog-post-content .read-more-button {
  display: block;
  width: 100%;
  padding: 16px 0; /* Adjusted padding */
  margin-top: auto;
  background-color: #00BFFF; /* Changed to accent color (Deep Sky Blue) */
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 12px; /* Adjusted border-radius */
  font-weight: bold;
  font-size: 1.2em; /* Adjusted font size */
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease; /* Added box-shadow transition */
  border: none;
  cursor: pointer;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); /* Added initial shadow */
}
.blog-post-content .read-more-button:hover {
  background-color: #009ACD; /* Darker shade for hover */
  transform: translateY(-4px); /* Enhanced hover effect */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}
.blog-post-content .read-more-button:active {
  transform: scale(0.95); /* Adjusted active scale */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}
.scroll-indicator {
  position: fixed;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 2em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}
.scroll-indicator i.material-icons {
  font-size: 2em;
}
@media (max-width: 768px) {
  [data-ui-field="main-cover"] {
    height: 50vh; /* Further reduce height on small screens */
  }
  .hero-text {
    padding: 25px;
  }
  .hero-text h1 {
    font-size: 2.5em;
  }
  .hero-text p {
    font-size: 1.2em;
  }
  .explore-button {
    padding: 12px 25px;
    font-size: 1.1em;
  }
  .categories {
    gap: 15px;
    margin-bottom: 25px;
  }
  .category-title {
    font-size: 2em;
  }
  .category-nav {
    gap: 10px;
  }
  .category-button {
    padding: 10px 20px;
    font-size: 1em;
  }
  .blog-feed {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Adjusted for smaller screens */
    padding: 25px; /* Increased padding for better spacing */
    gap: 25px; /* Increased gap for better spacing */
  }
  .blog-post {
    width: 100%;
  }
  .blog-post-content h3 {
    font-size: 1.3em; /* Slightly larger font for readability */
  }
  .blog-post-content p {
    font-size: 1em; /* Slightly larger font for readability */
  }
  .blog-post-content .read-more-button {
    padding: 14px 0; /* Adjusted padding */
    font-size: 1.1em; /* Adjusted font size */
  }
}

/* Search Page Styles */
#search-page {
  max-width: 800px; /* 限制最大宽度 */
  margin: 80px auto 50px auto; /* 顶部留出header空间，底部留出footer空间，左右居中 */
  padding: 30px; /* 增加内边距 */
  background-color: #2a2a2a; /* 与博客文章卡片背景色一致 */
  border-radius: 15px; /* 圆角 */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); /* 增加阴影效果 */
  min-height: calc(100vh - 186px); /* 确保内容区域有足够的最小高度，186px = header(56) + footer(100) + top_margin(80) + bottom_margin(50) - padding(30*2) */
  box-sizing: border-box; /* 确保padding和border包含在宽度内 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* 内容从顶部开始排列 */
  text-align: center;
}

#search-page h1 {
  font-size: 3em;
  color: #4CAF50;
  margin-bottom: 20px;
}

#search-page p {
  font-size: 1.2em;
  color: #c0c0c0;
  line-height: 1.8;
}

/* Responsive adjustments for search page */
@media (max-width: 768px) {
  #search-page {
    margin: 70px 20px 40px 20px; /* 调整小屏幕下的边距 */
    padding: 20px;
    min-height: calc(100vh - 130px); /* 调整小屏幕下的最小高度 */
  }
  #search-page h1 {
    font-size: 2.2em;
  }
  #search-page p {
    font-size: 1em;
  }
}

/* Footer Styles */
footer {
  background-color: #212121; /* Darker shade for footer */
  color: #e0e0e0;
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
  margin-top: 50px; /* Space above footer */
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.footer-content p {
  margin: 0;
  font-size: 0.95em;
  color: #c0c0c0;
}

.footer-links {
  display: flex;
  gap: 25px;
}

.footer-link {
  color: #4CAF50; /* Accent color for links */
  text-decoration: none;
  font-size: 1em;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #66BB6A; /* Lighter shade for hover */
}

@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
  footer {
    padding: 20px 15px; /* Adjusted padding for smaller screens */
  }
}

.ad-container {
    display: block; /* Show ad-container */
    width: 10%;
    position: fixed;
    top: 0;
    height: 100vh;
    z-index: 1;
}

.ad-left,
.ad-right {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 150px;
    height: 600px;
    z-index: 1000;
    background-color: #2a2a2a; /* Darker background, consistent with blog posts */
    border: none; /* Remove border */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); /* Add shadow for depth */
    border-radius: 15px; /* Rounded corners */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.5em; /* Slightly larger font size */
    color: #e0e0e0; /* Lighter text color */
    transition: all 0.3s ease; /* Add transition for smooth effects */
}

.ad-left {
    left: 0;
}

.ad-right {
    right: 0;
}

/* Mobile Ad Placeholder */
.mobile-ad-placeholder {
  display: none; /* Hidden by default on desktop */
  background-color: #2a2a2a;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  padding: 20px;
  margin: 20px auto; /* Center the ad */
  text-align: center;
  color: #e0e0e0;
  font-size: 1.2em;
  width: 80%; /* Adjust width for mobile */
  max-width: 300px; /* Max width for mobile ad */
}

@media (max-width: 768px) {
  .ad-left,
  .ad-right {
    display: none; /* Hide fixed ads on small screens */
  }
  .mobile-ad-placeholder {
    display: flex; /* Show mobile ad on small screens */
    align-items: center;
    justify-content: center;
  }
  main {
    margin-left: 0; /* Remove side margins on mobile */
    margin-right: 0; /* Remove side margins on mobile */
  }
  .blog-feed {
    max-width: 100%; /* Full width on mobile */
    padding: 25px; /* Adjusted padding for better spacing */
    gap: 25px; /* Adjusted gap for better spacing */
  }
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.pagination-controls button {
  background-color: #2a2a2a; /* 与游戏框背景色一致 */
  color: #e0e0e0;
  border: none;
  padding: 16px 25px; /* 与游戏框按钮padding一致 */
  border-radius: 12px; /* 与游戏框按钮border-radius一致 */
  cursor: pointer;
  font-size: 1.2em; /* 与游戏框按钮font-size一致 */
  font-weight: bold; /* 与游戏框按钮font-weight一致 */
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3); /* 与游戏框按钮shadow一致 */
  min-width: 50px; /* 调整最小宽度 */
  text-align: center;
  outline: none;
}

.pagination-controls button:hover {
  background-color: #009ACD; /* 与游戏框按钮hover背景色一致 */
  color: white;
  transform: translateY(-4px); /* 与游戏框按钮hover transform一致 */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4); /* 与游戏框按钮hover shadow一致 */
}

.pagination-controls button.active {
  background-color: #00BFFF; /* 与游戏框按钮active背景色一致 */
  color: white;
  font-weight: bold;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.pagination-controls button:disabled {
  background-color: #3a3a3a; /* 禁用按钮背景色 */
  color: #999; /* 禁用按钮文字颜色 */
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pagination-controls .ellipsis {
  color: #e0e0e0;
  font-size: 1.2em;
  font-weight: bold;
  padding: 16px 5px; /* 调整内边距使其与按钮对齐 */
  user-select: none; /* 禁止选中 */
}

@media (max-width: 768px) {
  .pagination-controls {
    gap: 8px;
    margin-top: 30px;
    margin-bottom: 30px;
  }
  .pagination-controls button {
    padding: 10px 15px;
    font-size: 1em;
    min-width: 35px;
  }
  .pagination-controls .ellipsis {
    padding: 10px 3px;
    font-size: 1em;
  }
}