/* ============================================================
   補勞通 — site styles (web farm shared pattern)
   System fonts · one small CSS · no frameworks
   ============================================================ */
:root {
  --brand: #0d7377;
  --brand-dark: #0a4f52;
  --brand-ink: #063638;
  --brand-tint: #e6f4f4;
  --accent: #f59e0b;
  --ink: #14232b;
  --ink-soft: #46595f;
  --bg: #f7faf9;
  --card: #ffffff;
  --line: #dbe7e5;
  --ok: #0f766e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(6, 54, 56, .08), 0 8px 24px rgba(6, 54, 56, .06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  font-size: 17px;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.3; color: var(--brand-ink); }
h1 { font-size: 1.9rem; margin: .4em 0; }
h2 { font-size: 1.45rem; margin: 1.4em 0 .5em; }
h3 { font-size: 1.15rem; }
p { margin: .7em 0; }
img { max-width: 100%; }

/* ---------- header / nav ---------- */
.site-header {
  background: var(--brand-ink);
  color: #eafaf9;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 3px solid var(--accent);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; color: #fff; text-decoration: none;
}
.brand small { font-weight: 500; font-size: .68rem; color: #9fd6d3; display: block; line-height: 1.2; }
.nav-toggle {
  margin-left: auto; background: none; border: 1px solid #3b6a6c; color: #cfeeed;
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: .9rem;
}
.site-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: #d9f1ef; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .95rem;
}
.site-nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.site-nav a.lang-switch { border: 1px solid #3b6a6c; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--brand-ink);
    padding: 10px 20px 16px; border-bottom: 3px solid var(--accent);
  }
  .site-nav.open { display: flex; }
}
@media (min-width: 861px) { .nav-toggle { display: none; } }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--brand-ink) 0%, var(--brand-dark) 55%, #0e6266 100%);
  color: #e8f7f6;
  padding: 44px 0 30px;
}
.hero h1 { color: #fff; }
.hero p { color: #c9e9e7; max-width: 46em; }
.hero .lede-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 6px; }
.hero .official-note { font-size: .82rem; color: #9fd6d3; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; background: var(--accent); color: #3a2a00; font-weight: 700;
  border: 2px solid var(--accent); border-radius: 10px; padding: 10px 20px;
  text-decoration: none; cursor: pointer; font-size: 1rem;
}
.btn:hover { background: #d97706; border-color: #d97706; color: #3a2a00; }
.btn.ghost {
  background: transparent; color: #eafaf9; border-color: #3b6a6c;
}
.btn.ghost:hover { border-color: #eafaf9; color: #fff; background: rgba(255,255,255,.08); }
main .btn.ghost, article .btn.ghost { color: var(--brand-dark); border-color: var(--brand); }
main .btn.ghost:hover { background: var(--brand-tint); }

/* ---------- sections / cards ---------- */
.section { padding: 34px 0 10px; }
.sub { color: var(--ink-soft); margin-top: 0; }
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; margin: 18px 0;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 14px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--ink); }
.card .kicker {
  color: var(--brand); font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase;
}
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.topic-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.tag {
  background: var(--brand-tint); color: var(--brand-dark); border-radius: 999px;
  padding: 6px 16px; text-decoration: none; font-size: .95rem; font-weight: 600;
}
.tag:hover { background: var(--brand); color: #fff; }

/* ---------- article layout ---------- */
article.article { max-width: 760px; margin: 0 auto; padding: 30px 20px 40px; }
article.article h1 { font-size: 1.7rem; }
.article-meta { color: var(--ink-soft); font-size: .9rem; margin-bottom: 8px; }
.article-body blockquote {
  margin: 1.2em 0; padding: 12px 18px; background: var(--brand-tint);
  border-left: 4px solid var(--brand); border-radius: 0 8px 8px 0; color: var(--brand-ink);
}
.article-body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.article-body th { background: var(--brand-tint); color: var(--brand-ink); }
.article-body tr:nth-child(even) td { background: #fbfdfd; }
.step-list { counter-reset: step; list-style: none; padding: 0; margin: 1.2em 0; }
.step-list li {
  counter-increment: step; position: relative; padding: 4px 0 18px 56px;
}
.step-list li::before {
  content: counter(step); position: absolute; left: 0; top: 2px;
  width: 38px; height: 38px; border-radius: 50%; background: var(--brand);
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.notice {
  background: #fff8ea; border: 1px solid #f2d9a4; border-radius: var(--radius);
  padding: 12px 16px; margin: 1.2em 0; font-size: .95rem;
}
.notice strong { color: #92600a; }

/* ---------- Q&A auto-reply widget ---------- */
.qa-shell {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden; margin: 22px 0;
}
.qa-head {
  background: var(--brand-dark); color: #dff3f2; padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
}
.qa-head .qa-dot { width: 10px; height: 10px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .25); }
.qa-head strong { font-size: 1.05rem; }
.qa-head .qa-autotoggle, .qa-head .qa-reset {
  background: none; border: 1px solid #3b6a6c; color: #cfeeed;
  border-radius: 8px; padding: 4px 12px; cursor: pointer; font-size: .85rem;
}
.qa-head .qa-autotoggle:hover, .qa-head .qa-reset:hover { background: rgba(255,255,255,.1); }
.qa-head .qa-autotoggle { margin-left: auto; }
.qa-head .qa-autotoggle[aria-pressed="true"] { border-color: #4ade80; color: #bbf7d0; }
.qa-log {
  height: 430px; overflow-y: auto; padding: 18px; background: #f2f8f7; scroll-behavior: smooth;
}
.msg { display: flex; gap: 10px; margin: 12px 0; }
.msg .who {
  flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem;
}
.msg.bot .who { background: var(--brand); color: #fff; }
.msg.user .who { background: var(--accent); color: #3a2a00; order: 2; }
.msg .bubble {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 15px; max-width: 78%; font-size: .97rem; box-shadow: 0 1px 2px rgba(6,54,56,.06);
}
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { background: var(--brand-tint); border-color: #c3e2e0; }
.msg.user .bubble .auto-flag {
  display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 4px;
  background: #fde68a; color: #92400e; font-size: .68rem; font-weight: 700; vertical-align: 1px;
}
.msg .bubble p { margin: .35em 0; }
.msg .bubble .ans { color: var(--ink); }
.msg .bubble .src { font-size: .82rem; color: var(--ink-soft); border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; }
.msg .bubble .src a { word-break: break-all; }
.typing .bubble { display: flex; gap: 5px; align-items: center; }
.typing .bubble span {
  width: 7px; height: 7px; border-radius: 50%; background: #9cc3c1; animation: blink 1.2s infinite;
}
.typing .bubble span:nth-child(2) { animation-delay: .2s; }
.typing .bubble span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.qa-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 4px; background: var(--card); }
.chip {
  background: var(--brand-tint); border: 1px solid #c3e2e0; color: var(--brand-dark);
  border-radius: 999px; padding: 5px 14px; font-size: .88rem; cursor: pointer;
}
.chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.qa-form { display: flex; gap: 10px; padding: 12px 16px 16px; background: var(--card); }
.qa-form input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  font-size: 1rem; font-family: inherit; background: #fbfdfd;
}
.qa-form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.qa-form .btn { padding: 10px 22px; }
.qa-footnote { font-size: .8rem; color: var(--ink-soft); padding: 0 16px 12px; background: var(--card); }

/* ---------- levy calculator ---------- */
.calc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin: 1.4em 0;
}
.calc .calc-row { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0; }
.calc label { font-weight: 700; color: var(--brand-ink); display: block; margin-bottom: 4px; }
.calc input[type="number"] {
  width: 130px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 1.05rem; font-family: inherit;
}
.calc select {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
.calc input[type="text"] {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 1rem; font-family: inherit; background: #fbfdfd;
}
.calc input:focus, .calc select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.calc .calc-result {
  margin-top: 14px; background: var(--brand-tint); border-radius: 10px; padding: 14px 18px;
}
.calc .calc-result .amount { font-size: 1.9rem; font-weight: 800; color: var(--brand-dark); }
.calc .calc-result small { color: var(--ink-soft); display: block; margin-top: 4px; }

/* ---------- application submit ---------- */
.apply-result { margin: 12px 0 0; font-weight: 600; }
.apply-result.apply-ok { color: #0f766e; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; padding: 10px 14px; }
.apply-result.apply-err { color: #b91c1c; }

/* ---------- application prep tool ---------- */
.tool-output { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 1.2em 0; }
.tool-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; font-size: .97rem;
}
.tool-card h3 { margin: 0 0 6px; font-size: 1rem; color: var(--brand-dark); }
.tool-big { font-size: 1.7rem; font-weight: 800; color: var(--brand-dark); }
.checklist {
  display: flex; flex-direction: column; gap: 4px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 1em 0;
}
.checklist label { cursor: pointer; }
.checklist input { margin-right: 8px; transform: scale(1.15); accent-color: var(--brand); }
.tool-hint { font-size: .86rem; color: var(--ink-soft); }
.tool-status { font-weight: 700; min-height: 1.4em; }

/* ---------- 列印：只印乾淨的準備清單 ---------- */
@media print {
  .site-header, .site-footer, .cookie-banner, .ad-slot, .nav-toggle, .qa-shell,
  .newsletter, .btn, .btn.ghost, #tool-status, .tool-hint { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  article.article { max-width: 100%; padding: 0; }
  .calc, .tool-card, .checklist { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- newsletter / footer ---------- */
.newsletter {
  background: var(--brand-ink); color: #d9f1ef; border-radius: 16px;
  padding: 28px 26px; margin: 40px 0;
}
.newsletter h2 { color: #fff; margin-top: 0; }
.newsletter form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter input {
  flex: 1; min-width: 220px; border: 1px solid #3b6a6c; background: #084345;
  color: #eafaf9; border-radius: 10px; padding: 10px 14px; font-size: 1rem; font-family: inherit;
}
.newsletter small { color: #9fd6d3; }
.site-footer { background: var(--brand-ink); color: #bfe4e2; padding: 34px 0 26px; margin-top: 30px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 22px; }
.footer-cols nav { display: flex; flex-direction: column; gap: 6px; }
.footer-cols strong { color: #fff; margin-bottom: 4px; }
.footer-cols a { color: #bfe4e2; text-decoration: none; }
.footer-cols a:hover { color: #fff; }
.footer-note { font-size: .85rem; color: #8fc7c4; margin-top: 22px; }
.footer-note a { color: #bfe4e2; }

/* ---------- ad slot / cookie banner ---------- */
.ad-slot {
  min-height: 90px; margin: 26px auto; border: 1px dashed var(--line); border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #fbfdfd, #fbfdfd 12px, #f4f9f8 12px, #f4f9f8 24px);
  display: flex; align-items: center; justify-content: center; color: #a9c2bf; font-size: .8rem;
}
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--brand-ink);
  color: #eafaf9; padding: 14px 20px; display: none; gap: 14px; align-items: center;
  flex-wrap: wrap; z-index: 90; border-top: 3px solid var(--accent);
}
.cookie-banner.show { display: flex; }
.cookie-banner p { margin: 0; flex: 1; min-width: 240px; font-size: .9rem; }
.cookie-banner .actions { display: flex; gap: 10px; }
