/* 公司形象首頁樣式：維持靜態、無外部依賴、方便本機快速驗證。 */
:root {
  --bg: #f7f5ef;
  --text: #172124;
  --muted: #667078;
  --deep: #08292c;
  --deep-2: #0f3b3f;
  --gold: #b8874b;
  --gold-2: #d3ad74;
  --line: #e4ded3;
  --card: #ffffff;
  --shadow: 0 18px 42px rgba(24, 33, 36, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", "Noto Sans TC", Arial, sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 86px;
  padding: 0 54px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 230px;
}

.brand-logo {
  display: block;
  width: 220px;
  max-width: 42vw;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 30px;
  color: #2d383b;
  font-size: 15px;
  font-weight: 650;
}

.site-nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.nav-cta,
.btn {
  border-radius: 6px;
}

.nav-cta {
  padding: 12px 18px !important;
  color: #fff !important;
  background: var(--gold);
  border: 0 !important;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  min-height: 560px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(8, 41, 44, 0.78), rgba(8, 41, 44, 0.2)),
    radial-gradient(circle at 82% 30%, rgba(211, 173, 116, 0.34), transparent 32%),
    linear-gradient(135deg, #050707, #162426 55%, #314040);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
}

.hero-content,
.hero-signage {
  position: relative;
  z-index: 1;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 720px;
  padding: 72px 40px 72px 84px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gold-2);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.08;
  letter-spacing: 0.03em;
}

.hero-subtitle {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  font-weight: 800;
}

.btn-primary {
  color: #fff;
  background: var(--gold);
  box-shadow: 0 10px 24px rgba(184, 135, 75, 0.3);
}

.btn-secondary {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.hero-signage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 70px 48px 20px;
}

.hero-image {
  display: block;
  width: min(620px, 100%);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.section {
  padding: 70px 54px;
}

.service-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  background: #fff;
}

.service-section .section-copy {
  max-width: 760px;
}

.section-copy h2,
.section-heading h2,
.about-copy h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.25;
}

.section-copy p:not(.eyebrow),
.about-copy p {
  color: var(--muted);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.service-card,
.work-card {
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.service-card {
  min-height: 310px;
  text-align: left;
}

.service-image,
.work-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f2efe8;
  border-bottom: 1px solid var(--line);
}

.service-card h3,
.service-card p,
.work-card h3,
.work-card p {
  padding-inline: 18px;
}

.service-card h3,
.work-card h3 {
  margin: 18px 0 10px;
  font-size: 20px;
}

.service-card p,
.work-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.service-card p {
  padding-bottom: 18px;
}

.equipment-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.equipment-row img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8f4eb;
}

.works-section {
  background: #f8f4eb;
}

.section-heading {
  margin-bottom: 28px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.work-card p {
  padding-bottom: 20px;
}

.about-section {
  background: linear-gradient(90deg, #efe4d3, #fffaf1);
}

.about-copy {
  max-width: 980px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.metrics div {
  padding: 18px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(184, 135, 75, 0.24);
  border-radius: 8px;
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  color: var(--deep);
  font-size: 28px;
}

.metrics span {
  color: var(--muted);
  font-size: 14px;
}

.contact-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) 150px minmax(0, 1.25fr) auto;
  gap: 28px;
  align-items: center;
  padding: 34px 54px;
  color: #fff;
  background: linear-gradient(90deg, var(--deep), #103f43);
}

.contact-title p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.contact-title strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.3;
}

.line-card {
  display: grid;
  align-content: center;
  justify-items: center;
  place-items: center;
  gap: 6px;
  min-height: 218px;
  padding: 12px;
  color: var(--text);
  background: #fff;
  border-radius: 8px;
  text-align: center;
}

.line-card img {
  width: 112px;
  height: 112px;
  object-fit: contain;
}

.line-card span {
  color: var(--muted);
  font-size: 12px;
}

.line-card strong {
  font-size: 15px;
}

.line-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  min-height: 38px;
  margin-top: 6px;
  padding: 8px 10px;
  color: #fff;
  background: #06c755;
  border: 2px solid #04a847;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(6, 199, 85, 0.34);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.line-add-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(6, 199, 85, 0.42);
}

/* 封測快速入口：固定於頁面右側，維持純靜態連結。 */
.floating-action-stack {
  position: fixed;
  right: 18px;
  top: 50%;
  z-index: 80;
  display: grid;
  gap: 12px;
  transform: translateY(-50%);
}

.floating-action-button {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(8, 41, 44, 0.24);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-action-button:hover {
  transform: scale(1.05);
  box-shadow: 0 18px 42px rgba(8, 41, 44, 0.28);
}

.floating-line-button {
  background: #06c755;
  box-shadow: 0 18px 42px rgba(6, 199, 85, 0.5);
}

.floating-inquiry-button {
  background: var(--gold);
}

.floating-ai-button {
  background: var(--deep);
}

[data-ai-service-entry][hidden],
.ai-chat-shell[hidden],
.ai-service-disabled-notice[hidden] {
  display: none !important;
}

.floating-action-button img {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.contact-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.contact-items div {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.24);
}

.contact-items span,
.contact-items small {
  display: block;
  color: rgba(255, 255, 255, 0.7);
}

.contact-items strong {
  display: block;
  margin: 4px 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}

/* 首頁卡片圖片連結：只讓圖示區可點選，保留文字區正常閱讀。 */
.card-media-link {
  display: block;
  color: inherit;
}

.card-media-link img {
  transition: transform 0.24s ease, filter 0.24s ease;
}

.card-media-link:hover img {
  filter: brightness(0.95) contrast(1.06);
  transform: scale(1.025);
}

/* 子頁面共用版型：支援服務頁與作品頁的第一版內容。 */
.detail-main {
  background: #fffaf1;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 42px;
  align-items: center;
  padding: 70px 54px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(8, 41, 44, 0.95), rgba(8, 41, 44, 0.72)),
    radial-gradient(circle at 85% 20%, rgba(211, 173, 116, 0.28), transparent 34%);
}

.detail-hero h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.12;
}

.detail-hero p {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 19px;
}

.detail-hero-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.back-link {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--gold-2);
  font-weight: 800;
}

.detail-section {
  padding: 70px 54px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.detail-card {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail-card h2,
.detail-card h3 {
  margin: 0 0 12px;
}

.detail-card p,
.detail-card li {
  color: var(--muted);
}

.detail-list {
  padding-left: 1.2em;
  margin: 0;
}

.detail-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 32px;
  color: #fff;
  background: linear-gradient(90deg, var(--deep), #103f43);
  border-radius: 10px;
}

/* 詢價頁：封測期間只提供靜態導線，不接後端服務。 */
.inquiry-page {
  background: #fffaf1;
}

.inquiry-hero {
  display: grid;
  gap: 16px;
  padding: 70px 54px 46px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(8, 41, 44, 0.95), rgba(8, 41, 44, 0.74)),
    radial-gradient(circle at 86% 20%, rgba(211, 173, 116, 0.32), transparent 34%);
}

.inquiry-hero h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.12;
}

.inquiry-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 19px;
}

.inquiry-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 42px 54px 70px;
}

.inquiry-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.inquiry-panel h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
}

.inquiry-panel p {
  margin: 0;
  color: var(--muted);
}

.inquiry-panel .line-add-button {
  width: auto;
  min-width: 180px;
  align-self: flex-start;
}

.inquiry-line-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.inquiry-status {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 10px;
  color: var(--deep);
  background: #f4ead9;
  border: 1px solid rgba(184, 135, 75, 0.28);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.inquiry-form {
  display: grid;
  gap: 14px;
}

.inquiry-form label {
  display: grid;
  gap: 6px;
  color: var(--deep);
  font-weight: 800;
}

.inquiry-form input,
.inquiry-form select,
.inquiry-form textarea {
  width: 100%;
  padding: 10px 12px;
  color: var(--text);
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.inquiry-form textarea {
  min-height: 132px;
  resize: vertical;
}

.inquiry-form button[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
}

.inquiry-form-status {
  min-height: 1.5em;
  color: var(--deep);
  font-weight: 800;
}

.inquiry-form-status.is-error {
  color: #9d2f1f;
}

.inquiry-note {
  padding: 12px;
  color: var(--deep);
  background: #f4ead9;
  border-radius: 6px;
  font-weight: 800;
}

/* AI客服封測頁：只驗證 ChatTester 鏈路，不代表正式客服承諾。 */
.ai-service-page {
  background: #fffaf1;
}

.ai-service-hero {
  display: grid;
  gap: 16px;
  padding: 70px 54px 46px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(8, 41, 44, 0.96), rgba(8, 41, 44, 0.72)),
    radial-gradient(circle at 84% 24%, rgba(211, 173, 116, 0.32), transparent 34%);
}

.ai-service-hero h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.12;
}

.ai-service-hero p {
  max-width: 820px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 19px;
}

.ai-service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.ai-chat-shell {
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr);
  gap: 24px;
  padding: 42px 54px 70px;
}

.ai-chat-guidance,
.ai-chat-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ai-chat-guidance {
  align-self: start;
  padding: 26px;
}

.ai-chat-guidance h2 {
  margin: 0 0 12px;
}

.ai-chat-guidance p {
  margin: 0 0 12px;
  color: var(--muted);
}

.ai-chat-guidance p:last-child {
  margin-bottom: 0;
}

.ai-service-disabled-notice {
  max-width: 760px;
  margin: 0 auto 70px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.ai-chat-panel {
  display: grid;
  grid-template-rows: minmax(320px, 54vh) auto;
  overflow: hidden;
}

.ai-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 22px;
  background: #f8f4eb;
}

.ai-chat-message {
  max-width: min(680px, 88%);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ai-chat-message strong,
.ai-chat-message p {
  display: block;
  margin: 0;
}

.ai-chat-message strong {
  margin-bottom: 6px;
  color: var(--deep);
  font-size: 14px;
}

.ai-chat-message p {
  color: var(--text);
  white-space: pre-wrap;
}

.ai-chat-message-user {
  align-self: flex-end;
  color: #fff;
  background: var(--deep);
  border-color: rgba(8, 41, 44, 0.2);
}

.ai-chat-message-user strong,
.ai-chat-message-user p {
  color: #fff;
}

.ai-chat-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.ai-chat-form label {
  color: var(--deep);
  font-weight: 800;
}

.ai-chat-form textarea {
  width: 100%;
  min-height: 112px;
  padding: 12px;
  color: var(--text);
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}

.ai-chat-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ai-chat-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--deep);
  font-weight: 800;
}

.ai-chat-status.is-error {
  color: #9d2f1f;
}

.ai-chat-form button[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
}

/* 作品圖庫：縮圖負責快速瀏覽，點擊後用同頁燈箱顯示大圖。 */
.gallery-section {
  padding-top: 0;
}

.gallery-heading {
  max-width: 780px;
  margin-bottom: 24px;
}

.gallery-heading h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 36px);
}

.gallery-heading p {
  margin: 0;
  color: var(--muted);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.gallery-thumb {
  display: block;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.24s ease, filter 0.24s ease;
}

.gallery-thumb:hover img {
  filter: brightness(0.95) contrast(1.06);
  transform: scale(1.035);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 28px;
}

.gallery-lightbox:target {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 7, 0.84);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(1120px, 94vw);
  max-height: 92vh;
}

.lightbox-panel img {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  background: #111;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  justify-self: end;
  padding: 8px 14px;
  color: #fff;
  background: var(--gold);
  border-radius: 6px;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .site-header,
  .service-section,
  .section,
  .contact-band {
    padding-inline: 28px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 18px;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 18px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero,
  .detail-hero,
  .service-section,
  .contact-band {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding-inline: 40px;
  }

  .hero-signage {
    padding: 0 40px 54px;
  }

  .service-grid,
  .works-grid,
  .detail-grid,
  .inquiry-methods,
  .gallery-grid,
  .contact-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-chat-shell {
    grid-template-columns: 1fr;
    padding-inline: 28px;
  }

  .line-card {
    justify-self: start;
    width: 150px;
  }
}

@media (max-width: 680px) {
  .site-header,
  .detail-hero,
  .detail-section,
  .ai-service-hero,
  .section,
  .service-section,
  .contact-band {
    padding-inline: 18px;
  }

  .brand {
    min-width: 0;
  }

  .brand-logo {
    width: 190px;
    max-width: 62vw;
  }

  .hero-content {
    padding: 48px 22px;
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .service-grid,
  .works-grid,
  .detail-grid,
  .gallery-grid,
  .metrics,
  .contact-items {
    grid-template-columns: 1fr;
  }

  .line-card {
    width: 100%;
  }

  .contact-band {
    padding-block: 28px;
  }

  .inquiry-methods {
    grid-template-columns: 1fr;
  }

  .ai-chat-shell {
    padding: 28px 18px 76px;
  }

  .ai-chat-panel {
    grid-template-rows: minmax(280px, 52vh) auto;
  }

  .ai-chat-message {
    max-width: 94%;
  }

  .ai-chat-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .floating-action-stack {
    right: 12px;
    top: auto;
    bottom: 18px;
    transform: none;
  }

  .floating-action-button {
    width: 56px;
    height: 56px;
  }

  .floating-action-button:hover {
    transform: scale(1.04);
  }
}


/* Staging-only preview label for CatWeb corporate homepage review. */
.corporate-preview-label {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 100;
  padding: 6px 10px;
  color: #fff;
  background: rgba(8, 41, 44, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
