:root {
  --bg: #f6f6f3;
  --panel: #ffffff;
  --ink: #1c1c1e;
  --muted: #6b6b70;
  --faint: #9a9a9f;
  --line: #e6e5e0;
  --soft: #f0efea;
  --accent: #1f6f5c;
  --accent-soft: #e6f1ed;
  --warn: #a3541c;
  --warn-soft: #fbefe5;
  --danger: #b3261e;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: 0; height: 100vh; background: var(--bg); }
.brand { font-weight: 600; font-size: 15px; padding: 0 10px 18px; letter-spacing: .02em; }
.brand small { display: block; color: var(--faint); font-weight: 400; font-size: 12px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 8px; color: var(--ink); margin-bottom: 2px; }
.nav a:hover { background: var(--soft); text-decoration: none; }
.nav a.on { background: var(--panel); box-shadow: 0 0 0 1px var(--line); font-weight: 600; }
.nav .badge { background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.side form { margin-top: 18px; padding: 0 10px; }
.main { padding: 28px 36px 60px; max-width: 1180px; width: 100%; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 16px; margin: 28px 0 10px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 22px; }
.flash { background: var(--accent-soft); color: var(--accent); padding: 9px 14px; border-radius: var(--radius); margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat .n { font-size: 26px; font-weight: 650; letter-spacing: -.01em; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.warn .n { color: var(--warn); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 6px; background: var(--soft); color: var(--muted); line-height: 20px; white-space: nowrap; }
.tag.acc { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12px; }
.title-cell a { color: var(--ink); font-weight: 500; }
.title-cell .s { color: var(--muted); font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
input[type=text], input[type=password], input:not([type]), select, textarea {
  font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; min-height: 120px; resize: vertical; }
textarea.code, pre, code { font-family: var(--mono); font-size: 12.5px; }
.btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 6px 12px; }
.btn:hover { border-color: #cfcdc6; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.pri:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select { width: 100%; }
.body-md { white-space: pre-wrap; word-break: break-word; line-height: 1.75; }
pre { background: #faf9f6; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
.diff { max-height: 280px; overflow: auto; }
.diff .add { color: var(--accent); } .diff .del { color: var(--danger); }
details summary { cursor: pointer; color: var(--muted); }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.col h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 0 8px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.item .t { font-weight: 500; }
.meter { height: 6px; background: var(--soft); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--accent); }
.meter.over i { background: var(--warn); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 4px 11px; border-radius: 16px; border: 1px solid var(--line); color: var(--ink); background: var(--panel); font-size: 13px; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.secret { background: #1c1c1e; color: #f3f3f3; padding: 10px 12px; border-radius: 8px; font-family: var(--mono); word-break: break-all; }
.login { max-width: 360px; margin: 14vh auto; }
.pager { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .nav { display: flex; overflow-x: auto; gap: 4px; }
  .nav a { white-space: nowrap; }
  .brand { padding-bottom: 8px; }
  .side form { display: none; }
  .main { padding: 18px 16px 48px; }
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2, .kanban, .pair { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
