:root {
  --blue: #1e5aa8; --blue-d: #174a8a; --blue-l: #e8f1fb; --line: #d9e2ee;
  --bg: #f4f6f9; --text: #1f2d3d; --muted: #6b7a90;
  --ok: #1a7f37; --ok-bg: #e6f4ea; --err: #c0392b; --err-bg: #fdecea;
  --warn: #9a6700; --warn-bg: #fff3d6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--blue); text-decoration: none; }

.topbar { background: linear-gradient(135deg, var(--blue-d), var(--blue)); color: #fff; padding: 14px 26px; display: flex; align-items: center; gap: 14px; box-shadow: 0 2px 8px rgba(23,74,138,.25); }
.topbar .logo { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.topbar h1 { font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.topbar .sub { font-size: 12px; opacity: .85; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; background: rgba(255,255,255,.12); padding: 5px 12px; border-radius: 16px; }
.topbar button { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35); color: #fff; padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.topbar button:hover { background: rgba(255,255,255,.28); }

.wrap { max-width: 1100px; margin: 22px auto; padding: 0 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(31,45,61,.05); }
.card h2 { font-size: 16px; margin-bottom: 12px; color: var(--blue-d); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 .right { margin-left: auto; display: flex; gap: 8px; font-weight: normal; }
.muted { color: var(--muted); font-size: 12.5px; }
.hint { background: var(--blue-l); border-left: 3px solid var(--blue); padding: 10px 12px; border-radius: 6px; margin: 10px 0; font-size: 13px; line-height: 1.8; }

button, .btn { background: var(--blue); border: none; color: #fff; padding: 8px 18px; border-radius: 6px; cursor: pointer; font-size: 13.5px; transition: background .15s; }
button:hover, .btn:hover { background: var(--blue-d); }
button:disabled { background: #b8c4d4; cursor: not-allowed; }
button.ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
button.ghost:hover { background: var(--blue-l); }
button.danger { background: var(--err); }
button.danger:hover { background: #a3302a; }
button.small { padding: 4px 12px; font-size: 12.5px; }

input[type=text], input[type=password], input[type=search], input[type=number], input[type=datetime-local], select, textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(30,90,168,.25); border-color: var(--blue); }
label.fld { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--muted); }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
table.grid th { background: var(--blue-l); color: var(--blue-d); white-space: nowrap; }
table.grid tr:nth-child(even) td { background: #fafcff; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.err { background: var(--err-bg); color: var(--err); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.info { background: var(--blue-l); color: var(--blue); }
.tag.gray { background: #eef1f5; color: var(--muted); }

.att { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-top: 12px; background: #fbfcfe; }
.att .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.att .head b { font-size: 14px; }
.att .status { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }

.errbox { max-height: 340px; overflow: auto; margin-top: 10px; border-radius: 6px; border: 1px solid var(--line); }
.okbox { background: var(--ok-bg); color: var(--ok); border-radius: 6px; padding: 10px 14px; margin-top: 10px; font-size: 13.5px; }
.errsum { background: var(--err-bg); border: 1px solid #f2c4bf; color: var(--err); border-radius: 6px; padding: 10px 14px; margin-top: 10px; }
.warnsum { background: var(--warn-bg); border: 1px solid #eadfa8; color: var(--warn); border-radius: 6px; padding: 10px 14px; margin-top: 10px; font-size: 13px; }

/* 登录页 */
.login-bg { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #174a8a 0%, #1e5aa8 55%, #2f74c8 100%); }
.login-card { background: #fff; border-radius: 14px; padding: 38px 42px 30px; width: 400px; box-shadow: 0 18px 60px rgba(10,35,80,.45); }
.login-card .emblem { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 14px; background: linear-gradient(135deg, var(--blue-d), var(--blue)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.login-card h1 { text-align: center; font-size: 19px; color: var(--blue-d); letter-spacing: 1px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 12.5px; margin: 6px 0 22px; }
.login-card input { width: 100%; margin: 6px 0 14px; padding: 11px 12px; }
.login-card button { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.login-err { background: var(--err-bg); color: var(--err); border-radius: 6px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; display: none; }
.login-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.9; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 20px; font-size: 14px; color: var(--muted); border-radius: 8px 8px 0 0; cursor: pointer; }
.tabs a.on { color: var(--blue); font-weight: 600; border-bottom: 2px solid var(--blue); margin-bottom: -2px; background: #fff; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { flex: 1; min-width: 130px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.stat .num { font-size: 22px; font-weight: 700; color: var(--blue-d); }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { word-break: break-all; }
code.mono { background: #f0f3f8; border-radius: 4px; padding: 1px 6px; font-family: Consolas, monospace; font-size: 12.5px; }
.fingerprint { font-family: Consolas, monospace; font-size: 13px; letter-spacing: 1px; color: var(--blue-d); font-weight: 600; }
.fp-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-l); border: 1px dashed var(--blue); padding: 5px 12px; border-radius: 6px; }

.modal-mask { position: fixed; inset: 0; background: rgba(15,30,55,.45); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 22px 26px; width: min(680px, 92vw); max-height: 88vh; overflow: auto; }
.modal h3 { margin-bottom: 12px; color: var(--blue-d); }

.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: #22314a; color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 13.5px; z-index: 99; box-shadow: 0 6px 24px rgba(0,0,0,.25); display: none; }
.toast.err { background: var(--err); }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; }
}
