:root {
  --ink: #16343c;
  --muted: #5b7278;
  --line: #d5e0e2;
  --paper: #f4f1ea;
  --card: #fffdf8;
  --side: #12363f;
  --side2: #0e2c33;
  --accent: #1f7a6c;
  --accent2: #c9783a;
  --bad: #b42318;
  --warn: #b54708;
  --good: #067647;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 228px;
  background: linear-gradient(180deg, var(--side), var(--side2));
  color: #e8f2f0; display: flex; flex-direction: column; z-index: 5;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 22px 18px 16px; }
.mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: #2aa58f; color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.brand strong { display: block; font-size: 15px; }
.brand small { color: #9cb8b8; font-size: 12px; }
.side nav { flex: 1; padding: 8px; }
.side nav a {
  display: block; color: #d5e8e4; padding: 10px 12px; border-radius: 8px; margin-bottom: 2px;
}
.side nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.who { padding: 14px 18px 20px; font-size: 12px; color: #9cb8b8; border-top: 1px solid rgba(255,255,255,.08); }
.who a { color: #f0d2b0; margin-left: 8px; }
.main { margin-left: 228px; padding: 28px 32px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 650; }
.page-head p, .page-head small { margin: 0; color: var(--muted); font-weight: 400; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 1px 0 rgba(18,54,63,.04);
}
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-grid.mini { grid-template-columns: repeat(4, 1fr); }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
}
.stat em { font-style: normal; font-size: 26px; font-weight: 700; display: block; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.warn em { color: var(--warn); }
.stat.bad em { color: var(--bad); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td { text-align: left; }
th { color: var(--muted); font-weight: 600; text-align: center; }
.empty { color: var(--muted); text-align: center; }
.btn, button {
  display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-size: 14px;
}
.btn:hover, button:hover { filter: brightness(1.05); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.mini { padding: 4px 8px; font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.toolbar input[name="q"] {
  width: 40em;
  min-width: 320px;
  max-width: 100%;
}
.toolbar input, .toolbar select, .form input, .form select, .form textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; background: #fff;
}
.form fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 14px; padding: 14px; background: var(--card); }
.form legend { padding: 0 6px; color: var(--accent); font-weight: 650; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.form label { display: block; font-size: 13px; color: var(--muted); }
.form label input, .form label select, .form label textarea { width: 100%; margin-top: 4px; color: var(--ink); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 6px 0 12px; color: var(--ink); }
.checks label { color: var(--ink); font-size: 13px; }
.lab { margin: 10px 0 4px; font-size: 13px; color: var(--muted); }
.form-actions { display: flex; gap: 10px; }
.hint { color: var(--muted); font-size: 12px; }
.flash { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.flash.ok { background: #e7f6ee; color: var(--good); }
.flash.err { background: #fde8e6; color: var(--bad); }
.tag { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 12px; background: #eef2f3; }
.tag.good { background: #e7f6ee; color: var(--good); }
.tag.warn { background: #fef4e6; color: var(--warn); }
.tag.bad { background: #fde8e6; color: var(--bad); }
.tag.mute { background: #eef2f3; color: var(--muted); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: 14px; }
.kv b { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.dev-block { border-top: 1px dashed var(--line); padding: 10px 0; }
.dev-block h3 { margin: 0 0 4px; font-size: 15px; }
.ops { display: flex; gap: 10px; align-items: center; }
.pager { padding-top: 10px; color: var(--muted); }
.pager a { margin-right: 6px; }
.pager a.on { font-weight: 700; color: var(--ink); }
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #102c33 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><circle cx="20" cy="20" r="2" fill="%231f7a6c" opacity=".25"/></svg>');
}
.login-card {
  width: 860px; display: grid; grid-template-columns: 1.1fr .9fr; background: #fffdf8;
  border-radius: 18px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-hero { padding: 42px 36px; background: #1f7a6c; color: #fff; }
.login-hero h1 { margin: 0 0 12px; font-size: 28px; }
.login-form { padding: 36px; }
.login-form h2 { margin: 0 0 16px; }
.login-form label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.login-form input { width: 100%; margin-top: 4px; padding: 10px; border-radius: 8px; border: 1px solid var(--line); }
.login-form button { width: 100%; margin-top: 8px; padding: 11px; }
.edu-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
a.edu { color: inherit; }
a.edu em { display: block; color: var(--accent2); font-size: 12px; margin: 4px 0; }
.article { white-space: normal; line-height: 1.7; }
tr.late td { color: var(--bad); }
.inline { display: inline; }
.checkline { color: var(--ink) !important; }
.print-toolbar { position: sticky; top: 0; background: #fff; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.paper {
  max-width: 900px; margin: 16px auto; background: #fff; padding: 28px 32px;
  border: 1px solid #cfc6b6; color: #222;
}
.paper h1 { text-align: center; margin: 0 0 8px; font-size: 22px; }
.paper h2 { font-size: 15px; border-bottom: 1px solid #222; padding-bottom: 4px; margin: 16px 0 8px; }
.paper p { margin: 6px 0; line-height: 1.65; }
.paper .box { margin-right: 8px; white-space: nowrap; display: inline-block; }
.paper-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0 16px; }
.paper-table th, .paper-table td { border: 1px solid #333; padding: 4px 6px; }
.paper-table th { text-align: center; }
.sign { margin-top: 24px; }
.tiny { font-size: 12px; color: #444; }
@media print {
  .no-print, .print-toolbar, .side, .flash { display: none !important; }
  .main { margin: 0; padding: 0; }
  .paper { border: 0; margin: 0; max-width: none; page-break-after: always; }
  .paper:last-child { page-break-after: auto; }
  body { background: #fff; }
}
@media (max-width: 1100px) {
  .stat-grid, .split, .login-card, .edu-list { grid-template-columns: 1fr; }
  .main .grid3 { grid-template-columns: 1fr 1fr; }
  .side { width: 64px; }
  .brand strong, .brand small, .side nav a, .who span { display: none; }
  .main { margin-left: 64px; }
  .toolbar input[name="q"] { width: 100%; min-width: 0; }
}
@media (max-width: 720px) {
  .main .grid3, .modal-page .grid3 { grid-template-columns: 1fr; }
}

body.modal-open {
  overflow: hidden;
}
body.modal-open .side,
body.modal-open .main {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}
.modal-mask {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 32, 38, .38);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
}
.modal-mask[hidden] { display: none !important; }
.modal-dialog {
  position: relative;
  width: min(1180px, 96vw);
  height: min(92vh, 960px);
  background: rgba(255, 253, 248, .88);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0,0,0,.32);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-dialog iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 0;
}
.modal-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, .96);
}
.modal-title {
  font-size: 18px;
  font-weight: 650;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-close {
  flex-shrink: 0;
  width: auto;
  min-width: 72px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid rgba(18,54,63,.18);
  border-radius: 6px;
  background: rgba(18,54,63,.08);
  color: var(--ink);
  font-size: 14px;
  line-height: 32px;
  cursor: pointer;
}
.modal-close:hover { background: rgba(18,54,63,.16); }
.modal-page {
  background: transparent;
  min-height: 100%;
  padding: 10px 16px 18px;
}
.modal-page .page-head { display: none; }
.modal-page .form fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  margin: 0 0 8px;
  padding: 8px 12px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.72);
}
.modal-page .form legend {
  grid-column: 1 / -1;
  font-size: 13px;
}
.modal-page .form fieldset > .grid3,
.modal-page .form fieldset > .lab,
.modal-page .form fieldset > .checks,
.modal-page .form fieldset > .hint,
.modal-page .form fieldset > .checkline {
  grid-column: 1 / -1;
}
.modal-page .grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}
.modal-page .form input,
.modal-page .form select,
.modal-page .form textarea {
  padding: 5px 8px;
}
.modal-page .form label { font-size: 12px; }
.modal-page .form label input,
.modal-page .form label select,
.modal-page .form label textarea { margin-top: 2px; }
.modal-page .lab { margin: 4px 0 2px; }
.modal-page .checks { margin: 2px 0 4px; gap: 4px 12px; }
.modal-page .form fieldset > label:has(textarea) {
  grid-column: 1 / -1;
}
.modal-page .form-actions {
  position: sticky;
  bottom: 0;
  background: rgba(255,253,248,.94);
  padding: 8px 0 2px;
  margin-top: 4px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.tabs a {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
}
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 650;
}
.tabs a em {
  font-style: normal;
  font-size: 12px;
  margin-left: 2px;
  opacity: .88;
}
.group-title {
  margin: 18px 0 8px;
  font-size: 14px;
  color: var(--ink);
}
.group-title small { color: var(--muted); font-weight: 400; }
.toolbar.compact { margin: 0; }
.toolbar.compact select { min-width: 10em; }
.records-table { font-size: 12px; }
.records-table td:last-child { white-space: nowrap; }
.btn.mini.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.js-follow-content[hidden] { display: none !important; }
.rule-form { margin: 0 0 16px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; }
.rule-days { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 10px; }
.rule-days label { color: var(--muted); font-size: 13px; }
.rule-days input { width: 5.2em; margin: 0 4px; }
.rule-form .ops { gap: 8px; }
