/* 后台皮肤 A：layuiAdmin 观感（不改架构）
   主色 #009688 · 深色侧栏 · 浅色内容区 */
:root {
  --primary: #009688;
  --primary-hover: #33aba0;
  --primary-active: #00867a;
  --primary-bg: #e8f5f3;
  --primary-border: #9fd5cf;

  --success: #5FB878;
  --success-bg: #f0f9eb;
  --success-border: #c2e7b0;
  --warning: #FFB800;
  --warning-bg: #fff8e6;
  --warning-border: #ffe6a0;
  --error: #FF5722;
  --error-bg: #fff2ee;
  --error-border: #ffc6b3;

  --text: #333;
  --text-2: #666;
  --muted: #999;
  --heading: #333;

  --border: #e6e6e6;
  --split: #f0f0f0;
  --hairline: #eee;
  --bg-layout: #f2f2f2;
  --bg-container: #fff;
  --bg-hover: rgba(0,0,0,.03);
  --header-bg: #fff;
  --side-bg: #20222A;
  --side-text: rgba(255,255,255,.7);
  --side-text-on: #fff;
  --side-group: rgba(255,255,255,.35);

  --radius: 2px;
  --radius-sm: 2px;
  --shadow-card: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow-hover: 0 2px 8px rgba(0,0,0,.08);
  --shadow-pop: 0 2px 12px rgba(0,0,0,.12);
  --ring: 0 0 0 3px rgba(0,150,136,.12);
  --ease: .15s ease;

  --bg: var(--bg-layout);
  --bg2: var(--bg-container);
  --panel: var(--bg-container);
  --line: var(--split);
  --accent: var(--primary);
  --coruna: var(--primary);
  --ds: var(--success);
  --warn: var(--warning);
  --danger: var(--error);
  --ok: var(--success);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg-layout); color: var(--text);
  font: 14px/1.6 "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::selection { background: rgba(0,150,136,.18); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c2c2c2; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ---------- 布局：左侧栏 + 右侧顶栏/内容（贴近 layuiAdmin） ---------- */
.layout { display: flex; flex-direction: column; min-height: 100vh; }
.body-row { display: flex; flex: 1; min-height: 100vh; min-height: 0; }
.side {
  width: 220px; background: var(--side-bg); border-right: 0;
  padding: 0 0 24px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; overflow-x: hidden; flex: 0 0 220px;
  transition: width .2s ease, flex-basis .2s ease;
  z-index: 30;
}
.side-brand {
  height: 50px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; color: #fff; font-size: 15px; font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,.06); white-space: nowrap;
}
.side-brand .logo {
  width: 28px; height: 28px; border-radius: 2px; color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  background: var(--primary); flex: 0 0 28px;
}
.side-brand small { color: rgba(255,255,255,.45); font-weight: 400; font-size: 12px; margin-left: 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: var(--side-text);
  padding: 0 16px 0 20px; height: 40px; line-height: 40px; margin: 0;
  border-radius: 0; text-decoration: none; position: relative; font-size: 14px;
  transition: background var(--ease), color var(--ease);
  white-space: nowrap; overflow: hidden;
}
.nav a:hover { color: var(--side-text-on); background: rgba(255,255,255,.05); }
.nav a.on { color: var(--side-text-on); background: var(--primary) !important; font-weight: 400; }
.nav a.on::after { display: none; }
.nav a .layui-icon { width: 18px; flex: 0 0 18px; text-align: center; font-size: 16px; opacity: .9; }
.nav a.on .layui-icon { opacity: 1; }
.nav .nav-text { overflow: hidden; text-overflow: ellipsis; }
.nav .nav-group {
  color: var(--side-group); font-size: 12px; font-weight: 400;
  padding: 16px 20px 6px; letter-spacing: .5px; white-space: nowrap; overflow: hidden;
}

.content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-layout); }
.topbar {
  height: 50px; background: var(--header-bg); color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { font-size: 15px; font-weight: 500; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-side-fold {
  width: 34px; height: 34px; padding: 0; border-radius: 2px;
  color: var(--text-2); border-color: transparent !important; background: transparent !important;
}
.btn-side-fold:hover { color: var(--primary) !important; background: var(--primary-bg) !important; }
.btn-side-fold .layui-icon { font-size: 18px; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-2); }
.topbar-right a { color: var(--text-2); }
.topbar-right a:hover { color: var(--primary); }
.topbar-right .top-user { color: var(--text); display: inline-flex; align-items: center; gap: 7px; }
.topbar-right .top-user::before {
  content: ""; width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary-bg); border: 1px solid var(--primary-border);
}

/* 折叠侧栏 */
.layout.side-folded .side { width: 60px; flex-basis: 60px; }
.layout.side-folded .side-brand { padding: 0; justify-content: center; }
.layout.side-folded .side-brand .nav-text,
.layout.side-folded .nav .nav-text,
.layout.side-folded .nav .nav-group { display: none; }
.layout.side-folded .nav a { padding: 0; justify-content: center; }
.layout.side-folded .nav a .layui-icon { margin: 0; font-size: 18px; }

.brand { display: none; } /* 旧顶栏品牌占位兼容 */

.main { flex: 1; min-width: 0; padding: 15px; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; gap: 12px; }
.top h1 {
  font-size: 16px; margin: 0; font-weight: 500; color: var(--heading); line-height: 1.4;
  padding-left: 10px; border-left: 4px solid var(--primary);
}
.top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn-mnemonic-reveal { font-size: 12px; padding: 0 12px; height: 30px; }
.muted { color: var(--muted); }
.user { color: var(--muted); font-size: 13px; }
.user a { margin-left: 12px; color: var(--text-2); }
.user a:hover { color: var(--primary); }

/* ---------- 卡片 / 表单 / 按钮 ---------- */
.card {
  background: var(--bg-container); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 15px; margin-bottom: 15px;
  box-shadow: var(--shadow-card);
}
.card > h3:first-child { font-size: 14px; font-weight: 600; color: var(--heading); margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--split); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--split); }
.card-head h3 { font-size: 14px; font-weight: 600; color: var(--heading); margin: 0; }
.card-head-ico { width: 26px; height: 26px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; background: var(--primary-bg); color: var(--primary); flex: 0 0 26px; }
.card-head-ico svg { width: 15px; height: 15px; }
.card-head-more { margin-left: auto; font-size: 13px; color: var(--muted); }
.card-head-more:hover { color: var(--primary); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  background: var(--bg-container); color: var(--text); border: 1px solid #e6e6e6;
  border-radius: var(--radius-sm); padding: 6px 10px; min-height: 32px; outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
textarea { min-height: auto; }
input::placeholder, textarea::placeholder { color: #ccc; }
input:hover, select:hover, textarea:hover { border-color: #d2d2d2; }
input:focus, select:focus, textarea:focus { border-color: var(--primary) !important; box-shadow: var(--ring); }
label { color: var(--text-2); }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 100%; min-width: 0; }
.field > span { font-size: 13px; color: var(--text-2); }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; }
.callout { border: 1px solid var(--warning-border); background: var(--warning-bg); color: var(--text); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 32px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--primary); color: #fff; cursor: pointer; white-space: nowrap;
  transition: all var(--ease); font-size: 13px; line-height: 1;
}
button:hover, .btn:hover { background: var(--primary-hover); color: #fff; opacity: .95; }
button:active, .btn:active { background: var(--primary-active); }
button.primary, .btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 400; box-shadow: none; }
button.primary:hover, .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; box-shadow: none; }
button.primary:active, .btn.primary:active { background: var(--primary-active); border-color: var(--primary-active); }
button.ghost, .btn.ghost { background: #fff; color: var(--text); border: 1px solid #d2d2d2; }
button.ghost:hover, .btn.ghost:hover { border-color: var(--primary); color: var(--primary); background: #fff; }
button.danger, .btn.danger { background: var(--error); color: #fff; border-color: var(--error); }
button.danger:hover, .btn.danger:hover { background: #ff704d; border-color: #ff704d; color: #fff; }
.table .btn.danger { padding: 0 8px; font-size: 12px; height: 26px; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--bg-container); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--split); vertical-align: middle; }
.table th { color: #666; font-weight: 600; font-size: 13px; background: #f2f2f2; white-space: nowrap; border-bottom: 1px solid #e6e6e6; }
.table th:first-child, .table td:first-child { padding-left: 12px; }
.table th:last-child, .table td:last-child { padding-right: 12px; }
.table tbody tr { transition: background var(--ease); }
.table tr:hover td { background: #f8f8f8; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table code { font-size: 12px; color: var(--text-2); }

/* ---------- Tag ---------- */
.badge { display: inline-block; padding: 0 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; line-height: 20px; border: 1px solid transparent; white-space: nowrap; }
.badge.coruna { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-border); }
.badge.darksword { background: var(--success-bg); color: #5FB878; border-color: var(--success-border); }
.badge.on { background: var(--success-bg); color: #5FB878; border-color: var(--success-border); }
.badge.off { background: #fafafa; color: var(--text-2); border-color: #e6e6e6; }
.badge.pending { background: var(--warning-bg); color: #E6A23C; border-color: var(--warning-border); }
.badge.pl { background: var(--warning-bg); color: #E6A23C; border-color: var(--warning-border); }
.badge.combo { background: #f9f0ff; color: #722ed1; border-color: #d3adf7; }
.badge.sent { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-border); }
.badge.done { background: var(--success-bg); color: #5FB878; border-color: var(--success-border); }
.badge.likely { background: var(--error-bg); color: var(--error); border-color: var(--error-border); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 15px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 0 16px; height: 40px; line-height: 40px; color: var(--text); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--primary); }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* ---------- 描述列表 / 分页 ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; }
.kv b { color: var(--muted); font-weight: 400; }
.pager { margin-top: 15px; color: var(--muted); }
.pager a { margin-right: 8px; }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 15px 0 0; flex-wrap: wrap; }
.pagination li a, .pagination li span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid #e6e6e6;
  border-radius: var(--radius-sm); color: var(--text); background: #fff;
}
.pagination li a:hover { border-color: var(--primary); color: var(--primary); }
.pagination li.active span { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 500; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 15px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stat-grid { grid-template-columns: minmax(0, 1fr); } }
.stat-card {
  position: relative; overflow: hidden; background: var(--bg-container);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-card); transition: box-shadow var(--ease), border-color var(--ease);
}
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.stat-card:hover { box-shadow: var(--shadow-hover); border-color: var(--primary-border); }
.stat-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.stat-ico { width: 30px; height: 30px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; background: #f6f6f6; color: var(--text-2); flex: 0 0 30px; }
.stat-ico svg { width: 16px; height: 16px; }
.stat-card .stat-title { color: var(--muted); font-size: 13px; font-weight: 400; }
.stat-card .stat-value { font-size: 28px; line-height: 1.15; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat-card .stat-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--split); font-size: 12px; color: var(--muted); }
.stat-card .stat-value small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat-card.accent .stat-value { color: var(--primary); }
.stat-card.accent::before { background: var(--primary); }
.stat-card.accent .stat-ico { background: var(--primary-bg); color: var(--primary); }
.stat-card.ok .stat-value { color: #5FB878; }
.stat-card.ok::before { background: var(--success); }
.stat-card.ok .stat-ico { background: var(--success-bg); color: #5FB878; }
.stat-card.warn .stat-value { color: #E6A23C; }
.stat-card.warn::before { background: var(--warning); }
.stat-card.warn .stat-ico { background: var(--warning-bg); color: #E6A23C; }
.stat-card.err .stat-value { color: var(--error); }
.stat-card.err::before { background: var(--error); }
.stat-card.err .stat-ico { background: var(--error-bg); color: var(--error); }

/* ---------- 相册 ---------- */
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.photo-item { background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.photo-thumb { position: relative; display: block; }
.photo-scan-badge { position: absolute; top: 8px; right: 8px; z-index: 2; font-size: 11px; padding: 1px 7px; box-shadow: 0 1px 4px rgba(0,0,0,.15); pointer-events: none; }
.photo-item img { width: 100%; height: 160px; object-fit: cover; display: block; }
.photo-meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.photo-meta code { font-size: 11px; word-break: break-all; color: var(--text-2); }
.photo-cell { display: flex; flex-direction: column; gap: 4px; }
.photo-cell .btn-del-photo, .photo-meta .btn-del-photo { padding: 0 10px; font-size: 12px; height: 26px; align-self: stretch; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photos a { display: block; background: var(--bg-container); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.photos .photo-thumb { position: relative; }
.photos img { width: 100%; height: 140px; object-fit: cover; display: block; }

/* ---------- 备忘录 ---------- */
.note-list-tg { display: flex; flex-direction: column; gap: 2px; }
.note-row-tg { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); color: inherit; border: 1px solid var(--border); background: var(--bg-container); margin-bottom: 8px; }
.note-row-tg:hover { border-color: var(--primary-border); }
.note-row-device a { text-decoration: none; }
.note-row-device a:hover code { color: var(--primary); }
.note-row-meta .btn.ghost { padding: 0 10px; font-size: 12px; white-space: nowrap; height: 26px; }
.note-detail-block p { margin: 0 0 10px; text-align: left; }
.note-detail-body { max-height: 420px; text-align: left; margin: 0; }
.note-row-device { flex: 0 0 auto; max-width: 28%; }
.note-row-device code { font-size: 11px; word-break: break-all; }
.note-row-main { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.note-row-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.note-item { background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }

/* ---------- 密钥 ---------- */
.secret { background: #fafafa; border: 1px solid var(--split); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.secret code { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; color: #cf1322; font-size: 12px; }
.secret-cell { min-width: 280px; max-width: 560px; }
.wallet-group h3 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wallet-pair { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 6px; margin-bottom: 16px; background: #fafafa; }
.wallet-pair .secret { margin-bottom: 10px; }
.wallet-pair .wallet-fold { margin-top: 0; }
.wallet-fold { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 10px 0; background: var(--bg-container); }
.wallet-fold summary { cursor: pointer; padding: 10px 12px; color: var(--text); list-style: none; display: flex; gap: 8px; align-items: center; }
.wallet-fold summary::-webkit-details-marker { display: none; }
.wallet-fold summary::before { content: "▸"; color: var(--muted); }
.wallet-fold[open] summary::before { content: "▾"; }
.wallet-fold .table { margin: 0 12px 12px; width: calc(100% - 24px); }

/* ---------- 推广链接 ---------- */
.promo-link-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.promo-url { display: block; font-size: 12px; line-height: 1.6; word-break: break-all; color: var(--text-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.promo-link-actions .btn.ghost { padding: 0 11px; font-size: 12px; height: 28px; }
.promo-iframe-wrap { margin-top: 10px; max-width: 560px; }
.promo-iframe-snippet { display: block; font-size: 11px; line-height: 1.5; word-break: break-all; white-space: pre-wrap; padding: 10px 12px; background: #fafafa; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text-2); }
button.btn-toggle-iframe.on { border-color: var(--primary); color: var(--primary); }

/* ---------- 设备详情：命令 ---------- */
.cmd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.apps-all { display: none; margin-top: 12px; }
.apps-all.show { display: block; }
.tg-inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #393D49 url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-box {
  width: 380px; background: #fff; border: 0; border-radius: 2px;
  padding: 35px 30px 30px; box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.login-box h1 { margin: 0 0 8px; font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; color: var(--heading); justify-content: center; }
.login-box h1 .logo {
  width: 34px; height: 34px; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff; background: var(--primary);
}
.login-box > p { margin: 0 0 24px; color: var(--muted); text-align: center; font-size: 13px; }
.login-box label { display: block; margin: 14px 0 6px; color: var(--text-2); font-size: 13px; }
.login-box input { width: 100%; height: 40px; padding: 8px 12px; border-radius: var(--radius-sm); }
.login-box button {
  width: 100%; margin-top: 24px; height: 40px; background: var(--primary); color: #fff;
  border-color: var(--primary); font-size: 15px; border-radius: var(--radius-sm); box-shadow: none;
}
.login-box button:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.login-foot { color: rgba(255,255,255,.45); font-size: 12px; margin-top: 24px; }

.err { color: var(--error); margin: 0 0 12px; }
.ok { color: #5FB878; }

/* ---------- SweetAlert2 ---------- */
.swal2-popup.adm-swal { background: var(--bg-container); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.swal2-popup.adm-swal .swal2-title { color: var(--heading); font-size: 16px; font-weight: 600; }
.swal2-popup.adm-swal .swal2-html-container { color: var(--text-2); }
.swal2-popup.adm-swal .swal2-actions { gap: 8px; }
.swal-json {
  max-height: 70vh; overflow: auto; text-align: left;
  white-space: pre-wrap; word-break: break-word;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #fafafa; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 0; color: var(--text);
}
.swal-json .jk { color: var(--primary); }
.swal-json .js { color: #5FB878; }
.swal-json .jn { color: #E6A23C; }
.swal-json .jl { color: #FF5722; }



/* ===== layui3 overrides: accordion + visible fold ===== */

/* 手风琴菜单 */
.nav { list-style: none; margin: 0; padding: 8px 0 24px; }
.nav .nav-item { margin: 0; }
.nav .nav-title {
  display: flex; align-items: center; gap: 10px; color: var(--side-text);
  padding: 0 16px 0 20px; height: 40px; line-height: 40px; cursor: pointer;
  text-decoration: none; white-space: nowrap; overflow: hidden;
  transition: background var(--ease), color var(--ease); user-select: none;
}
.nav .nav-title:hover { color: var(--side-text-on); background: rgba(255,255,255,.05); }
.nav .nav-title .layui-icon:first-child { width: 18px; flex: 0 0 18px; text-align: center; font-size: 16px; }
.nav .nav-arrow { margin-left: auto; font-size: 12px; opacity: .55; transition: transform .2s ease; }
.nav .nav-item.open > .nav-title { color: var(--side-text-on); }
.nav .nav-item.open > .nav-title .nav-arrow { transform: rotate(180deg); opacity: .9; }
.nav .nav-child {
  display: none; list-style: none; margin: 0; padding: 0 0 6px;
  background: rgba(0,0,0,.12);
}
.nav .nav-item.open > .nav-child { display: block; }
.nav .nav-child dd { margin: 0; }
.nav .nav-child a {
  display: flex; align-items: center; gap: 10px; color: var(--side-text);
  padding: 0 16px 0 48px; height: 36px; line-height: 36px; margin: 0;
  text-decoration: none; white-space: nowrap; overflow: hidden;
  transition: background var(--ease), color var(--ease);
}
.nav .nav-child a:hover { color: var(--side-text-on); background: rgba(255,255,255,.05); }
.nav .nav-child a.on { color: var(--side-text-on); background: var(--primary) !important; }
.nav .nav-child a .layui-icon { width: 16px; flex: 0 0 16px; text-align: center; font-size: 14px; opacity: .85; }
.nav .nav-text { overflow: hidden; text-overflow: ellipsis; }

/* 折叠按钮：纯图标 */
.btn-side-fold {
  display: inline-flex !important; align-items: center; justify-content: center;
  width: 34px; height: 34px; min-width: 34px; padding: 0 !important;
  border-radius: 2px; cursor: pointer;
  color: var(--text-2) !important; background: transparent !important;
  border: 1px solid transparent !important; box-shadow: none;
}
.btn-side-fold:hover { color: var(--primary) !important; background: var(--primary-bg) !important; }
.btn-side-fold .layui-icon { font-size: 18px; color: inherit; }
.btn-side-fold .fold-fallback { display: none; font-size: 18px; line-height: 1; }
.btn-side-fold.no-iconfont .layui-icon { display: none; }
.btn-side-fold.no-iconfont .fold-fallback { display: inline; }

.layout.side-folded .nav .nav-title { padding: 0; justify-content: center; }
.layout.side-folded .nav .nav-title .nav-text,
.layout.side-folded .nav .nav-title .nav-arrow,
.layout.side-folded .nav .nav-child .nav-text { display: none; }
.layout.side-folded .nav .nav-child a { padding: 0; justify-content: center; }
.layout.side-folded .nav .nav-item.open > .nav-child { display: block; }
.layout.side-folded .side-brand .nav-text { display: none; }

@media (max-width: 900px) {
  .body-row { display: block; }
  .side { width: 100%; height: auto; position: relative; top: 0; flex: none; border-right: 0; border-bottom: 1px solid var(--border); }
  .layout.side-folded .side { width: 100%; flex-basis: auto; }
  .layout.side-folded .side-brand .nav-text,
  .layout.side-folded .nav .nav-text,
  .layout.side-folded .nav .nav-group { display: inline; }
  .layout.side-folded .nav a { padding: 0 16px 0 20px; justify-content: flex-start; }
  .nav { display: flex; flex-wrap: wrap; }
  .nav a { height: 36px; line-height: 36px; }
  .cmd-grid { grid-template-columns: 1fr; }
  .main { padding: 12px; }
  .side-brand { width: auto; }
}



/* ===== fold fix layui6: checkbox + class ===== */
.side-fold-check {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}
#adm-layout > .side-fold-check:checked ~ .body-row > .side,
#adm-layout.side-folded > .body-row > .side {
  width: 60px !important;
  flex: 0 0 60px !important;
  max-width: 60px !important;
  min-width: 60px !important;
}
#adm-layout > .side-fold-check:checked ~ .body-row > .side .side-brand,
#adm-layout.side-folded > .body-row > .side .side-brand {
  padding: 0 !important; justify-content: center !important;
}
#adm-layout > .side-fold-check:checked ~ .body-row > .side .nav-text,
#adm-layout > .side-fold-check:checked ~ .body-row > .side .nav-arrow,
#adm-layout.side-folded > .body-row > .side .nav-text,
#adm-layout.side-folded > .body-row > .side .nav-arrow {
  display: none !important;
}
#adm-layout > .side-fold-check:checked ~ .body-row > .side .nav-title,
#adm-layout > .side-fold-check:checked ~ .body-row > .side .nav-child a,
#adm-layout.side-folded > .body-row > .side .nav-title,
#adm-layout.side-folded > .body-row > .side .nav-child a {
  padding-left: 0 !important;
  padding-right: 0 !important;
  justify-content: center !important;
}
#btn-side-fold {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 100;
  margin: 0;
}
#btn-side-fold .fold-fallback { display: none; }
