/* 隆昌 C652NA Plus 3D 展示站 — 共用樣式（技術圖面／建築型錄風格）
   識別元素：尺寸線（細線＋端點刻度）、窄體大數字。按鈕一律小圓角矩形。 */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #14171a;          /* 主文字、深色面板 */
  --ink-2: #2b3137;
  --ink-3: #5b646d;        /* 次要文字 */
  --line: #c9d0d6;         /* 細線 */
  --line-soft: #e2e7eb;
  --paper: #ffffff;
  --stage-a: #eef1f4;      /* 3D 舞台漸層（上） */
  --stage-b: #d5dbe1;      /* 3D 舞台漸層（下） */
  --red: #b4202a;          /* Derek 紅，只用在重點 */
  --red-dark: #8f1820;
  --dim: #0f6f80;          /* 尺寸標註線 */
  --ok: #1d7a4f;
  --warn: #a35a00;
  --radius: 4px;
  --font-zh: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  --font-latin: "Archivo", var(--font-zh);
  --font-num: "Barlow Condensed", "Archivo", var(--font-zh);
  --shadow: 0 10px 30px rgba(20, 23, 26, .14);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-latin); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; }

/* 頁首 */
.site-head { height: 56px; display: flex; align-items: center; gap: 20px; padding: 0 20px; background: var(--ink); color: #fff; position: relative; z-index: 30; }
.site-head .brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; white-space: nowrap; }
.site-head .brand b { font-family: var(--font-num); font-size: 24px; letter-spacing: .5px; font-weight: 600; }
.site-head .brand span { font-size: 12.5px; color: #aeb7bf; }
.site-head nav { margin-left: auto; display: flex; gap: 2px; }
.site-head nav a { text-decoration: none; font-size: 14px; padding: 8px 12px; border-radius: var(--radius); color: #d5dbe0; border-bottom: 2px solid transparent; }
.site-head nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.site-head nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--red); border-radius: var(--radius) var(--radius) 0 0; }
@media (max-width: 720px) {
  .site-head { padding: 0 12px; gap: 8px; height: 50px; }
  .site-head .brand span { display: none; }
  .site-head .brand b { font-size: 19px; }
  .site-head nav a { padding: 6px 5px; font-size: 12.5px; white-space: nowrap; }
  .hint { display: none; }
}

/* 按鈕 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; font-size: 14.5px; font-weight: 600; text-decoration: none; transition: background .15s, color .15s, transform .1s; }
@media (hover: hover) { .btn:hover { background: var(--ink); color: #fff; } }      /* 只在有滑鼠的裝置套用：觸控裝置的 hover 會黏住，看起來像「已按下」 */
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--dim); outline-offset: 2px; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { border-color: var(--line); font-weight: 400; }
.btn.ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn[aria-pressed="false"]:hover { background: var(--line-soft); color: var(--ink); }      /* 切換鈕未按下時 hover 用淺底，跟已按下（深底）分得開 */
.btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }

/* 3D 舞台＋側欄版面 */
.stage-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100% - 56px); }
.stage { position: relative; background: linear-gradient(180deg, var(--stage-a), var(--stage-b)); overflow: hidden; min-height: 0; }
.stage canvas, .stage model-viewer { width: 100%; height: 100%; display: block; }
.rail { border-left: 1px solid var(--line); background: #fff; overflow-y: auto; padding: 18px 18px 28px; }
.rail h1 { font-size: 21px; line-height: 1.3; margin: 0 0 2px; }
.rail .model-no { font-family: var(--font-num); font-size: 34px; line-height: 1; letter-spacing: .5px; margin: 0 0 8px; }
.rail h2 { font-size: 13px; color: var(--ink-3); font-weight: 600; margin: 22px 0 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); letter-spacing: .5px; }
.rail p { margin: 6px 0; color: var(--ink-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 860px) {
  .stage-wrap { grid-template-columns: 1fr; grid-template-rows: 56vh auto; height: auto; }
  .rail { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .site-head + .stage-wrap { min-height: calc(100% - 50px); }
}

/* 規格表 */
.spec { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec th, .spec td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.spec th { color: var(--ink-3); font-weight: 400; width: 42%; }
.spec td { font-weight: 600; }
.num { font-family: var(--font-num); font-size: 1.25em; letter-spacing: .3px; }

/* 尺寸線（HTML 版，裝飾與標題用） */
.dimline { display: flex; align-items: center; gap: 10px; color: var(--dim); font-family: var(--font-num); font-size: 18px; }
.dimline::before, .dimline::after { content: ""; flex: 1; height: 1px; background: currentColor; box-shadow: 0 0 0 0 currentColor; border-left: 1px solid currentColor; border-right: 1px solid currentColor; min-width: 24px; height: 9px; background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat; }

/* 3D 內的標籤（尺寸、提示） */
.tag3d { position: absolute; transform: translate(-50%, -50%); padding: 1px 7px; background: #fff; color: var(--dim); border: 1px solid var(--dim); border-radius: 2px; font-family: var(--font-num); font-size: 17px; line-height: 1.35; white-space: nowrap; pointer-events: none; }
.tag3d.note { font-family: var(--font-zh); font-size: 12.5px; color: var(--ink); border-color: var(--ink-3); }

/* 狀態 */
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; background: linear-gradient(180deg, var(--stage-a), var(--stage-b)); z-index: 5; transition: opacity .4s; }
.loading.done { opacity: 0; pointer-events: none; }
.loading .bar { width: 180px; height: 3px; background: var(--line); margin-top: 10px; border-radius: 2px; overflow: hidden; }
.loading .bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s; }
.errorbox { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; border: 1px solid var(--red); color: var(--red-dark); padding: 14px 18px; border-radius: var(--radius); max-width: 80%; z-index: 6; }
.hint { position: absolute; left: 14px; bottom: 12px; font-size: 12.5px; color: var(--ink-3); background: rgba(255, 255, 255, .78); padding: 4px 8px; border-radius: 2px; pointer-events: none; }
.schematic-flag { display: inline-block; font-size: 12px; color: var(--warn); border: 1px solid var(--warn); padding: 0 6px; border-radius: 2px; }
