:root {
  --bg: #f6f6f4; --card: #fff; --ink: #1d1d1f; --muted: #6e6e73; --line: #e5e5ea; --accent: #1d1d1f;
  --ok: #1f8a4c; --bad: #c4361f; --warn: #b26b00; --soft: #f0f0ee;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
[hidden] { display: none !important; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand small { color: var(--muted); font-weight: 400; font-size: 13px; }
.me { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 220px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 16px; }
.narrow { max-width: 420px; margin: 60px auto; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0; }
input, textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 9px; }
input:focus, textarea:focus { outline: 2px solid #1d1d1f22; border-color: #1d1d1f55; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
button { font: inherit; font-size: 14px; padding: 8px 16px; border-radius: 9px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap; }
button:hover { opacity: .88; }
button:disabled { opacity: .35; cursor: not-allowed; }
button.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
button.danger { background: var(--bad); border-color: var(--bad); }
button.small { padding: 4px 10px; font-size: 13px; }
button.link { display: block; margin-top: 12px; padding: 0; background: transparent; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button { background: transparent; color: var(--muted); border-color: transparent; }
.tabs button.on { background: var(--card); color: var(--ink); border-color: var(--line); }
.bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input { width: auto; flex: 1; min-width: 200px; margin-top: 0; }
.inline label.check { display: flex; gap: 6px; align-items: center; margin: 0; white-space: nowrap; }
.inline label.check input { width: auto; min-width: 0; margin: 0; }
.row { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.row a { color: var(--muted); font-size: 13px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list a { color: var(--ink); }
table.keys td:first-child { width: 190px; font-weight: 600; }
table.keys .note { font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
table.keys td.state { width: 190px; color: var(--muted); word-break: break-all; }
table.keys input { margin: 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--soft); color: var(--muted); }
.pill.ok { background: #e7f5ec; color: var(--ok); }
.pill.bad { background: #fbe9e6; color: var(--bad); }
.pill.warn { background: #fdf1de; color: var(--warn); }
.people { list-style: none; padding: 0; margin: 0 0 10px; }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.people li:last-child { border-bottom: 0; }
.people li .tag { color: var(--muted); font-size: 12px; margin-left: 8px; }
.people li label { margin: 0; display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; }
.people li label input { width: auto; margin: 0; }
.danger-title { color: var(--bad); }
.msg { font-size: 13px; color: var(--muted); min-height: 1.2em; }
.msg.bad { color: var(--bad); }
.job { position: fixed; left: 0; right: 0; bottom: 0; background: #111; color: #eee; padding: 12px 20px 16px; box-shadow: 0 -6px 24px #0003; z-index: 10; }
.job .row { justify-content: flex-start; }
.job .row button { margin-left: auto; background: transparent; color: #ccc; border-color: #444; }
.job pre { margin: 10px 0 0; max-height: 170px; overflow: auto; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; color: #ddd; }
.job .pill { background: #333; color: #ddd; }
.job .pill.ok { background: #1f8a4c; color: #fff; }
.job .pill.bad { background: #c4361f; color: #fff; }
.toast { position: fixed; bottom: 24px; right: 24px; max-width: 420px; background: #1d1d1f; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 20; box-shadow: 0 6px 20px #0003; }
.toast.bad { background: var(--bad); }
input.cat-name { min-width: 145px; }
input.cat-model { min-width: 210px; }
input.cat-note { min-width: 275px; }
.fb-pre { white-space: pre-wrap; margin: 8px 0; font-size: 13px; background: var(--soft); padding: 10px 12px; border-radius: 8px; }
.fb-diag { white-space: pre-wrap; margin: 6px 0 0; font-size: 12px; max-height: 220px; overflow: auto; background: var(--soft); padding: 10px 12px; border-radius: 8px; }
h4 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }
select { font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; }
label.check.muted { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
label.check input { display: inline-block; width: auto; margin: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; max-height: 240px; overflow: auto; margin: 6px 0 10px; }
.checks label { display: flex; gap: 6px; align-items: center; margin: 0; color: var(--ink); font-size: 13px; }
.checks label input { width: auto; margin: 0; }
.bill { border-top: 1px solid var(--line); padding: 12px 0; }
.bill:first-child { border-top: 0; }
.bill .row { margin-bottom: 6px; }
.step { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 14px; }
.step h3 { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; }
.step .num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; }
textarea.plain { font-family: inherit; font-size: 14px; }
.field { margin: 10px 0; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 2px #fff; }
.swatch.on { border-color: var(--ink); }
.inline-file { margin-top: 10px; }
details.more { margin: 12px 0; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.card.more > summary { font-size: 15px; color: var(--ink); font-weight: 600; }
.example { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.example textarea { margin-top: 0; }
@media (max-width: 640px) {
  .example { grid-template-columns: 1fr; }
  .top { padding: 12px 16px; }
  table.list th:nth-child(3), table.list td:nth-child(3) { display: none; }
  table.keys td.state { width: auto; }
}
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-name { margin-left: 8px; font-size: 13px; color: var(--muted, #666); }
