:root {
  --p: #1f3864;
  --s: #2e74b5;
  --bg: #f5f7fa;
  --card: #fff;
  --text: #333;
  --muted: #7f7f7f;
  --border: #e5e7eb;
  --green: #2e7d32;
  --orange: #ed6c02;
  --red: #c62828;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 20px; margin: 8px 0 0; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1f3864, #2e74b5);
  padding: 24px;
}
.login-card {
  width: 360px;
  background: var(--card);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.login-card .brand { color: var(--s); font-weight: 700; letter-spacing: .1em; }
.login-card h1 { margin: 8px 0 4px; color: var(--p); font-size: 24px; }
.login-card label { display: block; margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.login-card input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.login-card button {
  width: 100%; margin-top: 22px; padding: 11px; border: 0; border-radius: 8px;
  background: var(--p); color: #fff; font-size: 15px;
}

.topbar {
  height: 56px; background: var(--p); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}
.brand { font-weight: 700; letter-spacing: .05em; }
.brand span { font-weight: 400; opacity: .75; margin-left: 8px; font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.top-actions .muted { color: #d6e4f0; }
.ghost {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4);
  border-radius: 8px; padding: 6px 12px;
}

.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 168px; background: #fff; border-right: 1px solid var(--border); padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.nav {
  text-align: left; padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 14px;
}
.nav:hover { background: #eef3f9; }
.nav.active { background: var(--p); color: #fff; }
.content { flex: 1; padding: 24px; max-width: 1200px; }

h2 { color: var(--p); margin: 0 0 16px; font-size: 20px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.card .label { color: var(--muted); font-size: 13px; }
.card .value { font-size: 26px; font-weight: 700; color: var(--p); margin-top: 6px; }
.card .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
th { background: #eef3f9; color: var(--p); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eef3f9; color: var(--p); font-size: 12px; }
.tag.green { background: #e8f5e9; color: var(--green); }
.tag.orange { background: #fff3e0; color: var(--orange); }
.tag.red { background: #ffebee; color: var(--red); }

.section { margin-bottom: 22px; }
.empty { padding: 24px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.toolbar button { padding: 8px 14px; border: 0; border-radius: 8px; background: var(--p); color: #fff; }

.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.hint code { background: #f2f3f5; padding: 2px 6px; border-radius: 4px; }

.login-card .secondary {
  width: 100%; margin-top: 10px; padding: 10px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--p); font-size: 14px;
}
.diag { margin: 10px 0 0; padding: 10px; background: #0f172a; color: #d1e7ff; border-radius: 8px;
  font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button, .toolbar button.secondary {
  padding: 6px 10px; border: 0; border-radius: 6px; background: var(--p); color: #fff; font-size: 12px;
}
.actions button.secondary, .toolbar button.secondary { background: #eef3f9; color: var(--p); }
.actions button.danger { background: #ffebee; color: var(--red); }
.code { font-family: Consolas, monospace; font-weight: 700; letter-spacing: .08em; }
@media print {
  .topbar, .sidebar, .toolbar { display: none !important; }
  .content { padding: 0; }
  .print-area { font-size: 14px; }
}

.user-picker { position: relative; min-width: 240px; }
.user-picker input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.suggestions { position: absolute; top: 38px; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 20; max-height: 220px; overflow: auto; }
.suggestion { padding: 9px 10px; cursor: pointer; font-size: 13px; }
.suggestion:hover { background: #eef3f9; }

.detail-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.detail-card { width: 100%; max-width: 760px; max-height: 90vh; overflow: auto; background: #fff; border-radius: 14px; padding: 24px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; }
.detail-head h2 { margin: 4px 0 0; color: var(--p); }
.detail-close { border: 0; background: #eef3f9; color: var(--p); border-radius: 8px; padding: 8px 12px; }
.detail-section { background: #f8fafc; border-radius: 10px; padding: 12px; margin: 16px 0; }
.detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 13px; }
.detail-row span:first-child { color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.photo-item img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; background: #eef2f7; }
.photo-item div { font-size: 12px; color: var(--muted); text-align: center; margin-top: 4px; }
.log-line { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f0f2f5; font-size: 12px; }
.review-box { background: #fff8e1; border-radius: 8px; padding: 12px; font-size: 13px; }
