/* Global Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Microsoft YaHei", Arial, sans-serif;
  margin: 0;
  padding-top: 70px;
  color: #333;
  line-height: 1.6;
  transition: background-color 0.3s ease;
}

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

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 10px 24px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  transition: box-shadow 0.3s ease;
}

.header.scrolled {
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px;
}

.logo img {
  max-width: 160px;
  height: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 28px;
  flex-shrink: 0;
}

.nav a {
  font-size: 18px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s, color .2s;
  position: relative;
  color: #333;
  white-space: nowrap;
}

.nav a:hover {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

.nav a:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Mobile Navigation Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 5px;
  background: none;
  border: none;
  font-size: 1.5rem;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #333;
  margin: 3px 0;
  display: block;
  transition: 0.3s;
}

/* 首页 - Banner */
#home {
  position: relative;
  min-height: 380px;
  margin-bottom: 0;
  transform: translateZ(0);
  will-change: transform;
}

.banner-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.banner-wrap img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 320px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Apply hover effect to the container to avoid interruption when hovering on text */
.banner-wrap:hover img {
  transform: scale(1.02);
}

.banner-slogan {
  position: absolute;
  top: 55%;
  left: 55%;
  transform: translate(-50%, -50%);
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  text-align: center;
  animation: fadeInUp 1s ease-out;
  z-index: 2; /* Ensure text stays above the image */
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.banner-slogan .title {
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  animation: slideInLeft 0.8s ease-out 0.3s both;
}

.banner-slogan .text {
  font-size: 26px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.05em;
  animation: slideInRight 0.8s ease-out 0.5s both;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-50%) translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(-50%);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-50%) translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(-50%);
  }
}

/* 关于星奥 */
#about {
  padding: 56px 24px 64px;
  background-color: #f8f9fa;
  background-size: cover;
  background-position: center;
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-size: 26px;
  font-weight: bold;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid #1a73e8;
  display: inline-block;
}

#about .intro {
  font-size: 16px;
  line-height: 1.9;
  color: #444;
}
#about .intro p { margin: 0 0 14px; }
#about .intro h3 { font-size: 18px; color: #1a73e8; margin: 28px 0 12px; }
#about .intro h3:first-of-type { margin-top: 0; }
#about .intro ul { margin: 0 0 14px; padding-left: 1.4em; }
#about .intro li { margin-bottom: 6px; }
#about .highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
#about .highlight-item { padding: 16px; background: #fff; border-radius: 8px; border-left: 4px solid #1a73e8; box-shadow: 0 1px 4px rgba(0,0,0,.06); transition: transform 0.3s ease, box-shadow 0.3s ease; }
#about .highlight-item:hover { transform: translateY(-5px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
#about .highlight-item strong { display: block; margin-bottom: 4px; color: #1a73e8; font-size: 15px; }

/* 联系我们 */
#contact {
  padding: 56px 24px 64px;
  background-color: #fff;
  background-size: cover;
  background-position: center;
}

.contact-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.contact-item {
  padding: 20px;
  background: rgba(255,255,255,.9);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.contact-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,.1);
}

.contact-item strong {
  display: block;
  margin-bottom: 6px;
  color: #1a73e8;
}

.contact-item span {
  font-size: 15px;
}

/* 首屏标题 SEO 与可访问性 */
.banner-section .site-title {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
  background: #1a73e8;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  clip: auto;
  margin: 10px;
}

/* 页脚 */
.footer {
  padding: 24px 24px 32px;
  background: #f0f0f0;
  font-size: 14px;
  color: #666;
  text-align: center;
}

.footer .section-inner {
  padding: 0 24px;
}

.footer a {
  color: #1a73e8;
  text-decoration: underline;
}

.footer a:hover {
  text-decoration: none;
}

/* Animations */
/* Base animations for entrance */
#home {
  opacity: 0;
  animation: fadeInSection 1s ease-out forwards;
}

#about {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUpSection 0.8s ease-out 0.2s forwards;
}

#about .section-inner {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUpSection 0.8s ease-out 0.3s both;
}

#about .intro {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUpSection 0.8s ease-out 0.5s both;
}

#contact {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUpSection 0.8s ease-out 0.4s forwards;
}

#contact .section-inner {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUpSection 0.8s ease-out 0.5s both;
}

#about .highlight-item {
  opacity: 0;
  transform: translateY(20px);
}

/* Animate highlight items with stagger */
#about .highlight-item:nth-child(1) { animation: fadeInUpSection 0.6s ease-out 1.0s both; }
#about .highlight-item:nth-child(2) { animation: fadeInUpSection 0.6s ease-out 1.1s both; }
#about .highlight-item:nth-child(3) { animation: fadeInUpSection 0.6s ease-out 1.2s both; }
#about .highlight-item:nth-child(4) { animation: fadeInUpSection 0.6s ease-out 1.3s both; }

.contact-item {
  opacity: 0;
  transform: translateY(20px);
}

/* Animate contact items with stagger */
.contact-grid > :nth-child(1) { animation: fadeInUpSection 0.6s ease-out 0.7s both; }
.contact-grid > :nth-child(2) { animation: fadeInUpSection 0.6s ease-out 0.8s both; }
.contact-grid > :nth-child(3) { animation: fadeInUpSection 0.6s ease-out 0.9s both; }

/* Header animations */
.header {
  animation: slideDownHeader 0.6s ease-out both;
}

.header-inner {
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.2s forwards;
}

.logo img {
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.4s forwards;
}

.nav {
  opacity: 0;
  animation: fadeIn 0.8s ease-out 0.5s forwards;
}

.nav a {
  opacity: 0;
  transform: translateY(10px);
}

/* Animate navigation items with stagger */
.nav a:nth-of-type(1) { animation: slideInDelayed 0.6s ease-out 0.7s forwards; }
.nav a:nth-of-type(2) { animation: slideInDelayed 0.6s ease-out 0.8s forwards; }
.nav a:nth-of-type(3) { animation: slideInDelayed 0.6s ease-out 0.9s forwards; }

/* Animation keyframes */
@keyframes fadeInUpSection {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInSection {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDownHeader {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInDelayed {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced hover effects for interactive elements */
a, button {
  transition: color 0.2s ease, transform 0.2s ease;
}

/* Smooth scrolling enhancement */
html {
  scroll-behavior: smooth;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.3s ease;
  }

  .nav.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }

  .nav a {
    padding: 10px 0;
    font-size: 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .banner-slogan .title {
    font-size: 22px;
  }

  .banner-slogan .text {
    font-size: 20px;
  }

  #about .highlights {
    grid-template-columns: 1fr;
  }

  .section-inner {
    padding: 0 15px;
  }

  /* Reset animations for better performance on mobile */
  .header,
  .header-inner,
  .logo img,
  .nav,
  .nav a,
  #home,
  #about,
  #about .section-inner,
  #about .intro,
  #about .highlight-item,
  #contact,
  #contact .section-inner,
  .contact-grid > *,
  .footer,
  .footer .section-inner {
    animation: none;
  }

  /* Fade in on mobile without delay */
  *,
  #home,
  #about,
  #contact,
  .footer {
    opacity: 1;
  }
}

/* Print styles */
@media print {
  .header,
  .skip-link,
  .footer {
    display: none;
  }

  body {
    padding-top: 0;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* 首屏标题 SEO 与可访问性 */
.banner-section .site-title {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}