/* ============================================================
   K盾 官網共用樣式（site.css）
   設計目標：App Store 詳情頁的乾淨感 + 大按鈕 + 去技術化
   品牌色 = K盾 紅 #E63946
   ============================================================ */

:root {
  --primary: #E63946;
  --primary-dark: #C72D38;
  --primary-light: #FDE2E4;
  --green: #059669;
  --green-dark: #047857;
  --amber: #B45309;
  --amber-light: #FEF3C7;
  --bg: #faf8f7;
  --card: #ffffff;
  --ink: #1f2430;
  --ink-soft: #5b6270;
  --ink-faint: #9aa1ab;
  --line: #efe7e6;
  --shadow: 0 8px 30px rgba(198, 45, 56, 0.08);
  --shadow-lg: 0 18px 50px rgba(198, 45, 56, 0.14);
  --radius: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 640px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 247, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 10px; height: 60px; }
.nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.nav img { width: 34px; height: 34px; border-radius: 9px; }
.nav b { font-size: 19px; letter-spacing: .5px; }
.nav .spacer { flex: 1; }
.nav a.link { text-decoration: none; color: var(--ink-soft); font-size: 14px; }
.nav a.cta {
  background: var(--primary); color: #fff; text-decoration: none;
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 700;
}
.nav a.back { color: var(--ink-soft); text-decoration: none; font-size: 14px; }

/* ---------- wrong-environment banner（主動攔截錯誤裝置/瀏覽器）---------- */
.envbar {
  display: none;
  background: var(--amber-light); border-bottom: 1px solid #fde68a;
  color: var(--amber);
}
.envbar.show { display: block; }
.envbar .inner {
  max-width: 880px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 14px; font-weight: 600;
}
.envbar .inner .txt { flex: 1; min-width: 180px; }
.envbar .copybtn {
  background: #fff; border: 1px solid #fcd34d; color: var(--amber);
  border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.envbar .copybtn:active { transform: scale(.97); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 56px 0 24px; }
.hero .logo { width: 104px; height: 104px; border-radius: 26px; box-shadow: var(--shadow-lg); margin-bottom: 22px; }
.hero .logo-sm { width: 84px; height: 84px; border-radius: 21px; box-shadow: var(--shadow); margin-bottom: 18px; }
.hero h1 { font-size: 40px; letter-spacing: 2px; margin-bottom: 10px; }
.hero h1.sm { font-size: 28px; letter-spacing: .5px; }
.hero .tag { font-size: 18px; color: var(--ink-soft); margin-bottom: 6px; }
.hero .sub { font-size: 14px; color: var(--ink-soft); max-width: 460px; margin: 0 auto; }

/* ---------- detected banner (homepage) ---------- */
.detect {
  margin: 26px auto 6px; max-width: 520px;
  background: var(--primary-light); border: 1px solid #f6c9cf;
  border-radius: 16px; padding: 14px 18px; text-align: center;
  font-size: 15px; color: var(--primary-dark); font-weight: 600;
}
.detect .os { color: var(--primary); }

/* ---------- buttons ---------- */
.cta-main { text-align: center; margin: 16px auto 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: none; cursor: pointer; text-decoration: none;
  font-size: 17px; font-weight: 800; border-radius: 16px;
  padding: 17px 32px; min-width: 250px;
  transition: transform .1s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: scale(.98); }
.btn .ico { font-size: 20px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 24px rgba(230,57,70,.28); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 10px 24px rgba(5,150,105,.28); }
.btn-green:hover { background: var(--green-dark); }
.btn-ghost { background: #fff; color: var(--primary); border: 2px solid var(--primary-light); min-width: 0; padding: 13px 24px; font-size: 15px; box-shadow: var(--shadow); }
.btn-soon { background: #eef0f3; color: var(--ink-faint); cursor: not-allowed; box-shadow: none; }
.hint { font-size: 13px; color: var(--ink-soft); margin-top: 12px; max-width: 420px; margin-left: auto; margin-right: auto; }

/* ---------- sections ---------- */
section { padding: 34px 0; }
h2 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.lead { text-align: center; color: var(--ink-soft); font-size: 15px; margin-bottom: 26px; }

/* ---------- device grid (homepage「其他裝置」) ---------- */
.devgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.devtile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 14px; text-align: center; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); position: relative;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.devtile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.devtile.active { border-color: var(--primary); }
.devtile .picon { font-size: 32px; }
.devtile h3 { font-size: 15px; }
.devtile .state { font-size: 12px; color: var(--green); font-weight: 700; }
.devtile .state.soon { color: var(--ink-faint); }
.devtile .badge {
  position: absolute; top: 8px; right: 8px; background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  opacity: 0; transition: opacity .2s ease;
}
.devtile.active .badge { opacity: 1; }
.devtile.dim { opacity: .78; }

/* ---------- card / reassure box ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; box-shadow: var(--shadow);
}
.calm {
  background: #fff7f7; border: 1px solid var(--primary-light); border-radius: var(--radius-sm);
  padding: 16px 18px; font-size: 14px; color: var(--ink); margin: 4px 0 8px;
}
.calm.green { background: #f0fdf8; border-color: #bbf7d0; }
.calm b { color: var(--primary-dark); }
.calm.green b { color: var(--green-dark); }
.calm .ttl { display: block; font-weight: 800; margin-bottom: 4px; }

/* ---------- numbered steps ---------- */
.steps { list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 20px 46px; font-size: 15px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 2px; background: var(--primary-light);
}
.steps.green li::before { background: var(--green); }
.steps.green li:not(:last-child)::after { background: #bbf7d0; }
.steps li b { color: var(--primary-dark); }
.steps.green li b { color: var(--green-dark); }

/* ---------- section title with icon ---------- */
.blk-title { font-size: 18px; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.blk-note { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }

/* ---------- features (homepage condensed) ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px 18px; box-shadow: var(--shadow); }
.fcard .fi { font-size: 26px; margin-bottom: 8px; }
.fcard h4 { font-size: 16px; margin-bottom: 4px; }
.fcard p { font-size: 13px; color: var(--ink-soft); }

/* ---------- footer ---------- */
footer { text-align: center; padding: 40px 0; color: var(--ink-soft); font-size: 13px; border-top: 1px solid var(--line); margin-top: 20px; }
footer .fnav { margin-bottom: 12px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
footer .fnav a { color: var(--ink-soft); text-decoration: none; font-size: 13px; }
footer .fnav a:hover { color: var(--primary); }

/* ---------- coming-soon page ---------- */
.soon-wrap { text-align: center; padding: 20px 0 10px; }
.soon-emoji { font-size: 56px; margin-bottom: 12px; }
.soon-card { max-width: 520px; margin: 8px auto 0; }
.alt-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- copy-link inline button ---------- */
.copy-inline {
  background: #fff; border: 1px solid var(--line); color: var(--primary);
  border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 8px;
}
.copy-inline:active { transform: scale(.97); }
.copy-ok { color: var(--green) !important; border-color: #bbf7d0 !important; }

/* ---------- QR code（電腦上看到 → 用手機相機掃描下載） ---------- */
.qr-block {
  margin: 26px auto 6px; max-width: 340px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 20px; box-shadow: var(--shadow); text-align: center;
}
.qr-img {
  width: 200px; height: 200px; margin: 4px auto 14px;
  background: #fff; border-radius: 12px; padding: 10px;
  border: 1px solid var(--line); box-sizing: content-box;
}
.qr-img svg { display: block; width: 100%; height: 100%; }
.qr-ttl { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.qr-ttl.green { color: var(--green-dark); }
.qr-sub { font-size: 13px; color: var(--ink-soft); margin: 0 auto; max-width: 280px; }
/* 首頁那顆 QR：預設藏起，JS 偵測到桌面裝置才顯示 */
.qr-desktop { display: none; }
.qr-desktop.show { display: block; }

@media (max-width: 600px) {
  .hero h1 { font-size: 34px; }
  .devgrid { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}
