/* 源码授权中心 · 后台与公开页样式（单文件，无外链） */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --mut: #64748b;
  --line: #e6eaf2;
  --brand: #3556d8;
  --brand-ink: #ffffff;
  --ok: #059669;
  --warn: #b45309;
  --err: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.3; }
h2 { font-size: 17px; }
code, .mono { font-family: ui-monospace, Consolas, "Courier New", monospace; }
.muted { color: var(--mut); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ---------- 外壳 ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: 0 0 232px; background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 6px 18px; }
.brand b { color: #fff; font-size: 15px; display: block; }
.brand small { color: #94a3b8; font-size: 11.5px; }
.logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand);
  color: #fff; display: grid; place-items: center; font-weight: 700;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  color: #cbd5e1; padding: 9px 12px; border-radius: 9px; font-size: 14px;
}
.nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav a.on { background: var(--brand); color: #fff; }
.side-foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: #94a3b8; padding: 12px 6px 4px; border-top: 1px solid rgba(255,255,255,.08);
}
.side-foot button {
  background: none; border: 1px solid rgba(255,255,255,.18); color: #cbd5e1;
  border-radius: 7px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.main { flex: 1; min-width: 0; padding: 20px 24px 60px; }
.topbar { margin-bottom: 16px; }
.topbar h1 { font-size: 20px; margin: 0; }

/* ---------- 公开页 ---------- */
.pub-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: #fff; border-bottom: 1px solid var(--line);
}
.pub-brand { font-weight: 700; color: var(--ink); font-size: 16px; }
.pub-top nav a { margin-left: 18px; color: var(--mut); font-size: 14px; }
.pub-main { max-width: 880px; margin: 0 auto; padding: 26px 18px 60px; }
.pub-foot { text-align: center; color: var(--mut); font-size: 12.5px; padding: 30px 0; }
.hero { padding: 18px 4px 6px; }
.hero h1 { font-size: 30px; margin: 0 0 8px; }
.hero-actions { margin: 16px 0 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.nums div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.nums b { display: block; font-size: 22px; }
.nums span { color: var(--mut); font-size: 12.5px; }
.notice {
  margin-top: 14px; background: #eef4ff; border: 1px solid #dbe4ff; color: #1e3a8a;
  border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px;
}
.steps { margin: 0; padding-left: 20px; color: #334155; }
.steps li { margin: 6px 0; }

/* ---------- 面板与表格 ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.panel.narrow { max-width: 640px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--mut); font-weight: 600; font-size: 12.5px; background: #fafbfe; }
.table tr:last-child td { border-bottom: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 20px; line-height: 1.4; word-break: break-all; }
.stat b.small { font-size: 15px; }
.stat span { color: var(--mut); font-size: 12.5px; }

/* ---------- 小件 ---------- */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px;
  background: #eef2f7; color: #475569; border: 1px solid #e2e8f0; white-space: nowrap;
}
.tag.ok { background: #ecfdf5; color: var(--ok); border-color: #a7f3d0; }
.tag.warn { background: #fffbeb; color: var(--warn); border-color: #fde68a; }
.tag.err { background: #fef2f2; color: var(--err); border-color: #fecaca; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #cbd5e1; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--err); border-color: #fecaca; background: #fff; }
.btn.small { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.alert { border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; border: 1px solid; }
.alert.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; margin: 10px 0 4px; }
.kv > div { border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.kv span { display: block; color: var(--mut); font-size: 12px; }
.kv b { font-size: 14px; word-break: break-all; }

.form { display: flex; flex-direction: column; gap: 12px; }
.form.inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.form label, .filters label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #334155; flex: 1; min-width: 160px; }
.form input, .form select, .form textarea, .filters input, .filters select, .inline-form input, .inline-form select {
  height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; color: var(--ink); background: #fff; outline: none; min-width: 0;
}
.form textarea { height: auto; padding: 9px 10px; resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus, .filters input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(53, 86, 216, .1); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 10px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px;
}
.chip.static { padding: 4px 12px; }
.chip button { border: 0; background: none; color: var(--err); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }

.pager { display: flex; gap: 6px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.pager a { min-width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--ink); }
.pager a.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.code, .code-area {
  background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px 14px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
}
.code-area { width: 100%; border: 1px solid var(--line); resize: vertical; }

.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card {
  width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 26px 26px 22px; box-shadow: var(--shadow);
}
.auth-card.wide { max-width: 700px; }
.auth-card h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card .btn { margin-top: 14px; }

@media (max-width: 860px) {
  .shell { display: block; }
  .side { width: auto; flex: none; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; overflow-x: auto; }
  .brand { padding: 0; }
  .brand div { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .main { padding: 16px 14px 50px; }
  .nums { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
}

/* 图形验证码 */
.cap-row { display: flex; gap: 10px; align-items: center; width: 100%; }
.cap-row input { flex: 1; min-width: 0; }
.cap-img {
  flex: none; width: 132px; height: 44px; border: 1px solid var(--line);
  border-radius: 9px; cursor: pointer; background: #f6f8fc; display: block;
  user-select: none; -webkit-user-select: none;
}
.cap-img:active { transform: scale(.99); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; font-weight: 400; }
.check-line { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #334155; }
.check-line span { display: flex; align-items: flex-start; gap: 8px; }
.check-line input[type="checkbox"] { width: 16px; height: 16px; margin-top: 1px; flex: none; accent-color: var(--brand); }
