* {
  padding: 0;
  margin: 0;
  font-family: "Noto Sans TC", sans-serif;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  overflow: hidden;
  background: #f7f9fa;
  background: linear-gradient(
    90deg,
    rgba(247, 249, 250, 1) 0%,
    rgba(232, 255, 251, 1) 78%,
    rgba(245, 250, 249, 1) 98%
  );
}

nav {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
}

.nav-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 10%;
  background: #fefefe;
}

.nav-container .link-icons {
  display: flex;
  align-items: center;
}

.link-icons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #a8b2d1;
  text-decoration: none;
  margin-left: 15px;
  font-size: 1.5rem;
  transition:
    border-color 0.3s,
    color 0.3s,
    box-shadow 0.3s;
}

.link-icons a:hover {
  color: #f1950e;
  scale: 1.3;
  cursor: pointer;
}

.banner-container {
  margin-top: 80px;
  width: 100%;
  height: 500px;
  background-image: url("../imgs/esg2.jpg");
  background-repeat: no-repeat;
  background-position: top center;
}
.row {
  margin: auto;
  width: 80%;
  height: 100%;
}
.row .col-2 {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px;
  text-align: center;
}
.row .col-2 h2 {
  max-width: 60%;
  font-size: 50px;
  font-weight: 500;
  margin-block: 30px;
  color: #fff;
}

.row .col-2 p {
  max-width: 60%;
  font-size: 16px;
  line-height: 2;
  color: #fff;
}

#main {
  /* margin: 0; */
  width: 100%;
  min-height: 100vh;
  background: #f7f9fa;
  background: linear-gradient(
    90deg,
    rgba(247, 249, 250, 1) 0%,
    rgba(232, 255, 251, 1) 78%,
    rgba(245, 250, 249, 1) 98%
  );
  border-bottom: 2px solid #16f7d2;
  border-top-left-radius: 50px;
  border-top-right-radius: 50px;
  border-bottom-right-radius: 30px;
  border-bottom-left-radius: 30px;
  box-shadow: 0 10px 30px rgba(30, 58, 138, 0.2);
}

.main-container {
  padding: 3rem 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  gap: 20px;
}

.main-container .image {
  z-index: 0;
  width: 50%;
  text-align: right;
}

.main-container .image img {
  max-width: 100%;
}

.main-container .content {
  width: 50%;
  padding: 50px;
}

.content .typewriter {
  font-weight: 500;
  font-size: 2rem;
  /* font-size: clamp(1rem, 1rem + 5vw, 2rem); */
  min-height: 3rem;
  display: flex;
  align-items: center;
}

.typewriter span {
  color: #3b82f6;
  font-size: 2rem;
  text-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
  position: relative;
}

.typewriter span::after {
  content: "";
  position: absolute;
  right: -8px;
  width: 3px;
  height: 100%;
  background-color: #f59e0b;
  animation: cursor 0.8s infinite;
}

@keyframes cursor {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.content .items {
  margin: 20px 0;
}

.items .item-title {
  font-size: 18px;
  font-weight: 500;
}
.items .item-list {
  font-size: 16px;
  font-weight: 300;
}

.social-links i {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 3rem;
  height: 3rem;
  background-color: transparent;
  border: 0.2rem solid #a8b2d1;
  border-radius: 50%;
  color: #a8b2d1;
  margin: 5px;
  font-size: 1.5rem;
  transition: 0.2s linear;
}

.social-links i:hover {
  scale: 1.3;
  /* filter: drop-shadow(0 0 10px rgb(109,67,0)); */
  border-color: #64ffda;
  color: #64ffda;
  box-shadow: 0 0 20px #64ffda;
}

.content button {
  width: 40%;
  height: 6vh;
  margin: 30px 0;
  background-color: #f59e0b;
  color: #1f2937;
  border: none;
  outline: none;
  font-size: 100%;
  font-weight: 700;
  border-radius: 5px;
  transition: 0.2s linear;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.content button:hover {
  scale: 1.1;
  border: 2px solid #f59e0b;
  background-color: #f59e0b;
  font-weight: 700;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.5);
}

.content button a {
  color: #1f2937;
  text-decoration: none;
}

#services h1,
#contact h1,
#project h1,
#patent h1,
#gallery h1 {
  padding: 15vh 0 5vh;
  text-align: center;
  color: #1f2937;
}

.service-container {
  margin: 0 auto 10vh;
  width: 80%;
  height: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.card {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.1);
  transition:
    transform 0.3s ease-in-out,
    box-shadow 0.3s ease-in-out;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #3b82f6;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(30, 58, 138, 0.2);
  border-left-color: #f59e0b;
}

.icon {
  font-size: 2em;
  color: #3b82f6;
  margin-bottom: 15px;
}

.card-title {
  font-size: 1.5em;
  margin-bottom: 10px;
  color: #1f2937;
}

.card .list {
  font-size: 16px;
  font-weight: 300;
  line-height: 2;
}

.file-item .download-btn {
  border: 1px solid #053c4d;
  border-radius: 5px;
  padding: 0px 12px;
  transition: 0.2s ease;
}
.file-item .download-btn:hover {
  background-color: #053c4d;
  color: #bce5f1;
  cursor: pointer;
}

.list a {
  text-decoration: none;
  color: #374151;
  transition: color 0.3s;
}

.list a:hover {
  color: #3b82f6;
  font-weight: 500;
}

.patent-container {
  margin: 0 auto 10vh;
  width: 80%;
  height: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.patent-container .patent-row {
  background-color: #ffffff;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.1);
  transition:
    transform 0.3s ease-in-out,
    box-shadow 0.3s ease-in-out;
  border: 1px solid #e5e7eb;
}

.patent-row .patent-col {
  width: 100%;
}

.patent-row .patent-col .patent-img {
  text-align: center;
}

.patent-row .patent-col .patent-img img {
  width: 100%;
}

.project-container {
  margin: 0 auto 10vh;
  width: 80%;
  height: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project-container .project-row {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.1);
  transition:
    transform 0.3s ease-in-out,
    box-shadow 0.3s ease-in-out;
  border: 1px solid #e5e7eb;
}

.project-row .project-col {
  width: 100%;
}

.project-row .project-col .project-img {
  text-align: center;
}

.project-row .project-col .project-img img {
  width: 100%;
}

.contact-container {
  margin: 0 auto;
  display: flex;
  background-color: #ffffff;
  width: 80%;
  box-shadow: 0 0 20px rgba(30, 58, 138, 0.1);
}

.contact-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #f8fafc;
  padding: 80px;
}

.contact-info h2 {
  font-size: 2.5em;
  margin-top: 0;
  color: #1f2937;
  margin-bottom: 10px;
}

.contact-info h2 span {
  color: #3b82f6;
}

.contact-info p {
  line-height: 2;
  color: #374151;
}

.contact-details {
  margin-bottom: 20px;
}

.contact-details a {
  display: block;
  color: #374151;
  text-decoration: none;
  line-height: 2;
  transition: color 0.3s;
}

.contact-details a:hover {
  color: #3b82f6;
}

.contact-form {
  flex: 1;
  background-color: #ffffff;
  padding: 80px;
}

.contact-form form {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  background-color: #ffffff;
  color: #1f2937;
  font-size: 1em;
  box-sizing: border-box;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.submit-btn {
  background-color: #3b82f6;
  color: #ffffff;
  border: 1px solid #3b82f6;
  padding: 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.2em;
  font-weight: bold;
  transition:
    background-color 0.3s,
    box-shadow 0.3s;
  text-shadow: none;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.submit-btn:hover {
  background-color: #1d4ed8;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* 表單提示訊息 */
.form-message {
  display: flex;
  /* text-align: center; */
  margin-top: 10px;
  padding: 10px;
  border-radius: 5px;
  font-weight: bold;
  /* display: none;  */
  /* color: #f90821; */
  color: #ccd6f6;
}

.form-message.success {
  color: #38a169;
  background-color: #d1f7e3;
}

.form-message.error {
  color: #e53e3e;
  background-color: #fee2e2;
}

#scroll-up {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  animation: scrollup 2s ease-in-out;
}

#scroll-up i {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 3rem;
  height: 3rem;
  background-color: transparent;
  border: 0.2rem solid #a8b2d1;
  border-radius: 50%;
  color: #a8b2d1;
  /* margin: 5px 10px; */
  font-size: 1.5rem;
  transition: 0.2s linear;
}

@keyframes scrollup {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#scroll-up i:hover {
  scale: 1.3;
  /* filter: drop-shadow(0 0 10px rgb(109,67,0)); */
  border-color: #64ffda;
  color: #64ffda;
  box-shadow: 0 0 20px #64ffda;
  cursor: pointer;
}

.footer {
  margin-top: 3rem;
  background-color: #1e3a8a;
  color: #93c5fd;
  /* color:#a8b2d1; */
  text-align: center;
  font-size: 9px !important;
  padding: 10px 0;
}

.loader-email {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin-right: 10px;
  /* 與文字保持間距 */
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 1200px) {
  .service-container,
  .project-container,
  .patent-container,
  .contact-container {
    width: 90%;
  }

  .row {
    width: 90%;
    padding: 16px;
  }
  .row .col-2 {
    width: 100%;
    padding: 100px 0;
  }

  .row .col-2 h2 {
    max-width: 90%;
  }
  .row .col-2 p {
    max-width: 90%;
  }
}

@media (max-width: 992px) {
  .main-container {
    flex-direction: column;
    gap: 50px;
  }

  .main-container .image,
  .main-container .content {
    width: 80%;
    padding: 0;
  }

  .contact-container {
    flex-direction: column-reverse;
  }

  .row {
    width: 100%;
  }

  .row .col-2 h2 {
    max-width: 100%;
  }
  .row .col-2 p {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .service-container {
    grid-template-columns: 1fr;
  }

  .patent-container {
    grid-template-columns: 1fr 1fr;
  }

  .project-container {
    grid-template-columns: 1fr 1fr;
  }

  .project-col,
  .patent-col {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .nav-container {
    padding: 16px 4%;
  }

  .row .col-2 h2 {
    font-size: 36px;
  }

  .contact-info,
  .contact-form {
    padding: 40px 10px;
  }
}

/* Lightbox gallery styles */
.gallery-container {
  margin: 0 auto 6vh;
  width: 80%;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.gallery-item {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(16, 24, 40, 0.08);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}
.gallery-item img:hover {
  transform: scale(1.03);
}
.gallery-caption {
  padding: 8px 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1f2937;
  background: #f5f5f5;
}

/* Overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  padding: 2rem;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-content {
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 0 auto;
}
.lightbox-caption {
  margin-top: 12px;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  padding: 8px 16px;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
}
.lightbox-close {
  top: 12px;
  right: 12px;
  transform: none;
}
.lightbox-prev {
  left: -36px;
}
.lightbox-next {
  right: -36px;
}

@media (max-width: 768px) {
  .gallery-container {
    width: 94%;
  }
  /* .lightbox-prev,
  .lightbox-next {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    transform: none;
  }
  .lightbox-prev {
    left: 8px;
  }
  .lightbox-next {
    right: 8px;
  } */
}
/* ===== Banner Carousel RWD Section ===== */
.banner-carousel {
  width: 100%;
  position: relative;
  background: #000;
  overflow: hidden;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  background: #000;
}

.carousel-slides {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: #fff;
  padding: 60px 40px 30px;
  text-align: left;
}

.carousel-caption h3 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.carousel-caption p {
  font-size: 1rem;
  opacity: 0.9;
}

/* Carousel Controls */
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
  left: 20px;
}

.carousel-next {
  right: 20px;
}

/* Carousel Dots */
.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.dot.active {
  background: #fff;
  transform: scale(1.2);
}

/* RWD - Responsive Design */
@media (max-width: 768px) {
  .carousel-slide img {
    object-fit: cover;
  }

  .carousel-caption {
    padding: 40px 20px 20px;
  }

  .carousel-caption h3 {
    font-size: 1.5rem;
  }

  .carousel-caption p {
    font-size: 0.875rem;
  }

  .carousel-prev,
  .carousel-next {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .carousel-prev {
    left: 10px;
  }

  .carousel-next {
    right: 10px;
  }

  .carousel-dots {
    bottom: 15px;
    gap: 8px;
  }

  .dot {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 480px) {
  .carousel-caption {
    padding: 30px 15px 15px;
  }

  .carousel-caption h3 {
    font-size: 1.2rem;
  }

  .carousel-caption p {
    font-size: 0.75rem;
    display: none; /* Hide paragraph on very small screens */
  }

  .carousel-prev,
  .carousel-next {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .carousel-prev {
    left: 5px;
  }

  .carousel-next {
    right: 5px;
  }

  .carousel-dots {
    bottom: 12px;
    gap: 6px;
  }

  .dot {
    width: 8px;
    height: 8px;
  }

  .gallery-grid {
  /* display: grid; */
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }

  .contact-info h2 {
    font-size: 1.6rem;
  }
  
}
/* ===== End Banner Carousel RWD ===== */
