/* beebot Cloud 共享样式：控制台与管理后台共用。明暗自适应。 */

:root {
  --bg: #f6f6f3; --surface: #fff; --surface-2: #f1f0ec; --line: #e6e4de;
  --text: #1b1b19; --muted: #85817a; --accent: #f2a900; --accent-ink: #1c1400; --accent-soft: #fff4d6;
  --ok: #1f9d55; --warn: #c97a06; --danger: #d93b3b; --info: #2f6fdf;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f10; --surface: #18181a; --surface-2: #222225; --line: #2c2c30;
    --text: #f1f0ec; --muted: #8e8b85; --accent-soft: #2b2208;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 26px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
       -webkit-font-smoothing: antialiased; }
a { color: var(--info); text-decoration: none; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.3; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .right { text-align: right; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .danger { color: var(--danger); }

/* 布局 */
.shell { display: flex; min-height: 100vh; }
.side { width: 220px; flex: none; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px;
        position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; font-size: 16px; padding: 4px 10px 18px; display: flex; gap: 8px; align-items: center; }
.nav-group { font-size: 12px; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--text); }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--accent-soft); font-weight: 600; }
.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.topbar .spacer { flex: 1; }
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; display: flex; overflow-x: auto; padding: 8px; gap: 4px; }
  .brand, .nav-group { display: none; }
  .nav { display: flex; gap: 4px; } .nav a { white-space: nowrap; }
  .main { padding: 16px; }
}

/* 组件 */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat .label { color: var(--muted); font-size: 12.5px; } .stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px;
       padding: 7px 14px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.danger { color: var(--danger); } .btn.sm { padding: 3px 10px; font-size: 12.5px; }
.btn.link { border: 0; background: none; color: var(--info); padding: 0 4px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.badge.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge.info { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); }

.input, select.input, textarea.input { width: 100%; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; outline: none; }
.input:focus { border-color: var(--accent); }
.field { margin-bottom: 12px; } .field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters .input { width: auto; min-width: 140px; }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; } .t tr.click:hover td { background: var(--surface-2); }
.empty { text-align: center; color: var(--muted); padding: 36px 10px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; }

/* 弹窗与提示 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); width: min(520px, 100%);
          max-height: 90vh; overflow-y: auto; padding: 20px 22px; }
.dialog.wide { width: min(860px, 100%); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.toast { position: fixed; left: 50%; top: 20px; transform: translate(-50%, -20px); opacity: 0; transition: .25s; z-index: 99;
         background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px; box-shadow: var(--shadow); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.ok { background: var(--ok); color: #fff; } .toast.err { background: var(--danger); color: #fff; }

/* 登录页 */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: min(380px, 100%); padding: 28px; }
.auth h1 { text-align: center; } .auth .sub { text-align: center; color: var(--muted); margin: -4px 0 20px; }
.qr svg { width: 200px; height: 200px; background: #fff; border-radius: 10px; padding: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-all; }
.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bar-chart i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 1px; }
