:root {
  --brand: #0f95fb;
  --brand-dark: #007ad3;
  --bg: #eef1f5;
  --card: #fff;
  --text: #1f2329;
  --muted: #7a8b97;
  --line: #e3e8ee;
  --danger: #e34d59;
  --ok: #00a870;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}
.hidden { display: none !important; }
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.userbox { display: flex; align-items: center; gap: 10px; color: var(--muted); }
main { max-width: 1120px; margin: 0 auto; padding: 22px 18px 60px; }
.card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 18px;
}
.login-card { max-width: 380px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, textarea, select {
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
button {
  font: inherit;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
button:hover { border-color: var(--brand); color: var(--brand); }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-dark); color: #fff; }
button.ghost { border-color: transparent; color: var(--muted); }
button.danger { color: var(--danger); border-color: #f3c2c6; }
button:disabled { opacity: .55; cursor: not-allowed; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { background: transparent; border: none; padding: 8px 14px; border-radius: 8px; color: var(--muted); }
.tab.active { background: #fff; color: var(--brand); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.toolbar h2 { margin: 0; font-size: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.item {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; cursor: pointer; transition: .15s;
}
.item:hover { border-color: var(--brand); transform: translateY(-1px); }
.item h3 { margin: 0 0 6px; font-size: 15px; }
.muted { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; background: #eef4ff; color: var(--brand-dark); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { background: #f7f9fc; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stat { display: flex; gap: 20px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.stat b { font-size: 20px; color: var(--brand-dark); }
.qcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.qcard .bar { height: 6px; border-radius: 4px; background: #eef1f5; overflow: hidden; margin-top: 6px; }
.qcard .bar i { display: block; height: 100%; background: var(--ok); }
.modal { position: fixed; inset: 0; background: rgba(15,23,32,.45); z-index: 50; overflow: auto; padding: 5vh 16px; }
.modal-box { background: #fff; border-radius: 14px; padding: 18px; width: min(720px, 92vw); margin: 0 auto; }
.modal-box h3 { margin: 0 0 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1f2329; color: #fff; padding: 10px 16px; border-radius: 999px; z-index: 99;
}
.toast.err { background: var(--danger); }
.update-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: #1f2329; color: #fff; padding: 10px 14px; border-radius: 999px;
  z-index: 120; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.update-bar button { padding: 6px 14px; }
.thumb { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.scan-result { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
@media (max-width: 760px) { .scan-result { grid-template-columns: 1fr; } }
.scan-result img { width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: #eef1f5; color: var(--muted); }
.tag.ok { background: #e8f8f2; color: var(--ok); }
.tag.bad { background: #fdecee; color: var(--danger); }
