/* ---------- Basic Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, Helvetica, "PingFang SC", "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  color: #222;
  text-align: center;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- Layout ---------- */
header {
  padding: 32px 16px 0;
}

.logo {
  width: 120px;
  margin: 0 auto 40px;
}

nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px 6px;
}

nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  white-space: nowrap;
  /* padding-bottom: 4px; */ /* This might not be needed anymore with the new centering */
  font-size: 16px;
  font-weight: 600; 
  border-radius: 100px;
  color: rgba(0,0,0,0.7);
  transition: all 0.2s cubic-bezier(0.075, 0.82, 0.165, 1);
}

nav a img.nav-icon {
  display: inline-flex;
  opacity: 0;
  max-width: 0; /* Use max-width for transition */
  height: 22px;
  margin-right: 0; /* Use margin for transition */
  transition: all 0.2s cubic-bezier(0.075, 0.82, 0.165, 1);
}

@media (hover: hover) {
  nav a:hover {
    color: rgba(0,0,0,1);
    background-color: rgba(0,0,0,0.04);
  }
}

nav a:hover img.nav-icon {
  opacity: 1;
  max-width: 22px; /* Animate max-width */
  margin-right: 10px; /* Animate margin */
}

nav a.active {
  color: rgba(0,0,0,1);
}

nav a.active img.nav-icon {
  opacity: 1;
  max-width: 22px;
  margin-right: 10px;
}

/* Exception for the "Home" link: always hide icon when active */
#nav-home.active img.nav-icon {
  opacity: 0;
  max-width: 0;
  margin-right: 0;
}

nav a.link-xhs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: #ff2851;
  font-size: 16px;
  color: #fff;
  line-height: 1;
  transition: all 0.4s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.tx-xhs {
  width: 34px;
  height: 12px;
}

@media (hover: hover) {
  nav a.link-xhs:hover {
    outline: 6px solid rgba(255,40,81,0.12);
  }
}

/* ---------- Main ---------- */
main {
  display: flex;
  align-items: center;
  flex: 1 0 auto;
  padding: 48px 16px;
}

section.content {
  display: none;
  max-width: 480px;
  margin: 0 auto;
}

section.content.active {
  display: block;
}

/* ---------- Story Board ---------- */
.story-board-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.story-board {
  position: relative;
  display: inline-flex;
  width: 360px;
  aspect-ratio: 1/1;
}

.bubble-bg {
  width: 100%;
  height: 100%;
}

.speech {
  position: absolute;
  top: 60px;
  left: 40px;
  padding: 8px 20px;
  background: #000;
  border-radius: 100px;
  font-size: 18px;
  color: #fff;
}

.speech img.bubble-tri {
  position: absolute;
  width: 16px;
  height: 12px;
  bottom: -10px;
  left: 46%;
}

@keyframes speechPop {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateY(-8px) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.speech-animate {
  animation: speechPop 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}


/* ---------- Content ---------- */
.content .avatar_w {
  display: inline-flex;
  width: 120px;
  aspect-ratio: 1/1;
  margin-bottom: 40px;
}

.content .para p {
  font-size: 16px;
  text-align: center;
  margin-bottom: 20px;
}

.content .mangmang-gif-404 {
  display: inline-flex;
  height: 180px;
  margin-bottom: 28px;
} 


/* ---------- Footer ---------- */
footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  padding: 40px 0;
  font-size: 12px;
  text-align: right;
}

.footer p.info {
  vertical-align: middle;
}

.footer-logo {
  display: inline-flex;
  height: 40px;
}

.beian-logo {
  display: inline-flex;
  height: 14px;
  position: relative;
  top: 2px;
}

/* ---------- Responsive ---------- */
@media (min-width: 1920px) {
  .story-board {
    width: 600px;
  }
  .speech {
    padding: 12px 24px;
    font-size: 22px;
  }
}
@media (max-width: 480px) {
  nav a {
    font-size: 16px;
    flex-shrink: 0;
  }
  #nav-home img {
    display: none;
  }
  .story-board {
    width: 100%;
  }
  footer { 
    flex-direction: column;
    text-align: center;
    gap: 28px;
  }
} 