/* ============================================================
   iOS 无感系统 · 浅色卡片版
   —— 只换皮，不动任何交互逻辑
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --bg-deep: #eef1f8;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --line: #e6eaf2;
  --line-strong: #d8deeb;
  --text: #101828;
  --text-2: #344054;
  --muted: #7b8496;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef0ff;
  --ok: #059669;
  --ok-soft: #e7f8f1;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --danger: #e11d48;
  --danger-soft: #fdeef1;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 12px 28px -18px rgba(16, 24, 40, .28);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(1100px 420px at 12% -8%, #e9ecff 0%, rgba(233, 236, 255, 0) 62%),
    radial-gradient(900px 380px at 92% -12%, #e6f7f4 0%, rgba(230, 247, 244, 0) 58%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }

code, .mono {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  letter-spacing: -.1px;
}

/* ---------------- 顶栏 ---------------- */
.layout { display: block; }

.side {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 26px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .2px;
  color: var(--text);
  border-bottom: 1px solid #f0f2f8;
}

.brand::before {
  content: "i";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 14px -6px rgba(79, 70, 229, .8);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand span {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 4px;
  padding: 10px 22px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: background .16s, color .16s, box-shadow .16s;
}
.nav a:hover { background: #f1f3fa; color: var(--text); }
.nav a.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9);
}

/* ---------------- 主体 ---------------- */
.main {
  max-width: 1340px;
  margin: 0 auto;
  padding: 22px 26px 64px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 4px 0 18px;
}

.top h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -.4px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.user a {
  padding: 4px 11px;
  border-radius: 999px;
  background: #f3f5fa;
  color: var(--muted);
  font-size: 12.5px;
}
.user a:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card > h3 { font-size: 14.5px; font-weight: 620; }

/* ---------------- 表单 ---------------- */
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}

input[type=text],
input[type=password],
input[type=search],
select,
textarea {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
input::placeholder { color: #a6aebf; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(79, 70, 229, .13);
}
select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237b8496' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 13.5px;
  font-weight: 560;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 8px 18px -12px rgba(79, 70, 229, .95);
  transition: transform .12s, filter .15s, background .15s, box-shadow .15s;
}
button:hover, .btn:hover { filter: brightness(1.06); }
button:active, .btn:active { transform: translateY(1px); }

.btn.ghost {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.btn.ghost:hover { background: #f7f8fc; filter: none; }
.btn.ghost.on {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: #d5d8ff;
}

.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f7d4dc;
  box-shadow: none;
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}
.btn.danger:hover { background: #fbe2e8; filter: none; }

.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-copy-link, .btn-copy-iframe, .btn-toggle-iframe {
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: none;
}
.btn-copy-link:hover, .btn-copy-iframe:hover, .btn-toggle-iframe:hover {
  background: #f7f8fc;
  filter: none;
}
.btn-toggle-iframe.on { background: var(--brand-soft); color: var(--brand); border-color: #d5d8ff; }

.grow { flex: 1 1 auto; }

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1px;
  background: #f1f3f9;
  color: var(--muted);
  white-space: nowrap;
}
.badge.coruna { background: var(--brand-soft); color: #4338ca; }
.badge.darksword { background: var(--warn-soft); color: var(--warn); }
.badge.on { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: #f1f3f9; color: #98a1b3; }
.badge.likely { background: var(--danger-soft); color: var(--danger); }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.pending { background: #f1f3f9; color: #98a1b3; }
.badge.on::before,
.badge.off::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: 5px;
  background: currentColor;
}

/* ---------------- 表格 ---------------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 620;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f3f9;
  color: var(--text-2);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbff; }

.table td code,
.table td .mono {
  color: #3b3f4d;
  background: #f5f6fa;
  border: 1px solid #eceef5;
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}

.table a code:hover { border-color: #cfd3ff; color: var(--brand); }

/* ---------------- 文本 ---------------- */
.muted { color: var(--muted); font-size: 12.5px; }
.err {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #f7d4dc;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
}
.ok {
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid #c9ecdd;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
}

.pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
  max-height: 420px;
  overflow: auto;
}

.kv {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 8px 14px;
  font-size: 13px;
}
.kv b { color: var(--muted); font-weight: 520; }

/* ---------------- 分页 ---------------- */
.pager {
  display: flex;
  justify-content: center;
  padding: 16px 0 4px;
}
.pager .pagination,
.pagination {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.pagination li a,
.pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.pagination li a:hover { border-color: #cfd3ff; color: var(--brand); }
.pagination li.active span {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
}
.pagination li.disabled span { color: #b9c0cd; background: var(--surface-2); }

/* ---------------- 密钥块 ---------------- */
.secret {
  font-size: 12.5px;
  line-height: 1.75;
  background: #fbfbfe;
  border: 1px dashed #e2e5f2;
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--text-2);
}
.secret code {
  background: transparent;
  border: 0;
  padding: 0;
  color: #33384a;
  word-break: break-all;
}
.secret-cell { max-width: 520px; }

/* ---------------- 密钥表：固定列宽，长助记词折行不撑破表格 ---------------- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll > .table { min-width: 880px; }

.table-secrets { table-layout: fixed; }
.table-secrets th,
.table-secrets td { overflow: hidden; }

/* 列宽合计 100%：UUID / 类型 / 钱包 / 密钥类型 / 内容 / 来源 / 时间 */
.table-secrets th:nth-child(1) { width: 23%; }
.table-secrets th:nth-child(2) { width: 8%; }
.table-secrets th:nth-child(3) { width: 10%; }
.table-secrets th:nth-child(4) { width: 8%; }
.table-secrets th:nth-child(5) { width: 29%; }
.table-secrets th:nth-child(6) { width: 9%; }
.table-secrets th:nth-child(7) { width: 13%; }

/* UUID 太长就省略号，不再把整列顶宽 */
.table-secrets td:nth-child(1) code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  letter-spacing: -.2px;
}

/* 时间单行不折 */
.table-secrets td:nth-child(7) { white-space: nowrap; }

/* 助记词/私钥：允许换行，最多显示 3 行 */
.table-secrets .secret-cell { max-width: none; }
.table-secrets .secret { padding: 6px 9px; }
.table-secrets .secret code {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-all;
  line-height: 1.65;
}

/* ---------------- 钱包表：同上，密钥列折行不撑破卡片 ---------------- */
.table-wallets { table-layout: fixed; }
.table-wallets th,
.table-wallets td { overflow: hidden; }

/* UUID / 类型 / 钱包 / 地址数 / 密钥 / 时间 */
.table-wallets th:nth-child(1) { width: 23%; }
.table-wallets th:nth-child(2) { width: 9%; }
.table-wallets th:nth-child(3) { width: 11%; }
.table-wallets th:nth-child(4) { width: 7%; }
.table-wallets th:nth-child(5) { width: 37%; }
.table-wallets th:nth-child(6) { width: 13%; }

.table-wallets td:nth-child(1) code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  letter-spacing: -.2px;
}
.table-wallets td:nth-child(6) { white-space: nowrap; }
.table-wallets .secret { padding: 6px 9px; }
.table-wallets .secret > div + div { margin-top: 4px; }
.table-wallets .secret code {
  white-space: normal;
  word-break: break-all;
  line-height: 1.65;
}

/* ---------------- 备忘录列表 ---------------- */
.note-list-tg { display: flex; flex-direction: column; }

.note-row-tg {
  display: grid;
  grid-template-columns: 250px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 11px 4px;
  border-bottom: 1px solid #f1f3f9;
}
.note-row-tg:last-child { border-bottom: 0; }
.note-row-tg:hover { background: #fafbff; }

.note-row-device a code { font-size: 12px; }
.note-row-main {
  color: var(--text-2);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-row-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.note-row-meta .btn.ghost {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}
.note-detail-block p { margin: 0 0 8px; font-size: 13px; }
.note-detail-body {
  max-height: 340px;
  background: #fafbfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", ui-monospace, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.75;
}

/* ---------------- 相册 ---------------- */
.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}

.photo-item {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .16s, box-shadow .16s;
}
.photo-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -16px rgba(16, 24, 40, .5);
}

.photo-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: #f1f3f9;
  overflow: hidden;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-scan-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-sm);
}
.photo-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px 11px;
  font-size: 12px;
}
.photo-meta code { font-size: 11.5px; }

/* ---------------- 设备详情 tabs ---------------- */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 16px;
}
.tabs a {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.tabs a:hover { background: #fff; color: var(--text); }
.tabs a.on {
  background: var(--surface);
  color: var(--brand);
  font-weight: 620;
  box-shadow: var(--shadow-sm);
}

/* ---------------- 命令面板 ---------------- */
.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

/* ---------------- 应用折叠 ---------------- */
.apps-all { display: none; }
.apps-all.show { display: block; }

/* ---------------- 推广 iframe 片段 ---------------- */
.promo-iframe-snippet {
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text-2);
  word-break: break-all;
  margin: 0;
}
.promo-iframe-wrap[hidden] { display: none; }
.promo-link-actions { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: 100%; }
.promo-url {
  display: inline-block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* ---------------- 钱包分组 ---------------- */
.wallet-group {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  margin-bottom: 10px;
  background: var(--surface);
}
.wallet-pair {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: 13px;
  padding: 4px 0;
}
.wallet-fold { margin-top: 6px; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  grid-template-rows: 1fr;
  background: var(--bg);
}

.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 56px 60px;
  color: #fff;
  background:
    radial-gradient(720px 420px at 18% 12%, rgba(255, 255, 255, .24), transparent 62%),
    radial-gradient(520px 320px at 82% 88%, rgba(255, 255, 255, .14), transparent 60%),
    linear-gradient(150deg, #4f46e5 0%, #6d28d9 48%, #9333ea 100%);
  min-height: 100%;
  overflow: hidden;
}
.login-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 40px solid rgba(255, 255, 255, .08);
}
.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  letter-spacing: 1.2px;
  opacity: .9;
}
.hero-brand::before {
  content: "i";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .92);
  color: var(--brand-2);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}
.login-hero h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -.6px;
}
.login-hero p {
  margin: 0;
  font-size: 13.5px;
  opacity: .82;
  max-width: 300px;
  line-height: 1.7;
}

.login-box {
  align-self: center;
  justify-self: center;
  width: min(380px, calc(100vw - 56px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 30px 30px;
  box-shadow: 0 24px 60px -30px rgba(16, 24, 40, .55);
  margin: 40px 0;
}
.login-box h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -.3px;
}
.login-box label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin: 14px 0 6px;
}
.login-box input { width: 100%; height: 42px; }
.login-box button { width: 100%; height: 44px; margin-top: 20px; font-size: 14px; }
.login-box p { margin: 0; }

/* ---------------- 图表 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity: .9;
}
.stat.s-ok::after { background: linear-gradient(90deg, #10b981, #059669); }
.stat.s-warn::after { background: linear-gradient(90deg, #f59e0b, #d97706); }
.stat.s-rose::after { background: linear-gradient(90deg, #fb7185, #e11d48); }

.stat .k {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.stat .v {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.8px;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.stat .d { font-size: 12px; color: var(--muted); }
.stat .d b { color: var(--ok); font-weight: 600; }

.chart-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}
.chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 12px;
}
.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.chart-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 620;
}
.chart-head .sub { font-size: 12px; color: var(--muted); }
.chart-body svg { display: block; width: 100%; height: auto; }

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 6px;
}

.empty-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .chart-grid, .chart-grid-2 { grid-template-columns: 1fr; }
}

/* 中等宽度下备忘录行改堆叠，避免 UUID 与正文互相挤 */
@media (max-width: 980px) {
  .note-row-tg { grid-template-columns: 1fr; gap: 6px; }
  .note-row-main { white-space: normal; }
}

@media (max-width: 720px) {
  .main { padding: 16px 14px 48px; }
  .brand { padding: 0 16px; }
  .nav { padding: 9px 12px 11px; }
  .top h1 { font-size: 19px; }
  .card { padding: 14px 14px; border-radius: 14px; }
  .table th, .table td { padding: 10px; }
  .note-row-tg { grid-template-columns: 1fr; gap: 6px; }
  .note-row-main { white-space: normal; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv b { margin-top: 8px; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* SweetAlert 亮色适配 */
.adm-swal { border-radius: 16px !important; }
.swal-json {
  max-height: 420px;
  overflow: auto;
  text-align: left;
  font-size: 12px;
  line-height: 1.7;
  background: #fafbfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.swal-json .jk { color: #7c3aed; }
.swal-json .js { color: #047857; }
.swal-json .jn { color: #b45309; }
.swal-json .jl { color: #2563eb; }
