/* QQ Official Bot - admin stylesheet (unified theme) */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f4f6f9;
  color: #24292f;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 4px;
  padding: 1px 5px; font-size: 12px; color: #b91c1c; word-break: break-all;
}

/* ---------- top bar (wraps instead of overflowing) ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px 16px;
  background: #1f2937; color: #fff; padding: 10px 20px;
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand .sub { font-weight: 400; font-size: 12px; color: #9ca3af; margin-left: 8px; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.topbar nav a {
  color: #d1d5db; padding: 7px 11px; font-size: 14px; display: inline-block;
  border-radius: 6px; line-height: 1.5; transition: background .15s, color .15s;
}
.topbar nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.10); }
.topbar nav a.active {
  color: #fff; background: rgba(59,130,246,.22);
  box-shadow: inset 0 -2px 0 #3b82f6;
}
.topbar nav a.danger { color: #fca5a5; }
.topbar nav a.danger:hover { background: rgba(239,68,68,.18); color: #fff; }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 16px 60px; }
h1 { font-size: 22px; margin: 4px 0 18px; }
h2 { font-size: 16px; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid #eef0f3; }

/* ---------- collapsible skill cards (native <details>) ---------- */
.skill-card { padding: 0; overflow: hidden; }
.skill-card > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; font-size: 16px; font-weight: 700; color: #111827;
  transition: background .15s;
}
.skill-card > summary::-webkit-details-marker { display: none; }
.skill-card > summary:hover { background: #f8fafc; }
.skill-card > summary .skill-name::before {
  content: "▸"; display: inline-block; width: 18px; color: #3b82f6;
  transition: transform .18s; transform: translateY(-1px);
}
.skill-card[open] > summary .skill-name::before { content: "▾"; }
.skill-card > summary .skill-tip { font-size: 12px; font-weight: 400; color: #9ca3af; }
.skill-card[open] > summary { border-bottom: 1px solid #eef0f3; }
.skill-card[open] > summary .skill-tip { color: #6b7280; }
.skill-card > .skill-body { padding: 18px 22px 22px; }
.skill-card > .skill-body .hint:first-child { margin-top: 0; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.card-title { color: #6b7280; font-size: 13px; }
.card-value { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.card-note { color: #9ca3af; font-size: 12px; }

/* ---------- panels & forms (applies to every <form>, not only .form) ---------- */
.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px 22px; margin-bottom: 22px; }
form label {
  display: block; margin-bottom: 16px; font-weight: 600; color: #374151; font-size: 14px;
}
form input[type=text], form input[type=password], form input[type=number],
form input[type=url], form input[type=email], form input[type=search], form input[type=time],
form textarea, form select {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
  border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; font-weight: 400;
  background: #fff; color: #24292f; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
form textarea { resize: vertical; min-height: 80px; }
form input:focus, form textarea:focus, form select:focus {
  outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
form input[type=checkbox], form input[type=radio] {
  display: inline-block; width: 16px; height: 16px; margin: 0 6px 0 0;
  vertical-align: -3px; accent-color: #2563eb; cursor: pointer;
}
.hint { display: block; color: #6b7280; font-size: 12px; font-weight: 400; margin-top: 5px; line-height: 1.5; }
.form .row { display: flex; gap: 14px; flex-wrap: wrap; }
.form .row label { flex: 1; min-width: 160px; }
.check { font-weight: 500; }
.check.inline { display: inline-block; margin: 0 0 0 12px; font-weight: 400; color: #6b7280; }
.form .check input, form label input[type=checkbox] { margin-right: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 9px 20px; border: 1px solid #d1d5db; border-radius: 8px;
  background: #fff; color: #374151; font-size: 14px; cursor: pointer;
  font-family: inherit; line-height: 1.4; transition: background .15s, border-color .15s;
}
.btn:hover { background: #f3f4f6; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { background: #fff; border-color: #fca5a5; color: #b91c1c; }
.btn.danger:hover { background: #fee2e2; }
.btn.small { padding: 5px 12px; font-size: 13px; }

/* ---------- tables (.tbl = .list, both supported) ---------- */
.tbl, .list { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td, .list th, .list td {
  text-align: left; padding: 9px 10px; border-bottom: 1px solid #eef0f3;
  vertical-align: top; word-break: break-word;
}
.tbl th, .list th { color: #6b7280; font-weight: 600; background: #fafbfc; white-space: nowrap; }
.tbl tr:hover td, .list tr:hover td { background: #f9fafb; }
.tbl td code, .list td code { white-space: nowrap; }
.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv th, .kv td { padding: 9px 10px; border-bottom: 1px solid #eef0f3; text-align: left; vertical-align: top; }
.kv th { width: 220px; min-width: 140px; color: #6b7280; font-weight: 600; }
.cell-content { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-msg { font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.dim { color: #9ca3af; }

/* ---------- badges & states ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #e5e7eb; color: #374151; }
.lv-debug { background: #e0e7ff; color: #3730a3; }
.lv-info { background: #dbeafe; color: #1e40af; }
.lv-warn { background: #fef3c7; color: #92400e; }
.lv-error { background: #fee2e2; color: #991b1b; }
.ok-text { color: #059669; font-weight: 600; }
.warn-text { color: #d97706; }

/* ---------- flashes ---------- */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; line-height: 1.6; }
.flash.ok { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.flash.err, .flash.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash.warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---------- auth pages ---------- */
.auth-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
}
.auth-card {
  width: 100%; max-width: 400px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 30px; box-shadow: 0 6px 24px rgba(0,0,0,.06);
}
.auth-card h1 { margin: 0 0 8px; font-size: 20px; }
.auth-card .muted { margin-top: 0; }
.auth-card label { display: block; margin-bottom: 14px; font-weight: 600; color: #374151; }
.auth-card input[type=text], .auth-card input[type=password] {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
  border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;
}
.auth-card .btn { width: 100%; margin-top: 8px; }
.muted { color: #6b7280; font-size: 13px; }

/* ---------- pager / inline filters ---------- */
.pager { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-size: 13px; }
.inline-form { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-form select, .inline-form input[type=text] {
  padding: 7px 10px; border-radius: 8px; border: 1px solid #d1d5db; font-size: 13px;
  background: #fff; color: #24292f; font-family: inherit;
}
.inline-form select:focus, .inline-form input:focus {
  outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
.inline-form label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: 13px; }

.foot { text-align: center; color: #9ca3af; font-size: 12px; padding: 20px; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .brand .sub { display: none; }
  .topbar { padding: 8px 12px; }
  .container { padding: 16px 10px 48px; }
  .panel { padding: 16px; }
  .kv th { width: 120px; min-width: 100px; }
  .panel > table { display: block; overflow-x: auto; white-space: nowrap; }
}
