:root {
  --bg: #F7F8FA;
  --bg-soft: #ffffff;
  --ink: #0B1220;
  --muted: #64748b;
  --cyan: #0F766E;
  --cyan-dim: #0d9488;
  --navy: #ffffff;
  --line: #E6E9EE;
  --glass: rgba(255, 255, 255, 0.88);
  --nav-h: 4rem;
  --footer-h: 3.5rem;
  --radius-rect: 1.15rem;
  --font: "Noto Sans TC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  padding-bottom: var(--footer-h);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: color-mix(in srgb, var(--navy) 72%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
  margin-right: 0.75rem;
}

.logo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.logo img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.brand-tagline {
  margin: 0;
  min-width: 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.nav-list {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a,
.nav-ai {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0.35rem 0;
  font-family: inherit;
  cursor: pointer;
}

.nav-list a:hover,
.nav-ai:hover {
  color: var(--cyan);
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  display: block;
  width: 1.15rem;
  height: 1.5px;
  background: var(--ink);
  margin: 0 auto;
  position: relative;
}

.nav-toggle-bar::before {
  position: absolute;
  top: -6px;
}

.nav-toggle-bar::after {
  position: absolute;
  top: 6px;
}

.hero {
  margin-top: calc(var(--nav-h) * -1);
  min-height: 58vh;
  padding: calc(var(--nav-h) + 3.2rem) 8vw 3.5rem;
  display: flex;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(247, 248, 250, 0.92) 0%, rgba(247, 248, 250, 0.72) 42%, rgba(247, 248, 250, 0.45) 100%),
    url("../assets/hero-bg.png?v=4") right center / cover no-repeat;
}

.hero-copy {
  max-width: 22em;
}

.hero-copy h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.35;
  color: #0B1220;
}

.hero-line {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--cyan);
}

.services,
.contact {
  max-width: 1120px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
}

.section-kicker {
  margin: 0 0 2.5rem;
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  color: var(--cyan);
}

.section-title {
  width: max-content;
  max-width: 100%;
  margin: 0 auto 1.5rem;
  text-align: center;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.3;
  color: #0B1220;
  cursor: pointer;
}

.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 1.05fr);
  align-items: center;
  gap: 2rem;
  padding: 2.75rem 0;
}

.service-copy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.05rem;
  min-width: 0;
}

.service-title,
.service-body {
  margin: 0;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.service-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  padding: 1.15rem 1.45rem;
  border-radius: 999px;
  color: var(--ink);
  box-shadow: 0 0 24px color-mix(in srgb, var(--cyan) 12%, transparent);
  cursor: pointer;
}

.service-sub {
  display: block;
  max-width: 100%;
  font-size: clamp(0.9rem, 1.5vw, 1.12rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.06em;
  color: var(--cyan);
  opacity: 0.88;
  overflow-wrap: break-word;
}

.service-body {
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
  line-height: 1.85;
  color: #475569;
  padding: 1.7rem 1.9rem;
  border-radius: 3.5rem;
  text-align: justify;
}

.service-body p {
  margin: 0;
}

.service-body p + p {
  margin-top: 0.85em;
}

.service-visual {
  background: color-mix(in srgb, var(--navy) 80%, black);
  border: 1px solid var(--line);
  border-radius: var(--radius-rect);
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  overflow: hidden;
}

.service-visual--photo {
  background: #ffffff;
}

.service-visual--soon {
  color: #8a93a0;
  letter-spacing: 0.16em;
  font-size: 0.92rem;
}

.service-visual img {
  width: 100%;
  height: min(280px, 36vw);
  object-fit: contain;
}

.illus {
  width: min(100%, 280px);
  height: auto;
}

.contact {
  text-align: center;
  padding-bottom: 6rem;
}

.contact-title {
  margin: -0.35rem 0 1.25rem;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 500;
  color: var(--muted);
}

.contact-mail {
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--cyan);
  text-decoration: none;
}

.contact-mail:hover {
  text-decoration: underline;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  min-height: var(--footer-h);
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 5.5rem 0.65rem 1.25rem;
  background: color-mix(in srgb, var(--navy) 88%, transparent);
  backdrop-filter: blur(16px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
}

.footer-nav a,
.footer-nav .nav-ai {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0.2rem 0;
  font-family: inherit;
  cursor: pointer;
}

.footer-nav a:hover,
.footer-nav .nav-ai:hover,
.footer-nav a.is-current {
  color: var(--cyan);
}

.fab {
  position: fixed;
  right: 1.25rem;
  bottom: calc(var(--footer-h) + 1.1rem);
  z-index: 45;
  width: 3.5rem;
  height: 3.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--cyan);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.18);
  display: grid;
  place-items: center;
}

.fab:hover {
  background: #0d9488;
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.28);
}

.chat {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: color-mix(in srgb, black 45%, transparent);
  display: grid;
  place-items: end;
  padding: 1rem 1rem calc(var(--footer-h) + 1.2rem);
}

.chat[hidden] {
  display: none;
}

.chat-card {
  width: min(100%, 460px);
  height: min(74vh, 680px);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  overflow: hidden;
  box-shadow: 0 18px 50px color-mix(in srgb, black 40%, transparent);
  justify-self: end;
  display: flex;
  flex-direction: column;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  background: var(--navy);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.chat-head-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.chat-head h2 {
  margin: 0;
  flex: 1;
  font-size: 1.05rem;
  font-weight: 500;
}

.chat-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan-dim) transparent;
}

.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
}

.chat-msg--user {
  justify-content: flex-end;
}

.chat-msg-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: 78%;
}

.chat-msg--user .chat-msg-content {
  align-items: flex-end;
}

.chat-copy {
  border: 1px solid color-mix(in srgb, var(--cyan) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--navy) 82%, black);
  color: var(--cyan);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.32rem 0.75rem;
  cursor: pointer;
}

.chat-copy:hover {
  background: var(--cyan);
  color: var(--bg);
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}

.chat-bubble {
  margin: 0;
  max-width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: color-mix(in srgb, var(--cyan) 12%, var(--navy));
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg--user .chat-bubble {
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: #eef2f6;
}

.chat-form {
  display: flex;
  gap: 0.55rem;
  padding: 0.85rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.chat-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.chat-form input:focus {
  outline: 1px solid var(--cyan);
}

.chat-send {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.chat-send img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.chat-send:hover {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cyan) 45%, transparent);
}

.chat-form button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.nav-list a,
.contact-mail,
.footer-nav a {
  display: inline-block;
}

.logo,
.nav-list a,
.nav-ai,
.nav-toggle,
.section-title,
.service-title,
.service-visual,
.contact-mail,
.footer-nav a,
.footer-nav .nav-ai,
.fab,
.chat-close,
.chat-send,
.chat-copy {
  transition: transform 0.18s ease;
}

.service-visual {
  cursor: pointer;
}

.service-visual:hover {
  transform: scale(1.03);
}

.section-title:hover,
.service-title:hover {
  transform: scale(1.05);
}

@keyframes press-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.is-popping {
  animation: press-pop 0.22s ease;
}

.logo:active,
.nav-list a:active,
.nav-ai:active,
.nav-toggle:active,
.section-title:active,
.service-title:active,
.service-visual:active,
.contact-mail:active,
.footer-nav a:active,
.footer-nav .nav-ai:active,
.fab:active,
.chat-close:active,
.chat-send:active,
.chat-copy:active {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .logo,
  .nav-list a,
  .nav-ai,
  .nav-toggle,
  .section-title,
  .service-title,
  .service-visual,
  .contact-mail,
  .footer-nav a,
  .footer-nav .nav-ai,
  .fab,
  .chat-close,
  .chat-send,
  .chat-copy {
    transition: none;
  }

  .section-title:hover,
  .service-title:hover,
  .service-visual:hover,
  .logo:active,
  .nav-list a:active,
  .nav-ai:active,
  .nav-toggle:active,
  .section-title:active,
  .service-title:active,
  .service-visual:active,
  .contact-mail:active,
  .footer-nav a:active,
  .footer-nav .nav-ai:active,
  .fab:active,
  .chat-close:active,
  .chat-send:active,
  .chat-copy:active {
    transform: none;
  }

  .is-popping {
    animation: none;
  }
}

@media (max-width: 860px) {
  :root {
    --footer-h: 3.6rem;
  }

  .site-header {
    padding: 0 0.75rem 0 1rem;
  }

  .brand {
    gap: 0.55rem;
    margin-right: 0.4rem;
  }

  .brand-tagline {
    font-size: 0.68rem;
    max-width: 9.2rem;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .nav-list {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: color-mix(in srgb, var(--navy) 94%, black);
    border-bottom: 1px solid var(--line);
  }

  .site-header.is-open .nav-list {
    display: flex;
  }

  .nav-list a,
  .nav-list .nav-ai {
    width: 100%;
    padding: 0.95rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--line);
  }

  .hero {
    min-height: 48vh;
    padding: calc(var(--nav-h) + 2.6rem) 1.4rem 2.8rem;
    background:
      linear-gradient(180deg, rgba(247, 248, 250, 0.78) 0%, rgba(247, 248, 250, 0.88) 100%),
      url("../assets/hero-bg.png?v=4") right center / cover no-repeat;
  }

  .service {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    padding: 2.5rem 0;
  }

  .service-copy {
    order: 1;
    gap: 0.9rem;
  }

  .service-title {
    width: 100%;
    padding: 1.05rem 1.2rem;
    gap: 0.22rem;
  }

  .service-sub {
    font-size: 0.88rem;
    letter-spacing: 0.04em;
  }

  .section-title {
    padding-inline: 0.5rem;
  }

  .contact .section-title,
  .contact-title {
    max-width: calc(100% - 3.25rem);
    margin-left: auto;
    margin-right: auto;
  }

  .service-visual {
    order: 2;
    min-height: 180px;
    width: 100%;
  }

  .service-visual img {
    height: 200px;
  }

  .service-body {
    border-radius: 1.75rem;
    text-align: left;
  }

  .footer {
    padding: 0.45rem 0.6rem;
  }

  .footer-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    gap: 0;
  }

  .footer-nav a,
  .footer-nav .nav-ai {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    padding: 0.4rem 0.1rem;
  }

  .chat-card {
    width: 100%;
    height: min(78vh, 640px);
  }
}

@media (max-width: 768px) {
  body:has(.chat:not([hidden])) .fab,
  body:has(.chat:not([hidden])) .footer {
    visibility: hidden;
    pointer-events: none;
  }

  .chat {
    inset: auto;
    top: var(--chat-vv-top, 0px);
    left: 0;
    right: 0;
    width: 100%;
    height: var(--app-vh, 100dvh);
    max-height: var(--app-vh, 100dvh);
    padding: 0.5rem 4%;
    place-items: stretch;
    align-items: stretch;
    justify-items: stretch;
  }

  .chat-card {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    justify-self: stretch;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .chat-head {
    flex: 0 0 auto;
  }

  .chat-body {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    background: #F7F8FA;
  }

  .chat-form {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: auto;
    padding: 0.7rem 0.75rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
    position: relative;
    z-index: 5;
    pointer-events: auto;
    touch-action: manipulation;
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    box-sizing: border-box;
  }

  .chat-form input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    font-size: 16px;
    min-height: 44px;
  }

  .chat-send {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0.15rem;
    position: relative;
    z-index: 6;
    touch-action: manipulation;
    pointer-events: auto;
    border: 2px solid var(--cyan);
    background: #fff;
  }

  .chat-msg,
  .chat-msg--user,
  .chat-msg-content,
  .chat-avatar,
  .chat-bubble {
    display: flex;
    visibility: visible;
    opacity: 1;
  }

  .chat-msg {
    align-items: flex-end;
    gap: 0.55rem;
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
  }

  .chat-msg-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .chat-msg:not(.chat-msg--user) .chat-msg-content {
    max-width: calc(100% - 2.7rem);
  }

  .chat-bubble {
    display: block;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    overflow-x: hidden;
    background: #e6f4f1;
    color: #0B1220;
  }

  .chat-msg--user .chat-bubble {
    background: #eef2f6;
    color: #0B1220;
  }
}
