/* 鴻綸科技成果展示 — 極簡日式風（米白＋深藍）＋護眼深色模式，共用樣式 */
:root {
  /* 淺色（預設） */
  --bg: #fdfdfc;
  --bg-soft: #f7f7f5;
  --card: #ffffff;
  --card-hover: #ffffff;
  --line: rgba(0, 0, 0, 0.09);
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --muted-faint: #9a9a96;
  --accent: #1e3a5f;
  --accent-deep: #15293f;
  --accent-gold: #1e3a5f;
  --glow: rgba(30, 58, 95, 0.10);
  --header-bg: rgba(253, 253, 252, 0.92);
  --grid-line: rgba(0, 0, 0, 0.05);
  --hero-glow-1: transparent;
  --hero-glow-2: transparent;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 4px;
  --maxw: 1080px;
}

:root[data-theme="dark"] {
  /* 護眼深色模式 */
  --bg: #141414;
  --bg-soft: #1b1b1b;
  --card: #1b1b1b;
  --card-hover: #1b1b1b;
  --line: rgba(255, 255, 255, 0.10);
  --text: #f2f2f0;
  --muted: #9a9a96;
  --muted-faint: #6b7280;
  --accent: #7fa8d9;
  --accent-deep: #5f87b8;
  --accent-gold: #7fa8d9;
  --glow: rgba(127, 168, 217, 0.14);
  --header-bg: rgba(20, 20, 20, 0.9);
  --grid-line: rgba(255, 255, 255, 0.05);
  --hero-glow-1: transparent;
  --hero-glow-2: transparent;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 手機端細字重（300）可讀性補償：不改字重，改用字距/行高/邊緣渲染拯救小螢幕強光下的對比度 */
@media (max-width: 768px) {
  body {
    letter-spacing: 0.02em;
    line-height: 1.9;
    -webkit-text-stroke: 0.15px currentColor;
  }
  .btn, .card-body h3, h1, h2 { font-weight: 400; }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  max-width: 1600px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 1; min-width: 0; max-width: 55%; margin-right: auto; }
.brand img { height: auto; width: auto; max-height: 90px; max-width: 100%; display: block; }
.header-visit-counter {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
  margin-right: 12px;
}
.header-visit-counter span { color: var(--accent); font-weight: 600; }
.main-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.main-nav a {
  color: var(--muted);
  padding: 8px 12px;
  font-size: 0.92rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text); text-decoration: none; }
.main-nav a.active { color: var(--accent); }
.nav-contact-cta {
  padding: 8px 18px;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #fff;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.nav-contact-cta:hover { opacity: 0.85; color: #fff; text-decoration: none; }
.nav-contact-cta.active { opacity: 0.85; }
.mobile-contact-link {
  display: none;
  color: var(--accent) !important;
  font-weight: 400 !important;
}
.mobile-tools-link {
  display: none;
  color: var(--accent) !important;
  font-weight: 400 !important;
}

.nav-tools { position: relative; flex-shrink: 0; }
.nav-tools-trigger {
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
}
.nav-tools-trigger:hover, .nav-tools-trigger.active { color: #fff; background: var(--accent); text-decoration: none; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1.3rem;
  padding: 4px 12px;
  cursor: pointer;
}
.theme-toggle {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 140px 0 160px;
  text-align: left;
  overflow: hidden;
  background: var(--bg);
}
.hero > .wrap { position: relative; max-width: 900px; }
.hero h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.5;
}
.hero h1 .grad {
  color: var(--text);
  font-weight: 300;
}
.hero p.lead {
  margin: 28px 0 0;
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 2.1;
  font-weight: 300;
}
.hero-badge {
  display: inline-block;
  margin-bottom: 44px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.35em;
  font-weight: 500;
  word-break: keep-all;
}
.hero-cta { margin-top: 56px; display: flex; gap: 24px; justify-content: flex-start; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 15px 32px;
  border-radius: 2px;
  font-weight: 400;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  transition: opacity 0.2s, border-color 0.2s;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { opacity: 0.85; color: #fff; }
.btn-ghost { background: none; border: none; border-bottom: 1px solid var(--muted); color: var(--muted); padding: 15px 0; border-radius: 0; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-sm { padding: 9px 20px; font-size: 0.86rem; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section.alt { background: transparent; border: none; }
.section-title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 400; text-align: left; }
.section-sub { text-align: left; color: var(--muted); font-weight: 300; margin: 14px 0 56px; max-width: 620px; }
.eyebrow {
  display: block;
  text-align: left;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  margin-bottom: 14px;
}

/* ---------- Stats ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 40px; }
.stat {
  flex: 1;
  min-width: 160px;
  text-align: left;
}
.stat .num { font-size: 1.9rem; font-weight: 200; color: var(--text); font-family: "Noto Sans TC", "PingFang TC", system-ui, sans-serif; }
.stat .label { color: var(--muted); font-size: 0.88rem; margin-top: 10px; font-weight: 300; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.card {
  position: relative;
  background: transparent;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}
/* hover 用輕微上移＋圖示區塊變色取代劃線，避免全站線條過多 */
.card:hover { transform: translateY(-3px); }
.card:hover .card-visual { background: var(--glow); }
.card-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  opacity: 0.55;
  display: block;
  margin-bottom: 6px;
}
.card-visual {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  background: var(--bg-soft);
  transition: background 0.3s ease;
}
.card-visual svg { width: 34px; height: 34px; color: var(--accent); stroke-width: 1.4; }
.card-visual img { width: 76px; height: 76px; object-fit: contain; }
/* 情境照片（非圖示）淡淡灰階融入米白背景，hover/靠近卡片時恢復原色 */
.card-visual img.photo,
.svc-photo,
.l-tour-photo {
  filter: grayscale(15%) contrast(97%);
  transition: filter 0.5s ease;
}
.card:hover .card-visual img.photo,
.card:hover .svc-photo,
.tour-zoom-panel:hover .l-tour-photo { filter: grayscale(0%) contrast(100%); }
.card-visual img.food-photo { width: 100%; height: 100%; object-fit: cover; }
/* 美食照片容器：磨砂玻璃背景手法（仿Spotify專輯封面）——原圖本身構圖過滿過緊，
   用contain留白會出現像跑版的letterbox黑邊。改用同張圖片模糊放大當背景，前景圖縮小
   置中、加圓角陰影，視覺上緩解特寫照片的壓迫感，不需要重新生成圖片。 */
.card-visual.food-visual {
  height: 190px;
  position: relative;
  overflow: hidden;
  padding: 0;
}
.card-visual.food-visual::before {
  content: "";
  position: absolute;
  inset: -20px;
  background-image: var(--bg-img);
  background-size: cover;
  background-position: center;
  filter: blur(20px) brightness(0.72) saturate(1.1);
  transform: scale(1.15);
  z-index: 0;
}
.card-visual.food-visual img.food-photo {
  position: relative;
  z-index: 1;
  width: 76%;
  height: 76%;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}
.v-blue, .v-indigo, .v-cyan, .v-teal, .v-navy { background: var(--bg-soft); }
.card-body { padding: 26px 26px 30px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: 8px; }
.h3-icon { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); stroke-width: 1.6; margin-right: 2px; }
.card-body h3 a { color: var(--text); }
.card-body .tagline { color: var(--accent); font-size: 0.85rem; margin-bottom: 10px; }
.card-body p { color: var(--muted); font-size: 0.92rem; flex: 1; }
.card-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Feature list ---------- */
.feature-list { list-style: none; display: grid; gap: 18px; }
.feature-list li {
  padding-left: 28px;
  position: relative;
  color: var(--muted);
  word-break: keep-all;
}
.feature-list li::before {
  content: "▸";
  position: absolute;
  left: 8px;
  color: var(--accent);
}
.feature-list li strong { color: var(--text); }

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.faq-item summary {
  cursor: pointer;
  padding: 22px 4px;
  font-weight: 500;
  list-style: none;
  position: relative;
  padding-right: 40px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 300;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-a { padding: 0 4px 22px; color: var(--muted); }

/* ---------- Content pages ---------- */
.page-head { padding: 72px 0 44px; text-align: center; background: var(--bg); }
.page-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 400; }
.page-head p { color: var(--muted); margin-top: 14px; max-width: 640px; margin-inline: auto; }
.svc-tabs { display: flex; gap: 8px; justify-content: center; margin-top: 28px; border-bottom: 1px solid var(--grid-line); }
.svc-tab { font: inherit; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 18px; cursor: pointer; }
.svc-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.svc-tab:hover { color: var(--text); }
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin: 32px 0 14px; font-size: 1.3rem; font-weight: 400; color: var(--text); }
.prose p, .prose li { color: var(--muted); }
.prose ul { padding-left: 24px; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Tags ---------- */
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.tag {
  font-size: 0.76rem;
  padding: 4px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: none;
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); max-width: 820px; margin: 0 auto; }
.contact-card {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 24px 4px;
  text-align: center;
}
.contact-card a { display: block; color: inherit; text-decoration: none; }
.contact-card .ico { display: flex; justify-content: center; }
.contact-card .ico img { width: 76px; height: 76px; object-fit: contain; }
.contact-card h3 { margin: 12px 0 6px; font-size: 1rem; font-weight: 500; }
.contact-card p { color: var(--muted); font-size: 0.95rem; }
.contact-card a:hover h3 { color: var(--accent); }
.contact-card a:hover p { text-decoration: underline; }

/* ---------- Partner badge ---------- */
.badge-chip {
  display: inline-block;
  background: #fff;
  padding: 14px 22px;
  line-height: 0;
  border: 1px solid var(--line);
}
.badge-chip img { height: 52px; width: auto; }
@media (max-width: 480px) { .badge-chip img { height: 42px; } }
.badge-chip-lg { padding: 20px 28px; }
.badge-chip-lg img { height: 150px; }
@media (max-width: 480px) { .badge-chip-lg img { height: 110px; } }
/* ---------- Lightbox（點圖放大，見 main.js） ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(10, 10, 10, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox-overlay img {
  max-width: min(90vw, 900px);
  max-height: 88vh;
  width: auto;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.lightbox-overlay .lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
}

.prose-figure { margin: 20px 0; }
.prose-figure img { display: block; width: 100%; border: 1px solid var(--line); filter: grayscale(0.15); }
.prose-figure figcaption { margin-top: 8px; font-size: 0.76rem; color: var(--muted-faint); text-align: right; }
.cert-gallery {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 16px;
  margin: 32px auto 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cert-gallery img {
  width: 190px;
  min-width: 150px;
  flex: 1 1 190px;
  height: auto;
  border-width: 3px;
  border-style: solid;
  border-top-color: #4285f4;
  border-right-color: #ea4335;
  border-bottom-color: #fbbc05;
  border-left-color: #34a853;
  background: #fff;
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cert-gallery img:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
@media (max-width: 860px) {
  .cert-gallery {
    justify-content: flex-start;
    mask-image: linear-gradient(to right, black calc(100% - 36px), transparent);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 36px), transparent);
  }
}
.directory-excerpt {
  display: block;
  max-width: 640px;
  width: 100%;
  margin: 28px auto 0;
  border-width: 3px;
  border-style: solid;
  border-top-color: #4285f4;
  border-right-color: #ea4335;
  border-bottom-color: #fbbc05;
  border-left-color: #34a853;
}
.excerpt-caption {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 12px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-grid { display: grid; gap: 32px; grid-template-columns: 2fr 1fr 1fr; }
.footer-grid h4 { color: var(--text); font-size: 0.9rem; font-weight: 500; margin-bottom: 14px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--muted); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); text-decoration: underline; }
.footer-contact a { color: var(--accent); }
.footer-contact a:hover { text-decoration: underline; }
.footer-logo img { height: 56px; width: auto; margin-bottom: 18px; }
.footer-logo p { line-height: 1.8; margin-bottom: 20px; }
.copyright { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); text-align: center; font-size: 0.8rem; }
.visit-counter { margin-top: 10px; text-align: center; font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }

/* ---------- 浮動聯絡按鈕 ---------- */
.contact-fab {
  position: fixed; right: 20px; bottom: 24px; z-index: 60;
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 30px;
  padding: 8px 12px; box-shadow: 0 12px 30px -10px rgba(0,0,0,0.25);
}
.fab-label {
  font-size: 0.82rem; font-weight: 600; color: var(--accent);
  white-space: nowrap; padding: 0 2px;
  animation: fab-label-in 0.5s ease 0.3s both;
}
@keyframes fab-label-in { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: translateX(0); } }
.contact-fab a {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.contact-fab a:hover { transform: scale(1.08); opacity: 0.88; }
.contact-fab a svg { width: 20px; height: 20px; stroke: #fff; }
.contact-fab a.fab-fb { background: #1877F2; }
.contact-fab a.fab-line { background: #06C755; }
.contact-fab a.fab-line svg { width: 22px; height: 22px; fill: #fff; stroke: none; }
.contact-fab a.fab-map { background: #fff; border: 1px solid var(--line); }
.contact-fab a.fab-map img { width: 26px; height: 26px; }
.contact-fab a.fab-mail { background: var(--accent); }
@media (max-width: 480px) {
  .header-visit-counter { display: none; }
  .hero-badge { letter-spacing: 0.12em; }
  .contact-fab { right: 12px; bottom: 16px; padding: 6px 8px; gap: 8px; }
  .fab-label { display: none; }
  .contact-fab a { width: 36px; height: 36px; }
  .contact-fab a svg { width: 18px; height: 18px; }
  .contact-fab a.fab-map img { width: 22px; height: 22px; }
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Header／導覽列在裝不下前先收成漢堡選單，避免 main-nav 換行造成排版跑掉 ---------- */
@media (max-width: 1400px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
  }
  .main-nav.open { display: flex; }
  .nav-contact-cta { display: none; }
  .mobile-contact-link { display: block; }
  .mobile-tools-link { display: block; }
  .nav-tools { display: none; }
}

/* ---------- RWD ---------- */
@media (max-width: 860px) {
  .brand img { max-height: 72px; }
  .header-inner { padding: 10px 16px; }
  .header-visit-counter { font-size: 0.72rem; padding: 4px 10px; margin-right: 6px; }
  .wrap { padding: 0 16px; }
  .section { padding: 56px 0; }
  .btn { padding: 13px 22px; }
  .hero-cta .btn { width: 100%; max-width: 320px; }
  .card-actions .btn { flex: 1; text-align: center; min-width: 120px; }
  .stats { gap: 28px 20px; }
  .stat { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .stat .num { font-size: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 72px 0 60px; }
}

/* ---------- Logo 深/淺色切換（放在最後確保覆蓋 .brand img／.footer-logo img） ---------- */
img.logo-dark { display: none; }
:root[data-theme="dark"] img.logo-light { display: none; }
:root[data-theme="dark"] img.logo-dark { display: block; }
