* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "MingLiU", sans-serif;
  line-height: 1.6;
  color: #333;
}

header {
  background: #f0f8ff;  
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 3%;
  max-width: 1200px;
  margin: 0 auto;
}

.lang-selector {
  display: flex;
  gap: 0.2rem;
  margin-left: 0.8rem;
}

.lang-selector a {
  padding: 0.2rem 0.3rem;
  border-radius: 3px;
  background: #f5f5f5;
  font-size: 0.8rem;
  transition: background-color 0.3s, color 0.3s;
}

.lang-selector a.active {
  background: #0066cc;
  color: white;
}

.logo {
  margin-left: 20px;
  width: 400px;
  height: 60px;
  overflow: visible;
  flex-shrink: 0;
}

.logo svg {
  display: block;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.logo text {
  font-family: "MingLiU", sans-serif;
  font-weight: bold;
  text-anchor: start;
  font-size: 28px;
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  margin-right: -20px;
  gap: 0.8rem;
}

.nav-links li {
  margin-left: 0.8rem;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-weight: 300;
  transition: color 0.3s;
  font-size: 0.95rem;  
  white-space: nowrap;
}

html[lang="en"] .nav-links a {
  font-size: 1rem;
  font-weight: normal;
}

html[lang="zh-CN"] .nav-links a,
html[lang="zh-TW"] .nav-links a {
  font-weight: 200;
  font-size: 0.9rem;
}

.nav-links a:hover {
  color: #0066cc;
}

main {
  margin-top: 80px;
}

.section {
  padding: 4rem 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.product-pdf {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: #0066cc;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s;
  font-size: 0.9rem;
  text-align: center;
}

.product-pdf:hover {
  background-color: #0052a3;
}

.hero {
  text-align: center;
  padding: 4rem 0;
  background: linear-gradient(135deg, rgba(245, 247, 250, 0.6) 0%, rgba(195, 207, 226, 0.6) 100%);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('https://n8q4q8b8.delivery.rocketcdn.me/wp-content/uploads/2022/03/ST-765SS-Free-Chlorine-or-Chlorine-Dioxide-Sensor.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: -1;
  transform: scale(0.935);
  filter: blur(1px);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #0066cc;
  position: relative;
  z-index: 2;
}

.hero p {
  position: relative;
  z-index: 2;
}

h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #0066cc;
}

.products-grid, .services-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  width: 100%;
  margin: 0 auto;
}

.product-image {
  margin-bottom: 1.5rem;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: auto;
  max-width: 400px;
  max-height: 400px;
  margin: 0 auto;
  display: block;
  object-fit: contain;
}

.product-image svg {
  display: none;
}

.product-svg {
  width: 100%;
  height: auto;
  display: block;
}

.product-card {
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.3s;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 400px;
}

.product-card h3 {
  color: #0066cc;
  margin-bottom: 0.8rem;
  font-size: 1.2rem;
}

.product-card p {
  margin-bottom: 1rem;
  color: #666;
  font-size: 1rem;
}

.product-features {
  list-style: none;
  padding-left: 0;
}

.product-features li {
  padding: 0.5rem 0;
  color: #555;
  font-size: 0.9rem;
  position: relative;
  padding-left: 1.5rem;
  line-height: 1.4;
}

.product-features li:before {
  content: "•";
  color: #0066cc;
  position: absolute;
  left: 0;
  top: 0.5rem;
}

.product-card:hover, .service-item:hover {
  transform: translateY(-5px);
}

.services-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
  padding: 0.5rem;
}

.service-icon {
  margin-bottom: 1.2rem;
  align-self: center;
  width: 70px;
  height: 70px;
}

.service-icon circle {
  fill: #f0f8ff;
}

.service-icon path {
  stroke: #0066cc;
  stroke-width: 3;
  fill: none;
}

.service-item {
  text-align: left;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.3s;
  background: #fff;
  position: relative;
  overflow: hidden;
  z-index: 1;
  text-decoration: none;
  color: inherit;
  display: block;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 400px;
  gap: 1rem;
}

.service-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
}

.service-item.cooling-tower::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('https://n8q4q8b8.delivery.rocketcdn.me/wp-content/uploads/2024/01/cooling-towers-in-data-center-building-2023-11-27-04-59-47-utc-300x300.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.03;
  z-index: 0;
  pointer-events: none;
}

.service-item.municipal-water::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('https://n8q4q8b8.delivery.rocketcdn.me/wp-content/uploads/2024/05/water-treatment-plant-2023-11-27-05-31-06-utc.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.03;
  z-index: 0;
  pointer-events: none;
}

.service-item.boiler-water::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('https://n8q4q8b8.delivery.rocketcdn.me/wp-content/uploads/2025/01/contemporary-industrial-powerful-water-boiler-with-2023-11-27-05-22-43-utc-2048x1365.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.03;
  z-index: 0;
  pointer-events: none;
}

.service-item.data-center::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('https://n8q4q8b8.delivery.rocketcdn.me/wp-content/uploads/2025/01/server-room-data-center-networking-database-co-2025-01-09-04-18-27-utc-2048x1368.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.03;
  z-index: 0;
  pointer-events: none;
}

.service-item h3, 
.service-item p, 
.service-details {
  position: relative;
  z-index: 2;
}

.service-item h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: #0066cc;
}

.service-item p {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

.service-details {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-top: 1rem;
}

.service-details li {
  padding: 0.6rem 0;
  color: #666;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
}

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

.service-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

.application-btn, 
.download-btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  border-radius: 4px;
  text-align: center;
  transition: background-color 0.3s;
  font-weight: bold;
  font-size: 0.9rem;
  min-height: 44px;
  width: 100%;
}

.application-btn {
  background-color: #0066cc;
  color: white;
}

.download-btn {
  background-color: #28a745;
  color: white;
}

.application-btn:hover {
  background-color: #0052a3;
}

.download-btn:hover {
  background-color: #218838;
}

.video-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 4rem;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  grid-column: 1 / -1;
}

.youtube-embed {
  position: relative;
  padding-bottom: 40%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin: 1rem 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 768px) {
  .video-container {
    padding: 0 1rem;
  }
  
  .youtube-embed {
    padding-bottom: 56.25%;
  }
}

@media (min-width: 768px) {
  .video-container {
    padding: 0 2rem;
  }
  
  .youtube-embed {
    margin: 2rem 0;
  }
}

@media (min-width: 1200px) {
  .video-container {
    padding: 0;
  }
}

.contact-info {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem;
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.content p {
  font-size: 1.2rem;
  line-height: 1.8;
}

.contact-details {
  margin-bottom: 2rem;
  text-align: left;
  flex-direction: column;
}

.contact-details p {
  display: flex;
  margin-bottom: 1.5rem;
  align-items: flex-start;
  font-size: 1.2rem;
}

.contact-details .label {
  min-width: 120px;
  font-weight: bold;
  color: #0066cc;
  font-size: 1.2rem;
}

#contact-form input,
#contact-form textarea {
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  width: 100%;
  min-height: 44px;
  font-size: 1.1rem;
}

#contact-form button {
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
}

input, textarea {
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  width: 100%;
  min-height: 44px;
}

textarea {
  height: 150px;
}

button {
  padding: 0.8rem 2rem;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
  min-height: 44px;
}

button:hover {
  background: #0052a3;
}

.certificate-section {
  margin: 2rem 0;
  text-align: center;
}

.certificate-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: #f5f5f5;
  border-radius: 10px;
}

.certificate-info {
  text-align: left;
  margin-top: 1rem;
  color: #666;
}

footer {
  background: #333;
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: #f0f8ff;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    height: auto;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
  }
  
  .nav-links li {
    margin: 0.8rem 0;
    text-align: center;
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.8rem;
    width: 100%;
    font-size: 1.2rem;
  }

  html[lang="zh-CN"] .nav-links a,
  html[lang="zh-TW"] .nav-links a {
    font-size: 1.1rem;
  }
  
  .hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    margin-right: 1.5rem;
    cursor: pointer;
    z-index: 1001;
  }

  .hamburger span {
    width: 100%;
    height: 3px;
    background-color: #0066cc;
    transition: all 0.3s ease-in-out;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }
  
  .logo {
    width: 260px;
    margin-left: 1rem;
  }
  
  .lang-selector {
    position: static;
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
  }

  .lang-selector a {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }
  
  nav {
    padding: 1rem 0;
    height: 80px;
  }

  .nav-links li:not(:last-child) {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 0.8rem;
  }

  .nav-links a,
  .lang-selector a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .services-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .service-item {
    padding: 1.5rem;
    min-height: 300px;
  }

  .service-item h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
  }

  .service-item p {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .service-details li {
    font-size: 1rem;
    padding: 0.5rem 0;
  }

  .service-buttons {
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1.2rem;
  }

  .application-btn,
  .download-btn {
    width: 100%;
    padding: 0.8rem;
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .service-buttons a {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.9rem;
    min-height: 44px;
    margin: 0;
  }

  .product-pdf,
  .application-btn,
  .download-btn {
    padding: 0.7rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .product-card {
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 1rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .product-card h3 {
    font-size: 1.1rem;
  }

  .product-features li {
    font-size: 0.9rem;
  }

  .services-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .service-item {
    padding: 1.2rem;
    min-height: 280px;
  }

  .service-item h3 {
    font-size: 1.2rem;
  }

  .service-item p {
    font-size: 0.95rem;
  }

  .service-details li {
    font-size: 0.95rem;
    padding: 0.4rem 0;
  }

  .service-buttons {
    gap: 0.6rem;
    margin-top: 1rem;
  }

  .application-btn,
  .download-btn {
    padding: 0.6rem;
    font-size: 0.9rem;
  }

  .product-pdf,
  .application-btn,
  .download-btn {
    padding: 0.6rem;
    font-size: 0.9rem;
  }

  .products-grid,
  .services-list {
    gap: 1rem;
  }
  
  .content p {
    font-size: 1.1rem;
  }
  
  .contact-details p,
  .contact-details .label {
    font-size: 1.1rem;
  }
}

@media (hover: none) {
  .nav-links a,
  .product-pdf,
  .application-btn,
  button {
    padding: 0.8rem 1.2rem;
    min-height: 44px;
  }

  .application-btn,
  .download-btn {
    min-height: 44px;
    padding: 0.8rem 1.2rem;
  }
  
  input, 
  textarea {
    min-height: 44px;
  }
}

@supports (padding: max(0px)) {
  header {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  
  .section {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  
  .services-list {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

.section,
.product-card,
.service-item,
.nav-links,
.hero,
.contact-info {
  transition: all 0.3s ease-in-out;
}

@media screen and (min-width: 320px) {
  :root {
    font-size: calc(14px + 2 * ((100vw - 320px) / 680));
  }
}

@media screen and (min-width: 1000px) {
  :root {
    font-size: 16px;
  }
}