/* Practical ops admin skin — flat, structural, low ornament */
:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --line: #d8dde6;
  --text: #1f2a37;
  --muted: #6b7785;
  --accent: #2f6fed;
  --accent-2: #2458c4;
  --ok: #1f8f4e;
  --err: #c23b3b;
  --warn: #b7811a;
  --radius: 3px;
  --shadow: none;
  --font: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --sidebar: #243447;
  --sidebar-text: #d7deea;
  --sidebar-muted: #9aa8bc;
  --sidebar-active: #1b2838;
  --topbar-bg: #ffffff;
  --input-bg: #ffffff;
  --thead-bg: #f3f5f8;
  --stat-bg: #ffffff;
  --accent-soft: rgba(47, 111, 237, .12);
  --focus-ring: #2f6fed;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  width: 208px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 0;
}
.brand {
  margin: 0;
  padding: 16px 16px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: transparent;
  border-radius: 0;
}
.brand small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 400;
  color: var(--sidebar-muted);
}
.sidebar nav { padding: 10px 0 20px; }
.nav-item {
  display: block;
  color: var(--sidebar-muted);
  padding: 9px 16px 9px 18px;
  margin: 0;
  border-radius: 0;
  border-left: 3px solid transparent;
  font-size: 13px;
}
.nav-item:hover {
  background: rgba(255,255,255,.04);
  color: #fff;
  text-decoration: none;
}
.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--accent);
  text-decoration: none;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  height: 48px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  position: sticky;
  top: 0;
  z-index: 5;
}
.top-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.top-user {
  color: var(--muted);
  font-size: 12px;
}
.content { padding: 14px 16px 24px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.card h2, .card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.card > h2:last-child,
.card > h3:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.grid { display: grid; gap: 10px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  background: var(--stat-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat .label {
  color: var(--muted);
  font-size: 12px;
}
.stat .value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: end;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toolbar form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  width: 100%;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
input, select, textarea {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid #cfd6e0;
  border-radius: 2px;
  padding: 6px 9px;
  min-width: 140px;
  font: inherit;
  height: 32px;
}
textarea {
  min-height: 88px;
  height: auto;
  resize: vertical;
  line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0 12px;
  height: 32px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: #fff;
  background: #5b6b7c;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ok { background: var(--ok); border-color: var(--ok); }
.btn-danger { background: var(--err); border-color: var(--err); }
.btn-ghost {
  background: #fff;
  border-color: #cfd6e0;
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-sm { height: 28px; padding: 0 8px; font-size: 12px; }

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: var(--panel);
}
th, td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
  vertical-align: middle;
}
th:last-child, td:last-child { border-right: 0; }
th {
  background: var(--thead-bg);
  color: #4a5563;
  font-weight: 600;
  font-size: 12px;
}
tbody tr:nth-child(even) td { background: rgba(0,0,0,.015); }
tr:hover td { background: #f5f8ff; }

.alert {
  padding: 8px 12px;
  border-radius: 2px;
  margin-bottom: 12px;
  font-size: 12px;
  border: 1px solid transparent;
}
.alert-success {
  background: #edf8f0;
  border-color: #b7e0c2;
  color: #1f6b3a;
}
.alert-error {
  background: #fbf0f0;
  border-color: #e8bcbc;
  color: #9a2f2f;
}

.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 12px;
  background: #eef1f5;
  color: #4a5563;
  border: 1px solid #d8dde6;
  line-height: 1.6;
}
.badge-ok { background: #edf8f0; border-color: #b7e0c2; color: #1f6b3a; }
.badge-warn { background: #fff8e8; border-color: #edd59a; color: #8a6414; }
.badge-err { background: #fbf0f0; border-color: #e8bcbc; color: #9a2f2f; }

.pagination { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.page {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  padding: 0 6px;
}
.page.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.page:hover { text-decoration: none; color: var(--accent); }
.page.active:hover { color: #fff; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

.detail-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
  border: 1px solid var(--line);
}
.detail-list .k,
.detail-list > div {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.detail-list .k {
  background: var(--thead-bg);
  color: #4a5563;
  border-right: 1px solid var(--line);
}
.detail-list > div:nth-last-child(-n+2) { border-bottom: 0; }

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 2px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f0f2f5;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #e8ecf1;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid #d5dbe3;
  border-radius: 2px;
  padding: 28px 28px 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}
.login-card .login-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
}
.login-card label { margin-bottom: 12px; }
.login-card input, .login-card select { width: 100%; }

.portal {
  max-width: 860px;
  margin: 48px auto;
  padding: 0 16px;
}
.portal-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #243447;
}
.portal h1 {
  font-size: 20px;
  margin: 0 0 6px;
  font-weight: 700;
}
.portal p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  background: #fff;
}
.portal-card {
  display: block;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: #fff;
}
.portal-card:nth-child(2n) { border-right: 0; }
.portal-card:hover {
  background: #f7f9fc;
  text-decoration: none;
}
.portal-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}
.portal-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.portal-card .code {
  display: inline-block;
  margin-top: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  color: #708090;
  background: #f3f5f8;
  border: 1px solid #e1e6ee;
  padding: 1px 6px;
}

.install-wrap { max-width: 760px; margin: 32px auto; padding: 0 16px; }
.steps { display: flex; gap: 0; margin-bottom: 14px; border: 1px solid var(--line); background: #fff; }
.step {
  flex: 1;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  background: #fff;
  border-radius: 0;
}
.step:last-child { border-right: 0; }
.step.active { color: var(--accent); font-weight: 600; background: #f3f7ff; }
.step.done { color: var(--ok); }
.log-box {
  background: #1e2430;
  color: #d7deea;
  border: 1px solid #10151c;
  border-radius: 2px;
  padding: 10px 12px;
  max-height: 260px;
  overflow: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  white-space: pre-wrap;
}
.check-ok { color: var(--ok); }
.check-fail { color: var(--err); }

/* Help / usage guide */
.help-lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.help-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.help-toc a {
  font-size: 12px;
  color: var(--accent);
}
.help-section h2 {
  margin-bottom: 12px;
}
.help-section h3 {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 0;
  padding-bottom: 0;
}
.help-section ul {
  margin: 0 0 8px 18px;
  padding: 0;
  color: var(--text);
}
.help-section li {
  margin: 4px 0;
  line-height: 1.65;
  font-size: 13px;
}
.help-steps {
  margin: 0;
  padding-left: 20px;
}
.help-steps > li {
  margin: 0 0 12px;
  line-height: 1.65;
  font-size: 13px;
}
.help-steps > li > div {
  margin-top: 4px;
  color: #44505e;
}
.help-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  background: #fff8e8;
  border: 1px solid #edd59a;
  color: #8a6414;
  font-size: 12px;
  line-height: 1.6;
}
.help-section code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  background: #f3f5f8;
  border: 1px solid #e1e6ee;
  padding: 0 4px;
}

@media (max-width: 960px) {
  .grid-4, .grid-3, .grid-2, .form-grid, .portal-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 12px; }
  .portal-card { border-right: 0; }
  .detail-list { grid-template-columns: 96px 1fr; }
}
