/* 防止页面横向滚动 */
html,
body {
  overflow-x: hidden;
  width: 100vw;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 确保所有元素都遵循 border-box 盒模型 */
*,
*::before,
*::after {
  box-sizing: inherit;
}
.work-section {
  padding-top: 20vh;
  padding-bottom: 20vh;
}

/* 彩色渐变边框按钮 */
.rainbow-button {
  background: linear-gradient(
    45deg,
    #ff6b6b,
    #ffd93d,
    #6bcf7f,
    #4ecdc4,
    #45b7d1,
    #96ceb4,
    #feca57,
    #ff9ff3,
    #54a0ff
  );
  background-size: 300% 300%;
  animation: gradientShift 2s ease infinite;
  padding: 6px;
  border-radius: 50px;
  display: inline-block;
  box-shadow: 0 0 20px rgba(75, 232, 27, 0.6), 0 0 40px rgba(75, 232, 27, 0.4);
}

.rainbow-button-inner {
  background: #8b5cf6;
  border-radius: 44px;
  padding: 10px 25px;
  color: white;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.6s ease;
  /* min-width: 300px; */
}

/* 手机端竖屏专用样式 */
@media (max-width: 768px) {
  .rainbow-button-inner {
    background: #8b5cf6;
    border-radius: 44px;
    padding: 10px 25px;
    color: white;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.6s ease;
    /* min-width: 300px; */
  }
}

.rainbow-button:hover .rainbow-button-inner {
  background: #7c3aed;
  transform: translateY(-2px);
}

.rainbow-button:hover {
  box-shadow: 0 0 30px rgba(134, 239, 172, 0.8),
    0 0 60px rgba(134, 239, 172, 0.6);
  animation: gradientShift 1s ease infinite,
    glow 3s ease-in-out infinite alternate;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
  /* Force everything to stay within viewport */
  *,
  *::before,
  *::after {
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  /* Prevent any element from causing horizontal scroll */
  html,
  body {
    overflow-x: hidden !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Fix containers */
  .container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Fix header */
  header {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
  }

  /* nav {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  } */

  nav {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    background: rgba(255, 255, 255, 0.25) !important; /* base translucency */
    backdrop-filter: blur(12px) saturate(180%) contrast(120%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) contrast(120%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    overflow: hidden; /* make sure pseudo stays clipped */
  }
  /* gradient sheen overlay */
  nav::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.6) 0%,
      rgba(255, 255, 255, 0.15) 100%
    );
    pointer-events: none;
    mix-blend-mode: overlay;
  }
  /* slight inner shadow to enhance glass depth */
  nav::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
    pointer-events: none;
  }

  /* Fix hero section */
  .min-h-screen {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh;
    padding: 4rem 1rem 2rem 1rem !important;
    box-sizing: border-box !important;
  }

  /* Fix all sections */
  section {
    width: 100% !important;
    max-width: 100% !important;
    padding: 2rem 1rem !important;
    box-sizing: border-box !important;
  }

  /* Fix work section specifically */
  .work-section {
    width: 100% !important;
    max-width: 100% !important;
    padding: 2rem 1rem !important;
    box-sizing: border-box !important;
  }

  /* Fix flex layouts */
  .flex {
    /* flex-direction: column !important;
    gap: 2rem !important;
    width: 100% !important;
    max-width: 100% !important; */
  }

  /* Fix all divs and elements */
  div,
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  span,
  button {
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  /* Fix typography */
  .min-h-screen h1 {
    font-size: 3rem !important;
    margin-bottom: 1rem;
    max-width: 100% !important;
  }

  .min-h-screen h2 {
    font-size: 1.5rem !important;
    margin-bottom: 2rem;
    max-width: 100% !important;
  }

  .min-h-screen button {
    font-size: 0.9rem !important;
    padding: 0.75rem 1.5rem !important;
    max-width: 90% !important;
    width: auto !important;
    text-align: center;
  }

  /* Fix images */
  /* img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  } */

  /* Fix CTA section */
  .py-20 {
    padding: 3rem 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .text-5xl {
    font-size: 2.5rem !important;
    max-width: 100% !important;
  }

  .mb-12 {
    margin-bottom: 2rem !important;
  }

  /* Fix CTA button */
  .group {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 1rem 2rem !important;
    font-size: 1rem !important;
    max-width: 90% !important;
    width: auto !important;
  }

  .group svg {
    margin-left: 1rem !important;
    margin-top: 0 !important;
    flex-shrink: 0 !important;
  }

  /* Fix footer */
  footer {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Mobile footer styles */
@media (max-width: 768px) and (orientation: portrait) {
  footer {
    position: relative;
  }

  footer .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  footer .grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0rem !important;
    text-align: center !important;
    margin-left: 1rem;
  }

  /* 隐藏Agnes AI Logo部分 */
  footer .grid > div:first-child {
    display: none !important;
  }

  footer h3 {
    margin-bottom: 0.75rem !important;
    font-size: 0.875rem !important;
  }

  footer .text-2xl {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
  }

  footer .space-y-3 > * {
    margin-bottom: 0.5rem !important;
  }

  footer a {
    font-size: 0.875rem !important;
  }
  footer > .absolute {
    display: none !important;
  }
}

/* Nav & Mobile Menu styles (migrated from agnes.html) */
/* Mobile menu button */
#mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
}

/* Mobile menu panel */
#mobileMenu {
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.25) !important; /* base translucency */
  backdrop-filter: blur(12px) saturate(180%) contrast(120%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(180%) contrast(120%) !important;
  border-top: 1px solid rgba(229, 231, 235, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  z-index: 50;
}

#mobileMenu a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #374151;
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

#mobileMenu a:last-child {
  color: #8b5cf6;
  font-weight: 600;
}

#mobileMenu a:hover {
  color: #8b5cf6;
}

/* Hide mobile menu by default (Tailwind's hidden class) */
#mobileMenu.hidden {
  display: none !important;
}

/* ===== Liquid Glass Nav Effect ===== */
nav {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  background: rgba(255, 255, 255, 0.25) !important; /* base translucency */
  backdrop-filter: blur(12px) saturate(180%) contrast(120%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(180%) contrast(120%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  overflow: hidden; /* make sure pseudo stays clipped */
}

/* gradient sheen overlay */
nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.15) 100%
  );
  pointer-events: none;
  mix-blend-mode: overlay;
}
/* slight inner shadow to enhance glass depth */
nav::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

/* elevate hamburger button visibility */
#mobile-menu-btn svg {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Show button & adjust nav container on small screens */
/* 手机端竖屏专用样式 */
@media (max-width: 768px) {
  #mobile-menu-btn {
    display: block;
  }
  nav .container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  /* Ensure nav logo stays small */
  nav img {
    text-align: left;
    width: auto !important;
    height: 2rem !important;
  }
}
