/* Homepage overlays; the original background remains in background.css. */
.huanwuai-home {
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #fcfaff;
}

.huanwuai-header {
  position: absolute;
  z-index: 2;
  top: 8.9%;
  left: 4.9%;
  right: 4.9%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 3cqw;
}

.huanwuai-nav {
  display: flex;
  align-items: center;
  gap: 4.4cqw;
}

.huanwuai-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  padding: 0.8cqw 1.6cqw;
  border-radius: 8px;
  color: #fff;
  font-size: 1.22cqw;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.huanwuai-nav-text {
  position: relative;
  z-index: 2;
}

.huanwuai-language {
  --huanwuai-language-row: 2.25cqw;
  --huanwuai-language-pad: 0.7cqw;
  --huanwuai-language-icon: 1.2cqw;
  --huanwuai-language-gap: 0.45cqw;
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 5;
  box-sizing: border-box;
  width: 8.8cqw;
  height: var(--huanwuai-language-row);
  overflow: hidden;
  border: 1px solid rgb(241 213 255 / 28%);
  border-radius: calc(var(--huanwuai-language-row) / 2);
  background: rgb(38 17 65 / 14%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 6%);
  font-size: 1.04cqw;
  line-height: 1;
  transform: translateY(calc(var(--huanwuai-language-row) / -2));
  transition: height 260ms cubic-bezier(0.23, 1, 0.32, 1), background-color 260ms ease;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.huanwuai-language[data-open="true"] {
  height: calc(var(--huanwuai-language-row) * 2);
  background-color: rgb(38 17 65 / 55%);
}

.huanwuai-language-trigger,
.huanwuai-language-alternative {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: var(--huanwuai-language-row);
  padding: 0 var(--huanwuai-language-pad);
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.huanwuai-language-trigger {
  gap: var(--huanwuai-language-gap);
}

.huanwuai-globe {
  flex-shrink: 0;
  width: var(--huanwuai-language-icon);
  stroke: currentColor;
  stroke-width: 1.8;
}

.huanwuai-language-alternative {
  position: absolute;
  top: var(--huanwuai-language-row);
  left: 0;
  padding-left: calc(var(--huanwuai-language-pad) + var(--huanwuai-language-icon) + var(--huanwuai-language-gap));
  visibility: hidden;
  opacity: 0;
  transition: opacity 180ms ease;
}

.huanwuai-language[data-open="true"] .huanwuai-language-alternative {
  visibility: visible;
  opacity: 1;
}

.huanwuai-language-alternative:hover {
  background: rgb(255 255 255 / 7%);
}

.huanwuai-chevron {
  width: 0.65cqw;
  margin-left: auto;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  pointer-events: none;
  transition: transform 260ms ease;
}

.huanwuai-language[data-open="true"] .huanwuai-chevron {
  transform: rotate(180deg);
}

.huanwuai-headline {
  position: absolute;
  top: 21.1%;
  left: 0;
  right: 0;
  margin: 0;
  color: #fffaff;
  font-size: 5.7cqw;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.huanwuai-products {
  position: absolute;
  top: 41.5%;
  right: 16.5%;
  bottom: auto;
  left: 16.5%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.4cqw;
}

.huanwuai-home:lang(en) .huanwuai-headline {
  font-size: 4.4cqw;
}

.huanwuai-home:lang(en) .huanwuai-product-description h3,
.huanwuai-home:lang(en) .huanwuai-product-description p {
  white-space: normal;
}

.huanwuai-card {
  --huanwuai-accent: #b77cee;
  --huanwuai-button-top: #bd86ef;
  --huanwuai-button-bottom: #9862de;
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-columns: 46.8% minmax(0, 1fr);
  gap: 6%;
  box-sizing: border-box;
  min-width: 0;
  aspect-ratio: 1.68;
  padding: 3.8%;
  border: 1px solid rgb(214 184 248 / 38%);
  border-radius: 1.1cqw;
  background: linear-gradient(145deg, rgb(117 78 165 / 14%), rgb(255 255 255 / 3%) 62%, rgb(255 255 255 / 4%));
  box-shadow: inset 0 1px 0 rgb(246 224 255 / 16%), inset 0 0 32px rgb(149 95 215 / 3%), 0 12px 30px rgb(0 0 0 / 10%);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 280ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .huanwuai-card:hover {
    transform: translateY(-6px);
    box-shadow: inset 0 1px 0 rgb(246 224 255 / 16%), inset 0 0 32px rgb(149 95 215 / 3%), 0 22px 42px rgb(0 0 0 / 38%);
  }
}

.huanwuai-card-cyan {
  --huanwuai-accent: #72cce1;
  --huanwuai-button-top: #79cee2;
  --huanwuai-button-bottom: #63bed7;
}

.huanwuai-portrait {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: 1.85cqw;
}

.huanwuai-card-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 5cqw;
  padding-bottom: 3cqw;
}

.huanwuai-product-heading {
  padding-bottom: 2.35cqw;
  border-bottom: 1px solid rgb(224 200 246 / 25%);
}

.huanwuai-product-heading h2 {
  margin: 0;
  font-size: 7cqw;
  font-weight: 700;
  line-height: 1.13;
}

.huanwuai-product-en {
  margin: 0.9cqw 0 0;
  color: var(--huanwuai-accent);
  font-size: 4cqw;
  line-height: 1.2;
}

.huanwuai-product-description {
  padding-top: 2.6cqw;
}

.huanwuai-product-description h3 {
  margin: 0;
  color: #eeebf5;
  font-size: 3.44cqw;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.huanwuai-product-description p {
  margin: 0.65cqw 0 0;
  color: #aaa5b7;
  font-size: 2.48cqw;
  line-height: 1.5;
  white-space: nowrap;
}

.huanwuai-product-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  gap: 2.1cqw;
  box-sizing: border-box;
  width: 100%;
  height: 12.1cqw;
  margin-top: auto;
  border: 1.5px solid color-mix(in srgb, var(--huanwuai-accent), white 45%);
  border-radius: 1.65cqw;
  background: linear-gradient(160deg, var(--huanwuai-button-top), var(--huanwuai-button-bottom));
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 28%), 0 0 20px rgb(134 91 195 / 10%);
  color: #100b20;
  font: inherit;
  font-size: 3.9cqw;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 600ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 600ms cubic-bezier(0.23, 1, 0.32, 1);
}

.huanwuai-product-button svg {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 3.4cqw;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform 800ms cubic-bezier(0.23, 1, 0.32, 1), left 800ms cubic-bezier(0.23, 1, 0.32, 1);
}

.huanwuai-home :focus-visible,
.huanwuai-product-dialog :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.huanwuai-language :focus-visible {
  outline-offset: -3px;
  border-radius: calc(var(--huanwuai-language-row) / 2);
}

.huanwuai-product-dialog {
  width: min(680px, 85vw);
  padding: 28px;
  border: 1px solid rgb(214 184 248 / 38%);
  border-radius: 22px;
  background: #1a1028;
  color: #fcfaff;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.huanwuai-product-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  align-items: center;
  gap: 30px;
}

.huanwuai-product-dialog::backdrop {
  background: rgb(3 1 8 / 78%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.huanwuai-dialog-image {
  display: block;
  width: 100%;
  border-radius: 14px;
}

.huanwuai-dialog-summary {
  font-weight: 700;
  line-height: 1.6;
}

.huanwuai-dialog-details {
  color: #c3b6d1;
  line-height: 1.6;
}

.huanwuai-dialog-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fcfaff;
  cursor: pointer;
}

.huanwuai-dialog-close svg {
  width: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* Stack the cards beneath the headline on smaller screens. */
@media (max-width: 700px) {
  .huanwuai-home {
    aspect-ratio: auto;
    height: auto;
    min-height: calc(318px + 108cqw);
  }

  .huanwuai-header {
    top: 67px;
    left: 5%;
    right: 5%;
    flex-direction: column-reverse;
    gap: 20px;
  }

  .huanwuai-nav {
    width: 100%;
    justify-content: space-between;
    gap: 0;
  }

  .huanwuai-nav-link {
    padding: 9px 12px;
    font-size: 3.3cqw;
  }

  .huanwuai-language {
    --huanwuai-language-row: 30px;
    --huanwuai-language-pad: 10px;
    --huanwuai-language-icon: 16px;
    --huanwuai-language-gap: 6px;
    position: absolute;
    top: 0;
    right: 0;
    width: 110px;
    font-size: 12px;
    transform: none;
  }

  .huanwuai-nav {
    margin-top: 60px;
  }

  .huanwuai-chevron {
    width: 8px;
  }

  .huanwuai-headline {
    top: 191px;
    font-size: 7.5cqw;
    letter-spacing: -0.05em;
  }

  .huanwuai-products {
    top: 270px;
    right: 5%;
    bottom: auto;
    left: 5%;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .huanwuai-card {
    border-radius: 16px;
  }

  .huanwuai-home:lang(en) .huanwuai-headline {
    padding: 0 6%;
    font-size: 6.1cqw;
    white-space: normal;
  }

  .huanwuai-product-dialog[open] {
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: 85vh;
    overflow: auto;
  }

  .huanwuai-dialog-image {
    max-height: 35vh;
    object-fit: contain;
  }
}

@media (prefers-reduced-motion: reduce) {
  .huanwuai-home *,
  .huanwuai-home *::before,
  .huanwuai-home *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .huanwuai-card:hover {
    transform: none;
  }
}
