/* ============================================================
   清楚退休 — 香港跨境退休規劃工具
   視覺方向：香港街招（黃底黑字招牌）＋ 電車綠 ＋ 工程化數字排版
   ============================================================ */

:root {
  --ink: #1B2433;        /* 墨藍：主文字與深色區 */
  --jade: #23406E;       /* 主色（墨藍） */
  --jade-deep: #1A3157;
  --signal: #C08A3E;     /* 銅金：重點色塊 */
  --paper: #F4F5F7;      /* 冷灰白底 */
  --panel: #FFFFFF;
  --slate: #5A6272;      /* 次要文字 */
  --rule: #E1E4E9;       /* 分隔線 */
  --alert: #A6402A;      /* 警示（磚紅） */
  --good: #2F5D62;       /* 足夠（墨青） */

  --f-display: "Noto Serif TC", "Songti TC", "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
  --f-body: "Noto Sans HK", "PingFang HK", "Microsoft JhengHei", system-ui, sans-serif;
  --f-num: "IBM Plex Mono", "SFMono-Regular", ui-monospace, Menlo, monospace;

  --pad: clamp(1rem, 4vw, 2.5rem);
  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.72;
  letter-spacing: .01em;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.3rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); font-weight: 800; }
p { margin: 0 0 1em; }

a { color: var(--jade); text-underline-offset: 3px; }
a:hover { color: var(--jade-deep); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.narrow { max-width: 760px; }

/* ---------- 導覽 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247,245,239,.94);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
}
.head-in {
  display: flex; align-items: center; gap: 1rem;
  max-width: var(--maxw); margin: 0 auto; padding: .7rem var(--pad);
}
.brand {
  display: flex; align-items: baseline; gap: .5rem;
  font-weight: 900; font-size: 1.15rem; color: var(--ink);
  text-decoration: none; letter-spacing: -.02em;
}
.brand-mark {
  background: var(--signal); color: var(--ink);
  padding: .1rem .45rem; border: 2px solid var(--ink);
  font-weight: 900; font-size: .95rem; transform: rotate(-1.5deg);
}
.brand small { font-weight: 500; font-size: .72rem; color: var(--slate); letter-spacing: .04em; }
.head-nav { margin-left: auto; display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.head-nav a { color: var(--ink); text-decoration: none; font-size: .93rem; font-weight: 600; }
.head-nav a:hover { color: var(--jade); }
.nav-cta {
  background: var(--jade); color: #fff !important;
  padding: .5rem .95rem; border-radius: 2px; font-weight: 800 !important;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.nav-cta:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
@media (max-width: 720px) { .head-nav a:not(.nav-cta) { display: none; } }

/* ---------- 首屏 ---------- */
.hero {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(2.2rem, 6vw, 4rem) 0 clamp(2rem, 5vw, 3.4rem);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 8px;
  background: repeating-linear-gradient(90deg, var(--signal) 0 22px, var(--jade) 22px 44px);
}
.hero .wrap { position: relative; z-index: 1; }
.eyebrow {
  display: inline-block; font-family: var(--f-num); font-size: .78rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--signal);
  border-bottom: 1px solid rgba(192,138,62,.55); padding-bottom: .25rem; margin-bottom: 1rem;
}
.hero h1 { color: #fff; max-width: 20ch; }
.hero h1 em { font-style: normal; background: var(--signal); color: var(--ink); padding: 0 .18em; }
.hero-sub { font-size: clamp(1rem, 2.2vw, 1.15rem); color: #C9D6D0; max-width: 46ch; }
.hero-grid { display: grid; gap: 2rem; grid-template-columns: 1.05fr .95fr; align-items: start; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* 街招式重點數字 */
.sign {
  display: inline-block; background: var(--signal); color: var(--ink);
  padding: .35rem .7rem; font-weight: 900; border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--jade); font-family: var(--f-num);
  font-size: 1.05rem; letter-spacing: -.02em; transform: rotate(-1deg);
}
.sign-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-block; padding: .8rem 1.4rem; border: 2px solid var(--ink);
  background: var(--jade); color: #fff; text-decoration: none; font-weight: 800;
  font-size: 1rem; border-radius: 2px; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer; font-family: var(--f-body);
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); color: #fff; }
.btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: 4px 4px 0 var(--slate); }
.btn.ghost:hover { color: var(--ink); box-shadow: 6px 6px 0 var(--slate); }
.btn.solid { background: var(--signal); color: var(--ink); }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn-row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }

/* ---------- 區塊 ---------- */
section { padding: clamp(2.4rem, 6vw, 4rem) 0; }
.band { background: var(--panel); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.band.alt { background: transparent; }
.sec-head { max-width: 62ch; margin-bottom: 2rem; }
.sec-head h2 { margin-bottom: .35em; }
.kicker {
  font-family: var(--f-num); font-size: .78rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--jade); display: block; margin-bottom: .5rem;
}

.grid-3 { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--panel); border: 2px solid var(--ink); padding: 1.4rem;
  box-shadow: 5px 5px 0 rgba(27,36,51,.14);
}
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
.card .step {
  font-family: var(--f-num); font-size: 2rem; font-weight: 700; color: var(--signal);
  -webkit-text-stroke: 1px var(--ink); line-height: 1;
}

/* ---------- 計算器 ---------- */
.calc-shell {
  background: var(--panel); border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink); color: var(--ink);
}
.calc-shell .kicker { color: var(--jade); }
.calc-shell h3 { color: var(--ink); }
.lite-out {
  margin-top: .9rem; border-top: 2px dashed var(--rule); padding-top: .8rem;
  font-size: .92rem;
}
.lite-out .row { display: flex; justify-content: space-between; gap: .8rem; padding: .3rem 0; }
.lite-out .row b { font-family: var(--f-num); font-size: 1.02rem; }
.lite-out .row.bad b { color: var(--alert); }
.lite-out .row.ok b { color: var(--good); }
.lite-out .cap { font-size: .78rem; color: var(--slate); margin: .5rem 0 0; }
.calc-tabs { display: flex; border-bottom: 2px solid var(--ink); }
.calc-tabs button {
  flex: 1; padding: .85rem .6rem; background: var(--paper); border: 0;
  border-right: 2px solid var(--ink); font-family: var(--f-body); font-weight: 800;
  font-size: .95rem; cursor: pointer; color: var(--slate);
}
.calc-tabs button:last-child { border-right: 0; }
.calc-tabs button[aria-selected="true"] { background: var(--ink); color: var(--signal); }
.calc-tabs button:focus-visible { outline: 3px solid var(--signal); outline-offset: -3px; }
.calc-body { padding: clamp(1.1rem, 3vw, 2rem); }

.field { margin-bottom: 1.05rem; }
.field > label {
  display: flex; justify-content: space-between; align-items: baseline; gap: .8rem;
  font-weight: 700; font-size: .95rem; margin-bottom: .35rem;
}
.field .val {
  font-family: var(--f-num); font-weight: 700; color: var(--jade);
  background: #E7ECF4; padding: .05rem .45rem; font-size: .92rem;
}
.field .hint { font-size: .82rem; color: var(--slate); margin-top: .3rem; line-height: 1.5; }
input[type="range"] {
  width: 100%; appearance: none; height: 6px; background: var(--rule);
  border-radius: 3px; margin: .55rem 0 0;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--signal); border: 2px solid var(--ink); cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--signal);
  border: 2px solid var(--ink); cursor: grab;
}
input[type="range"]:focus-visible { outline: 3px solid var(--jade); outline-offset: 4px; }
select, input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%; padding: .6rem .7rem; border: 2px solid var(--ink);
  background: #fff; font-family: var(--f-body); font-size: 1rem; color: var(--ink);
  border-radius: 2px;
}
select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--signal); outline-offset: 2px;
}
.two-col { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* 結果面板 */
.results { display: none; }
.results.on { display: block; }
.verdict {
  border: 2px solid var(--ink); padding: 1.2rem 1.3rem; margin-bottom: 1.3rem;
  background: #E7ECF4;
}
.verdict.gap { background: #FBEDEA; }
.verdict .tag {
  display: inline-block; font-family: var(--f-num); font-size: .75rem; letter-spacing: .14em;
  text-transform: uppercase; border: 1.5px solid var(--ink); padding: .1rem .45rem; margin-bottom: .5rem;
}
.verdict h3 { font-size: clamp(1.2rem, 3vw, 1.6rem); margin-bottom: .3rem; }
.verdict p { margin: 0; color: var(--slate); }
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat {
  border: 2px solid var(--ink); background: var(--panel); padding: .9rem 1rem;
}
.stat .k { font-size: .8rem; color: var(--slate); font-weight: 600; margin-bottom: .35rem; }
.stat .v {
  font-family: var(--f-num); font-size: clamp(1.25rem, 3vw, 1.7rem); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.15;
}
.stat .v.bad { color: var(--alert); }
.stat .v.ok { color: var(--good); }
.stat .n { font-size: .78rem; color: var(--slate); margin-top: .3rem; }

table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { border: 1px solid var(--rule); padding: .55rem .6rem; text-align: left; white-space: nowrap; }
table.data th:first-child { white-space: normal; min-width: 7.5rem; }
table.data th { background: var(--ink); color: var(--paper); font-weight: 700; }
table.data td.num { font-family: var(--f-num); text-align: right; }
table.data tr.hl td { background: #E7ECF4; font-weight: 700; }
.table-wrap { overflow-x: auto; }

figure { margin: 0; }
figcaption { font-size: .82rem; color: var(--slate); margin-top: .5rem; }
.chart-box { border: 2px solid var(--ink); background: #fff; padding: .8rem; }
.chart-box svg { width: 100%; height: auto; display: block; }

/* 漏斗 */
.steps { counter-reset: s; display: grid; gap: 1rem; }
.step-item {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start;
  border-left: 4px solid var(--jade); padding-left: 1rem;
}
.step-item::before {
  counter-increment: s; content: counter(s);
  font-family: var(--f-num); font-weight: 700; background: var(--ink); color: var(--signal);
  width: 2rem; height: 2rem; display: grid; place-items: center; font-size: .9rem;
}

/* 條目 */
.price-card { position: relative; }
.price-card .price {
  font-family: var(--f-num); font-size: 2.4rem; font-weight: 700; letter-spacing: -.04em;
}
.price-card .price small { font-size: .9rem; font-weight: 500; color: var(--slate); font-family: var(--f-body); }
.price-card.featured { background: var(--ink); color: var(--paper); }
.price-card.featured .price, .price-card.featured h3 { color: var(--signal); }
.price-card.featured li { color: #CBD8D2; }
.price-card.featured .tagline { color: #CBD8D2; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .38rem 0 .38rem 1.3rem; position: relative; border-bottom: 1px dashed var(--rule); }
ul.plain li::before { content: "▸"; position: absolute; left: 0; color: var(--jade); font-weight: 700; }
.price-card.featured ul.plain li { border-bottom-color: rgba(255,255,255,.18); }
.price-card.featured ul.plain li::before { color: var(--signal); }

/* 頁尾 */
.site-foot {
  background: var(--ink); color: #A9BDB6; padding: 2.4rem 0 2rem; margin-top: 0; font-size: .9rem;
}
.site-foot h4 { color: var(--paper); font-size: 1rem; }
.site-foot a { color: var(--signal); }
.foot-grid { display: grid; gap: 1.6rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }
.disclaimer {
  border-left: 4px solid var(--signal); background: rgba(255,255,255,.05);
  padding: .9rem 1.1rem; margin-top: 1.8rem; font-size: .85rem; line-height: 1.65;
}

/* 條款 / 細字 */
.note { font-size: .86rem; color: var(--slate); line-height: 1.6; }
.pill {
  display: inline-block; background: #E7ECF4; border: 1.5px solid var(--jade); color: var(--jade-deep);
  font-size: .78rem; font-weight: 700; padding: .12rem .5rem; margin: 0 .25rem .25rem 0;
}
.tag-amber { background: #FFF3D6; border-color: var(--signal); color: #6A4E00; }

.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; transition: none; }
  .btn:hover, .nav-cta:hover { transform: none; }
}

@media print {
  .site-head, .site-foot, .no-print { display: none !important; }
  body { background: #fff; }
  .calc-shell { box-shadow: none; }
}

.page-h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: .35em; }
