/* ============================================================
   RPG Translator EA — 快速上手單頁網站樣式
   設計方向：乾淨、沉穩、以易讀為優先；配色呼應軟體本身的米色底 + 深藍。
   截圖作為輔助佐證，不作整頁底圖；所有圖片維持原比例、響應式縮放。
   無外部相依；純檔案開啟或任何靜態主機皆可運作。
   ============================================================ */

/* --- 設計變數 ------------------------------------------------ */
:root {
  --bg:        #f4f2ed;
  --surface:   #ffffff;
  --surface-2: #eeece6;
  --ink:       #1f2733;
  --ink-soft:  #56606e;
  --muted:     #7c8794;
  --navy:      #1f3a5f;
  --navy-700:  #16293f;
  --accent:    #2f5d50;
  --line:      #dcd8cf;
  --warn-bg:   #fdf3e3;
  --warn-bd:   #e6c98a;
  --important-bg: #eef3f8;
  --important-bd: #b9cde0;
  --yes-bd:    #4b8a6f;
  --no-bd:     #c58a3a;
  --radius: 12px;
  --radius-sm: 8px;
  --wrap: 980px;
  --shadow: 0 1px 3px rgba(20,30,45,.06), 0 6px 20px rgba(20,30,45,.05);
}

/* --- 基礎 ---------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC",
               "Noto Sans TC", system-ui, -apple-system, sans-serif;
  line-height: 1.75;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* 防止任何意外的水平溢出 */
}
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { line-height: 1.35; color: var(--ink); }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: "Cascadia Code", "Consolas", ui-monospace, monospace;
  font-size: .9em;
  word-break: break-word;
}
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* --- 頂端導覽列 --------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,242,237,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1rem; }
.brand-text em { font-style: normal; font-size: .78rem; color: var(--muted); }

.nav-links { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a { color: var(--ink-soft); padding: 6px 10px; border-radius: 7px; font-size: .92rem; }
.nav-links a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }

.nav-toggle {
  display: none; margin-left: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font: inherit; font-size: .9rem;
  color: var(--ink); cursor: pointer;
}

/* --- Hero ---------------------------------------------------- */
.hero { padding: 56px 0 40px; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .02em; margin: 0 0 10px; font-size: .95rem; }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin: 0 0 18px; letter-spacing: -.01em; }
.lede { font-size: clamp(1.02rem, 2.4vw, 1.18rem); color: var(--ink-soft); max-width: 46em; margin: 0 0 16px; }
.who-for { color: var(--ink-soft); max-width: 46em; margin: 0 0 18px; }
.hero-note {
  background: var(--important-bg); border: 1px solid var(--important-bd);
  border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 24px;
  color: var(--ink-soft); max-width: 46em;
}
.hero-note strong { color: var(--ink); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn { display: inline-block; padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 1rem; cursor: pointer; border: 1px solid transparent; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }

/* --- 產品截圖 ----------------------------------------------- */
.shot { margin: 0; }
.shot img { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.shot figcaption { margin-top: 8px; font-size: .88rem; color: var(--muted); text-align: center; }
.shot-hero { margin-top: 34px; max-width: 900px; margin-left: auto; margin-right: auto; }
.shot-info img { border-style: solid; }
.shot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; }
/* 操作流程示意圖：置中並適度限制寬度，細節以放大檢視補足 */
.shot-diagram { max-width: 860px; margin-left: auto; margin-right: auto; }

/* --- 可放大圖片的觸發按鈕（重置按鈕外觀）------------------- */
.zoom-trigger {
  display: block; width: 100%; margin: 0; padding: 0; border: 0;
  background: none; font: inherit; color: inherit; cursor: zoom-in; position: relative;
}
.zoom-trigger img { display: block; width: 100%; }
.zoom-hint {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(20,30,45,.78); color: #fff; font-size: .8rem;
  padding: 3px 10px; border-radius: 999px; pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.zoom-trigger:hover .zoom-hint,
.zoom-trigger:focus-visible .zoom-hint { background: rgba(20,30,45,.95); }
.zoom-trigger:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; border-radius: var(--radius); }

/* --- 放大檢視（Lightbox / dialog）--------------------------- */
.lightbox {
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  margin: 0; border: 0; padding: 0; background: transparent; overflow: hidden;
}
.lightbox::backdrop { background: rgba(15,22,33,.84); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox-img {
  max-width: min(1200px, 94vw); max-height: 92vh; width: auto; height: auto;
  border-radius: 10px; background: #fff; box-shadow: 0 12px 44px rgba(0,0,0,.5);
}
.lightbox-close {
  position: fixed; top: 16px; right: 16px; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.4); background: rgba(20,30,45,.72);
  color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: rgba(20,30,45,.96); }
.lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* 佔位圖（頁面已改用實際截圖；此樣式僅保留供 README 範例使用） */
.shot-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; aspect-ratio: 4 / 3; width: 100%;
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted);
}
.shot-ph span { font-weight: 600; color: var(--ink-soft); }
.shot-ph small { font-size: .82rem; }

/* --- 文字 + 圖片 兩欄版面 ----------------------------------- */
.media-split { display: grid; grid-template-columns: 1.02fr .98fr; gap: 30px; align-items: center; }
.media-split > div > p:first-child { margin-top: 0; }
.media-split-rev .shot { order: -1; } /* 桌面：圖片置左 */

/* --- 區塊通用 ----------------------------------------------- */
.section { padding: 52px 0; }
.section-alt { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: clamp(1.4rem, 3.2vw, 1.85rem); margin: 0 0 8px; }
.section-sub { color: var(--ink-soft); margin: 0 0 26px; }
.fineprint { margin-top: 22px; font-size: .9rem; }

/* --- 呼籲 / 揭露方塊 ---------------------------------------- */
.callout { border-radius: var(--radius); padding: 20px 22px; margin: 26px 0; border: 1px solid var(--line); background: var(--surface); }
.callout-title { margin: 0 0 8px; font-size: 1.08rem; }
.callout p:last-child { margin-bottom: 0; }
.callout p:first-child { margin-top: 0; }
.callout-important { background: var(--important-bg); border-color: var(--important-bd); }
.callout-important .callout-title { color: var(--navy); }
.callout-info { background: var(--surface); border-color: var(--important-bd); }
.callout-info .callout-title { color: var(--navy); }
.callout-warn { background: var(--warn-bg); border-color: var(--warn-bd); }
.callout-warn .callout-title { color: #8a5a12; }
.callout-warn ul { margin: 8px 0; padding-left: 20px; }
.callout-warn li { margin: 3px 0; }
.callout-ea { background: #eef4f1; border-color: var(--yes-bd); border-left-width: 4px; }
.callout-ea p:first-child { font-size: 1.12rem; }

/* --- 購買前須知清單 ----------------------------------------- */
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.check-ic { font-size: 1.4rem; line-height: 1.4; }
.check-list h3 { margin: 0 0 2px; font-size: 1.02rem; }
.check-list p { margin: 0; color: var(--ink-soft); font-size: .94rem; }

/* --- 步驟 ---------------------------------------------------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 18px 66px; box-shadow: var(--shadow); }
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px;
  width: 34px; height: 34px; border-radius: 9px; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.steps h3 { margin: 2px 0 4px; font-size: 1.08rem; }
.steps p { margin: 0; color: var(--ink-soft); }

/* --- 功能總覽 ----------------------------------------------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.feature h3 { margin: 0 0 6px; font-size: 1.08rem; color: var(--navy); }
.feature p { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* --- 適合 / 不適合 ------------------------------------------ */
.fit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fit-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.fit-card h3 { margin: 0 0 10px; font-size: 1.15rem; }
.fit-card ul { margin: 0; padding-left: 20px; }
.fit-card li { margin: 6px 0; color: var(--ink-soft); }
.fit-yes { border-top: 4px solid var(--yes-bd); }
.fit-yes h3 { color: var(--accent); }
.fit-no { border-top: 4px solid var(--no-bd); }
.fit-no h3 { color: #8a5a12; }

/* --- 持續改善中（低強調）------------------------------------ */
.improve { margin-top: 24px; padding: 18px 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.improve h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--ink-soft); }
.improve p { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* --- FAQ ----------------------------------------------------- */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 18px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 28px 16px 0; position: relative; font-weight: 600; font-size: 1.03rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "＋"; position: absolute; right: 2px; top: 14px; color: var(--muted); font-weight: 400; transition: transform .15s ease; }
.faq details[open] summary::after { content: "－"; }
.faq-body { padding: 0 0 16px; color: var(--ink-soft); border-top: 1px solid var(--line); margin-top: -1px; padding-top: 14px; }
.faq-body p { margin: 0; }

/* --- 支援 ---------------------------------------------------- */
.support-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.support-card > p:first-child { margin-top: 0; font-size: 1.1rem; }
.mail { font-weight: 600; word-break: break-all; }

/* --- 頁尾 ---------------------------------------------------- */
.site-footer { background: var(--navy); color: #dfe7f0; padding: 30px 0; margin-top: 10px; }
.site-footer strong { color: #fff; }
.footer-wrap { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-footer .muted { color: #a9bacd; }
.site-footer p { margin: 6px 0 0; }

/* --- 響應式 -------------------------------------------------- */
@media (max-width: 820px) {
  .media-split { grid-template-columns: 1fr; gap: 22px; }
  .media-split-rev .shot { order: 0; } /* 手機：恢復自然順序（文字在前）*/
  .shot-hero { margin-top: 26px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-links {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 14px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 8px; border-radius: 7px; }
  .nav-toggle { display: inline-block; }
  .feature-grid { grid-template-columns: 1fr; }
  .fit-grid { grid-template-columns: 1fr; }
  .shot-row { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 30px; }
  .section { padding: 40px 0; }
}
@media (min-width: 761px) and (max-width: 980px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- 尊重減少動態偏好 --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .faq summary::after { transition: none; }
}
