:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e5e9f2;
  --text: #1f2733;
  --muted: #7b8598;
  --primary: #2f6bff;
  --primary-dk: #1e50d6;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}
header {
  background: linear-gradient(120deg, #1e50d6, #2f6bff 60%, #4f8bff);
  color: #fff; padding: 26px 6vw;
}
.logo { font-size: 22px; font-weight: 700; }
.sub { opacity: .85; margin-top: 6px; font-size: 13px; }
main { max-width: 1100px; margin: -14px auto 40px; padding: 0 16px; }

.toolbar {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; display: flex; gap: 10px; align-items: center;
  box-shadow: 0 4px 16px rgba(30, 80, 214, .06);
}
.toolbar input {
  flex: 0 1 320px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; outline: none;
}
.toolbar input:focus { border-color: var(--primary); }
.spacer { flex: 1; }

.btn {
  display: inline-block; padding: 9px 16px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--text); font-size: 14px;
  cursor: pointer; text-decoration: none; transition: .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dk); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger:hover { border-color: var(--err); color: var(--err); }

.table-wrap {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  margin-top: 14px; overflow: auto; box-shadow: 0 4px 16px rgba(30, 80, 214, .06);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #f8faff; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafcff; }
.empty { padding: 42px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; }
.pw { font-family: monospace; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag.on { background: #e8f8ee; color: var(--ok); }
.tag.off { background: #f1f3f8; color: var(--muted); }
.ops { display: flex; gap: 6px; flex-wrap: wrap; }

.kdocs-bar {
  margin-top: 14px; background: #fffbe8; border: 1px solid #f5e3a3;
  border-radius: 12px; padding: 12px 16px; display: flex; gap: 12px;
  align-items: center; justify-content: space-between; flex-wrap: wrap;
  font-size: 13px;
}
.kdocs-bar code { display: inline-block; margin-top: 6px; background: #fff; padding: 4px 8px; border-radius: 6px; }
.kdocs-actions { display: flex; gap: 8px; }

dialog {
  border: none; border-radius: 14px; padding: 24px; width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
dialog::backdrop { background: rgba(15, 23, 42, .45); }
dialog h3 { margin-bottom: 14px; }
dialog label { display: block; font-size: 13px; color: var(--muted); margin-top: 12px; }
dialog input {
  width: 100%; margin-top: 5px; padding: 9px 12px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; outline: none;
}
dialog input:focus { border-color: var(--primary); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.captcha-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
#captchaImg { height: 46px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; }
.err { color: var(--err); font-size: 13px; margin-top: 8px; min-height: 16px; }

.gate-mask {
  position: fixed; inset: 0; background: linear-gradient(120deg, #1e50d6, #4f8bff);
  display: flex; align-items: center; justify-content: center; z-index: 99;
}
.gate-card {
  background: #fff; padding: 34px; border-radius: 16px; width: 340px; text-align: center;
}
.gate-card input {
  width: 100%; margin: 14px 0 4px; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px; outline: none; text-align: center;
}
.gate-card .btn { width: 100%; margin-top: 10px; }

.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
