@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');

* {
  box-sizing: border-box;
}

body {
  font-family: lato, Arial, sans-serif;
  margin: 0;
}

.mainHeader {
  height: 350px;
  text-align: center;
  background-image: url('../assets/images/banner.jpg');
  background-position: bottom;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 10;
  padding-top: 40px;
}

.out-container {
  top: 0;
  left: 0;
  width: 100%;
  border-bottom: 1px solid white;
  background-color: #545454af;
  backdrop-filter: blur(10px);
  position: fixed;
  z-index: 98;
}

.max-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 99;
}

nav a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  padding: 1rem 3rem;
  display: inline-block;
  border-left: 1px solid white;
}

.home {
  border-left: 1px solid white;
  border-right: 1px solid white;
}

.right-nav {
  display: flex;
}

nav a:last-child {
  border-right: 1px solid white;
}

header a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

h1 {
  color: rgb(255, 255, 255);
  font-size: 5.2rem;
  font-weight: 100;
  margin-top: 0;
  margin-bottom: 0.4rem;
}

h2 {
  color: rgb(255, 255, 255);
  font-size: 1.6rem;
  margin-top: 0px;
  font-weight: 300;
}

main {
  display: flex;
  justify-content: center;
  max-width: 1280px;
  gap: 1.6rem;
  margin: 46px auto;
  padding: 0 1.6rem;
}

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

.tags-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  position: sticky;
  top: 100px;
  align-self: start;
}

.tags-section .tag-item {
  background-color: #1a1a1a;
  padding: 12px 8px;
  border-radius: 6px;
  text-align: center;
  color: white;
  cursor: pointer;
  display: inline-block;
  font-size: 1.2rem;
}

.tags-section .tag-item:hover {
  background-color: #767676;
  color: #1a1a1a;
}

.items-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.6rem;
  margin: 0 auto;
  flex: 8;
}

.dish {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 2px 12px rgba(2, 2, 2, 0.3);
}

.dish-image {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 12px;
}

.name-price {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.dish-name {
  font-size: 1rem;
  text-align: left;
  margin-right: 2rem;
}

.item-description {
  text-align: left;
  font-weight: 300;
  line-height: 1.6;
  color: #555;
  margin-bottom: 12px;
}

.tag-item {
  text-transform: capitalize;
}

.item-tags {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.item-tags a {
  display: inline-block;
  background-color: #1a1a1a;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9rem;
  text-transform: capitalize;
}

.item-tags a:hover {
  background-color: #767676;
  color: #1a1a1a;
}

.space {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.addToCart {
  width: 100%;
  color: #1a1a1a;
  border: 1px solid #1a1a1a;
  text-align: center;
  border-radius: 6px;
  transition: transform 0.15s ease-out;
}

.addToCart:hover {
  background-color: #1a1a1a;
  color: #ffffff;
  transform: scale(1.1);
}

.options {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding-top: 2rem;
}

.options a {
  display: inline-block;
  background-color: #ffffff16;
  color: #ffffff;
  border: 1px solid #ffffff;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 1rem;
}

.options a:hover {
  box-shadow: 0 0 5px #f1f1f1;
  background-color: #ffffff;
  color: #747474;
}

.info {
  width: 65ch;
  height: 40vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-color: rgba(69, 69, 69, 0.244);
  border: 1px solid #ffffff;
  box-shadow: 0 0 20px #f1f1f1;
  backdrop-filter: blur(10px);
  padding: 6rem 4rem;
  border-radius: 16px;
  text-align: center;
  animation: reloadA 0.4s ease-out forwards;
  opacity: 0;
  animation-delay: 0.2s;
}

.info h3 {
  color: white;
  margin-bottom: 2.6rem;
  animation: reloadA 0.4s ease-out forwards;
  opacity: 0;
  animation-delay: 0.3s;
}

.withBackground {
  background-image: url('../assets/images/confirmback.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fa-bowl-rice {
  font-size: 3.5rem;
}

.checkoutBackground {
  background-image: url('../assets/images/checkoutback.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
}

.checkoutInfo {
  max-width: 1400px;
  min-width: 700px;
  padding: 4rem 6rem;
  border-radius: 16px;
  box-shadow: 0 0 20px #f1f1f1;
  backdrop-filter: blur(10px);
  text-align: center;
  background-color: rgb(255, 255, 255);
  margin-top: 9rem;
  display: flex;
  flex-direction: column;
  animation: reloadA 0.4s ease-out forwards;
  opacity: 0;
  animation-delay: 0.3s;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 12px;
  gap: 22rem;
}

.cart-item-info {
  display: flex;
  justify-content: left;
  align-items: center;
}

.cart-words-info {
  text-align: left;
}

.optA {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid #1a1a1a;
  border-radius: 6px;
}

.optA:hover {
  background-color: #1a1a1a;
  color: #ffffff;
}

.opts {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
  margin-top: 1.2rem;
}

.total {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.total p {
  color: #747474;
  font-size: 0.8rem;
}

.total div p {
  text-align: right;
}

.note {
  margin-top: 2rem;
}

#note {
  margin-top: 0.6rem;
  border-radius: 6px;
  outline: none;
}

#note:focus {
  border-color: rgb(255, 123, 0);
}

.processor input[type="submit"] {
  padding: 12px 24px;
  border-radius: 6px;
  color: white;
  background-color: #1a1a1a;
  font-size: 0.9rem;
}

.processor input[type="submit"]:hover {
  color: #1a1a1a;
  background-color: white;
  cursor: pointer;
}

.dish p:nth-of-type(2) {
  line-height: 2.4rem;
  font-weight: 300;
}

.orders {
  padding: 0 1.6rem;
}

@keyframes reloadA {
  from {
    transform: translateY(250px);
  }

  to {
    transform: translateY(0px);
    opacity: 1;
  }
}

/* 移动端响应式设计 */
@media screen and (max-width: 768px) {
  /* 防止页面被撑宽 */
  body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  /* 导航栏调整 */
  nav a {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
  }

  .home {
    padding: 0.8rem 1.2rem;
  }

  .right-nav a {
    padding: 0.8rem 1rem;
  }

  /* 主标题调整 */
  .mainHeader {
    height: 280px;
    padding-top: 60px;
  }

  h1 {
    font-size: 3.2rem;
    margin-bottom: 0.3rem;
  }

  h2 {
    font-size: 1.1rem;
    padding: 0 1rem;
  }

  /* 主内容区域调整 */
  main {
    flex-direction: column;
    gap: 1.2rem;
    margin: 20px auto;
    padding: 0 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* 标签区域调整 - 自动换行显示 */
  .tags-section {
    position: relative;
    top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.8rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .tags-section .tag-item {
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 1rem;
  }

  /* 菜品网格调整 - 2列显示 */
  .items-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    width: 100%;
  }

  /* 菜品卡片调整 */
  .dish {
    padding: 16px;
  }

  .dish-name {
    font-size: 0.95rem;
    margin-right: 1rem;
  }

  .item-description {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }

  /* 购物车页面调整 */
  .checkoutBackground {
    min-height: 100vh;
    padding: 1rem;
    gap: 20px;
  }

  .checkoutInfo {
    min-width: unset;
    width: 100%;
    max-width: 100%;
    padding: 2rem 1.5rem;
    margin-top: 5rem;
  }

  /* 购物车项目调整 */
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 16px;
  }

  .cart-item-info {
    width: 100%;
    gap: 12px;
  }

  .cart-item-info img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
  }

  .cart-words-info {
    flex: 1;
  }

  .cart-words-info p {
    margin: 4px 0;
    font-size: 0.9rem;
  }

  .opt {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }

  /* 信息框调整 */
  .info {
    width: 90%;
    max-width: 100%;
    min-height: auto;
    padding: 3rem 2rem;
    margin: 0 1rem;
  }

  .info h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
  }

  .fa-bowl-rice {
    font-size: 2.5rem;
  }

  .options {
    flex-direction: column;
    gap: 1rem;
    padding-top: 1.5rem;
    width: 100%;
  }

  .options a {
    width: 100%;
    padding: 14px 22px;
  }

  /* 背景页面调整 */
  .withBackground {
    min-height: 100vh;
    padding: 1rem;
  }

  /* 订单页面调整 */
  .orders {
    padding: 0 1rem;
  }

  .dish p {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  /* 表单调整 */
  #note {
    width: 100%;
    max-width: 100%;
  }

  .opts {
    flex-direction: column;
    width: 100%;
  }

  .opts a,
  .opts input[type="submit"] {
    width: 100%;
  }

  .processor input[type="submit"] {
    width: 100%;
    padding: 14px 24px;
  }
}

/* 小屏幕手机优化 (480px以下) */
@media screen and (max-width: 480px) {
  /* 导航栏进一步缩小 */
  nav a {
    padding: 0.7rem 0.8rem;
    font-size: 0.85rem;
  }

  .home {
    padding: 0.7rem 1rem;
  }

  .right-nav a {
    padding: 0.7rem 0.8rem;
  }

  /* 标题进一步调整 */
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1rem;
  }

  /* 标签区域和标签项调整 - 减小间距、字体和尺寸 */
  .tags-section {
    gap: 0.5rem;
  }

  .tags-section .tag-item {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  /* 菜品网格单列 */
  .items-section {
    grid-template-columns: 1fr;
  }

  /* 购物车信息框 */
  .checkoutInfo {
    padding: 1.5rem 1rem;
  }

  /* 信息框 */
  .info {
    padding: 2rem 1.5rem;
  }

  .info h3 {
    font-size: 1.1rem;
  }
}