:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #24292f; --muted: #6a737d; --line: #dcd9d0; --accent: #2f5d8a;
  --accent-soft: #e6eef6; --warn: #8a5a00; --warn-soft: #fff4d6; --del: #9a2b2b; --del-soft: #fbeaea; --ok-soft: #e9f4ea;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.65 "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button, .btn { background: var(--accent); color: #fff; border: 0; border-radius: 4px; padding: 5px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
button.link { background: none; color: var(--accent); padding: 2px 6px; }
button.danger { background: var(--del); }
button.small { padding: 1px 8px; font-size: 13px; }
input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; background: #fff; color: var(--ink);
}
textarea { width: 100%; resize: vertical; }
.top { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-size: 18px; font-weight: 600; }
.tabs button { background: none; color: var(--ink); border-bottom: 2px solid transparent; border-radius: 0; padding: 4px 10px; }
.tabs button.on { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.who { margin-left: auto; color: var(--muted); }
.notice { background: var(--warn-soft); color: var(--warn); padding: 8px 20px; border-bottom: 1px solid #ecd9a6; }
.center { display: flex; justify-content: center; padding: 60px 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 20px; margin-bottom: 16px; }
.card.narrow { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { margin: 0 0 4px; font-size: 17px; }
.muted { color: var(--muted); margin: 0; }
.err { color: var(--del); margin: 0; min-height: 1em; }
.layout { display: grid; grid-template-columns: 290px 1fr; min-height: calc(100vh - 100px); }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 10px 0; overflow-y: auto; max-height: calc(100vh - 100px); position: sticky; top: 0; }
.side .cat { display: block; width: 100%; text-align: left; background: none; color: var(--ink); padding: 6px 16px; border-radius: 0; }
.side .cat.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .cat .n { float: right; color: var(--muted); font-size: 13px; font-weight: normal; }
.side .cat .ro { font-size: 12px; color: var(--muted); margin-left: 4px; }
.side .grp { display: block; width: 100%; text-align: left; background: none; color: var(--ink); padding: 2px 16px 2px 32px; font-size: 14px; border-radius: 0; }
.side .grp.on { color: var(--accent); font-weight: 600; }
.side .grp .n { float: right; color: var(--muted); font-size: 12px; }
.main, .single { padding: 14px 22px; min-width: 0; }
.single { max-width: 1500px; }
h1 { font-size: 20px; margin: 0 0 4px; }
.catnote { color: var(--muted); margin: 0 0 10px; max-width: 70em; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.toolbar input[type=search] { width: 300px; }
.grow { flex: 1; }
.count { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
table.grid { border-collapse: collapse; width: 100%; }
.grid th, .grid td { border-bottom: 1px solid #ebe8e0; padding: 6px 10px; text-align: left; vertical-align: top; }
.grid th { background: #f0eee8; font-weight: 600; font-size: 14px; white-space: nowrap; position: sticky; top: 0; }
.grid td { max-width: 420px; min-width: 3em; overflow-wrap: break-word; }
.grid td { min-width: 5em; }
.grid td.list { min-width: 9em; }
.grid td.meta { min-width: 11em; }
.grid td.ops, .grid td.cnt { min-width: 0; }
.grid td:first-child { min-width: 0; color: var(--muted); font-size: 13px; }
.grid tr.deleted td { color: #999; text-decoration: line-through; background: var(--del-soft); }
.grid tr.edited td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.grid td.ops { white-space: nowrap; }
.grid pre { margin: 0; white-space: pre-wrap; font: 13px/1.5 Consolas, "Courier New", monospace; }
.tag { display: inline-block; font-size: 12px; padding: 0 6px; border-radius: 3px; margin-right: 4px; background: #eee; color: #555; white-space: nowrap; }
.tag.edited { background: var(--accent-soft); color: var(--accent); }
.tag.up { background: var(--warn-soft); color: var(--warn); }
.tag.ro { background: #eee; color: #666; }
.tag.del { background: var(--del-soft); color: var(--del); }
.note { color: var(--muted); font-size: 13px; }
.raw { border-bottom: 1px dotted #b7b2a6; cursor: help; }
.card.ut { margin-top: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.filters select, .filters input[type=text] { font-size: 14px; padding: 3px 6px; }
.filters label { font-size: 14px; white-space: nowrap; }
.qpick { position: relative; }
.qpick summary { cursor: pointer; border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; background: #fff; font-size: 14px; list-style: none; }
.qpanel { position: absolute; z-index: 5; top: 32px; left: 0; width: 380px; max-height: 380px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.qpanel input[type=text] { width: 100%; margin-bottom: 6px; }
.qopt { display: block; font-size: 14px; padding: 1px 0; }
.qopt .n { float: right; color: var(--muted); font-size: 12px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.filterbar .count { margin: 0; color: var(--ink); }
.tag.seen { background: var(--ok-soft); color: #2d6a33; }
.tag.doubt { background: var(--warn-soft); color: var(--warn); }
.side .cat.all { color: var(--accent); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
a.small { font-size: 13px; }
.grid td.cnt { text-align: right; font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.grid tfoot th { background: #f0eee8; }
.more { padding: 10px 0; }
.chg-before { background: var(--del-soft); }
.chg-after { background: var(--ok-soft); }
.kv { font-size: 13px; }
.kv b { font-weight: 600; color: #444; }
dialog { border: 1px solid var(--line); border-radius: 8px; width: min(760px, 96vw); padding: 0; }
dialog form { padding: 16px 20px; max-height: 88vh; overflow-y: auto; }
dialog h2 { margin: 0 0 6px; font-size: 18px; }
dialog .meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.field { display: block; margin-bottom: 10px; }
.field > span { display: block; font-size: 14px; color: #444; margin-bottom: 2px; }
.field input[type=text], .field input[type=number], .field select { width: 100%; }
.field .hint { font-size: 12px; color: var(--muted); }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.hist { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; }
.hist div { margin-bottom: 6px; }
.links li { margin-bottom: 6px; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: 240px; }
  .toolbar input[type=search] { width: 100%; }
}
