:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #5f6b7a;
  --line: #d9dee5;
  --accent: #1d5fa8;
  --accent-soft: #e8f0fa;
  --ok: #1e7d4f;
  --ok-soft: #e6f4ec;
  --no: #a33b2b;
  --no-soft: #fbecea;
  --err: #c0392b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 16px 16px 48px; }
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
h1 { font-size: 1.25rem; line-height: 1.5; margin: 0 0 4px; }
.from { color: var(--muted); font-size: .9rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
p { margin: 0 0 12px; }
ol { margin: 0; padding-left: 1.4em; }
ol li { margin-bottom: 10px; }
ol li b { color: var(--accent); }
.note { font-size: .92rem; color: var(--muted); margin: 12px 0 0; padding-left: 1.2em; text-indent: -1.2em; }

.choices { display: grid; gap: 10px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start;
  border: 2px solid var(--line); border-radius: 10px;
  padding: 14px; cursor: pointer;
}
.choice input { width: 22px; height: 22px; margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.choice strong { display: block; font-size: 1.05rem; }
.choice span { color: var(--muted); font-size: .95rem; }
.choice.agree:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); }
.choice.disagree:has(input:checked) { border-color: var(--no); background: var(--no-soft); }

.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=text], input[type=tel], select {
  width: 100%; font: inherit; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.sig-box {
  position: relative;
  border: 2px dashed var(--line); border-radius: 10px;
  background: #fff; touch-action: none;
}
.sig-box canvas { display: block; width: 100%; height: 180px; cursor: crosshair; }
.sig-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #b3bcc7; pointer-events: none; font-size: 1.05rem;
}
.sig-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: var(--muted); font-size: .9rem; }
.linkbtn { background: none; border: none; color: var(--accent); font: inherit; cursor: pointer; padding: 4px 0; }

.date { color: var(--muted); }
.error { color: var(--err); font-size: .92rem; margin-top: 4px; display: none; }
.has-error .error { display: block; }
.has-error input, .has-error select, .has-error .sig-box, .has-error .choice { border-color: var(--err); }

.submit {
  width: 100%; font: inherit; font-size: 1.1rem; font-weight: 700;
  padding: 14px; border: none; border-radius: 10px;
  background: var(--accent); color: #fff; cursor: pointer;
}
.submit:disabled { opacity: .6; cursor: wait; }
.formerr { color: var(--err); text-align: center; margin-top: 10px; display: none; }

.done { text-align: center; padding: 32px 20px; }
.done .mark { font-size: 3rem; line-height: 1; margin-bottom: 8px; color: var(--ok); }
.done dl { text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 20px auto 0; max-width: 360px; }
.done dt { color: var(--muted); }
.done dd { margin: 0; font-weight: 600; }
[hidden] { display: none !important; }

/* ---- 首頁清單 ---- */
a { color: var(--accent); }
.back { display: inline-block; margin: 0 0 12px; text-decoration: none; font-size: .95rem; }
.form-link { display: block; text-decoration: none; color: inherit; border: 2px solid transparent; transition: border-color .15s; }
.form-link:hover, .form-link:focus-visible { border-color: var(--accent); outline: none; }
.form-link-title { display: block; font-size: 1.1rem; font-weight: 700; line-height: 1.5; }
.form-link-summary { display: block; color: var(--muted); font-size: .95rem; margin-top: 4px; }
.form-link-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.form-link-meta .go { color: var(--accent); font-weight: 700; font-size: 1rem; }
.empty { text-align: center; color: var(--muted); }
.closed-list { margin-top: 8px; color: var(--muted); font-size: .95rem; }
.closed-list summary { cursor: pointer; padding: 8px 4px; }
.closed-item { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.deadline { margin: 8px 0 0; font-weight: 700; color: var(--no); }
.closed-notice { background: var(--no-soft); color: var(--no); font-weight: 700; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
