/* 新版官網新增的元件樣式。沿用 common.css 的色彩變數（--blue、--deep、--ink、--muted、--line、--pale、--sky）。
   日本風格版原有樣式不在這裡改，要調整原有元件請改 common.css 或 jp.css。 */

[hidden] { display: none !important; }

/* ---------- 語言切換（頁首上方小橫條） ---------- */
.lang-switch { display: inline-flex; align-items: center; gap: 4px; margin-left: 18px; }
.lang-switch .icon { width: 15px; height: 15px; opacity: .75; margin-right: 2px; }
.lang-switch a { padding: 2px 7px; border-radius: 2px; color: inherit; text-decoration: none; opacity: .78; font-size: 12px; }
.lang-switch a:hover { opacity: 1; text-decoration: underline; }
.lang-switch a[aria-current="true"] { opacity: 1; font-weight: 700; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.lang-switch a { white-space: nowrap; }
@media (max-width: 700px) {
  .utility .wrap > span { display: none; } /* 手機上省略標語，讓出位置給電話與語言 */
  .utility .wrap { justify-content: flex-end; }
  .lang-switch { margin-left: 8px; gap: 2px; }
  .lang-switch .icon { display: none; }
  .lang-switch a { padding: 2px 5px; }
}

/* ---------- 產品詳細頁文字 ---------- */
.detail-subhead { font-size: 15px; margin: 22px 0 8px; color: var(--ink); letter-spacing: .04em; }
.feature-list { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; line-height: 1.75; }
.detail-notes { margin-top: 14px; padding: 12px 14px; background: var(--pale); border-left: 3px solid var(--sky); font-size: 14px; color: var(--ink); }
.detail-notes p { margin: 0 0 4px; }
.detail-notes p:last-child { margin-bottom: 0; }
.fallback-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* 規格表：建置時由資料產生（取代舊站貼上的 HTML 表格） */
.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table th, .spec-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.spec-table thead th { font-size: 12px; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: var(--pale); }
.spec-table tbody th { width: 34%; font-weight: 600; color: var(--ink); }
@media (max-width: 700px) {
  .spec-table tbody th { width: 40%; }
  .spec-table th, .spec-table td { padding: 10px 8px; font-size: 14px; }
}

/* ---------- 影片（點擊才載入 YouTube） ---------- */
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 960px) { .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .video-grid { grid-template-columns: 1fr; gap: 18px; } }
.video-card { margin: 0; }
.video-card figcaption { margin-top: 10px; font-size: 15px; color: var(--ink); line-height: 1.6; }
.video-card figcaption .text-link { display: inline-flex; margin-left: 6px; font-size: 13px; }
.video-facade, .video-frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; background: var(--deep); cursor: pointer; overflow: hidden; }
.video-facade .video-thumb { width: 100%; height: 100%; object-fit: cover; opacity: .88; transition: opacity .2s, transform .3s; }
.video-facade:hover .video-thumb, .video-facade:focus-visible .video-thumb { opacity: 1; transform: scale(1.02); }
.video-play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: rgba(21, 38, 83, .82); display: grid; place-items: center; color: #fff; }
.video-play .icon { width: 28px; height: 28px; fill: currentColor; margin-left: 3px; }
.hero-video .video-card figcaption { display: none; }
.section-lead { margin: -8px 0 24px; color: var(--muted); line-height: 1.8; }

/* ---------- 最新消息 ---------- */
a.news-row { color: inherit; text-decoration: none; }
a.news-row:hover h3 { color: var(--blue); text-decoration: underline; }
.news-list-page { max-width: 920px; }
.news-article { max-width: 880px; }
.news-article h1 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.35; margin: 8px 0 24px; }
.news-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin: 0 0 28px; border-top: 1px solid var(--line); }
.news-facts div { padding: 14px 4px; border-bottom: 1px solid var(--line); }
.news-facts dt { font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.news-facts dd { margin: 4px 0 0; font-weight: 600; }
.news-image { margin: 0 0 28px; }
.news-image img { width: 100%; height: auto; max-height: 520px; object-fit: contain; background: var(--pale); }
.news-body p { line-height: 1.9; }

/* ---------- 關於友聯：證書 ---------- */
.cert-grid img { object-fit: contain; background: #fff; }

/* ---------- 3D 示意外框（元件本身的樣式在 viewer3d.css） ---------- */
.demo-section .viewer3d-host { min-height: 420px; background: var(--pale); border: 1px solid var(--line); }
@media (max-width: 700px) { .demo-section .viewer3d-host { min-height: 340px; } }

@media (prefers-reduced-motion: reduce) {
  .video-facade .video-thumb { transition: none; }
}
@media print {
  .lang-switch, .video-grid, .demo-section { display: none; }
}

/* ---------- 聯絡頁：LINE 官方帳號 ---------- */
.line-item > span { display: grid; gap: 10px; justify-items: start; }
.line-btn { background: #06c755; border-color: #06c755; color: #fff; padding: 8px 18px; min-height: 0; }
.line-btn:hover, .line-btn:focus-visible { background: #05a948; border-color: #05a948; color: #fff; }
.line-qr { display: grid; gap: 4px; justify-items: start; }
.line-qr img { width: 132px; height: 132px; border: 1px solid var(--line); background: #fff; padding: 4px; }
.line-qr small { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .line-qr { display: none; } } /* 手機直接點按鈕即可，不需要掃碼 */

/* ---------- 底色 RGB 248（照片去背效果） ----------
   公司的產品照、證書、系列圖底色都是 #f8f8f8（2026-10-21 量測：95 張產品主圖四角全部 248,248,248）。
   放照片的區塊與頁面底色一致，照片的方形邊界就會消失，看起來像去背。
   原則：頁面與放照片的區塊用 --photo-bg；輸入框、按鈕維持白色以便辨識；淡藍色的分段區塊保留，維持層次。 */
:root { --photo-bg: #f8f8f8; }
body,
#header,
.header-main nav,
.detail-anchor,
.product-card,
.product-image,
.main-image,
.thumbnails button,
.drawing-grid button,
.category-card,
.category-card:hover,
.jp-hero-visual,
#image-dialog,
.demo-section .viewer3d-host { background: var(--photo-bg); }
.inquiry-row img { background: var(--photo-bg); }
/* 卡片改用框線與陰影表現互動，不再靠底色 */
.category-card:hover { border-color: #8a9fc5; box-shadow: 0 8px 30px #1426540c; }
/* 日本風格版原本用「色彩相乘」把照片底色融進淡藍底，是假去背。
   現在底色與照片同為 248，相乘反而會變成 241（248×248÷255），照片區塊比周圍暗一圈，所以關掉。 */
.product-image img,
.category-card img,
.main-image > img,
.catalog-cover img,
.range-image { mix-blend-mode: normal; }

/* ---------- 聯絡頁：線上詢價 ---------- */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: 6px 0 14px; min-height: 65px; }
#draft-status.ok { color: #1d7a46; font-weight: 600; }
#draft-status.err { color: #b3261e; }
