:root{
  --accent:#0d6efd;
  --bg:#f7f8fb;
  --card:#ffffff;
  --muted:#666;
  --max-width:1200px;
}
*{box-sizing:border-box}
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,'Microsoft YaHei',sans-serif;margin:0;color:#222;background:var(--bg);line-height:1.5}

/* smooth scroll for internal anchors */
html{scroll-behavior:smooth}

/* page transitions */
html,body{height:100%}
.page-enter{opacity:0;transform:translateY(6px)}
.page-enter-active{transition:opacity .36s ease, transform .36s cubic-bezier(.2,.9,.2,1);opacity:1;transform:none}
.page-exit{opacity:1}
.page-exit-active{opacity:0;transition:opacity .28s ease}

/* reveal on scroll */
.reveal-item{opacity:0;transform:translateY(18px) scale(.995);transition:opacity .6s ease, transform .6s cubic-bezier(.2,.9,.2,1);will-change:opacity,transform}
.reveal-item.in-view{opacity:1;transform:none}

/* micro interactions */
.card{transition:transform .18s ease, box-shadow .18s ease}
.card:hover{transform:translateY(-4px);box-shadow:0 14px 30px rgba(6,30,73,.12)}
.btn{transition:transform .16s ease, filter .16s ease}
.btn:hover{filter:brightness(.98);transform:translateY(-2px)}
.container{max-width:var(--max-width);margin:0 auto;padding:1rem}

/* Default page blocks (main content) left-aligned */
main.container{text-align:left}
.site-header{background:#fff;border-bottom:1px solid #eee}
.header-inner{display:flex;align-items:center;justify-content:space-between;padding:0.75rem 1rem}
.brand img{height:42px}
.main-nav a{margin-left:1rem;text-decoration:none;color:#222;font-weight:600}

/* language toggle button */
.lang-toggle{
  margin-left:0.75rem;
  background:var(--accent);
  color:#fff;
  border:0;
  padding:.45rem .9rem;
  border-radius:999px;
  font-weight:800;
  font-size:0.95rem;
  cursor:pointer;
  box-shadow:0 8px 22px rgba(13,110,253,0.16);
  transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
  display:inline-flex;align-items:center;gap:0.5rem;
  z-index:1500;
}
.lang-toggle:hover{transform:translateY(-2px);background:#0b5ed7;box-shadow:0 12px 30px rgba(13,110,253,0.18)}
.lang-toggle:focus{outline:3px solid rgba(13,110,253,0.18);box-shadow:0 12px 30px rgba(13,110,253,0.18)}

/* smaller on very small screens to avoid header wrapping */
@media (max-width:420px){
  .lang-toggle{padding:.35rem .6rem;font-size:.85rem}
}

/* show both language labels and highlight active one */
.lang-toggle .zh, .lang-toggle .en{opacity:0.9;transition:opacity .12s ease, font-weight .12s ease}
.lang-toggle .zh{font-weight:700}
.lang-toggle .en{font-weight:700}
html[lang^="zh"] .lang-toggle .zh{font-weight:900;opacity:1}
html[lang^="zh"] .lang-toggle .en{opacity:0.6}
html[lang="en"] .lang-toggle .en{font-weight:900;opacity:1}
html[lang="en"] .lang-toggle .zh{opacity:0.6}

.main-nav a:hover{color:var(--accent);text-decoration:underline}
.main-nav a:focus{outline:3px solid #dbeeff;border-radius:4px}

/* mobile toggle */
.mobile-nav-toggle{display:none;background:transparent;border:0;padding:.25rem;border-radius:6px}
.mobile-nav-toggle svg{height:24px;width:24px}
.hero{padding:2rem 0;background:linear-gradient(90deg,#fff 0%, #f0f6ff 100%)}
.hero-inner{display:flex;gap:2rem;align-items:center}
.hero-text h1{font-size:2rem;margin:0 0 .5rem}
.hero-title{display:flex;align-items:center;gap:1.25rem;flex-wrap:wrap}
.hero-title h1{margin:0;font-size:2rem}
.site-logo{height:120px;width:auto;border-radius:6px;object-fit:contain;flex-shrink:0}

/* left-side page logo inside hero */
.hero-left{flex:0 0 auto;margin-right:1.5rem;display:flex;align-items:center}
.page-left-logo{height:220px;width:auto;border-radius:6px;object-fit:contain;display:block}
.hero-text p{color:var(--muted);margin:0 0 1rem}
.btn{display:inline-block;background:var(--accent);color:#fff;padding:.6rem 1rem;border-radius:6px;text-decoration:none}
.hero-image img{max-width:400px;height:auto}
.features{display:grid;grid-template-columns:repeat(3,1fr);gap:1.25rem;margin-top:1.25rem}
.feature{background:var(--card);border-radius:8px;padding:1.25rem;text-align:center;box-shadow:0 6px 18px rgba(6,30,73,.06)}
.feature img{height:72px;margin-bottom:.5rem}
.cta{background:linear-gradient(90deg,#0d6efd1a, transparent);padding:2rem;border-radius:8px;margin:2rem 0;text-align:center}
.site-footer{background:#fff;border-top:1px solid #eee;margin-top:3rem}
.footer-inner{display:flex;align-items:center;justify-content:space-between;padding:1rem}
.footer-nav a{margin-left:1rem;color:var(--muted);text-decoration:none}

/* Pages */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem}

/* card gallery for items with multiple images */
.card .gallery{display:flex;gap:0.6rem;align-items:center}
.card .gallery img{width:calc(50% - 0.3rem);height:140px;object-fit:contain;border-radius:6px;display:block;background:#f6f7fb;padding:6px}
@media (max-width:900px){
  .card .gallery{flex-direction:column}
  .card .gallery img{width:100%;height:160px}
  .hero-inner{flex-direction:column;text-align:left}
  .site-logo{height:80px}
  .hero-title{gap:.75rem}
  .page-left-logo{height:140px;margin-bottom:.75rem}
  .hero-left{margin-right:0}
}
/* product grid with larger imagery */
.product-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1.25rem;align-items:start}
.product-grid .card img{width:100%;height:auto;max-height:220px;object-fit:contain;background:#f6f7fb;padding:6px;border-radius:6px}

/* product detail */
.product-detail{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;align-items:start}
.product-detail .detail-image img{width:100%;height:auto;border-radius:8px}
.product-detail .detail-info h2{margin-top:0}

@media (max-width:900px){
  .product-detail{grid-template-columns:1fr}
}

/* slogan block on homepage */
.slogans{display:flex;gap:1rem;align-items:center;justify-content:space-between;padding:1.25rem;background:linear-gradient(90deg,#f5fbff 0%, #ffffff 100%);border-radius:8px;border:1px solid rgba(13,110,253,0.06)}
.slogan{flex:1;text-align:left;padding:.75rem 1rem;border-radius:6px;background:transparent;color:#0a2a4a;font-weight:700}
.slogan.lead{font-size:1.15rem}
.slogan p{margin:0;color:var(--muted);font-weight:500}

@media (max-width:900px){
  .slogans{flex-direction:column;gap:.6rem}
  .slogan{font-size:1rem}
}
.card{background:var(--card);padding:1rem;border-radius:8px;box-shadow:0 6px 18px rgba(6,30,73,.04);contain:layout}
.card img{width:100%;height:auto;max-height:200px;object-fit:contain;border-radius:6px;margin-bottom:.75rem;display:block}

/* product detail gallery - keep images fully visible and naturally sized */
.product-detail .detail-image .gallery img{width:100%;height:auto;max-height:520px;object-fit:contain;border-radius:8px;display:block;margin-bottom:0.6rem}

/* Ensure gallery images inside .card keep intended size (override general .card img) */
.card .gallery img{width:calc(50% - 0.3rem);height:140px;object-fit:contain;border-radius:6px;display:block;background:#f6f7fb;padding:6px}

@media (max-width:900px){
  .card .gallery img{width:100%;height:160px}
}

/* brand images (logos) — preserve aspect ratio and center inside card */
/* brand logos: target exact display box on desktop, but allow scaling on small screens */
.brand-frame{width:400px;height:300px;max-width:100%;background:transparent;padding:12px;border-radius:8px;display:flex;align-items:center;justify-content:center;margin:0 auto 1rem;transition:transform .12s ease}
.brand-frame .brand-logo{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;display:block}
/* slightly lift on hover for visual feedback */
.card .brand-logo:hover{transform:translateY(-4px)}
@media (max-width:900px){
  /* on narrower screens allow logos to scale fluidly */
  .brand-frame{width:80%;height:auto;padding:10px}
  .brand-frame .brand-logo{max-height:200px}
}

/* ensure cards have room for larger logos */
.cards .card{min-height:220px;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;text-align:left}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.about-inner{align-items:center;gap:2rem}
.about-text h2{margin-top:0;font-size:1.6rem}
.about-text p{color:var(--muted);margin-bottom:0.75rem}
.about-image img{width:100%;height:auto;border-radius:8px;box-shadow:0 10px 30px rgba(6,30,73,.06)}
.map{background:#e9eef5;height:260px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--muted)}

/* Responsive */
@media (max-width:900px){
  .hero-inner{flex-direction:column;text-align:left}
  .about-inner{grid-template-columns:1fr}
  .features{grid-template-columns:1fr}
  .grid-2{grid-template-columns:1fr}
  /* keep the nav in document flow but hidden via opacity for smooth animations */
  .main-nav{display:flex;flex-direction:column;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(-8px);transition:opacity .24s ease, transform .24s ease, visibility .24s}
  .mobile-nav-toggle{display:block}
  /* Fullscreen mobile nav overlay with backdrop blur (visible when .open) */
  .main-nav.open{opacity:1;visibility:visible;pointer-events:auto;transform:none;background:rgba(255,255,255,0.55);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);position:fixed;inset:0;padding:2.5rem 1.25rem;box-shadow:none;border-radius:0;z-index:1400;overflow:auto}
  /* Add a slight inner container for nav items so they don't touch edges */
  .main-nav.open > *{width:100%}
}

/* prevent page scrolling when mobile nav is open (class toggled on <html>) */
html.nav-open, body.nav-open{overflow:hidden;height:100%}

/* full-screen semi-opaque backdrop shown when mobile nav is open; captures clicks */
.nav-backdrop{position:fixed;inset:0;background:rgba(0,0,0,0.28);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);opacity:0;visibility:hidden;transition:opacity .18s ease;z-index:1350}
html.nav-open .nav-backdrop{opacity:1;visibility:visible}

/* hide the original header during overlays or page transitions to avoid ghosting */
.site-header.hidden-during-overlay{opacity:0;pointer-events:none;transition:opacity .18s ease;will-change:opacity}

/* contact map styling */
.contact-map img{width:100%;height:auto;border-radius:8px;display:block}
.contact-map figcaption{color:var(--muted)}

/* responsive iframe for embedded maps */
.contact-map iframe{width:100%;height:320px;border-radius:8px;display:block}

@media (max-width:900px){
  .contact-map iframe{height:280px}
}

/* respect reduced motion preference */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{transition:none!important;animation:none!important}
}
