:root {
  /* 品牌：阿莫卡多 logo 的墨黑＋白，高對比單色；彩色只用於狀態 */
  --bg: #f4f4f2; --card: #ffffff; --ink: #141414; --ink-2: #3a3a3a; --muted: #6f6f6f; --line: #e2e2df;
  --brand: #141414; --brand-ink: #ffffff; --brand-soft: #efefec; --paper: #fafaf8;
  --ok: #141414; --ok-soft: #efefec; --warn: #a76a00; --warn-soft: #fff4dc; --bad: #c62f22; --bad-soft: #fdebe8; --info-soft: #f0f0ed;
  --radius: 10px;
  --display: "Oswald", "Arial Narrow", "Helvetica Neue", -apple-system, "PingFang TC", "Noto Sans TC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #000; }
h1 { font-size: 24px; margin: 0 0 16px; font-weight: 800; letter-spacing: .01em; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 800; }
h3 { font-size: 16px; margin: 0 0 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.topbar { background: var(--card); border-bottom: 3px solid var(--ink); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo img { height: 40px; width: auto; display: block; }
.logo .wm { display: flex; flex-direction: column; line-height: 1.05; }
.logo .wm b { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; }
.logo .wm span { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.topbar nav { margin-left: auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--ink); font-weight: 600; padding: 4px 2px; border-bottom: 2px solid transparent; }
.topbar nav a:hover, .topbar nav a.on { border-color: currentColor; }
.topbar.admin { background: var(--ink); border-bottom-color: #000; }
.topbar.admin .logo, .topbar.admin nav a { color: #fff; }
.topbar.admin .logo .wm span { color: #b5b5b0; }
.banner { padding: 10px 16px; font-size: 14px; text-align: center; }
.banner.info { background: var(--ink); color: #fff; }
.banner.info a { color: #fff; }
.banner.warn { background: var(--warn-soft); color: #7a4b00; }
main { padding: 24px 0 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 0 rgba(20,20,20,.04); }
.card.narrow { max-width: 440px; margin: 40px auto; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 4px 12px 4px 0; white-space: nowrap; }
label.inline select { width: auto; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c9ced6; border-radius: 6px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); }
.help { color: var(--muted); font-size: 13px; margin-top: 4px; }
.btn { display: inline-block; border: 2px solid var(--ink); background: var(--ink); color: var(--brand-ink); padding: 7px 16px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .05s ease, background .15s ease; }
.btn:hover { background: #000; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--ink); }
.btn.secondary:hover { background: var(--brand-soft); color: var(--ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: #a3241a; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.alert.ok { background: var(--ok-soft); color: var(--ink); border-left: 4px solid var(--ink); }
.alert.err { background: var(--bad-soft); color: #8a1f14; border-left: 4px solid var(--bad); }
.alert.warn { background: var(--warn-soft); color: #6b4300; border-left: 4px solid #e0a800; }
.alert ul { margin: 0; padding-left: 18px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { color: var(--ink-2); font-weight: 700; white-space: nowrap; background: var(--paper); border-bottom: 2px solid var(--ink); }
.table-scroll { overflow-x: auto; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--brand-soft); color: var(--ink); white-space: nowrap; border: 1px solid var(--line); }
.badge.ok { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge.warn { background: var(--warn-soft); color: #6b4300; border-color: #f2dfb0; }
.badge.bad { background: var(--bad-soft); color: #8a1f14; border-color: #f4c9c3; }
.light { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.light.ok { background: var(--ink); box-shadow: 0 0 0 3px #dcdcd8; } .light.warn { background: #e0a800; } .light.paused { background: var(--bad); } .light.off { background: #bdbdb8; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 8px; padding: 10px 12px; }
.stat b { display: block; font-size: 26px; font-family: var(--display); font-weight: 700; letter-spacing: .01em; }
.stat span { color: var(--muted); font-size: 13px; }
.bar { height: 10px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); }
.bar.warn > i { background: #e0a800; } .bar.bad > i { background: var(--bad); }
.spark { display: flex; gap: 6px; align-items: flex-end; height: 60px; }
.spark div { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.spark div i { display: block; background: var(--ink); border-radius: 3px 3px 0 0; margin: 0 auto 2px; width: 38%; min-height: 2px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 600; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-color: var(--ink); font-weight: 800; }
.tabs a.soon { color: #b5b5b0; }
.post { border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.post .meta { font-size: 12px; color: var(--muted); }
mark { background: #ffe680; color: var(--ink); padding: 0 2px; }
details.q { display: inline-block; }
details.q summary { list-style: none; cursor: pointer; color: var(--muted); display: inline-block; width: 18px; height: 18px; border: 1px solid #c9ced6; border-radius: 50%; text-align: center; font-size: 12px; line-height: 16px; }
details.q[open] > div { position: absolute; z-index: 5; max-width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; box-shadow: 0 6px 18px rgba(0,0,0,.08); font-size: 13px; font-weight: 400; }
.diff { font-size: 13px; }
.diff .b { background: #efefec; color: var(--muted); text-decoration: line-through; padding: 2px 4px; border-radius: 4px; white-space: pre-wrap; word-break: break-all; }
.diff .a { background: #e4e4e0; color: var(--ink); font-weight: 600; padding: 2px 4px; border-radius: 4px; white-space: pre-wrap; word-break: break-all; }
.pager { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.search-big { display: flex; gap: 8px; }
.search-big input { font-size: 16px; padding: 11px 14px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
@media (max-width: 640px) {
  .kv { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  h1 { font-size: 19px; }
}

/* 登入頁品牌區 */
.brand-hero { text-align: center; margin: 8px 0 18px; }
.brand-hero img { width: 132px; height: auto; }
.brand-hero .tag { font-family: var(--display); font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.card.narrow { border-top: 4px solid var(--ink); }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 32px; }
.footer img { height: 22px; vertical-align: middle; opacity: .85; margin-right: 6px; }
@media (max-width: 640px) {
  .logo img { height: 34px; }
  .logo .wm b { font-size: 17px; }
}

/* 條款頁 */
.legal { max-width: 820px; margin: 0 auto 16px; padding: 28px 32px; line-height: 1.85; }
.legal h1 { font-size: 24px; margin-bottom: 4px; }
.legal h2 { font-size: 17px; margin: 28px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.legal h3 { font-size: 15px; margin: 16px 0 6px; }
.legal ol, .legal ul { padding-left: 22px; }
.legal li { margin: 4px 0; }
.legal table.list { margin: 8px 0 12px; }
.footer a { color: var(--muted); }
@media (max-width: 640px) { .legal { padding: 20px 16px; } }
.legal table.list td:first-child { white-space: nowrap; }
