* {
  box-sizing: border-box;
}

:root {
  --red: #c1121f;
  --red-dark: #8f0d17;
  --navy: #08306b;
  --blue: #0067b1;
  --cyan: #19a7ce;
  --ink: #1f2933;
  --muted: #64748b;
  --line: #dbe5ef;
  --soft: #f4f8fb;
  --white: #ffffff;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  line-height: 1.75;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbfd 45%, #eef6fb 100%);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
}

.brand img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.brand strong {
  display: block;
  color: var(--red);
  font-size: 20px;
  letter-spacing: 0;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 1px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  padding: 9px 13px;
  border-radius: 4px;
  color: #334155;
  font-weight: 700;
  font-size: 15px;
}

.nav a:hover,
.nav a.active {
  background: var(--red);
  color: var(--white);
}

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(193, 18, 31, 0.09), rgba(0, 103, 177, 0.07) 52%, rgba(255, 255, 255, 0.82)),
    #ffffff;
}

.hero::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -160px;
  width: 560px;
  height: 360px;
  background: linear-gradient(135deg, var(--red), var(--blue), var(--cyan));
  clip-path: polygon(0 62%, 100% 0, 100% 100%, 0 100%);
  opacity: 0.2;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 380px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 42px;
  padding: 58px 0;
}

.eyebrow {
  color: var(--red);
  font-weight: 800;
  margin-bottom: 12px;
}

h1 {
  color: var(--red-dark);
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.15;
  margin: 0 0 18px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 690px;
  color: #334155;
  font-size: 20px;
  margin: 0;
}

.hero-card {
  border-left: 4px solid var(--blue);
  padding: 22px 0 22px 28px;
  min-width: 0;
}

.home-hero-card {
  position: relative;
  min-height: 292px;
  padding: 30px;
  border: 1px solid rgba(219, 229, 239, 0.86);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(8, 48, 107, 0.1);
  min-width: 0;
}

.home-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    url("fire-engineering-bg.png") center / cover no-repeat;
  opacity: 0.58;
}

.home-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(193, 18, 31, 0.09), rgba(0, 103, 177, 0.11));
}

.company-panel,
.home-hero-card p {
  position: relative;
  z-index: 1;
}

.company-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(8, 48, 107, 0.14);
}

.company-name {
  color: var(--red-dark);
  font-size: clamp(25px, 2.6vw, 34px);
  font-weight: 900;
  line-height: 1.25;
}

.company-subname {
  color: var(--navy);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  line-height: 1.35;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.home-hero-card p {
  margin: 0;
  color: #334155;
  font-weight: 700;
}

.logo-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 210px;
  padding: 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0) 70%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(0, 103, 177, 0.04));
  border-radius: 8px;
}

.logo-mark img {
  max-width: 100%;
  max-height: 198px;
  object-fit: contain;
  display: block;
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 80px;
}

.section {
  margin-bottom: 58px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.section-title::before {
  content: "";
  width: 10px;
  height: 36px;
  background: linear-gradient(var(--red), var(--blue));
  border-radius: 2px;
}

h2 {
  margin: 0;
  color: var(--red-dark);
  font-size: 30px;
  line-height: 1.3;
}

h3 {
  color: var(--navy);
  font-size: 22px;
  margin: 0 0 10px;
}

p {
  margin: 0 0 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.card,
.info-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 14px 38px rgba(8, 48, 107, 0.07);
}

.card strong {
  color: var(--red-dark);
}

.list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  position: relative;
  padding-left: 24px;
}

.list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.73em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}

.service-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-list li {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 6px;
  padding: 15px 18px;
  font-weight: 700;
}

.highlight {
  background: linear-gradient(135deg, var(--red-dark), var(--red) 42%, var(--blue));
  color: var(--white);
  border-radius: 8px;
  padding: 30px;
  position: relative;
  overflow: hidden;
}

.highlight::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -85px;
  width: 260px;
  height: 190px;
  background: var(--cyan);
  clip-path: polygon(0 45%, 100% 0, 100% 100%, 0 100%);
  opacity: 0.35;
}

.highlight h2,
.highlight h3 {
  color: var(--white);
}

.highlight > * {
  position: relative;
  z-index: 1;
}

.kpi {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kpi div {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  color: var(--red-dark);
  font-weight: 800;
  text-align: center;
}

.contact-table {
  display: grid;
  gap: 12px;
}

.contact-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.contact-row span {
  color: var(--muted);
  font-weight: 800;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 4px;
  background: var(--red);
  color: var(--white);
  font-weight: 800;
}

.button.secondary {
  background: var(--white);
  color: var(--blue);
  border: 1px solid var(--blue);
}

.button:hover {
  background: var(--red-dark);
  color: var(--white);
}

.button.secondary:hover {
  background: var(--blue);
  color: var(--white);
}

.site-footer {
  color: #d8e6f5;
  background: linear-gradient(135deg, #7f0b14, #06244f);
  padding: 34px 0;
}

.footer-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-inner strong {
  color: var(--white);
}

.line-float {
  position: fixed;
  top: 108px;
  right: 20px;
  z-index: 30;
  filter: drop-shadow(0 10px 18px rgba(6, 49, 116, 0.22));
}

.line-float img {
  width: 150px;
  height: auto;
  display: block;
}

@media (max-width: 860px) {
  .header-inner,
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .header-inner {
    align-items: flex-start;
    padding: 14px 0;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero-inner {
    display: block;
    min-height: auto;
    padding: 42px 0;
  }

  h1 {
    max-width: min(100%, 330px);
    font-size: 30px;
    line-height: 1.25;
    word-break: break-all;
  }

  .lead {
    max-width: min(100%, 330px);
    font-size: 18px;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .hero-card {
    margin-top: 34px;
    padding-left: 20px;
    max-width: min(100%, 330px);
  }

  .home-hero-card {
    padding: 24px;
  }

  .logo-pair {
    grid-template-columns: 1fr;
  }

  .logo-mark {
    min-height: 190px;
  }

  .hero-card p {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .grid,
  .grid.two,
  .service-list,
  .kpi {
    grid-template-columns: 1fr;
  }

  .line-float {
    top: auto;
    bottom: 18px;
    right: auto;
    left: auto;
    right: 16px;
  }

  .line-float img {
    width: 124px;
  }
}

@media (max-width: 560px) {
  .brand {
    min-width: 0;
  }

  .brand strong {
    font-size: 18px;
  }

  .nav a {
    font-size: 14px;
    padding: 8px 10px;
  }

  main,
  .header-inner,
  .hero-inner,
  .footer-inner {
    width: min(100% - 28px, 1120px);
  }

  .contact-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
