:root {
  --ink: #172033;
  --muted: #5f6b7a;
  --paper: #f7f3eb;
  --surface: #ffffff;
  --line: #d8dee8;
  --blue: #1769e0;
  --blue-dark: #0b3d91;
  --coral: #ff725e;
  --teal: #008b82;
  --amber: #d97706;
  --green: #16834a;
  --red: #c43d3d;
  --shadow: 0 14px 36px rgba(28, 38, 58, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0%, rgba(23,105,224,.10), transparent 32rem),
    var(--paper);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.65;
}
a { color: var(--blue-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed; left: 1rem; top: -5rem; z-index: 100;
  background: #111827; color: #fff; padding: .7rem 1rem; border-radius: .5rem;
}
.skip-link:focus { top: 1rem; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem max(1rem, calc((100vw - 1180px) / 2));
  background: rgba(247,243,235,.92); border-bottom: 1px solid rgba(216,222,232,.9);
  backdrop-filter: blur(12px);
}
.brand { font-weight: 900; letter-spacing: .02em; }
.back-home {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 40px; padding: .42rem .75rem; margin-left: auto;
  border: 1px solid #a9b9d1; border-radius: .7rem; background: #fff;
  color: var(--blue-dark); text-decoration: none; font-weight: 850; white-space: nowrap;
}
.back-home:hover { background: #e8eef9; border-color: #7e96b8; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .45rem; }
.topbar nav a { text-decoration: none; padding: .35rem .65rem; border-radius: 999px; }
.topbar nav a:hover, .topbar nav a:focus-visible { background: #e8eef9; }

.wrap { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.hero { padding: clamp(3.5rem, 8vw, 7.5rem) 0 3rem; }
.eyebrow { color: var(--blue); font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: .55rem 0 1rem; font-size: clamp(2.2rem, 6vw, 5.2rem); line-height: 1.03; letter-spacing: -.045em; }
h2 { margin: 0 0 1rem; font-size: clamp(1.65rem, 3vw, 2.5rem); line-height: 1.2; }
h3 { margin: 0 0 .55rem; line-height: 1.25; }
.lead { max-width: 58rem; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 750; }

.section { padding: 2.7rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.25rem; }
.section-head p { margin: 0; color: var(--muted); max-width: 44rem; }
.grid { display: grid; gap: 1rem; }
.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: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem; box-shadow: var(--shadow);
}
.card p { color: var(--muted); }
.card .kicker { color: var(--blue); font-weight: 900; font-size: .86rem; letter-spacing: .08em; }
.card-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .65rem 1rem; border-radius: .75rem;
  border: 1px solid transparent; background: var(--blue); color: #fff;
  text-decoration: none; font-weight: 850;
}
.btn:hover { filter: brightness(.94); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid #ffb703; outline-offset: 3px;
}
.btn.secondary { background: #fff; color: var(--blue-dark); border-color: #a9b9d1; }
.btn.coral { background: var(--coral); }
.btn.teal { background: var(--teal); }
.btn.dark { background: #172033; }
.btn.small { min-height: 36px; padding: .4rem .7rem; font-size: .9rem; }

.callout { border-left: 5px solid var(--blue); background: #edf4ff; padding: 1rem 1.15rem; border-radius: .75rem; }
.callout.warn { border-color: var(--amber); background: #fff7df; }
.callout.safe { border-color: var(--green); background: #eaf8ef; }
.callout.danger { border-color: var(--red); background: #fff0f0; }

.toolbar { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; margin: 1rem 0; }
.field { display: grid; gap: .35rem; min-width: min(100%, 13rem); flex: 1; }
.field label { font-weight: 800; }
input, select, textarea {
  width: 100%; border: 1px solid #aeb9c7; border-radius: .7rem; background: #fff;
  padding: .65rem .75rem; color: var(--ink);
}
textarea { min-height: 9rem; resize: vertical; }
.hint { color: var(--muted); font-size: .9rem; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 1rem; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: .7rem .75rem; border-bottom: 1px solid #e6eaf0; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #eef3fa; color: #24324a; z-index: 1; }
tbody tr:hover { background: #f8fbff; }
.num { font-variant-numeric: tabular-nums; }
.status { display: inline-flex; padding: .18rem .5rem; border-radius: 999px; font-size: .82rem; font-weight: 850; }
.status.ok { background: #def6e7; color: #0b6b39; }
.status.warn { background: #fff1c9; color: #855300; }
.status.bad { background: #ffe0e0; color: #9e2020; }

.metric { font-size: 2rem; font-weight: 950; line-height: 1; }
.bar { height: .75rem; background: #e7ebf1; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); }
.small { font-size: .9rem; }
.muted { color: var(--muted); }
.hide { display: none !important; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { border: 1px solid #aeb9c7; color: var(--ink); background: #fff; border-radius: 999px; padding: .45rem .8rem; font-weight: 800; }
.tab.active { background: #172033; color: #fff; border-color: #172033; }

.steps { counter-reset: step; display: grid; gap: 1rem; }
.step { position: relative; padding: 1rem 1rem 1rem 4rem; background: #fff; border: 1px solid var(--line); border-radius: 1rem; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 1rem; top: 1rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-weight: 900; }

footer { padding: 3rem 0; margin-top: 3rem; border-top: 1px solid var(--line); color: var(--muted); }
.print-only { display: none; }

@media (max-width: 850px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { position: static; align-items: flex-start; }
  .back-home { min-height: 44px; }
  .topbar nav { display: none; }
  .section-head { display: block; }
  h1 { font-size: clamp(2rem, 11vw, 3.5rem); }
}

@media print {
  :root { --paper: #fff; }
  body { background: #fff; font-size: 10.5pt; }
  .topbar, .no-print, .btn, .skip-link { display: none !important; }
  .print-only { display: block; }
  .wrap { width: 100%; }
  .hero { padding: 0 0 1.2rem; }
  h1 { font-size: 28pt; }
  h2 { font-size: 20pt; break-after: avoid; }
  h3 { break-after: avoid; }
  .section { padding: 1rem 0; }
  .card, .step, .callout { box-shadow: none; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; overflow-wrap: anywhere; }
  table { min-width: 0; font-size: 8.5pt; }
  th { position: static; }
  @page { size: A4; margin: 14mm; }
}
