/* 曜影科技 RayShadow 官網樣式。
   視覺語言沿用 stockly-website（同一品牌家族：柔卡 + 微陰影分層 + 大留白），
   主色改為靛紫以區隔「工作室」與「Stockly 產品」；元件命名刻意保持一致，
   兩站日後要合併設計系統時不必重寫。 */

:root {
  --accent: #4f46e5;
  --accent-dark: #3730a3;
  --accent-soft: #eef0ff;
  --ink: #0f172a;
  --muted: #5b6779;
  --faint: #97a1b2;
  --bg: #ffffff;
  --tint: #f6f7fb;
  --line: #e8ecf2;
  --radius: 18px;
  --shadow-s: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.06);
  --shadow-m: 0 2px 4px rgba(15, 23, 42, 0.05), 0 16px 40px rgba(15, 23, 42, 0.10);
  --wrap: 1080px;
  --wrap-wide: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
img { display: block; }
h1, h2, h3 { letter-spacing: -0.4px; }
[id] { scroll-margin-top: 84px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ── header ── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(32px, calc((100% - var(--wrap-wide)) / 2));
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(232, 236, 242, 0.7);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; }
.brand small { font-weight: 500; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.5px; }
.site-header nav { display: flex; gap: 24px; }
.site-header nav a { color: var(--muted); font-size: 0.95rem; transition: color 0.15s ease; }
.site-header nav a:hover { color: var(--accent); }
.site-header nav a.nav-active { color: var(--accent); font-weight: 600; }

/* ── hero ── */
.hero {
  max-width: var(--wrap); margin: 0 auto;
  padding: 64px 32px 80px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute; top: 8px; left: 50%;
  width: 460px; height: 320px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(79, 70, 229, 0.10), transparent 70%);
  pointer-events: none;
}
.hero-logo { position: relative; margin-bottom: 24px; filter: drop-shadow(0 14px 28px rgba(79, 70, 229, 0.28)); }
.hero h1 { font-size: 3rem; line-height: 1.2; text-wrap: balance; }
.lead { margin-top: 18px; font-size: 1.1rem; color: var(--muted); max-width: 40em; }
.hero-actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-note { margin-top: 22px; color: var(--muted); font-size: 0.94rem; }
.hero-hint { margin-top: 6px; color: var(--faint); font-size: 0.84rem; }

.eyebrow {
  display: inline-block;
  background: var(--accent-soft); color: var(--accent);
  padding: 5px 14px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; margin-bottom: 16px;
}

/* ── buttons ── */
.btn {
  display: inline-block; padding: 13px 28px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; border: 0; cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(79, 70, 229, 0.32); }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--accent); transform: translateY(-1px); }
.btn-line { background: #06C755; color: #fff; box-shadow: 0 6px 18px rgba(6, 199, 85, 0.25); }
.btn-line:hover { background: #05b14c; transform: translateY(-1px); }

/* ── sections ── */
.band { width: 100%; }
.band-tint { background: var(--tint); }
.section { max-width: var(--wrap); margin: 0 auto; padding: 80px 32px; }
.section-wide { max-width: var(--wrap-wide); }
.section h2 { font-size: 2rem; text-align: center; }
.section-sub { text-align: center; color: var(--muted); font-size: 0.98rem; margin: 10px auto 0; max-width: 46em; }

/* ── cards ── */
.grid { margin-top: 48px; display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: #fff; border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-s);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); }
.card .ico {
  width: 46px; height: 46px; display: grid; place-items: center;
  background: var(--accent-soft); border-radius: 13px;
  font-size: 1.4rem; line-height: 1;
}
.card h3 { margin-top: 16px; font-size: 1.12rem; }
.card p { margin-top: 6px; color: var(--muted); font-size: 0.95rem; }
.card .price-band {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-weight: 700; color: var(--accent); font-size: 1rem;
}
.card .price-band span { display: block; font-weight: 400; font-size: 0.85rem; color: var(--faint); }

/* ── 步驟（怎麼合作）── */
.steps { margin-top: 48px; display: grid; gap: 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; }
.step { position: relative; padding: 26px 24px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-s); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 0.95rem;
}
.step h3 { margin-top: 14px; font-size: 1.05rem; }
.step p { margin-top: 6px; color: var(--muted); font-size: 0.93rem; }

/* ── why / chips ── */
.why { text-align: center; }
.why h3 { font-size: 1.1rem; color: var(--accent); }
.why p { margin-top: 6px; color: var(--muted); font-size: 0.94rem; }
.chips { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip { padding: 7px 18px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 0.92rem; }

/* ── 產品線卡片 ── */
.product-card {
  max-width: 640px; margin: 44px auto 0;
  display: flex; gap: 26px; align-items: center;
  background: #fff; border-radius: var(--radius); padding: 28px 30px;
  box-shadow: var(--shadow-s);
}
.product-card img { flex: none; }
.product-card h3 { font-size: 1.25rem; }
.product-card p { margin-top: 6px; color: var(--muted); font-size: 0.95rem; }
.product-card .price { margin-top: 10px; font-weight: 700; }
.product-card .price small { font-weight: 400; color: var(--muted); }

/* ── FAQ ── */
.faq { margin-top: 36px; }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 4px; }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 1.02rem;
  list-style: none; padding-right: 30px; position: relative;
  transition: color 0.12s ease;
}
.faq summary:hover { color: var(--accent); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: -2px;
  color: var(--muted); font-size: 1.5rem; font-weight: 400; line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq p { margin-top: 12px; color: var(--muted); font-size: 0.96rem; }
.faq p + p { margin-top: 8px; }

/* ── cta / footer ── */
.cta { text-align: center; }
.cta p { margin-top: 10px; color: var(--muted); }
.cta-actions { margin-top: 28px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.site-footer {
  border-top: 1px solid var(--line);
  text-align: center; padding: 28px;
  color: var(--muted); font-size: 0.9rem;
}
.site-footer a:hover { color: var(--accent); }

/* ── 頁首（非首頁）── */
.page-hero { text-align: center; padding-top: 60px; padding-bottom: 40px; }
.page-hero h1 { font-size: 2.5rem; line-height: 1.25; margin-top: 8px; }
.lead-center { margin: 14px auto 0; color: var(--muted); font-size: 1.08rem; max-width: 38em; }

/* ── 模組目錄 ── */
/* 檢視模式切換（客製專案／產品加購）。做成兩張大的選擇卡而不是小 pill：
   這是進表格前要先做的決定，跟下面的分類篩選不是同一層，長得像就會被當成第 9 個分類。 */
.modes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; margin: 30px auto 0; max-width: 46em;
}
.modes button {
  padding: 14px 20px; border: 0; border-radius: var(--radius); cursor: pointer;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  font-family: inherit; font-size: 1rem; font-weight: 600; color: var(--ink);
  text-align: center; transition: box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.modes button span { display: block; margin-top: 4px; font-size: 0.84rem; font-weight: 400; color: var(--muted); }
.modes button:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.modes button[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.modes button[aria-pressed="true"] span { color: rgba(255, 255, 255, 0.82); }

/* 三種價格的導讀。這是整頁最常被問的一題（「同一顆為什麼兩個價」），
   放在表格之前，不要只留在下方的收合 FAQ 裡 —— 收合的等於沒寫。 */
.price-guide {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; margin: 28px auto 0; max-width: 58em; text-align: left;
}
.price-guide > div {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-s);
  padding: 18px 20px;
}
.price-guide b { display: block; font-size: 0.98rem; }
.price-guide span { display: block; margin-top: 6px; color: var(--muted); font-size: 0.9rem; line-height: 1.65; }
.price-guide strong { color: var(--ink); font-weight: 600; }

.legend {
  display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: center;
  margin: 26px auto 0; max-width: 44em;
  color: var(--muted); font-size: 0.88rem;
}
.legend span { display: inline-flex; align-items: center; gap: 7px; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.tag-inc { background: #e7f6ee; color: #147a4b; }
.tag-na { background: #f1f3f7; color: #7a8698; }
.tag-ask { background: var(--accent-soft); color: var(--accent); }

.filters { margin: 30px auto 0; display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.filter {
  padding: 7px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted); font-size: 0.92rem; font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.filter:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.filter[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: none; }

.searchbar { margin: 18px auto 0; max-width: 420px; }
input[type="search"], input[type="text"], select, textarea {
  width: 100%; padding: 11px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 0.96rem; color: var(--ink);
  background: #fff;
}
input[type="search"]:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.mod-group { margin-top: 46px; }
.mod-group > h2 { text-align: left; font-size: 1.35rem; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.mod-group > h2 code { font-size: 0.85rem; font-weight: 500; color: var(--faint); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.mod-group > p { margin-top: 6px; color: var(--muted); font-size: 0.94rem; }

.mod-table { width: 100%; margin-top: 18px; border-collapse: collapse; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-s); overflow: hidden; }
.mod-table th, .mod-table td { padding: 14px 18px; text-align: left; vertical-align: top; font-size: 0.95rem; }
.mod-table thead th { background: var(--tint); color: var(--muted); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.th-sub { display: block; margin-top: 3px; font-size: 0.76rem; font-weight: 400; color: var(--faint); }
.mod-table tbody tr + tr { border-top: 1px solid var(--line); }
.mod-table .col-price, .mod-table .col-cycle { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 價格欄收到內容寬度（nowrap ＋ width:1px 的縮到最小寫法），多的寬度全給「模組」欄。
   不這樣做的話三個價格欄會平分整張表，「—」置中後會飄到離數字很遠的地方。 */
.mod-table th:not(:first-child) { width: 1px; }
/* 只有一個「—」的欄位置中，否則會孤零零貼在寬欄位的左緣，看起來像沒對齊。 */
.mod-table td.is-empty { text-align: center; color: var(--faint); }
.mod-name { font-weight: 600; }
.mod-id { display: block; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.78rem; color: var(--faint); font-weight: 400; }
.mod-value { display: block; margin-top: 4px; color: var(--muted); font-size: 0.9rem; font-weight: 400; }
.mod-note { display: block; margin-top: 6px; color: var(--accent); font-size: 0.84rem; font-weight: 400; }
.mod-note::before { content: "※ "; }

.state { text-align: center; color: var(--muted); padding: 40px 0; }
.state.error { color: #b42318; }

/* ── 估價器 ── */
.est { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 30px; align-items: start; }
.est-main { display: grid; gap: 22px; }
.est-block { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 26px 28px; }
.est-block > h2 { text-align: left; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.est-block > h2 .n {
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 0.9rem; font-weight: 700;
}
.est-block > p { margin-top: 8px; color: var(--muted); font-size: 0.93rem; }

.opts { margin-top: 18px; display: grid; gap: 10px; }
.opts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px;
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.opt:hover { border-color: var(--accent); }
.opt input { margin-top: 5px; flex: none; accent-color: var(--accent); width: 16px; height: 16px; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt-body { min-width: 0; }
.opt-title { font-weight: 600; font-size: 0.97rem; }
.opt-desc { display: block; color: var(--muted); font-size: 0.87rem; margin-top: 2px; }
.opt-price { display: block; color: var(--accent); font-size: 0.87rem; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* 模組分類小標（估價器第 3 段用來分群，不是 heading，純視覺分隔） */
.opt-group-title {
  margin-top: 20px; font-size: 0.86rem; font-weight: 700;
  color: var(--faint); letter-spacing: 0.5px;
}
.opt-group-title:first-child { margin-top: 14px; }

/* 只給螢幕閱讀器（搜尋框的 label：視覺上有 placeholder 就夠，a11y 仍需要 label） */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.est-side { position: sticky; top: 92px; }
.est-total { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-m); padding: 26px; }
.est-total h2 { text-align: left; font-size: 1.1rem; }
.est-sum { margin-top: 16px; }
.est-sum-num { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.est-sum-label { color: var(--muted); font-size: 0.88rem; }
.est-lines { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; list-style: none; }
.est-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 0.9rem; color: var(--muted); }
.est-lines li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.est-lines li.total { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.est-disclaimer { margin-top: 18px; color: var(--faint); font-size: 0.82rem; line-height: 1.65; }
.est-actions { margin-top: 18px; display: grid; gap: 10px; }
.est-actions .btn { width: 100%; text-align: center; }
.copied { text-align: center; font-size: 0.85rem; color: #147a4b; min-height: 1.4em; }

.notice {
  margin: 26px auto 0; max-width: 46em;
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 14px; padding: 16px 20px; font-size: 0.92rem;
}

/* ── responsive ── */
@media (max-width: 980px) {
  .est { grid-template-columns: 1fr; }
  .est-side { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-guide, .modes { grid-template-columns: 1fr; }
  .page-hero h1 { font-size: 2rem; }
  /* 表格改為堆疊卡（窄螢幕上橫向捲動比堆疊更難用） */
  .mod-table, .mod-table tbody, .mod-table tr, .mod-table td { display: block; width: 100%; }
  .mod-table thead { display: none; }
  .mod-table tbody tr { padding: 6px 0; }
  .mod-table td { padding: 5px 18px; }
  .mod-table td[data-label]:not(:first-child)::before {
    content: attr(data-label) "："; color: var(--faint); font-size: 0.85rem;
  }
  /* 堆疊卡模式下每格是整行的「週期費：—」，置中就歪了 —— 還原成靠左。 */
  .mod-table td.is-empty { text-align: left; }
  .mod-table tbody tr:first-child { padding-top: 14px; }
  .mod-table tbody tr:last-child { padding-bottom: 14px; }
}
@media (max-width: 620px) {
  .site-header { padding: 12px 20px; flex-wrap: wrap; }
  .site-header nav { gap: 14px; font-size: 0.92rem; }
  .hero { padding: 40px 20px 60px; }
  .hero h1 { font-size: 2.1rem; }
  .hero-logo { width: 64px; height: 64px; margin-bottom: 18px; }
  .section { padding: 56px 20px; }
  .grid-2, .grid-3, .grid-4, .steps, .opts-2 { grid-template-columns: 1fr; }
  .product-card { flex-direction: column; text-align: center; }
  .est-block { padding: 22px 20px; }
}
