/* 全站背景 */
body {
  background: #FFD1DC;
  color: #333;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  margin: 0;
  padding: 0;
}

/* 页面整体布局为flex，左侧导航，右侧内容 */
.body-layout {
  display: flex;
  min-height: 100vh;
  flex-direction: row;
}

/* 左侧导航栏 */
.navbar {
  background: #B22222;
  color: #fff;
  width: 180px;
  min-height: calc(100vh - 80px - 70px); /* 头部80px，页脚70px */
  padding: 56px 0 0 32px; /* 左侧留32px空隙，右侧为0 */
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* 菜单内容也靠左 */
  box-shadow: 2px 0 8px rgba(178,34,34,0.05);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border-bottom-left-radius: 16px;   /* 新增底部左圆角 */
  border-bottom-right-radius: 16px;  /* 新增底部右圆角 */
  margin-top: 16px; /* 整体下移16px */
  margin-right: 24px; /* 新增，右侧留白 */
  margin-left: 220px;    /* 整个导航栏离页面左侧320px */
  position: sticky;
  top: 96px; /* 距离页面顶部80px头部+16px间距 */
  z-index: 100;
  transition: box-shadow 0.3s;
}
.navbar:hover {
  box-shadow: 4px 4px 24px rgba(178,34,34,0.18), 2px 0 8px rgba(178,34,34,0.05);
  transform: translateY(-2px) scale(1.02);
  transition: box-shadow 0.3s, transform 0.2s;
}
.navbar a {
  display: block;
  color: #fff;
  margin: 18px 0;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1em;
  width: 100%;
  text-align: left; /* 文字靠左 */
  padding: 10px 0 10px 8px; /* 文字左边再留点空间 */
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.navbar a:hover {
  background: #FFD1DC;
  color: #B22222;
}

/* 主体内容 */
.main-content {
  flex: 1;
  padding: 32px 0;
  box-sizing: border-box;
  min-width: 0;
}

/* 页眉、页脚不再有margin-left */
.header, .footer {
  margin-left: 0;
}

/* 页脚高度适配 */
.footer {
  min-height: 70px;
  margin-top: 40px;
  text-align: center;
  color: #B22222;
  background: #fff;
  padding: 18px 0;
  font-size: 1em;
  letter-spacing: 1px;
  box-shadow: 0 -2px 8px rgba(178,34,34,0.04);
}
.darkred-footer {
  background: #B22222;
  color: #fff;
  box-shadow: 0 -2px 8px rgba(178,34,34,0.04);
}

/* 头部整体样式 */
.header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(178,34,34,0.05);
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0;
}

/* 头部内部flex布局，logo左，搜索栏更大更居中 */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* logo靠左 */
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 80px;
  gap: 48px; /* 增加logo和搜索栏间距 */
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5em;
  font-weight: bold;
  color: #B22222;
  gap: 8px;
}
.logo img {
  height: 60px;
  vertical-align: middle;
  margin-right: 8px;
}

/* 搜索栏更大更显眼，整体偏中间 */
.search-form {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 400px;
}
.search-input {
  flex: 1;
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 25px 0 0 25px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}
.search-input:focus {
  border-color: #007b43;
}
.search-btn {
  padding: 10px 20px;
  background: #007b43;
  color: white;
  border: 2px solid #007b43;
  border-radius: 0 25px 25px 0;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}
.search-btn:hover {
  background: #005a32;
  border-color: #005a32;
}

/* 搜索建议样式 */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  display: none;
  max-height: 400px;
  overflow-y: auto;
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.suggestion-item:hover,
.suggestion-item.active {
  background-color: #f8f9fa;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 12px;
  flex-shrink: 0;
}

.suggestion-content {
  flex: 1;
  min-width: 0;
}

.suggestion-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 3px;
  font-size: 14px;
}

.suggestion-name mark {
  background-color: #007b43;
  color: white;
  padding: 1px 3px;
  border-radius: 3px;
}

.suggestion-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .search-form {
    max-width: 250px;
  }
  
  .search-input,
  .search-btn {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .suggestion-item {
    padding: 10px 12px;
  }
  
  .suggestion-image {
    width: 35px;
    height: 35px;
  }
}

/* 搜索结果页面样式 */
.search-results-container {
  padding: 20px;
}

.search-results-header {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #007b43;
}

.search-results-title {
  color: #007b43;
  font-size: 24px;
  margin-bottom: 10px;
}

.search-results-info {
  color: #666;
  font-size: 14px;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.search-result-item {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.search-result-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.search-result-content {
  padding: 15px;
}

.search-result-name {
  font-weight: 600;
  font-size: 16px;
  color: #333;
  margin-bottom: 8px;
}

.search-result-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.5;
}

/* 自定义滚动条颜色为暗红色 */
::-webkit-scrollbar {
  width: 16px;
  background: #FFD1DC;
}

::-webkit-scrollbar-thumb {
  background: #B22222;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a11c1c;
}

/* Firefox */
* {
  scrollbar-width: thick;
  scrollbar-color: #B22222 #FFD1DC;
}

/* 响应式：小屏幕下自动竖排 */
@media (max-width: 900px) {
  .search-form {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 12px 8px;
    gap: 10px;
  }
  .logo {
    justify-content: center;
    margin-bottom: 8px;
  }
  .main-content {
    padding: 16px 0;
  }
  .section {
    padding: 16px 8px;
    margin: 16px auto;
  }
  .navbar {
    margin-left: 0;
  }
}

/* 板块 */
.section {
  background: #FFFDF3;
  padding: 28px 32px;
  margin: 32px 0;      /* 左右margin为0，内容不再居中 */
  border-radius: 14px;
  max-width: 900px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.section h2, .section h3 {
  color: #B22222;
  margin-top: 0;
}
.game-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.game-list li {
  background: #fff;
  border: 1px solid #FFD1DC;
  border-radius: 8px;
  padding: 10px 22px;
  color: #B22222;
  font-weight: bold;
  box-shadow: 0 1px 4px rgba(178,34,34,0.04);
  transition: background 0.2s;
}
.game-list li:hover {
  background: #FFD1DC;
}

/* 卡片列表布局 */
.game-card-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  margin-top: 16px;
}

/* 单个卡片样式 */
.game-card {
  border: 1px solid #b7e4c7;
  box-shadow: 0 2px 8px rgba(75,113,86,0.07);
  border-radius: 12px;
  background: #fff;
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  height: 140px; /* 卡片高度与图片一致 */
  display: inline-block;
  vertical-align: top;
  margin: 10px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
  padding: 0; /* 去除多余内边距 */
}

.game-card-thumb {
  width: 100%;
  height: 100%;
  display: block;
  background: #e0e6d4;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  transition: transform 0.28s cubic-bezier(.4,1.6,.6,1);
}

.game-card:hover .game-card-thumb img,
.game-card:focus .game-card-thumb img {
  transform: scale(1.08);
  z-index: 1;
}

/* 标题覆盖在图片上，悬停时渐显 */
.game-card-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  opacity: 0;
  background: rgba(75,113,86,0.78);
  color: #B22222; /* 使用网站主色嫩绿色 */
  font-size: 1.1em;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.25s, color 0.2s;
  z-index: 2;
  padding: 0 6px;
}

.game-card:hover .game-card-title,
.game-card:focus .game-card-title {
  opacity: 1;
}

/* 新增游戏iframe样式 */
.game-iframe-wrapper {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.game-iframe {
  width: 100%;
  height: 480px;
  background: #000;
  border-radius: 12px;
  border: none;
  display: block;
}

/* 统一页脚所有文字颜色为白色 */
.footer,
.footer-links,
.footer-links a,
.footer-links span {
  color: #fff !important;
}

/* 添加到 main.css */
.iframe-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.fullscreen-btn {
  background: #B22222;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}
.fullscreen-btn:hover {
  background: #a11c1c;
}
.share-label {
  margin-left: 8px;
  font-weight: 500;
  color: #B22222;
}
.share-icon {
  font-size: 1.3em;
  margin-left: 4px;
  text-decoration: none;
  transition: transform 0.2s;
}
.share-icon:hover {
  transform: scale(1.2);
}

/* 添加新的样式，替换之前的重复样式 */

/* Game Modes Styling */
.game-modes {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

.game-modes h4 {
  color: #007b43;
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 16px;
}

.game-modes h4:first-child {
  margin-top: 0;
}

.game-modes p {
  margin-left: 15px;
  color: #555;
  line-height: 1.6;
}

/* Scoring Breakdown */
.scoring-breakdown {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
  padding: 25px;
  border-radius: 12px;
  margin: 20px 0;
  border-left: 4px solid #007b43;
}

.scoring-breakdown h4 {
  color: #007b43;
  margin-top: 20px;
  margin-bottom: 12px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scoring-breakdown h4:first-child {
  margin-top: 0;
}

/* Pro Tips */
.pro-tips {
  background: #fff3cd;
  padding: 25px;
  border-radius: 10px;
  margin: 20px 0;
  border: 1px solid #ffc107;
}

.pro-tips h4 {
  color: #856404;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 16px;
}

.pro-tips h4:first-child {
  margin-top: 0;
}

/* Mistakes Guide */
.mistakes-guide {
  background: #f8d7da;
  padding: 25px;
  border-radius: 10px;
  margin: 20px 0;
  border: 1px solid #dc3545;
}

.mistakes-guide h4 {
  color: #721c24;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 16px;
}

.mistakes-guide h4:first-child {
  margin-top: 0;
}

/* Unique Features */
.unique-features {
  background: #d1ecf1;
  padding: 25px;
  border-radius: 10px;
  margin: 20px 0;
  border: 1px solid #17a2b8;
}

.unique-features h4 {
  color: #0c5460;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 16px;
}

.unique-features h4:first-child {
  margin-top: 0;
}

/* Responsive Design for New Elements */
@media (max-width: 768px) {
  .game-modes,
  .scoring-breakdown,
  .pro-tips,
  .mistakes-guide,
  .unique-features {
    padding: 15px;
    margin: 15px 0;
  }
}

/* 添加到CSS文件末尾 */

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #007b43;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none; /* 默认隐藏 */
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 1000;
  font-size: 0; /* 隐藏文字，只显示图标 */
}

.back-to-top:hover {
  background: #005a32;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.back-to-top.show {
  display: flex; /* 滚动时显示 */
  animation: fadeInUp 0.3s ease;
}

.back-to-top:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 按钮出现动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* 确保按钮在所有内容之上 */
.back-to-top {
  z-index: 9999;
}

/* 翻转游戏内容样式 */
.flipping-games-content {
  margin-top: 40px;
  padding: 0 20px;
}

.flipping-games-content h3 {
  color: #007b43;
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 24px;
  border-bottom: 2px solid #007b43;
  padding-bottom: 5px;
}

.flipping-games-content p {
  line-height: 1.6;
  margin-bottom: 15px;
  color: #333;
}

/* 游戏特性网格 */
.game-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 25px 0;
}

.feature-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #007b43;
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.feature-card h4 {
  color: #007b43;
  margin-bottom: 10px;
  font-size: 16px;
}

.feature-card p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

/* 游戏描述部分 */
.game-descriptions {
  margin: 30px 0;
}

.game-desc {
  background: #fff;
  padding: 25px;
  margin-bottom: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-left: 4px solid #007b43;
}

.game-desc h4 {
  color: #007b43;
  margin-bottom: 15px;
  font-size: 18px;
}

.game-desc p {
  margin-bottom: 15px;
  color: #555;
}

.game-desc ul {
  margin: 0;
  padding-left: 20px;
}

.game-desc li {
  margin-bottom: 8px;
  color: #666;
  line-height: 1.5;
}

/* 技巧容器 */
.tips-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin: 25px 0;
}

.tip-section {
  background: #f0f8f0;
  padding: 20px;
  border-radius: 10px;
  border-top: 4px solid #007b43;
}

.tip-section h4 {
  color: #007b43;
  margin-bottom: 15px;
  font-size: 16px;
}

.tip-section ul {
  margin: 0;
  padding-left: 20px;
}

.tip-section li {
  margin-bottom: 10px;
  color: #555;
  line-height: 1.5;
}

/* 选择我们的原因 */
.why-choose-us {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 25px 0;
}

.reason-card {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s ease;
}

.reason-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.reason-card h4 {
  color: #007b43;
  margin-bottom: 12px;
  font-size: 16px;
}

.reason-card p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

/* 行动召唤 */
.call-to-action {
  background: linear-gradient(135deg, #007b43 0%, #005a32 100%);
  color: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  margin: 30px 0;
}

.call-to-action h4 {
  color: white;
  margin-bottom: 15px;
  font-size: 20px;
}

.call-to-action p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .flipping-games-content {
    padding: 0 15px;
  }
  
  .game-features-grid,
  .tips-container,
  .why-choose-us {
    grid-template-columns: 1fr;
  }
  
  .game-desc {
    padding: 20px 15px;
  }
  
  .call-to-action {
    padding: 25px 20px;
  }
  
  .flipping-games-content h3 {
    font-size: 20px;
  }
}