:root {
  --text: #1b2a3d;
  --muted: #5c6d82;
  --blue: #2f86ff;
  --line: #e5eef6;
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.admin { margin: 0; min-height: 100vh; min-width: 1180px; background: #eef4fb; }
button, input, textarea, select { font-family: inherit; font-size: 14px; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #8cbcff; outline-offset: 2px;
}

#gate, .gate {
  min-height: 100vh; display: grid; place-items: center; padding: 48px 24px;
}
.login-card {
  width: 420px; background: #fff; border-radius: 12px; padding: 32px 36px;
  box-shadow: 0 12px 40px rgba(20, 55, 95, 0.12);
}
.login-card h1 { margin: 0 0 6px; font-size: 24px; }
.login-card .sub { margin: 0 0 16px; color: var(--muted); line-height: 1.5; }
.demo-account { background: #f4f8fd; border-radius: 12px; padding: 10px 12px; color: #52657c; font-size: 13px; line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; color: #52657c; font-size: 13px; }
.field input, .field textarea, .field select {
  border: 1px solid #dce7f2; border-radius: 8px; padding: 8px 10px; color: var(--text); background: #fff; font-size: 14px;
}
.primary, .ghost, .danger, .mini {
  border-radius: 12px; padding: 10px 14px; font-weight: 700; border: 0;
}
.primary { background: var(--blue); color: #fff; }
.ghost, .mini { background: #fff; color: #24527f; border: 1px solid #d5e4f5; }
.danger { background: #fff; color: #d64545; border: 1px solid #ffd0d0; }
.full { width: 100%; height: 46px; margin-top: 8px; }
.form-error { color: #d64545; min-height: 20px; font-size: 13px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.side { background: #14375f; color: #fff; padding: 20px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { padding: 6px 12px 16px; }
.brand strong { display: block; font-size: 18px; }
.brand span { color: #b9cce2; font-size: 12px; }
.side button {
  width: 100%; text-align: left; border: 0; background: transparent; color: #d5e4f5;
  border-radius: 10px; padding: 10px 12px; margin: 4px 0;
}
.side button.on { background: var(--blue); color: #fff; }
.main { padding: 28px 36px 64px; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-top h1 { margin: 0; font-size: 22px; }
.admin-actions { display: flex; gap: 8px; }
.note { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 14px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: #fff; border-radius: 16px; padding: 14px 16px; text-align: left; border: 0; }
.stat span { color: var(--muted); font-size: 13px; }
.stat b { display: block; margin-top: 6px; font-size: 28px; }
.panel-card, .vcard, .editor { background: #fff; border-radius: 16px; padding: 16px; margin-top: 12px; }
.panel-card h2, .editor h2 { margin: 0 0 12px; font-size: 16px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 36px; gap: 8px; align-items: center; margin: 8px 0; font-size: 13px; }
.bar { height: 8px; background: #e7f0fa; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--blue); }
.checkline { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 14px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select { border: 1px solid #dce7f2; border-radius: 12px; padding: 10px 12px; background: #fff; }
.filters input { flex: 1; min-width: 280px; max-width: 420px; font-size: 14px; }
.vcard header, .hrow { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.vcard header strong, .hrow strong { font-size: 15px; }
.muted { color: var(--muted); }
.small { color: #7d8da1; font-size: 12px; line-height: 1.5; }
.tag { display: inline-block; border-radius: 99px; padding: 2px 8px; background: #e7f1ff; color: #1f6feb; font-size: 12px; font-weight: 700; }
.tag.warn { background: #fff1e8; color: #f06714; }
.tag.ok { background: #e7f8ef; color: #0f9f6e; }
.tag.off { background: #f1f3f6; color: #7b8796; }
.vcard p { margin: 6px 0; line-height: 1.5; }
.row-actions, .pager { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pager { justify-content: flex-end; margin-top: 8px; }
.hrow { padding: 12px 0; border-bottom: 1px solid var(--line); }
.hrow:last-child { border-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.span2 { grid-column: span 4; }
.half { grid-column: span 2; }
.desk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.desk-grid .vcard, .desk-grid .panel-card { margin-top: 0; }
.subform { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-top: 10px; }
.subform h3 { margin: 0 0 8px; font-size: 14px; }
.inline { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.help { color: #7d8da1; font-size: 12px; line-height: 1.5; }
.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: #eef4fb; }
.article-image { cursor: pointer; }
.article-image input { display: none; }
