:root {
  --fg: #1f2328; --muted: #656d76; --line: #d0d7de; --bg: #fff; --soft: #f6f8fa;
  --link: #0969da; --g: #1a7f37; --r: #cf222e; --accent: #0969da;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--fg); background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
main { padding: 12px 16px 48px; max-width: 1280px; }
h1 { font-size: 18px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 20px 0 8px; }
h2 a { font-size: 13px; font-weight: normal; margin-left: 8px; }
h2 a.back { font-size: inherit; font-weight: inherit; margin: 0; color: inherit; }
h2 a.back::after { content: " ↑"; font-size: 12px; color: var(--muted); }
[id] { scroll-margin-top: 56px; }

header.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 16px; padding: 8px 16px; background: var(--soft); border-bottom: 1px solid var(--line); }
header.top nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
header.top nav a { color: var(--fg); font-weight: 600; }
header.top nav a.on { color: var(--accent); border-bottom: 2px solid var(--accent); }
header.top .user { color: var(--muted); }

.g { color: var(--g); font-weight: 600; }
.r { color: var(--r); font-weight: 600; }
.muted { color: var(--muted); }
.msg { padding: 8px 12px; border-radius: 6px; }
.msg.ok { background: #dafbe1; }
.msg.err { background: #ffebe9; color: var(--r); }

input, select, textarea, button, .btn { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--fg); }
button, .btn { cursor: pointer; background: var(--soft); font-weight: 600; }
button[type=submit] { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { background: none; border: 0; padding: 0; color: var(--link); font-weight: normal; }
form.inline { display: inline; }
input.num { width: 80px; }
textarea { width: 100%; }

.box { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 12px; max-width: 900px; }
.box label { display: block; margin-bottom: 12px; }
.box label > input:not([type=hidden]), .box label > select { display: block; margin-top: 4px; }
.login { max-width: 320px; margin: 48px auto; }
.login input { width: 100%; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.jump { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0; }
.filter { width: 100%; max-width: 420px; margin: 4px 0 8px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.card { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 16px; color: var(--fg); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card b { display: block; font-size: 16px; color: var(--accent); }
.card span { color: var(--muted); }

table.grid { border-collapse: collapse; width: 100%; margin-bottom: 8px; }
.grid th, .grid td { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; text-align: left; word-break: break-word; }
.grid th { background: var(--soft); width: 130px; }
.ops3 td:nth-child(2) { width: 190px; }
.note { margin: 0 0 8px; }

article.zsk { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
article.zsk .meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 6px 12px; background: var(--soft); color: var(--muted); border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
article.zsk .ops { display: flex; gap: 12px; }
article.zsk .body { padding: 10px 12px; word-wrap: break-word; overflow-x: auto; }
article.zsk .body img { max-width: 100%; }
article.zsk.deleted { opacity: .6; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; }

.copy { cursor: pointer; }
.copy.copied { color: var(--g); }
.gotop { position: fixed; right: 16px; bottom: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--soft);
  border: 1px solid var(--line); text-align: center; line-height: 34px; font-weight: 700; color: var(--fg); }
[hidden] { display: none !important; }

@media (max-width: 640px) {
  .grid th, .grid td { display: block; width: auto !important; border-width: 0 0 1px; }
  .grid tr { display: block; border: 1px solid var(--line); margin-bottom: 8px; }
}
