/* ==========================================================================
   RuiFeng · public site
   Marketing / visitor-facing. Larger type, generous space, single accent.
   ========================================================================== */

:root {
  --ink: #0f1720;
  --ink-2: #2c3745;
  --ink-3: #5b6879;
  --ink-4: #8b97a6;

  --navy: #0b2545;
  --navy-2: #133563;
  --navy-3: #1d4b82;

  --brass: #a87828;
  --brass-2: #8a6220;
  --brass-soft: #f7f1e3;

  --line: #dfe4eb;
  --line-2: #eaeef4;
  --paper: #f7f8fa;
  --canvas: #eef0f4;
  --canvas-2: #e5e9ef;
  --surface: #ffffff;

  --good: #06654f;
  --good-soft: #dff0ea;
  --warn: #8a5d08;
  --warn-soft: #f7f0dd;

  --r-sm: 5px;
  --r-md: 9px;
  --r-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 32, 0.05), 0 2px 8px rgba(15, 23, 32, 0.04);
  --shadow-md: 0 2px 6px rgba(15, 23, 32, 0.06), 0 12px 32px rgba(15, 23, 32, 0.08);
  --shadow-lg: 0 10px 24px rgba(15, 23, 32, 0.10), 0 36px 80px rgba(15, 23, 32, 0.14);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "SF Mono", Consolas, monospace;

  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { scrollbar-width: thin; scrollbar-color: #c9d1dc transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #c9d1dc; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }

/* ── 版面容器 ── */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ==========================================================================
   導覽
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 66px;
}

.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--navy);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.logo-text { line-height: 1.15; }
.logo-text strong { display: block; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.logo-text span {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 13px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--canvas-2); color: var(--navy); }
.nav-actions { display: flex; align-items: center; gap: 9px; }
.nav-auth-slot { display: flex; align-items: center; gap: 9px; }

/* ── 語言切換選單 ── */
.lang-switch-wrap {
  display: inline-flex;
  align-items: center;
}
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--canvas-2, #f1f5f9) url('data:image/svg+xml;utf8,<svg fill="%230b2545" height="14" viewBox="0 0 24 24" width="14" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 9px center;
  color: var(--navy, #0b2545);
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 999px;
  padding: 6px 28px 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.15s ease;
}
.lang-select:hover {
  background-color: #fff;
  border-color: var(--navy-3, #1d4b82);
  box-shadow: 0 2px 6px rgba(11, 37, 69, 0.08);
}
.lang-select:focus {
  background-color: #fff;
  border-color: var(--navy, #0b2545);
  box-shadow: 0 0 0 2px rgba(11, 37, 69, 0.15);
}

/* ── 按鈕 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s, box-shadow 0.16s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); }

.btn-brass { background: var(--brass); color: #fff; box-shadow: var(--shadow-sm); }
.btn-brass:hover:not(:disabled) { background: var(--brass-2); }

.btn-outline { background: #fff; color: var(--navy); border-color: #cfd7e3; }
.btn-outline:hover:not(:disabled) { background: var(--canvas-2); border-color: #b6c2d3; }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--canvas-2); color: var(--navy); }

.btn-sm { padding: 8px 15px; font-size: 14px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }

/* ==========================================================================
   首屏
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: #fff;
  padding: 88px 0 96px;
}

/* 極細網格：暗示技術圖紙 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.hero-inner { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  padding: 5px 13px 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.8);
}
.eyebrow::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 3px rgba(181, 133, 53, 0.25);
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(34px, 4.4vw, 52px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.028em;
}
.hero h1 em {
  font-style: normal;
  color: #e8c989;
  border-bottom: 2px solid rgba(232, 201, 137, 0.32);
  padding-bottom: 2px;
}

.hero p.lead {
  margin: 0 0 30px;
  max-width: 540px;
  font-size: 17.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.76);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.hero-note {
  margin-top: 26px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.48);
}

/* 首屏右側：工序示意卡 */
.hero-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(8px);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.hero-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.hero-card-head .dot { display: flex; gap: 5px; }
.hero-card-head .dot i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }

.hero-rows { padding: 6px 0; }
.hero-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 11px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  font-size: 13.5px;
}
.hero-row:last-child { border-bottom: none; }
.hero-row .op { color: rgba(255, 255, 255, 0.9); }
.hero-row .sam {
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}
.hero-row .mc {
  min-width: 34px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(232, 201, 137, 0.14);
  color: #e8c989;
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: center;
}
.hero-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.14);
  font-size: 13px;
}
.hero-card-foot strong { font-size: 15px; color: #e8c989; }

/* ==========================================================================
   數據條
   ========================================================================== */

.stats {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.stats-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.stat-item {
  padding: 30px 24px;
  border-right: 1px solid var(--line-2);
  text-align: center;
}
.stat-item:last-child { border-right: none; }
.stat-item .v {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-item .v span { font-size: 15px; font-weight: 600; color: var(--ink-4); margin-left: 2px; }
.stat-item .k {
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* ==========================================================================
   區塊
   ========================================================================== */

.section { padding: 84px 0; }
.section.alt { background: var(--canvas); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 660px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .tag {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}
.section-head h2 {
  margin: 0 0 14px;
  font-size: clamp(26px, 2.9vw, 34px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.022em;
  color: var(--navy);
}
.section-head p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.72;
  color: var(--ink-3);
}

/* ── 三步流程 ── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

.step {
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.step:hover { box-shadow: var(--shadow-md); border-color: #d5dde8; transform: translateY(-2px); }

.step-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 17px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}
.step h3 { margin: 0 0 8px; font-size: 17px; font-weight: 650; letter-spacing: -0.012em; color: var(--navy); }
.step p { margin: 0; font-size: 14.5px; line-height: 1.68; color: var(--ink-3); }
.step .detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-4);
  line-height: 1.65;
}

/* ── 品類卡 ── */
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }

.type-card {
  display: block;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.type-card:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.type-card .t-name { font-size: 16px; font-weight: 650; color: var(--navy); letter-spacing: -0.01em; }
.type-card .t-en {
  margin-top: 1px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}
.type-card .t-meta {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--ink-3);
}
.type-card .t-meta b { color: var(--navy); font-variant-numeric: tabular-nums; }

/* ── 特色列表 ── */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 40px; }

.feature { display: flex; gap: 15px; padding: 6px 0; }
.feature .f-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--brass-soft);
  color: var(--brass-2);
  font-size: 15px;
  font-weight: 700;
}
.feature h4 { margin: 0 0 5px; font-size: 15.5px; font-weight: 650; color: var(--navy); }
.feature p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--ink-3); }

/* ── CTA 區 ── */
.cta {
  position: relative;
  overflow: hidden;
  padding: 72px 0;
  background: var(--navy);
  color: #fff;
  text-align: center;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 80% at 50% 50%, #000 30%, transparent 100%);
}
.cta-inner { position: relative; max-width: 620px; margin: 0 auto; }
.cta h2 { margin: 0 0 14px; font-size: clamp(25px, 3vw, 33px); font-weight: 700; letter-spacing: -0.022em; }
.cta p { margin: 0 0 28px; font-size: 16.5px; line-height: 1.7; color: rgba(255, 255, 255, 0.74); }
.cta-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ==========================================================================
   頁尾
   ========================================================================== */

.footer {
  padding: 52px 0 40px;
  background: var(--canvas);
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-3);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 38px; }
.footer h5 {
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--ink-2); text-decoration: none; transition: color 0.15s; }
.footer a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-4);
  flex-wrap: wrap;
}

/* ==========================================================================
   試算器（configure / hero widget）
   ========================================================================== */

.calc {
  display: grid;
  grid-template-columns: 372px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

/* ── 試算頁：左欄固定、右欄自然流動 ──
   刻意不用固定高度（height: 100vh）：
   視窗變小或內容變多時會上下都被裁掉，反而更難用。
   改成「左欄 sticky + 自己捲動」，右欄照常跟著頁面捲，
   兩個方向都完整可達。 */
.calc-body { height: 100%; }

.calc-page {
  background: var(--canvas);
  padding: 22px 0 40px;
}

.calc-shell {
  display: grid;
  /* 寬度隨視窗伸縮：小螢幕不至於擠爆，大螢幕也不會留下大片空白。
     下限 340px 是「訂單數量 / 生產天數」雙欄輸入還 readable 的最小值。 */
  grid-template-columns: clamp(340px, 31vw, 480px) minmax(0, 1fr);
  gap: 24px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 28px;
  align-items: start;
  transition: grid-template-columns 0.22s ease;
}

/* 收起狀態：條件面板讓位，結果吃滿寬度 */
.calc-shell.is-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
  gap: 0;
}
.calc-shell.is-collapsed .calc-side {
  display: none;
}
.calc-shell.is-collapsed .calc-main {
  padding-left: 0;
}

.calc-side {
  position: sticky;
  /* 82px = 頂欄 66px + 一點間距 */
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* 比視窗短一些，確保底部永遠搆得到；超過就自己捲 */
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  padding: 2px 8px 2px 2px;
  scrollbar-width: thin;
  min-width: 0;
}

.calc-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: none;
  padding: 4px 4px 2px;
}
.calc-side-head > div { min-width: 0; }
.calc-side-head h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.3;
}

/* 收起 / 展開按鈕 */
.calc-collapse,
.calc-expand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-3);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.calc-collapse:hover,
.calc-expand:hover {
  border-color: var(--navy-3);
  background: var(--accent-soft, #eaf2f9);
  color: var(--navy);
}

.calc-expand {
  display: none;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.calc-shell.is-collapsed .calc-expand { display: inline-flex; }
.calc-side-head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-4);
}

.calc-side-foot {
  flex: none;
  margin-top: auto;
  padding: 16px 4px 6px;
  border-top: 1px solid var(--line);
}
.calc-side-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-4);
  text-align: center;
}
.calc-side-copy {
  margin: 12px 0 0;
  font-size: 10.5px;
  color: var(--ink-4);
  text-align: center;
  opacity: 0.7;
}

/* 右欄：跟著頁面捲動（不另外做捲軸，避免兩層捲動互卡） */
.calc-main {
  min-width: 0;
  padding: 2px 4px 20px 2px;
}

.calc-side::-webkit-scrollbar { width: 8px; }
.calc-side::-webkit-scrollbar-thumb {
  background: #c6cfdb;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.calc-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.calc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.panel-step {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
}
.calc-panel-body { padding: 18px 20px 20px; }

.calc-field { margin-bottom: 18px; }
.calc-field:last-child { margin-bottom: 0; }
.calc-field > label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.005em;
}
.calc-field .help { margin-top: 5px; font-size: 12px; color: var(--ink-4); line-height: 1.5; }

.calc input[type="text"],
.calc input[type="number"],
.calc input[type="email"],
.calc select,
.calc textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d3dbe6;
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.calc input::placeholder, .calc textarea::placeholder { color: var(--ink-4); }
.calc select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23667085' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  appearance: none;
  cursor: pointer;
}
.calc input:hover, .calc select:hover, .calc textarea:hover { border-color: #b9c5d4; }
.calc input:focus, .calc select:focus, .calc textarea:focus {
  outline: none;
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px rgba(29, 75, 130, 0.1);
}
.calc textarea { resize: vertical; min-height: 84px; line-height: 1.6; }

.calc-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--ink-2);
  margin-bottom: 0 !important;
}
.calc-check input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--navy);
  cursor: pointer;
}
.calc-check em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-4);
  line-height: 1.45;
}

.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px;
  border: 1px solid #d3dbe6;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: #b0bfd2; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* ── 結果 ── */
.calc-result { min-height: 200px; }

.result-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--line);
  overflow: hidden;
}
.result-hero > div { display: flex; flex-direction: column; padding: 18px 20px; background: var(--paper); }
.result-hero .k {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.result-hero .v {
  margin-top: 3px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.result-hero .v small { font-size: 14px; font-weight: 600; color: var(--ink-4); margin-left: 3px; }
.result-hero .s { margin-top: auto; padding-top: 4px; font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }

/* 工藝拆解表 */
.ops-table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.ops-table th {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-4);
  text-align: left;
  white-space: nowrap;
}
.ops-table td { padding: 11px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.ops-table tr:last-child td { border-bottom: none; }
.ops-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ops-table .op-name { font-weight: 600; color: var(--ink); line-height: 1.35; }
.ops-table .op-en { margin-top: 2px; font-size: 12px; color: var(--ink-4); line-height: 1.35; }
.ops-table .code { font-family: var(--mono); font-size: 12.5px; color: var(--navy-3); word-break: break-all; }
.ops-table .part-cell { color: var(--ink-2); }
.ops-table .mc-badge {
  display: inline-block;
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

/* 設備卡 */
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

.machine-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
}
.machine-card .m-brand {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.machine-card .m-code {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
  word-break: break-all;
}
.machine-card .m-name { margin-top: 3px; font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.machine-card .m-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
}
.machine-card .m-qty { font-size: 20px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.machine-card .m-qty small { font-size: 12px; font-weight: 500; color: var(--ink-4); margin-left: 2px; }
.machine-card .m-prep { font-size: 11px; color: var(--ink-4); text-align: right; }

/* 提示 */
.notice {
  display: flex;
  gap: 12px;
  padding: 14px 17px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--brass);
  background: var(--brass-soft);
  font-size: 14px;
  line-height: 1.62;
  color: #6d4c12;
}
.notice.info { border-left-color: var(--navy-3); background: #eef4fa; color: #1a3a5c; }
.notice .n-code {
  flex: none;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.62;
  padding-top: 2px;
}

.notice-stack { display: grid; gap: 9px; margin-top: 16px; }

/* 免責 */
.disclaimer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-4);
}

/* 轉換 CTA（結果下方） */
.convert {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid #d9e3f0;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #f7fafd, #eef4fa);
}
.convert h4 { margin: 0 0 7px; font-size: 17px; font-weight: 650; color: var(--navy); letter-spacing: -0.012em; }
.convert p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.convert-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ==========================================================================
   表單（詢價 / 登入）
   ========================================================================== */

.form-page {
  min-height: calc(100vh - 66px);
  display: grid;
  place-items: center;
  padding: 48px 20px;
  background: var(--canvas);
}

.form-card {
  width: 100%;
  max-width: 460px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}
.form-card.wide { max-width: 620px; }
.form-card h1 { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -0.022em; color: var(--navy); }
.form-card .sub { margin: 0 0 26px; font-size: 14.5px; line-height: 1.6; color: var(--ink-3); }

.field { margin-bottom: 16px; }
.field > label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .help { margin-top: 5px; font-size: 12px; color: var(--ink-4); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d3dbe6;
  border-radius: var(--r-sm);
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--navy-3);
  box-shadow: 0 0 0 3px rgba(29, 75, 130, 0.1);
}
.field textarea { resize: vertical; min-height: 96px; }

.form-error {
  margin-bottom: 16px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border-left: 3px solid #b42318;
  background: #fdf0ee;
  color: #8a2118;
  font-size: 13.5px;
  line-height: 1.55;
}

.form-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}
.form-foot a { color: var(--navy-3); text-decoration: none; font-weight: 500; }
.form-foot a:hover { text-decoration: underline; }

/* ==========================================================================
   目錄頁
   ========================================================================== */

.catalog-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid #d3dbe6;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: #b0bfd2; }
.filter-btn.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.model-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  transition: box-shadow 0.18s, border-color 0.18s;
}
.model-card:hover { box-shadow: var(--shadow-sm); border-color: #d5dde8; }
.model-card .mc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.model-card .mc-brand { font-size: 11px; font-weight: 650; letter-spacing: 0.11em; text-transform: uppercase; color: var(--ink-4); }
.model-card .mc-code { margin-top: 2px; font-family: var(--mono); font-size: 15.5px; font-weight: 600; color: var(--navy); word-break: break-all; }
.model-card .mc-name { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.model-card .mc-fam {
  flex: none;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--canvas-2);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.model-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line-2);
}
.model-specs .spec { font-size: 12.5px; }
.model-specs .spec dt { color: var(--ink-4); font-size: 11.5px; }
.model-specs .spec dd { margin: 1px 0 0; color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.model-card .mc-note {
  margin-top: 13px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-3);
}
.model-card .mc-cta {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.model-card .mc-cta a { color: var(--navy-3); font-weight: 600; text-decoration: none; }
.model-card .mc-cta a:hover { text-decoration: underline; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  max-width: 380px;
  padding: 13px 18px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fff;
  font-size: 14.5px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { background: #8a2118; }

/* ==========================================================================
   詢價彈窗
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 25, 45, 0.42);
  backdrop-filter: blur(2px);
  animation: fade 0.16s ease;
}
.modal[hidden] { display: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  position: relative;
  width: min(680px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 26px 28px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-4);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--canvas-2); color: var(--ink); }

.req-title {
  margin: 0 0 6px;
  padding-right: 30px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.req-sub {
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-3);
}

.req-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.req-grid .field > span b { color: #a8261b; font-weight: 700; }

.req-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 6px;
}
.req-note {
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-4);
  text-align: center;
}

@media (max-width: 640px) {
  .req-grid { grid-template-columns: 1fr; }
  .modal-box { padding: 20px; }
}

/* ==========================================================================
   狀態頁
   ========================================================================== */

.status-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 40px 20px;
  background: var(--canvas);
}
.status-card { max-width: 420px; text-align: center; }
.status-mark {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin: 0 auto 20px;
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.status-card h1 { margin: 0 0 10px; font-size: 24px; font-weight: 700; color: var(--navy); letter-spacing: -0.02em; }
.status-card p { margin: 0 0 24px; font-size: 15px; line-height: 1.65; color: var(--ink-3); }

/* ==========================================================================
   客戶專區
   ========================================================================== */

.portal-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.portal-head h1 { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -0.022em; color: var(--navy); }
.portal-head p { margin: 5px 0 0; font-size: 14.5px; color: var(--ink-3); }

.quote-list { display: grid; gap: 12px; }

.quote-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  transition: box-shadow 0.18s, border-color 0.18s;
}
.quote-item:hover { box-shadow: var(--shadow-sm); border-color: #d5dde8; }
.quote-item .qi-no { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.quote-item .qi-style { margin-top: 3px; font-size: 16px; font-weight: 650; color: var(--navy); letter-spacing: -0.012em; }
.quote-item .qi-meta { margin-top: 5px; font-size: 13px; color: var(--ink-3); }
.quote-item .qi-right { text-align: right; }
.quote-item .qi-total { font-size: 21px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.quote-item .qi-actions { margin-top: 8px; display: flex; gap: 8px; justify-content: flex-end; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-sent { background: #eef4fa; color: var(--navy-3); }
.badge-accepted { background: var(--good-soft); color: var(--good); }
.badge-rejected { background: #fdf0ee; color: #8a2118; }
.badge-draft { background: var(--canvas-2); color: var(--ink-3); }

.empty-state {
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.7;
}
.empty-state strong { display: block; margin-bottom: 6px; font-size: 16px; color: var(--ink); font-weight: 600; }

/* ==========================================================================
   響應式
   ========================================================================== */

@media (max-width: 1180px) {
  .calc-shell {
    grid-template-columns: clamp(300px, 34vw, 380px) minmax(0, 1fr);
    gap: 18px;
    padding: 0 20px;
  }
}

@media (max-width: 1080px) {
  .calc { grid-template-columns: 1fr; }
  .calc-side { position: static; }

  /* 小螢幕改回單欄整頁捲動；收起功能在此不適用 */
  .calc-shell {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 18px;
  }
  .calc-shell.is-collapsed { grid-template-columns: 1fr; }
  .calc-shell.is-collapsed .calc-side { display: flex; }
  .calc-side {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .calc-collapse { display: none; }
  .calc-expand { display: none !important; }
  .calc-page { padding: 18px 0 40px; }
}

@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-card { max-width: 480px; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(-n + 2) { border-bottom: 1px solid var(--line-2); }
  .steps { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .nav-links { display: none; }
  .nav-inner { gap: 10px; }
  .lang-select { padding: 5px 22px 5px 8px; font-size: 12px; }
  .hero { padding: 56px 0 64px; }
  .hero h1 { font-size: 30px; }
  .hero p.lead { font-size: 16px; }
  .section { padding: 56px 0; }
  .result-hero { grid-template-columns: 1fr; }
  .calc-row { grid-template-columns: 1fr; }
  .quote-item { grid-template-columns: 1fr; }
  .quote-item .qi-right { text-align: left; }
  .quote-item .qi-actions { justify-content: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .form-card { padding: 24px 20px; }
  .model-grid { grid-template-columns: 1fr; }
}

/* ── 浮動客戶聯絡小工具 ── */
.floating-contact {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 990;
  font-family: inherit;
}
.fc-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--navy, #1e293b);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background 0.2s;
}
.fc-btn:hover {
  background: #0f172a;
  transform: translateY(-2px);
}
.fc-card {
  position: absolute;
  bottom: 52px;
  right: 0;
  width: 320px;
  background: #ffffff;
  color: var(--ink, #1e293b);
  border-radius: 12px;
  border: 1px solid var(--line, #e2e8f0);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  animation: fcFadeIn 0.2s ease-out;
}
@keyframes fcFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--navy, #1e293b);
  color: #fff;
  font-size: 13.5px;
}
.fc-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.fc-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}
.fc-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.fc-icon {
  font-size: 16px;
  line-height: 1.2;
}
.fc-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 2px;
}
.fc-val {
  font-weight: 600;
  color: var(--navy, #1e293b);
  text-decoration: none;
}
.fc-val:hover {
  text-decoration: underline;
}
.fc-sub {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}
.fc-actions {
  margin-top: 4px;
}

.fc-item[hidden] { display: none; }
