/* 晙珈工業首頁 — 依原站版面：
   上方半透明 Logo 區 → 左側由深到淺的長條選單（固定寬度）→ 兩張產品小圖 → 疊在底圖上的頁尾 */
:root {
  --jj-ink: #4a4a4a;          /* Logo 主色 */
  --jj-ink-light: #8c8c8c;    /* Logo 次色、英文字 */
  --jj-band: rgba(236, 236, 236, 0.82); /* 上方 Logo 區 */
  --jj-paper: #f4f5f7;        /* 底圖沒載入時的底色 */
  --jj-line: rgba(70, 90, 120, 0.13);   /* 底圖替代用的藍圖線條 */
  --jj-accent: #d0101b;       /* 紅色點綴 */
  --jj-foot-text: #8a8a8a;    /* 頁尾文字 */
  --jj-icon: #a3a3a3;         /* 社群圓形圖示 */
  --jj-panel: #ffffff;        /* 內容面板左側白底 */
  --jj-panel-gray: #e4e4e4;   /* 內容面板右側灰底 */
  --jj-rule: #d2d2d2;         /* 標題與消息之間的細線 */
  --jj-text: #333333;         /* 內文 */
  --jj-news-red: #c9302c;     /* 消息標題 */
  --jj-blue: #1f7ac4;         /* 公司介紹主標上方的藍色線條 */
  --jj-navy: #0d2340;         /* 規格卡標題列 */
  --jj-navy-text: #1f4466;    /* 規格數值 */
  --jj-steel: #3d7bad;        /* 加工項目卡片的短線 */
  --jj-card-bg: #edf1f5;      /* 規格卡、加工項目卡片底色 */
  /* 五條選單的顏色（由深到淺） */
  --jj-bar1: #242424;
  --jj-bar2: #303030;
  --jj-bar3: #6c6b67;
  --jj-bar4: #888786;
  --jj-bar5: #a1a1a1;
  --jj-font: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  --jj-font-foot: "Oswald", "Arial Narrow", "Noto Sans TC", sans-serif;
  --jj-font-serif: "Noto Serif TC", "PMingLiU", "MingLiU", "Songti TC", serif;
  color-scheme: light;
}

html, body { margin: 0; }
body { background: var(--jj-paper); color: var(--jj-ink); font-family: var(--jj-font); }

.jj-page { position: relative; overflow-x: hidden; }

/* ---------- 底圖 ---------- */
.jj-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    var(--jj-bg) center / cover no-repeat,
    /* 圖片沒載入時：淡藍色方格，近似原本的藍圖底圖 */
    radial-gradient(ellipse at 55% 45%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(var(--jj-line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--jj-line) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--jj-paper);
}

/* ---------- 上方 Logo 區：170px 高的半透明白色橫條 ---------- */
.jj-header {
  height: 170px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  padding-top: 22px;
  padding-left: max(86px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--jj-band);
}
.jj-logo { margin: 0; line-height: 1; }
.jj-logo a { display: inline-block; text-decoration: none; }
.jj-logo img { display: block; max-width: 100%; height: auto; }
.jj-logo-text { display: block; font-size: 44px; font-weight: 700; letter-spacing: 2px; color: var(--jj-ink-light); }
.jj-logo-text b { color: var(--jj-ink); }
.jj-logo-en { display: block; margin-top: 8px; padding-left: 50px; font-size: 20px; font-weight: 400; color: var(--jj-ink-light); }

/* 版面：Logo 區 → 循環影片 → 產品小圖 → 頁尾，頁尾貼齊畫面底部 */
.jj-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.jj-header { flex: none; }

/* 小紅點（原站畫面上的點綴） */
.jj-dot {
  position: absolute;
  left: 338px;
  top: 276px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--jj-accent);
}

/* ---------- 循環播放影片（量測錶畫面） ---------- */
.jj-video {
  position: relative;
  z-index: 1;
  width: min(1010px, calc(100% - 2 * 86px));
  margin: 48px auto 0;
  aspect-ratio: 1010 / 550;
  max-width: 100%;
  background: #111;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.jj-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 左上角紅色細線，呼應選單的紅色點綴 */
.jj-video::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 72px;
  height: 3px;
  background: var(--jj-accent);
  z-index: 1;
}

/* ---------- 懸浮漢堡按鈕：畫面右下方、距底部約 10% ---------- */
.jj-burger {
  position: fixed;
  z-index: 40;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: calc(10% + env(safe-area-inset-bottom, 0px));
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background:
    radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1.3px) 0 0 / 6px 6px,
    var(--jj-bar1);
  box-shadow: 0 6px 18px rgba(0,0,0,0.28);
  transition: transform 0.2s ease;
}
.jj-burger:hover { transform: scale(1.06); }
.jj-burger:active { transform: scale(0.94); }
.jj-burger:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 3px; }
.jj-burger span,
.jj-burger span::before,
.jj-burger span::after {
  content: "";
  position: absolute;
  left: 19px;
  width: 22px;
  height: 2px;
  background: #fff;
  transition: transform 0.3s ease, background-color 0.3s ease;
}
.jj-burger span { top: 29px; }
.jj-burger span::before { left: 0; top: -7px; }
.jj-burger span::after { left: 0; top: 7px; }
.jj-menu-open .jj-burger span { background: transparent; }
.jj-menu-open .jj-burger span::before { transform: translateY(7px) rotate(45deg); }
.jj-menu-open .jj-burger span::after { transform: translateY(-7px) rotate(-45deg); }

/* 背景遮罩：選單打開時淡入，點一下就關閉 */
.jj-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(244, 245, 247, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.jj-menu-open .jj-backdrop { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }

/* ---------- 長條選單：懸浮在按鈕上方，平常藏在畫面左側外 ---------- */
.jj-nav {
  position: fixed;
  z-index: 35;
  left: 0;
  right: 0;
  bottom: calc(10% + 60px + 16px + env(safe-area-inset-bottom, 0px));
  visibility: hidden;
  transition: visibility 0s linear 0.65s;
}
.jj-menu-open .jj-nav { visibility: visible; transition: none; }
.jj-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
/* 電腦版：原站的固定寬度、長短交錯、由深到淺 */
.jj-nav li:nth-child(1) { --w: 436px; --c: var(--jj-bar1); }
.jj-nav li:nth-child(2) { --w: 499px; --c: var(--jj-bar2); }   /* 選單五項：由深到淺 */
.jj-nav li:nth-child(3) { --w: 386px; --c: var(--jj-bar3); }
.jj-nav li:nth-child(4) { --w: 461px; --c: var(--jj-bar4); }
.jj-nav li:nth-child(5) { --w: 386px; --c: var(--jj-bar5); }

.jj-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: var(--w);
  max-width: calc(100% - 16px);
  height: 64px;
  box-sizing: border-box;
  padding-right: 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  /* 底色加上細點網紋 */
  background:
    radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1.3px) 0 0 / 6px 6px,
    var(--c);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateX(-105%);
  transition: transform 0.45s cubic-bezier(.2,.7,.2,1), width 0.35s ease, filter 0.25s ease;
}
/* 打開時由上到下依序滑出；關閉時由下到上依序收回 */
.jj-menu-open .jj-nav a { transform: translateX(0); }
.jj-menu-open .jj-nav li:nth-child(1) a { transition-delay: 0s; }
.jj-menu-open .jj-nav li:nth-child(2) a { transition-delay: 0.05s; }
.jj-menu-open .jj-nav li:nth-child(3) a { transition-delay: 0.1s; }
.jj-menu-open .jj-nav li:nth-child(4) a { transition-delay: 0.15s; }
.jj-menu-open .jj-nav li:nth-child(5) a { transition-delay: 0.2s; }
.jj-nav li:nth-child(1) a { transition-delay: 0.2s; }
.jj-nav li:nth-child(2) a { transition-delay: 0.15s; }
.jj-nav li:nth-child(3) a { transition-delay: 0.1s; }
.jj-nav li:nth-child(4) a { transition-delay: 0.05s; }
.jj-nav li:nth-child(5) a { transition-delay: 0s; }
/* 滑過時不再延遲，長條立即往右伸 */
.jj-menu-open .jj-nav a:hover, .jj-menu-open .jj-nav a:focus-visible { transition-delay: 0s; }

/* 滑過時長條往右伸、文字上下翻動（對應原站的雙標籤按鈕） */
.jj-nav a:hover, .jj-nav a:focus-visible { width: calc(var(--w) + 48px); filter: brightness(1.12); }
.jj-nav a:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 2px; }
.jj-roll { display: block; height: 1.5em; line-height: 1.5em; overflow: hidden; }
.jj-roll > span { display: block; transition: transform 0.3s ease; }
.jj-roll > span + span { text-decoration: underline; text-decoration-color: var(--jj-accent); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.jj-nav a:hover .jj-roll > span,
.jj-nav a:focus-visible .jj-roll > span { transform: translateY(-100%); }

/* ---------- 產品小圖：影片下方，75×75 ---------- */
.jj-thumbs {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 40px 0 0;
  padding: 0 0 0 286px;
}
.jj-thumbs a { display: block; text-decoration: none; width: 75px; height: 75px; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.jj-thumbs a:hover, .jj-thumbs a:focus-visible { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0,0,0,0.18); }
.jj-thumbs a:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 2px; }
.jj-thumbs img, .jj-thumb-fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, #8e8e8e, #4b4b4b);
}
/* 圖片沒載入時，在灰色方塊上顯示產品名稱 */
.jj-thumb-fallback {
  box-sizing: border-box;
  padding: 6px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
}

/* ---------- 頁尾：版權置中、社群圖示靠右，直接疊在底圖上 ---------- */
.jj-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: auto;
  padding-top: 32px;
  margin-bottom: 20px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.jj-copy {
  margin: 0;
  font-family: var(--jj-font-foot);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--jj-foot-text);
}
.jj-copy a { color: inherit; text-decoration: none; }
.jj-copy a:hover { color: var(--jj-accent); }

.jj-social {
  position: absolute;
  right: max(210px, env(safe-area-inset-right, 0px));
  top: calc(50% + 16px);   /* 對齊版權文字（頁尾上方有 32px 內距） */
  transform: translateY(-50%);
  list-style: none;
  display: flex;
  gap: 5px;
  margin: 0;
  padding: 0;
}
.jj-social a { display: block; text-decoration: none; transition: transform 0.2s ease; }
.jj-social a:hover { transform: translateY(-2px); }
.jj-social img, .jj-social-fallback { display: block; width: 26px; height: 26px; }
.jj-social-fallback {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--jj-icon);
  color: #fff;
  font: 700 12px/1 Arial, sans-serif;
}
.jj-social a:hover .jj-social-fallback { background: var(--jj-accent); }
/* Facebook、YouTube 圖示：灰色圓形底、白色圖案 */
.jj-social-icon { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--jj-icon); fill: #fff; transition: background-color 0.2s; }
.jj-social a:hover .jj-social-icon, .jj-social a:focus-visible .jj-social-icon { background: var(--jj-accent); }
.jj-social a:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 2px; border-radius: 50%; }

/* 目前所在頁面：選單長條加一條紅色邊 */
.jj-nav a[aria-current="page"] { box-shadow: inset -4px 0 0 var(--jj-accent), 0 4px 12px rgba(0,0,0,0.12); }

/* ---------- 內頁共用：內容面板（左白右灰兩欄） ---------- */
.jj-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 電腦版左右欄各占一半 */
  width: min(1048px, calc(100% - 2 * 86px));
  margin: 106px auto 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}
.jj-sheet { min-width: 0; padding: 84px 40px 56px; }
.jj-sheet--white { background: var(--jj-panel); }
.jj-sheet--gray {
  /* 淺灰底加細紋，左側有一道柔和陰影，像紙張疊在一起 */
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.18) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #ececec, var(--jj-panel-gray));
  box-shadow: inset 14px 0 18px -14px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
}

.jj-title {
  margin: 0 0 40px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--jj-rule);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #8e8e8e;
}
.jj-title b { font-weight: 400; color: var(--jj-text); }

/* 公司介紹內文：原站使用明體粗體、字距較寬 */
.jj-about { font-family: var(--jj-font-serif); color: var(--jj-text); font-weight: 700; font-size: 15px; letter-spacing: 2px; }
.jj-about-lead { margin: 0; }
/* 公司介紹：藍色線條 + 主標 + 副標 + 說明 */
.jj-about-intro { font-family: var(--jj-font); font-weight: 400; letter-spacing: 1px; }
.jj-about-bar { display: block; width: 120px; height: 5px; margin: 8px 0 26px; background: var(--jj-blue); }
.jj-about-headline { margin: 0 0 14px; font-size: 30px; font-weight: 700; line-height: 1.35; color: #2e2e2e; text-wrap: balance; }
.jj-about-subheadline { margin: 0 0 28px; font-size: 24px; line-height: 1.4; color: #6f6f6f; }
.jj-about-tagline { margin: 0; font-size: 16px; line-height: 1.7; color: #8a8a8a; }
.jj-about-intro + .jj-about-lead { margin-top: 40px; }
.jj-about-sub { margin: 120px 0 34px; font-size: 15px; font-weight: 700; }
.jj-about-list { list-style: none; margin: 0; padding: 0; counter-reset: jj-item; display: flex; flex-direction: column; gap: 36px; }
.jj-about-list li { counter-increment: jj-item; }
.jj-about-list li::before { content: counter(jj-item) "."; }

/* 最新消息：縮圖在左、紅色標題在右，每則之間以細線分隔 */
.jj-news-list { list-style: none; margin: 0; padding: 0; }
.jj-news-list li { border-bottom: 1px solid var(--jj-rule); padding-block: 44px; }
.jj-news-list li:first-child { padding-top: 4px; }
.jj-news-list a { display: flex; align-items: flex-start; gap: 18px; text-decoration: none; }
.jj-news-img { flex: none; width: 127px; height: 120px; background: #222; overflow: hidden; }
.jj-news-img img, .jj-news-noimg { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.jj-news-noimg { background: linear-gradient(135deg, #7a7a7a, #2e2e2e); }
.jj-news-list a:hover img, .jj-news-list a:hover .jj-news-noimg { transform: scale(1.05); }
.jj-news-title { font-size: 14px; line-height: 1.5; color: var(--jj-news-red); padding-top: 2px; }
.jj-news-list a:hover .jj-news-title { text-decoration: underline; }
.jj-news-list a:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 4px; }
.jj-news-more { margin: auto 0 0; padding-top: 40px; border-top: 1px solid var(--jj-rule); text-align: right; font-size: 13px; }
.jj-news-list + .jj-news-more { margin-top: 40px; }
.jj-news-more a { color: #444; text-decoration: none; }
.jj-news-more a::before { content: "›"; margin-right: 8px; }
.jj-news-more a:hover { color: var(--jj-accent); }

/* 內頁的產品小圖與面板保持距離 */
.jj-page--inner .jj-thumbs { margin-top: 24px; padding-left: 79px; }

/* ---------- 內頁共用元件 ---------- */
.jj-panel--wide { grid-template-columns: 1fr 1fr; width: min(1180px, calc(100% - 2 * 86px)); }

/* 灰底清單中目前所在的項目 */
.jj-news-list a[aria-current="page"] .jj-news-title { color: var(--jj-text); font-weight: 700; }
.jj-news-list a[aria-current="page"] .jj-news-img { outline: 3px solid var(--jj-accent); outline-offset: -3px; }

/* 按鈕：與選單長條同樣的深色細點網紋 */
.jj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  color: #fff;
  font: 700 14px/1 var(--jj-font);
  letter-spacing: 1px;
  text-decoration: none;
  cursor: pointer;
  background:
    radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1.3px) 0 0 / 6px 6px,
    var(--jj-bar1);
  transition: filter 0.2s ease;
}
.jj-btn:hover { filter: brightness(1.25); }
.jj-btn:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 2px; }
.jj-btn--ghost { background: transparent; color: var(--jj-text); box-shadow: inset 0 0 0 1px #9a9a9a; }
.jj-btn--ghost:hover { filter: none; box-shadow: inset 0 0 0 1px var(--jj-text); }
.jj-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 0; }

/* 產品介紹：圖片與規格 */
.jj-prod-img, .jj-article-img { margin: 0 0 28px; background: #f1f1f1; }
.jj-prod-img img, .jj-article-img img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.jj-prod-noimg {
  display: flex; align-items: flex-end;
  aspect-ratio: 16 / 9; max-width: 100%; padding: 16px; box-sizing: border-box;
  background: linear-gradient(135deg, #8e8e8e, #3c3c3c); color: #fff; font-size: 14px;
}
.jj-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; }
.jj-spec summary {
  display: block; list-style: none; pointer-events: none;   /* 電腦版規格全部展開，不需點選 */
  margin: 0 0 8px; padding-left: 10px;
  border-left: 3px solid var(--jj-accent);
  font-size: 15px; font-weight: 700; color: var(--jj-text);
}
.jj-spec summary::-webkit-details-marker { display: none; }
.jj-spec dl { margin: 0; font-size: 13.5px; }
.jj-spec dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed #dcdcdc; }
.jj-spec dt { color: #666; }
.jj-spec dd { margin: 0; color: var(--jj-text); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.jj-spec dl > div.is-feature dt { color: var(--jj-text); }
.jj-spec dl > div.is-feature dt::before { content: "✓"; color: var(--jj-accent); margin-right: 6px; }
.jj-spec-note { margin: 20px 0 0; font-size: 12.5px; color: #777; }

/* 最新消息：文章 */
.jj-article-video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: #111; margin-bottom: 24px; }
.jj-article-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.jj-article-body { font-size: 15px; line-height: 1.9; color: var(--jj-text); }
.jj-article-nav { display: flex; justify-content: space-between; gap: 16px; margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--jj-rule); font-size: 13px; }
.jj-article-nav a { color: #444; text-decoration: none; }
.jj-article-nav a:hover { color: var(--jj-accent); }

/* 電子型錄、圖檔下載：檔案清單 */
.jj-files { list-style: none; margin: 0; padding: 0; }
.jj-files li { border-bottom: 1px solid var(--jj-rule); }
.jj-files a { display: flex; align-items: center; gap: 16px; padding: 18px 0; color: var(--jj-text); text-decoration: none; }
.jj-file-type {
  flex: none; display: grid; place-items: center; width: 46px; height: 56px;
  background: var(--jj-accent); color: #fff; font: 700 12px/1 var(--jj-font-foot); letter-spacing: 1px;
  clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
}
.jj-file-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; }
.jj-file-go { flex: none; font-size: 13px; color: #777; }
.jj-file-go::after { content: " ↓"; }
.jj-files a:hover .jj-file-name, .jj-files a:hover .jj-file-go { color: var(--jj-accent); }
.jj-files a:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 2px; }
.jj-files-empty { padding: 8px 0 20px; color: #666; font-size: 14px; line-height: 1.8; }
.jj-files-empty p { margin: 0; }
.jj-files-empty a { color: var(--jj-news-red); }

/* 灰底側欄的說明文字與聯絡資訊 */
.jj-note { display: flex; flex-direction: column; flex: 1; font-size: 14px; line-height: 1.8; color: #555; }
.jj-note > p:first-child { margin: 0 0 20px; }
.jj-info { margin: 0; font-size: 14px; }
.jj-info > div { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--jj-rule); }
.jj-info dt { flex: none; width: 4.5em; color: #777; }
.jj-info dd { margin: 0; min-width: 0; color: var(--jj-text); overflow-wrap: anywhere; }
.jj-info a { color: var(--jj-text); text-decoration: none; border-bottom: 1px dotted #999; }
.jj-info a:hover { color: var(--jj-accent); border-color: var(--jj-accent); }
.jj-co { margin: 20px 0 6px; font-size: 16px; color: var(--jj-text); }

/* 聯絡我們：地圖與表單 */
.jj-map { aspect-ratio: 4 / 3; max-width: 100%; background: #d9d9d9; }
.jj-map iframe { display: block; width: 100%; height: 100%; border: 0; }
.jj-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.jj-form label span { display: block; margin-bottom: 4px; font-size: 13px; line-height: 18px; color: #666; }
.jj-form em { font-style: normal; color: var(--jj-accent); margin-left: 2px; }
.jj-form input { height: 38px; }
.jj-form input, .jj-form textarea {
  width: 100%; box-sizing: border-box;
  padding: 8px 2px; border: 0; border-bottom: 1px solid #bdbdbd; border-radius: 0;
  background: transparent; color: var(--jj-text); font: 16px/1.5 var(--jj-font);
}
.jj-form textarea { resize: vertical; border: 1px solid #bdbdbd; padding: 8px 10px; }
.jj-form input:focus, .jj-form textarea:focus { outline: none; border-color: var(--jj-accent); box-shadow: 0 1px 0 var(--jj-accent); }
.jj-form .is-invalid { border-color: var(--jj-accent); background: #fff4f4; }
.jj-form-full { grid-column: 1 / -1; }
.jj-form-msg { margin: 0; min-height: 1.4em; font-size: 13px; }
.jj-form-msg.is-error { color: var(--jj-accent); }
.jj-form-msg.is-ok { color: #2e7d32; }
.jj-form-actions { display: flex; justify-content: flex-end; gap: 12px; }

/* 聯絡表單：欄位錯誤訊息、防垃圾欄位 */
.jj-field-err { display: block; margin-top: 4px; font-size: 12px; color: var(--jj-accent); }
.jj-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 聯絡表單：附件上傳 */
.jj-upload-label { display: block; margin-bottom: 6px; font-size: 13px; color: #666; }
.jj-drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 18px 16px; text-align: center; cursor: pointer;
  border: 1px dashed #b5b5b5; background: #fafafa;
  transition: border-color 0.2s, background-color 0.2s;
}
.jj-drop:hover, .jj-drop.is-over { border-color: var(--jj-accent); background: #fff6f6; }
.jj-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.jj-drop:focus-within { outline: 2px solid var(--jj-accent); outline-offset: 2px; }
.jj-form .jj-drop span { margin: 0; }   /* 不套用表單欄位標題的樣式 */
.jj-form .jj-drop-alt { display: inline; }
.jj-drop-main { font-size: 14px; font-weight: 700; color: var(--jj-text); }
.jj-drop-main::before { content: "＋ "; color: var(--jj-accent); }
.jj-drop-alt { font-weight: 400; color: #777; }
.jj-drop-hint { font-size: 12px; line-height: 1.6; color: #888; }
.jj-upload.is-invalid .jj-drop { border-color: var(--jj-accent); }
.jj-filelist { list-style: none; margin: 8px 0 0; padding: 0; }
.jj-filelist li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #ececec; font-size: 13px; }
.jj-file-ext {
  flex: none; min-width: 38px; padding: 3px 4px; text-align: center;
  background: var(--jj-bar3); color: #fff; font: 11px/1.2 var(--jj-font-foot); letter-spacing: 0.5px;
}
.jj-file-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--jj-text); }
.jj-file-size { flex: none; color: #888; font-variant-numeric: tabular-nums; }
.jj-file-rm {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: transparent; color: #888; font-size: 18px; line-height: 1; cursor: pointer;
}
.jj-file-rm:hover { background: #f1f1f1; color: var(--jj-accent); }
.jj-file-rm:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 1px; }
.jj-filelist li.jj-file-sum { justify-content: flex-end; border-bottom: 0; color: #888; font-size: 12px; }
.jj-btn:disabled { opacity: 0.55; cursor: progress; }

/* ---------- 首頁：書本封面（中間播放影片，點選翻開進入公司介紹） ---------- */
.jj-cover-wrap { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 56px 16px 40px; }
.jj-cover {
  position: relative; display: block; flex: none;
  width: min(500px, 100%, calc((100vh - 330px) * 0.75));
  min-width: 260px;
  aspect-ratio: 3 / 4;
  perspective: 2200px;
  color: #fff; text-decoration: none;
  outline: none;
}
.jj-cover:focus-visible .jj-cover-front { outline: 3px solid var(--jj-accent); outline-offset: 4px; }
/* 封面下面的書頁：右側與下方露出一疊紙 */
.jj-cover-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 16px;
  padding: 0 12% 0 16%;
  background: var(--jj-panel); color: var(--jj-text);
  border-radius: 2px 6px 6px 2px;
  box-shadow: 3px 3px 0 #f1f1f1, 6px 6px 0 #e4e4e4, 9px 9px 0 #d8d8d8, 0 22px 44px rgba(0, 0, 0, 0.28);
}
.jj-cover-inner-title { font-size: 26px; letter-spacing: 2px; color: #555; }
.jj-cover-inner-bar { width: 84px; height: 4px; background: var(--jj-blue); }
.jj-cover-inner-text { font-size: 18px; font-weight: 700; color: #2e2e2e; }
/* 封面：深色硬殼、細點網紋，左側為書背 */
.jj-cover-front {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  padding: 36px 32px 28px 48px;
  border-radius: 3px 8px 8px 3px;
  background:
    radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1.3px) 0 0 / 6px 6px,
    linear-gradient(160deg, #2e2e2e 0%, #1c1c1c 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transform-origin: left center;
  transform: rotateY(0deg);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform 0.9s cubic-bezier(.3,.7,.2,1), box-shadow 0.3s ease;
}
.jj-cover-front::before {   /* 書背 */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 22px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, #111 0%, #3a3a3a 60%, #1b1b1b 100%);
}
.jj-cover-front::after {    /* 書背與封面的壓痕 */
  content: ""; position: absolute; left: 26px; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.08);
}
.jj-cover:hover .jj-cover-front { transform: rotateY(-10deg); box-shadow: 14px 18px 40px rgba(0, 0, 0, 0.35); }
.jj-cover.is-opening .jj-cover-front { transform: rotateY(-165deg); }
/* 影片不會被「背面隱藏」，翻到一半（立起時）就先藏起來，避免反面看到影片 */
.jj-cover.is-opening .jj-cover-video { visibility: hidden; transition: visibility 0s linear 0.3s; }
.jj-cover-head { display: flex; flex-direction: column; gap: 6px; }
.jj-cover-head::after { content: ""; width: 60px; height: 3px; margin-top: 12px; background: var(--jj-accent); }
.jj-cover-title { font-size: 30px; font-weight: 700; letter-spacing: 4px; line-height: 1.2; }
.jj-cover-sub { font-size: 14px; letter-spacing: 1px; color: #a9a9a9; }
.jj-cover-video {
  display: block; width: 100%; aspect-ratio: 1010 / 550;
  border: 6px solid #f2f2f2; background: #000;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}
.jj-cover-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
.jj-cover-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; letter-spacing: 1px; }
.jj-cover-tag { color: #bdbdbd; }
.jj-cover-open { color: #fff; font-weight: 700; animation: jj-hint 2.4s ease-in-out infinite; }
@keyframes jj-hint { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- 新頁面共用 ---------- */
.jj-panel--single { grid-template-columns: 1fr; width: min(1180px, calc(100% - 2 * 86px)); }
.jj-lead { margin: -24px 0 32px; font-size: 15px; letter-spacing: 1px; color: #777; }

/* 液靜壓圓盤式立臥磨床：加工行程規格卡 */
.jj-spec-card { background: var(--jj-card-bg); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(13, 35, 64, 0.12); }
.jj-spec-card h3 { margin: 0; padding: 16px 28px; background: var(--jj-navy); color: #fff; font-size: 19px; letter-spacing: 1px; }
.jj-spec-card dl, dl.jj-spec-card { margin: 0; padding: 8px 28px 20px; }
.jj-spec-card dl > div, dl.jj-spec-card > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 22px 0; border-bottom: 3px solid #dde2e8; }
.jj-spec-card dl > div:last-child, dl.jj-spec-card > div:last-child { border-bottom: 0; }
.jj-spec-card dt { font-size: 15px; letter-spacing: 1px; color: #333; }
.jj-spec-card dd { margin: 0; flex: none; font-size: 21px; font-weight: 700; color: var(--jj-navy-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jj-spec-card dd small { font-size: 0.95em; font-weight: 700; }
/* 立臥磨床右側：標題本身就是深藍色規格抬頭，下方接規格內容，頂端與左側示意圖對齊 */
.jj-title--bar { padding-bottom: 12px; }
.jj-title--bar span { display: block; padding: 7px 28px; background: var(--jj-navy); border-radius: 8px; color: #fff; font-size: 19px; font-weight: 700; line-height: 1.5; letter-spacing: 1px; }
.jj-spec-card--body { margin-top: 27px; }
dl.jj-spec-card--body { padding-top: 4px; }
.jj-spec-card dt { white-space: nowrap; }

/* 設備示意圖 */
.jj-figure { margin: 0; padding: 18px; background: #fff; border: 1px solid #dcdcdc; border-radius: 18px; }
.jj-figure img { display: block; width: 100%; height: auto; }
.jj-figure figcaption { margin-top: 8px; text-align: right; font-size: 12px; color: #666; }

/* 精密研磨加工項目：卡片（照片 + 標題 + 短線 + 說明） */
.jj-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
.jj-card {
  display: flex; align-items: stretch; gap: 22px; padding: 8px;
  background: var(--jj-card-bg); border-radius: 10px; color: inherit; text-decoration: none;
  box-shadow: 0 3px 8px rgba(13, 35, 64, 0.14);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.jj-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(13, 35, 64, 0.18); }
.jj-card:focus-visible { outline: 3px solid var(--jj-accent); outline-offset: 3px; }
.jj-card-img { position: relative; flex: none; width: 46%; aspect-ratio: 245 / 194; overflow: hidden; background: #ccd3db; }
.jj-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.jj-card-play {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.55);
  opacity: 0; transition: opacity 0.2s ease;
}
.jj-card-play::after { content: ""; position: absolute; left: 18px; top: 14px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff; }
.jj-card:hover .jj-card-play, .jj-card:focus-visible .jj-card-play { opacity: 1; }
.jj-card-body { display: flex; flex-direction: column; justify-content: center; gap: 14px; min-width: 0; padding: 8px 8px 8px 0; }
.jj-card-title { font: 700 24px/1.3 var(--jj-font-serif); color: var(--jj-navy); text-wrap: balance; }
.jj-card-bar { display: block; width: 58px; height: 4px; background: var(--jj-steel); }
.jj-card-desc { font-size: 16px; letter-spacing: 1px; color: #666; }
.jj-card-more { font-size: 13px; color: var(--jj-news-red); }
.jj-card-more::before { content: "▶ "; font-size: 10px; }

/* YouTube 播放器（16:9） */
.jj-yt { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; background: #000; }
.jj-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* 電腦版播放視窗 */
.jj-modal {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 24px max(24px, env(safe-area-inset-right, 0px)) 24px max(24px, env(safe-area-inset-left, 0px));
  background: rgba(10, 14, 20, 0.72);
}
.jj-modal[hidden] { display: none; }
.jj-modal-box { width: min(960px, 100%); background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.jj-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 20px; background: var(--jj-navy); color: #fff; }
.jj-modal-head h2 { margin: 0; font-size: 18px; letter-spacing: 1px; }
.jj-modal-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.jj-modal-close:hover { background: rgba(255, 255, 255, 0.15); }
.jj-modal-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.jj-modal-foot { margin: 0; padding: 12px 20px; text-align: right; font-size: 13px; }
.jj-modal-foot a { color: var(--jj-text); }
.jj-modal-foot a:hover { color: var(--jj-accent); }
body.jj-modal-open { overflow: hidden; }

/* ---------- 電腦版跨頁（精密研磨加工項目）：左右兩欄為一個書頁 ---------- */
.jj-spread { display: grid; grid-template-columns: 1fr 1fr; }
.jj-spread--wide { grid-template-columns: 1fr 1fr; }
.jj-panel.is-book[data-book="always"] { perspective: 2600px; }
.is-book > .jj-spread > .jj-sheet { height: 100%; box-sizing: border-box; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 72px; }
.is-book > .jj-spread > .jj-sheet--gray { box-shadow: inset 14px 0 18px -14px rgba(0, 0, 0, 0.28); }
.is-book > .jj-spread { background: var(--jj-panel); }
/* 電腦版翻書：右頁以中間書背為軸往左翻（.jj-spread 只是排序標記，不顯示） */
.is-flip > .jj-spread { display: none; }
.jj-fb { position: absolute; inset: 0; perspective: 2600px; }
.jj-fb-half { position: absolute; top: 0; width: 50%; height: 100%; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16); }
.jj-fb-left { left: 0; }
.jj-fb-right { left: 50%; }
.jj-fb-leaf {
  position: absolute; top: 0; left: 50%; width: 50%; height: 100%;
  transform-origin: left center;                 /* 以書背（面板中線）為軸 */
  transform: rotateY(var(--a, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(.3,.75,.25,1);
  will-change: transform;
}
.is-dragging .jj-fb-leaf { transition: none; }
.jj-fb-face {
  position: absolute; inset: 0; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}
.jj-fb-back { transform: rotateY(180deg); }     /* 背面是下一個跨頁的左頁 */
/* 翻動中的光影：紙張立起時靠書背的一側變暗 */
.jj-fb-face::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,0.38) 0%, rgba(0,0,0,0) 65%);
  opacity: var(--shade, 0);
}
.jj-fb-back::after { background: linear-gradient(270deg, rgba(0,0,0,0.38) 0%, rgba(0,0,0,0) 65%); }
.jj-fb .jj-sheet { height: 100%; box-sizing: border-box; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 72px; }
/* 書背陰影：右頁左緣、左頁右緣 */
.jj-fb-right .jj-sheet, .jj-fb-front .jj-sheet { box-shadow: inset 14px 0 18px -14px rgba(0, 0, 0, 0.28); }
.jj-fb-left .jj-sheet, .jj-fb-back .jj-sheet { box-shadow: inset -14px 0 18px -14px rgba(0, 0, 0, 0.16); }

/* 播放器高度配合書頁高度 */
.is-book .jj-yt { max-width: calc((var(--book-h, 600px) - 250px) * 16 / 9); margin: 0 auto; }

/* 加工項目卡片：每欄兩張，上下排列 */
.jj-cards { grid-template-columns: 1fr; gap: 22px; }
.jj-card.is-loading { opacity: 0.6; cursor: progress; }
.jj-card.is-loading .jj-card-more::after { content: "（讀取中…）"; }

/* 公司介紹頁右側清單：項目說明 */
.jj-news-title small { display: block; margin-top: 4px; font-size: 12px; color: #777; }

/* 影片清單：縮圖＋標題＋日期 */
.jj-videos { list-style: none; margin: 0; padding: 0; }
.jj-videos li + li { margin-top: 10px; }
.jj-videos a { display: flex; align-items: flex-start; gap: 14px; padding: 6px; border-radius: 6px; color: var(--jj-text); text-decoration: none; transition: background-color 0.2s; }
.jj-videos a:hover { background: rgba(255, 255, 255, 0.7); }
.jj-videos a:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 2px; }
.jj-videos a[aria-current] { background: #fff; box-shadow: inset 3px 0 0 var(--jj-accent); }
.jj-videos a.is-current { cursor: default; }                                  /* 正在播放：不可再點 */
.jj-videos a.is-current .jj-video-title { color: var(--jj-text); font-weight: 700; }
.jj-videos a.is-current .jj-video-thumb::after { content: "播放中"; margin: 0; left: auto; top: auto; right: 4px; bottom: 4px; border: 0; padding: 2px 6px; font-size: 11px; color: #fff; background: var(--jj-accent); }
.jj-yt-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.jj-modal-player .jj-yt { max-width: 100%; }
.jj-video-thumb { position: relative; flex: none; width: 144px; aspect-ratio: 16 / 9; overflow: hidden; background: #2b2b2b; }
.jj-video-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.jj-video-thumb::after {
  content: ""; position: absolute; left: 50%; top: 50%; margin: -9px 0 0 -6px;
  border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent rgba(255, 255, 255, 0.85);
}
.jj-video-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.jj-video-title { font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jj-videos a:hover .jj-video-title { color: var(--jj-news-red); }
.jj-video-date { font: 12px/1 var(--jj-font-foot); letter-spacing: 1px; color: #888; }
.jj-note-small { margin: -16px 0 16px; font-size: 12px; color: #888; }
.jj-figure--photo { padding: 8px; }
.jj-figure--photo img { max-height: 300px; object-fit: cover; }

/* ---------- 書本標籤選單：貼在內容面板上緣，目前頁面的標籤最長 ---------- */
.jj-tabs {
  position: absolute; left: 28px; bottom: 100%; z-index: 5;
  display: flex; align-items: flex-end; gap: 4px;
}
.jj-tab {
  --c: var(--jj-bar3);
  display: block; padding: 9px 18px 7px;
  color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 1px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  border-radius: 6px 6px 0 0;
  background:
    radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1.3px) 0 0 / 6px 6px,
    var(--c);
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.12);
  transition: padding 0.2s ease, filter 0.2s ease;
}
.jj-tab--1 { --c: var(--jj-bar1); }
.jj-tab--2 { --c: var(--jj-bar2); }
.jj-tab--3 { --c: var(--jj-bar3); }
.jj-tab--4 { --c: var(--jj-bar4); }
.jj-tab--5 { --c: var(--jj-bar5); }
.jj-tab:hover { padding-top: 13px; filter: brightness(1.15); }
.jj-tab.is-current { padding-top: 20px; padding-bottom: 9px; box-shadow: inset 0 3px 0 var(--jj-accent), 0 -2px 8px rgba(0, 0, 0, 0.18); }
.jj-tab:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 2px; }
.jj-tab-short { display: none; }

/* 翻頁控制列只在翻書模式顯示 */
.jj-panel:not(.is-book) .jj-book-pager { display: none; }

/* ---------- 翻書模式（JavaScript 啟用後才套用）----------
   手機版所有內頁、以及標記 data-book="always" 的頁面（精密研磨加工項目）會啟用 */
.jj-panel.is-book {
  display: block;
  height: var(--book-h, auto);
  perspective: 1800px;
  box-shadow: none;
  touch-action: pan-y;          /* 上下仍可捲動頁面，左右交給翻頁 */
  user-select: none;
  -webkit-user-select: none;
}
.is-book > .jj-sheet,
.is-book > .jj-spread {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--book-h, auto);
  box-sizing: border-box;
  transform-origin: left center;           /* 以左側為書背翻動 */
  transform: rotateY(var(--a, 0deg));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.75s cubic-bezier(.3,.75,.25,1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  will-change: transform;
}
/* 每頁固定滿版高度；萬一單一區塊比一頁還高，頁內可上下捲動 */
.is-book > .jj-sheet { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
/* 懸浮選單按鈕所在高度：右側留空，內容自動往左讓開（兩個浮動元素的組合） */
.jj-gap-a { float: right; width: 0; height: var(--gap-top, 0px); }
.jj-gap-b { float: right; clear: right; width: var(--gap-w, 0px); height: var(--gap-h, 0px); }
/* 規格列、清單列遇到留空處會自動縮短寬度（外層不能是 grid／flex，否則整塊都會變窄） */
.is-book .jj-specs { display: block; }
.is-book .jj-spec dl > div, .is-book .jj-news-list li, .is-book .jj-files li, .is-book .jj-info > div { overflow: hidden; }
/* 書頁內的地圖與聯絡資訊縮小一點，讓同一頁放得下 */
.is-book .jj-map { aspect-ratio: 2 / 1; }
.is-book .jj-info { font-size: 13px; }
.is-book .jj-info > div { padding: 5px 0; gap: 10px; }
.is-book .jj-info dt { width: 3.6em; }
.is-book .jj-co { margin: 10px 0 4px; font-size: 15px; }
/* 聯絡表單頁：內容較長，在書頁內上下捲動 */
.is-book > .jj-sheet[data-scroll] { -webkit-overflow-scrolling: touch; }
/* 分頁後的續頁標題 */
.jj-title--cont { font-size: 16px; color: #9a9a9a; margin-bottom: 14px; padding-bottom: 8px; }
/* 翻書模式下規格全部展開（改用分頁，不需收合） */
.is-book .jj-spec summary { pointer-events: none; }
.is-book .jj-spec summary::after { content: none; }
.is-book .jj-spec:last-child { border-bottom: 0; }
.is-book > .jj-sheet--gray { box-shadow: inset 12px 0 16px -12px rgba(0, 0, 0, 0.25), 0 10px 24px rgba(0, 0, 0, 0.16); }
.is-book.is-dragging > .jj-sheet, .is-book.is-dragging > .jj-spread { transition: none; }
/* 翻動時頁面上的光影：越接近垂直越暗 */
.is-book > .jj-sheet::after,
.is-book > .jj-spread::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.35) 100%);
  opacity: var(--shade, 0);
}
/* 書背：左側一道細陰影 */
.is-book > .jj-sheet::before,
.is-book > .jj-spread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,0.10), rgba(0,0,0,0));
}

/* 翻頁控制列：放在書頁底部（‹  ● ○  1 / 2  ›） */
.is-book > .jj-sheet { padding-bottom: 64px; }
.jj-book-pager {
  display: flex;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 100;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  font: 12px/1 var(--jj-font-foot);
  letter-spacing: 1px;
  color: #777;
  pointer-events: none;
}
.jj-book-pager > * { pointer-events: auto; }
.jj-book-pager button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--jj-rule);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.jj-book-pager button:disabled { opacity: 0.35; cursor: default; }
.jj-book-pager button:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: 2px; }
.jj-book-dots { display: flex; gap: 8px; }
.jj-book-dots span { width: 7px; height: 7px; border-radius: 50%; background: #c4c4c4; transition: background-color 0.3s; }
.jj-book-dots span.is-on { background: var(--jj-accent); }
.jj-book-label { min-width: 3.2em; text-align: center; }


/* ---------- 平板 ---------- */
@media (max-width: 1000px) {
  .jj-header { padding-left: max(40px, env(safe-area-inset-left, 0px)); }
  .jj-video { width: calc(100% - 2 * 40px); }
  .jj-thumbs, .jj-page--inner .jj-thumbs { padding-left: 40px; }
  .jj-panel, .jj-panel--wide, .jj-panel--single { width: calc(100% - 2 * 40px); margin-top: 64px; }
  .jj-cards { grid-template-columns: 1fr; }
  .jj-specs { grid-template-columns: 1fr; }
  .jj-social { position: static; transform: none; margin-left: 24px; }
  .jj-footer { flex-wrap: wrap; gap: 12px; }
}

/* ---------- 手機 ---------- */
@media (max-width: 640px) {
  .jj-header { height: 112px; padding-top: 18px; padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .jj-logo-text { font-size: 30px; }
  .jj-logo-en { font-size: 14px; padding-left: 34px; margin-top: 6px; }
  .jj-dot { top: 190px; left: 60%; }

  .jj-video { width: 100%; margin-top: 32px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2); }

  /* 手機：漢堡按鈕降到右下方、距底部約 10% */
  .jj-burger { width: 56px; height: 56px; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(10% + env(safe-area-inset-bottom, 0px)); }
  .jj-burger span { left: 17px; top: 27px; }
  .jj-nav { bottom: calc(10% + 56px + 16px + env(safe-area-inset-bottom, 0px)); }

  /* 長條保持由深到淺、長短交錯，寬度改成依螢幕比例 */
  .jj-nav li:nth-child(1) { --w: 78%; }
  .jj-nav li:nth-child(2) { --w: 90%; }
  .jj-nav li:nth-child(3) { --w: 70%; }
  .jj-nav li:nth-child(4) { --w: 84%; }
  .jj-nav li:nth-child(5) { --w: 70%; }
  .jj-nav a { height: 56px; padding-right: 24px; }
  .jj-nav a:hover, .jj-nav a:focus-visible { width: var(--w); }

  .jj-thumbs, .jj-page--inner .jj-thumbs { margin-top: 32px; padding-left: 0; justify-content: center; }

  /* 公司介紹頁：維持白、灰兩區的樣式；沒有 JavaScript 時改成上下排列 */
  .jj-panel { grid-template-columns: 1fr; width: calc(100% - 32px); margin-top: 24px; }
  /* 翻書模式：書頁縮小為 80%（寬度與高度），置中 */
  .jj-panel.is-book { width: calc((100% - 32px) * 0.8); }
  .jj-sheet { padding: 26px 20px 24px; }
  .jj-sheet--gray { box-shadow: inset 0 14px 18px -14px rgba(0, 0, 0, 0.28); }
  /* 手機版縮小間距，減少上下篇幅 */
  .jj-title { font-size: 22px; margin-bottom: 18px; padding-bottom: 12px; }
  .jj-about { font-size: 14px; letter-spacing: 1.2px; }
  .jj-about-sub { margin-top: 24px; margin-bottom: 12px; font-size: 14px; }
  .jj-about-list { gap: 10px; }
  .jj-news-list li { padding-block: 14px; }
  .jj-news-list li:first-child { padding-top: 0; }
  .jj-news-list a { gap: 14px; }
  .jj-news-img { width: 92px; height: 70px; }
  .jj-news-more { padding-top: 14px; }
  .jj-news-list + .jj-news-more { margin-top: 0; border-top: 0; }
  .jj-page--inner .jj-thumbs { margin-top: 20px; }

  /* 公司介紹：手機字級 */
  .jj-about-bar { width: 84px; height: 4px; margin: 4px 0 18px; }
  .jj-about-headline { font-size: 20px; margin-bottom: 10px; letter-spacing: 0.5px; }
  .jj-about-subheadline { font-size: 18px; margin-bottom: 16px; }
  .jj-about-tagline { font-size: 14px; }

  /* 書本標籤：手機版貼在書頁左側，上緣與書頁切齊，文字直寫 */
  .jj-tabs { left: auto; right: 100%; bottom: auto; top: 0; flex-direction: column; align-items: flex-end; gap: 4px; }
  .jj-tab {
    flex: none;
    /* 直式標籤：寬度只容得下一個字，文字自動一字一行（不使用 writing-mode，各家手機顯示一致） */
    width: 12px; box-sizing: content-box;
    padding: 10px 5px; font-size: 12px; line-height: 1.25; letter-spacing: 0;
    white-space: normal; word-break: break-all; text-align: center;
    border-radius: 6px 0 0 6px; box-shadow: -2px 0 6px rgba(0, 0, 0, 0.12);
  }
  .jj-tab:hover { padding-top: 10px; padding-left: 8px; }
  .jj-tab.is-current { padding: 12px 5px 12px 15px; box-shadow: inset 3px 0 0 var(--jj-accent), -2px 0 8px rgba(0, 0, 0, 0.18); }
  .jj-tab-full { display: none; }
  .jj-tab-short { display: inline; }
  /* 影片清單：手機縮小 */
  .jj-video-thumb { width: 104px; }
  .jj-video-title { font-size: 13px; }
  .jj-videos a { gap: 10px; padding: 4px; }
  .jj-videos li { overflow: hidden; }
  .jj-note-small { margin: 0 0 10px; }

  /* 首頁封面：手機版與內頁書本同寬 */
  .jj-cover-wrap { padding: 24px 16px 16px; }
  /* 寬度與內頁書本相同；高度不超過右下方懸浮按鈕上緣（畫面 90% − 按鈕 56px − 上方 136px） */
  .jj-cover { width: min(calc((100vw - 32px) * 0.8), calc((90svh - 56px - 150px) * 0.75)); min-width: 220px; }
  .jj-cover-front { padding: 22px 18px 18px 34px; gap: 12px; }
  .jj-cover-front::before { width: 16px; }
  .jj-cover-front::after { left: 19px; }
  .jj-cover-title { font-size: 20px; letter-spacing: 2px; }
  .jj-cover-sub { font-size: 11px; }
  .jj-cover-head::after { width: 40px; margin-top: 8px; }
  .jj-cover-video { border-width: 4px; }
  .jj-cover-foot { font-size: 11px; }
  .jj-cover-inner-title { font-size: 18px; }
  .jj-cover-inner-text { font-size: 14px; }

  /* 新頁面：手機版 */
  .jj-panel--single { grid-template-columns: 1fr; width: calc(100% - 32px); }
  .jj-lead { margin: -10px 0 14px; font-size: 13px; }
  .jj-spec-card h3 { padding: 10px 14px; font-size: 15px; }
  .jj-spec-card dl, dl.jj-spec-card { padding: 2px 14px 6px; }
  .jj-spec-card dl > div, dl.jj-spec-card > div { flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 0; border-bottom-width: 2px; }
  .jj-spec-card dt { font-size: 13px; }
  .jj-spec-card dd { font-size: 17px; align-self: flex-end; }
  .jj-title--bar { padding-bottom: 10px; }
  .jj-title--bar span { padding: 6px 14px; font-size: 16px; border-radius: 6px; }
  .jj-spec-card--body { margin-top: 0; }
  .jj-spec-card dt { white-space: normal; }
  dl.jj-spec-card--body { margin-bottom: 4px; }
  .jj-figure { padding: 8px; border-radius: 10px; }
  .jj-cards { grid-template-columns: 1fr; gap: 12px; }
  .jj-card { gap: 12px; padding: 6px; }
  .jj-card-img { width: 42%; }
  .jj-card-body { gap: 6px; padding: 4px 4px 4px 0; }
  .jj-card-title { font-size: 16px; }
  .jj-card-bar { width: 36px; height: 3px; }
  .jj-card-desc { font-size: 12px; letter-spacing: 0.5px; }
  .jj-card-more { font-size: 11px; }
  .jj-card-play { opacity: 1; width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  .jj-card-play::after { left: 13px; top: 10px; border-width: 7px 0 7px 11px; }
  .is-book .jj-cards { display: block; }
  .is-book .jj-cards > li + li { margin-top: 12px; }

  /* 內頁元件：手機縮小間距 */
  .jj-panel--wide { grid-template-columns: 1fr; width: calc(100% - 32px); }
  .jj-prod-img, .jj-article-img { margin-bottom: 16px; }
  .jj-prod-img img, .jj-article-img img { max-height: 180px; }
  .jj-specs { gap: 14px; }
  /* 手機：規格分組可點選收合，標題右側顯示 ＋／－ */
  .jj-specs { gap: 0; }
  .jj-spec { border-bottom: 1px solid var(--jj-rule); }
  .jj-spec summary {
    pointer-events: auto; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    margin: 0; padding: 10px 2px 10px 10px; font-size: 14px;
  }
  .jj-spec summary::after { content: "＋"; color: #888; font-weight: 400; }
  .jj-spec[open] summary::after { content: "－"; }
  .jj-spec summary:focus-visible { outline: 2px solid var(--jj-accent); outline-offset: -2px; }
  .jj-spec dl { padding-bottom: 8px; }
  .jj-spec dl { font-size: 12.5px; }
  .jj-spec dl > div { padding: 4px 0; }
  .jj-actions { margin-top: 18px; }
  .jj-actions .jj-btn { flex: 1; padding: 0 12px; }
  .jj-files a { padding: 12px 0; gap: 12px; }
  .jj-file-type { width: 38px; height: 46px; }
  .jj-file-name { font-size: 14px; }
  .jj-note > p:first-child { margin-bottom: 12px; }
  .jj-info > div { padding: 6px 0; }
  .jj-map { aspect-ratio: 16 / 10; }
  .jj-co { margin-top: 12px; }
  .jj-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
  .jj-form input { padding: 5px 2px; }
  .jj-form textarea { min-height: 72px; }
  .jj-drop { padding: 12px 10px; }
  .jj-form .jj-drop-alt { display: none; }   /* 手機沒有拖曳，只顯示「選擇檔案」 */
  .jj-drop-hint { font-size: 11px; }
  .jj-article-nav { margin-top: 18px; flex-direction: column; gap: 8px; }
  .jj-form input { height: 34px; }
  /* 按鈕靠左，避開右下方的懸浮選單按鈕 */
  .jj-form-actions { justify-content: flex-start; }

  /* 頁尾常駐在畫面最底部 */
  .jj-page { box-sizing: border-box; padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .jj-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    margin: 0;
    padding-top: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(244, 245, 247, 0.94);
    backdrop-filter: blur(4px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }
  .jj-copy { font-size: 11px; }
  .jj-social img, .jj-social-fallback, .jj-social-icon { width: 24px; height: 24px; }
  .jj-social { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .jj-cover-front { transition: none; }
  .jj-cover-open { animation: none; }
  .jj-nav a, .jj-menu-open .jj-nav a { transition: none; }
  .jj-roll > span, .jj-thumbs a, .jj-social a,
  .jj-burger, .jj-burger span, .jj-burger span::before, .jj-burger span::after, .jj-backdrop { transition: none; }
  .is-book > .jj-sheet { transition: none; }
}

/* 手機矮螢幕（約 5 吋）：立臥磨床規格列縮小，四項放得進同一頁 */
@media (max-width: 640px) and (max-height: 700px) {
  .jj-title { font-size: 19px; margin-bottom: 14px; padding-bottom: 8px; }
  .jj-title--bar { margin-bottom: 8px; padding-bottom: 6px; }
  .jj-title--bar span { padding: 4px 12px; font-size: 15px; }
  dl.jj-spec-card > div { padding: 3px 0; gap: 0; border-bottom-width: 1px; }
  .jj-spec-card dt { font-size: 12px; line-height: 1.3; }
  .jj-spec-card dd { font-size: 15px; line-height: 1.2; }
  /* 示意圖依畫面高度縮小，與標題留在同一頁 */
  .jj-figure img { width: auto; max-width: 100%; margin: 0 auto; max-height: calc(46vh - 150px); max-height: max(90px, calc(46svh - 150px)); }
}
