/* CloudDL QQ 机器人管理系统 — 共用样式
   深色侧栏 + 单字方形图标 + 浅色内容区 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --ink: #1a2233;
  --ink-2: #354056;
  --muted: #707c90;
  --line: #e6eaf2;
  --line-soft: #eef1f7;
  --sidebar: #0f1724;
  --sidebar-2: #111c2c;
  --accent: #3d6bfa;
  --accent-2: #6f95ff;
  --accent-soft: #eaf0ff;
  --green: #159a55;
  --green-soft: #e7f7ee;
  --amber: #c47a0a;
  --amber-soft: #fdf3e3;
  --red: #d43c3c;
  --red-soft: #fdecec;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(21, 35, 60, 0.06);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

html,
body {
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* ---------- 布局 ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #c7d2e5;
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform 0.22s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 16px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(61, 107, 250, 0.35);
  flex: 0 0 auto;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.brand-name {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-sub {
  color: #71829c;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 16px;
}

.nav-group-title {
  color: #56657c;
  font-size: 10px;
  letter-spacing: 0.16em;
  padding: 16px 10px 8px;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #a8b5c9;
  font-size: 14px;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e9effb;
}

.nav-item.active {
  background: rgba(61, 107, 250, 0.16);
  color: #fff;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #5b8cff;
}

.icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  background: #1b283b;
  color: #9fb2cf;
  flex: 0 0 auto;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item.active .icon {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
}

.nav-item .badge {
  margin-left: auto;
  font-size: 11px;
  color: #8ea1bd;
  background: #1c2a3d;
  border-radius: 999px;
  padding: 1px 8px;
}

.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 16px 18px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #22314a;
  color: #cfe0ff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}

.user-name {
  color: #e8eefb;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  color: #6f8099;
  font-size: 11px;
}

.logout-btn {
  margin-left: auto;
  border: 0;
  background: #1b283b;
  color: #9fb2cf;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12px;
  cursor: pointer;
}

.logout-btn:hover {
  background: #24344c;
  color: #fff;
}

.main {
  margin-left: 238px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.input:disabled,
.select:disabled {
  background: #f3f5f9;
  color: #98a2b3;
  cursor: not-allowed;
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  background: #fff4e5;
  border-bottom: 1px solid #f5c26b;
  color: #7a4a00;
  font-size: 13px;
  font-weight: 600;
}

.impersonation-banner[hidden] {
  display: none;
}

.impersonation-who {
  margin-left: 6px;
  font-weight: 400;
  color: #9a6a1f;
}

.impersonation-exit {
  border: 1px solid #d99a2b;
  background: #fff;
  color: #7a4a00;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.impersonation-exit:hover {
  background: #ffefd1;
}

.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 18px;
  cursor: pointer;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.page-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  width: 100%;
  max-width: 1240px;
  padding: 26px 28px 56px;
  flex: 1;
}

/* ---------- 通用组件 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 0;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

.card-desc {
  font-size: 12px;
  color: var(--muted);
}

.card-body {
  padding: 18px 20px 20px;
}

.card-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.stat-value {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-top: 6px;
  line-height: 1.15;
}

.stat-hint {
  font-size: 11px;
  color: #93a0b4;
  margin-top: 5px;
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.stat.green .stat-dot {
  background: var(--green);
}

.stat.amber .stat-dot {
  background: var(--amber);
}

.stat.gray .stat-dot {
  background: #9aa6b8;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.grid-2 > *,
.stack > * {
  min-width: 0;
}

.main {
  min-width: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.between {
  justify-content: space-between;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  background: #eef1f7;
  color: #5c687c;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.online {
  background: var(--green-soft);
  color: var(--green);
}

.pill.offline {
  background: #eef1f7;
  color: #7c8798;
}

.pill.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.danger {
  background: var(--red-soft);
  color: var(--red);
}

.pill.plain::before {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
}

.btn.ghost:hover {
  background: #f7f9fd;
}

.btn.soft {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn.danger {
  background: #fff;
  border-color: #f1c9c9;
  color: var(--red);
}

.btn.danger:hover {
  background: var(--red-soft);
}

.btn.sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn.link {
  background: transparent;
  color: var(--accent);
  padding: 0 4px;
  height: auto;
}

.btn.link.danger-link {
  color: var(--red);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th {
  text-align: left;
  font-weight: 500;
  color: #8b96a9;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 11px 14px;
  background: #f8fafd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: middle;
}

table.data tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr:hover {
  background: #fafbfe;
}

table.data td.right {
  text-align: right;
  white-space: nowrap;
}

.empty {
  text-align: center;
  padding: 42px 20px;
  color: #8d99ab;
}

.empty-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: #f0f4fb;
  color: #a7b4c7;
  display: grid;
  place-items: center;
  font-size: 18px;
  margin: 0 auto 12px;
}

.empty-title {
  color: var(--ink-2);
  font-weight: 550;
  font-size: 14px;
}

.empty-desc {
  font-size: 12px;
  margin-top: 4px;
}

/* ---------- 表单 ---------- */
.field {
  margin-bottom: 15px;
}

.field label {
  display: block;
  font-size: 12px;
  color: #5f6b7e;
  margin-bottom: 6px;
  font-weight: 500;
}

.field .hint {
  font-size: 11px;
  color: #93a0b4;
  margin-top: 5px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid #dfe5ef;
  background: #fbfcfe;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #9ab6ff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(61, 107, 250, 0.1);
}

.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b96a9' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  user-select: none;
}

.switch input {
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d7dee9;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
  margin: 0;
  flex: 0 0 auto;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}

.switch input:checked {
  background: var(--accent);
}

.switch input:checked::after {
  transform: translateX(16px);
}

/* ---------- 登录页 ---------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}

.login-side {
  background: radial-gradient(1200px 600px at 10% 10%, #1d3154 0%, transparent 55%),
    linear-gradient(160deg, #0d1420 0%, #121e30 100%);
  color: #dfe8f7;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.login-side::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -140px;
  bottom: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 107, 250, 0.35) 0%, transparent 65%);
}

.login-side .brand {
  padding: 0;
}

.login-headline {
  font-size: 34px;
  line-height: 1.3;
  font-weight: 650;
  color: #fff;
  margin: 70px 0 14px;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.login-headline span {
  color: #7ea4ff;
}

.login-desc {
  color: #93a5c0;
  font-size: 14px;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-points {
  margin-top: 42px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.login-point {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 13px;
  color: #b9c7dc;
}

.login-point .dot {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(61, 107, 250, 0.2);
  color: #9dbcff;
  display: grid;
  place-items: center;
  font-size: 11px;
  flex: 0 0 auto;
}

.login-foot {
  margin-top: auto;
  color: #5e718e;
  font-size: 11px;
  position: relative;
  z-index: 1;
}

.login-main {
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: 100%;
  max-width: 384px;
}

.login-card h1 {
  font-size: 24px;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.login-card .sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 26px;
}

.login-error {
  display: none;
  background: var(--red-soft);
  color: #b33232;
  border: 1px solid #f4d3d3;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12px;
  margin-bottom: 14px;
}

.login-error.show {
  display: block;
}

.login-success {
  display: none;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #c9ecd8;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12px;
  margin-bottom: 14px;
}

.login-success.show {
  display: block;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
  font-size: 12px;
  color: var(--muted);
}

.auth-links a {
  color: var(--accent);
  font-weight: 500;
}

.code-row {
  display: flex;
  gap: 8px;
}

.code-row .input {
  flex: 1;
  min-width: 0;
}

.code-row .btn {
  flex: 0 0 auto;
  height: 38px;
}

/* 按钮菜单配置 */
.button-head,
.button-row {
  display: grid;
  grid-template-columns: 44px 1.1fr 0.9fr 1.5fr 64px 56px;
  gap: 10px;
  align-items: center;
}

.button-head {
  padding: 8px 4px;
  color: #8b96a9;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.button-row {
  padding: 10px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.button-row:last-child {
  border-bottom: 0;
}

.button-row .input,
.button-row .select {
  height: 36px;
  padding: 7px 10px;
}

.button-row .switch {
  justify-content: center;
}

@media (max-width: 860px) {
  .button-head {
    display: none;
  }
  .button-row {
    grid-template-columns: 38px 1fr 1fr;
    grid-template-areas:
      "enabled label action"
      "command command sort"
      "del del del";
    gap: 8px;
  }
  .button-row .btn-enabled {
    grid-area: enabled;
  }
  .button-row .btn-label {
    grid-area: label;
  }
  .button-row .btn-action {
    grid-area: action;
  }
  .button-row .btn-command {
    grid-area: command;
  }
  .button-row .btn-sort {
    grid-area: sort;
  }
  .button-row [data-row-del] {
    grid-area: del;
    justify-self: end;
  }
}

.login-tip {
  margin-top: 18px;
  background: #f3f6fc;
  border: 1px dashed #dbe3f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11px;
  color: #7d899c;
  line-height: 1.7;
}

/* ---------- 弹窗 / 提示 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 36, 0.52);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 7vh 18px 18px;
  z-index: 100;
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(15, 23, 36, 0.3);
  animation: pop 0.16s ease;
}

@keyframes pop {
  from {
    transform: translateY(6px) scale(0.99);
    opacity: 0.6;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  padding: 18px 20px 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-x {
  margin-left: auto;
  border: 0;
  background: #f2f5fa;
  color: #6c7890;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.modal-body {
  padding: 16px 20px 4px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px 20px;
}

.toast-wrap {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(21, 35, 60, 0.14);
  padding: 11px 14px;
  font-size: 13px;
  color: var(--ink-2);
  animation: slide-in 0.18s ease;
}

.toast.error {
  border-left-color: var(--red);
}

.toast.success {
  border-left-color: var(--green);
}

@keyframes slide-in {
  from {
    transform: translateX(12px);
    opacity: 0;
  }
}

/* ---------- 绑定码 / 二维码 ---------- */
.bind-code-card {
  background: linear-gradient(135deg, #101b2c 0%, #16253c 100%);
  color: #e8eefb;
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.bind-code-card::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -90px;
  top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 107, 250, 0.35), transparent 65%);
}

.bind-code {
  font-family: var(--mono);
  font-size: 30px;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: #fff;
  margin: 10px 0 4px;
}

/* 扫码绑定弹窗 */
.scan-status {
  margin-bottom: 14px;
}

.scan-grid {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.scan-qr {
  flex: 0 0 190px;
  width: 190px;
  height: 190px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 6px 20px rgba(21, 35, 60, 0.08);
}

.scan-qr img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.scan-official {
  flex: 0 0 190px;
  width: 190px;
  height: 214px;
  padding: 6px;
}

.scan-title {
  font-size: 15px;
  font-weight: 600;
  margin-top: 3px;
  color: var(--ink);
}

.scan-divider {
  border-top: 1px dashed var(--line);
  margin: 12px 0;
}

.friend-qr {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.friend-qr summary {
  cursor: pointer;
}

.friend-qr img {
  display: block;
  width: 128px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.scan-info {
  min-width: 0;
  flex: 1;
}

.scan-command {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  color: #23419e;
  background: #eef3ff;
  border-radius: 10px;
  padding: 11px 12px;
  margin-top: 7px;
  word-break: break-all;
}

.scan-success {
  background: var(--green-soft);
  border: 1px solid #c9ecd8;
  color: var(--green);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}

.scan-success .small {
  color: #3f7d5b;
  font-weight: 400;
  margin-top: 4px;
}

@media (max-width: 560px) {
  .scan-grid {
    flex-direction: column;
    align-items: center;
  }
  .scan-qr {
    flex: none;
    width: 170px;
    height: 170px;
  }
  .scan-info {
    width: 100%;
  }
}

.qr-box {
  width: 128px;
  height: 128px;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  display: grid;
  place-items: center;
}

.qr-box canvas {
  width: 112px;
  height: 112px;
  image-rendering: pixelated;
}

.placeholder-tag {
  display: inline-block;
  font-size: 10px;
  color: #9fb2cf;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---------- 其他 ---------- */
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.kv:last-child {
  border-bottom: 0;
}

.kv .k {
  color: var(--muted);
}

.kv .v {
  color: var(--ink-2);
  text-align: right;
  word-break: break-all;
}

.section-title {
  font-size: 12px;
  color: #8b96a9;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.sidebar-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 36, 0.45);
  z-index: 55;
}

.dev-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--amber);
  background: var(--amber-soft);
  border-radius: 999px;
  padding: 2px 9px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .login-screen {
    grid-template-columns: 1fr;
  }
  .login-side {
    display: none;
  }
  .login-main {
    padding: 24px 18px;
  }
}

@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 20px 0 60px rgba(15, 23, 36, 0.3);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-mask.show {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .hamburger {
    display: inline-grid;
    place-items: center;
  }
  .topbar {
    height: 62px;
    padding: 0 16px;
  }
  .content {
    padding: 18px 16px 40px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .stat-value {
    font-size: 25px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  table.data {
    min-width: 620px;
  }
  .page-sub {
    display: none;
  }
  .card-head {
    flex-wrap: wrap;
  }
  .modal-mask {
    padding: 3vh 12px 12px;
  }
  .login-headline {
    margin-top: 32px;
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stat {
    padding: 14px 14px 12px;
  }
  .stat-value {
    font-size: 23px;
  }
  .stat-hint {
    display: none;
  }
}
