/* 全局 */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #1d1e20;
  color: #dadadb; 
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Logo */
.header-left .logo {
  width: 200px;
  height: auto;
}

/* 菜单 */
.header-menu {
  display: flex;
  align-items: center;
}

.header-menu a {
  font-size: 18px;
  line-height: 1.5;
  margin-left: 100px;
  text-decoration: none;
  color: #dadadb;
  font-weight: bold;
}

.header-menu a:first-child {
  margin-left: 0;
}

.header-menu a:hover {
  color: #ffff00;
}

/* About & Purchase 区块 */
section {
  padding: 40px 20px;
  max-width: 1200px;
  margin: auto;
}

section h2 {
  margin-bottom: 10px;
}

/* 产品网格 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 20px 0;
  max-width: 1200px;
  margin: auto;
}

.product-item img {
  width: 100%;
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: 5px;
  transition: transform 0.2s;
}

.product-item img:hover {
  transform: scale(1.05);
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* 弹窗外层滚动 */
  background-color: rgba(0,0,0,0.7);
  padding-top: 50px; /* 距顶部 */
  box-sizing: border-box;
}

.modal-content {
  background-color: #fff;
  color: #1d1e20;            /* 弹窗内文字颜色 */
  margin: auto;
  padding: 20px;
  max-width: 600px;        /* 弹窗最大宽度，桌面端 */
  width: 90%;              /* 自适应屏幕宽度 */
  max-height: 80vh;        /* 弹窗最大高度为视口高度80% */
  overflow-y: auto;        /* 内容过多纵向滚动 */
  border-radius: 8px;
  text-align: center;
  box-sizing: border-box;
}

.modal-content img {
  max-width: 100%;
  height: auto;
}

.close {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.buy-btn {
  display: inline-block;
  padding: 10px 20px;
  margin-top: 15px;
  background-color: #007bff;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
}

.buy-btn:hover {
  background-color: #0056b3;
}

/* 页脚 */
footer {
  text-align: center;
  padding: 15px;
  border-top: 1px solid #ddd;
  margin-top: 40px;
}

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

/* 响应式 */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 20px;
    padding-right: 20px;
  }

  .header-menu {
    margin-top: 10px;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .header-menu a {
    margin-left: 0;
    margin-right: 20px;
  }

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