/* ===== 后台通用 ===== */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f2d3d;
  background: #f4f6fb;
  line-height: 1.6;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
a { color: #2f6fed; text-decoration: none; }

.adm-top {
  background: #1f2d3d;
  color: #fff;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.adm-logo { font-weight: 700; font-size: 16px; }
.adm-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.adm-nav a { color: #c4ccd8; font-size: 14px; }
.adm-nav a:hover { color: #fff; }
.adm-exit { color: #ff9c9c !important; }

.adm-main { padding: 28px 0 40px; }
.adm-h1 { font-size: 22px; margin: 0 0 6px; }
.adm-h2 { font-size: 16px; margin: 18px 0 10px; color: #34455c; }
.adm-welcome { color: #6b7686; margin: 0 0 18px; }
.adm-tip { color: #8a93a3; font-size: 13px; margin: 0 0 16px; }
.adm-ok { color: #1f9d55; font-size: 14px; }
.adm-err { color: #e23b3b; font-size: 14px; }

.adm-foot { text-align: center; color: #aab2c0; font-size: 12px; padding: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 底部「返回首页」链接：蓝色字体，字号与后台正文一致，确保清晰可见 */
.adm-foot a { font-size: 14px; color: #2f6fed; text-decoration: none; }
.adm-foot a:hover { color: #2257c4; text-decoration: underline; }

/* 概览卡片 */
.adm-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.adm-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 4px 16px rgba(31,45,61,.06); text-align: center; }
.adm-card-num { font-size: 30px; font-weight: 700; color: #2f6fed; }
.adm-card-label { color: #6b7686; font-size: 13px; margin: 4px 0 10px; }
.adm-card-link { font-size: 13px; }
.adm-quick { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

/* 工作台：分类模块网格 */
.adm-mods { margin-top: 6px; }
.adm-mod-group { margin-bottom: 28px; }
.adm-mod-group-title {
  font-size: 16px; font-weight: 700; color: #34455c; margin: 0 0 14px;
  padding-left: 11px; border-left: 4px solid #2f6fed;
}
.adm-mod-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px;
}
.adm-mod-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid #e6eaf1; border-radius: 12px;
  padding: 16px 18px; text-decoration: none; color: inherit;
  box-shadow: 0 4px 16px rgba(31,45,61,.06);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.adm-mod-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(31,45,61,.12);
  border-color: #c5d4f5;
}
.adm-mod-ico {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 11px;
  background: #eef3ff; color: #2f6fed;
  display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1;
}
.adm-mod-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-mod-title { font-size: 15px; font-weight: 600; color: #2b3a4d; display: inline-flex; align-items: center; gap: 6px; }
.adm-mod-desc { font-size: 12px; color: #8a93a3; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-mod-arrow { flex: 0 0 auto; color: #c0c6d4; font-size: 22px; line-height: 1; transition: color .12s ease, transform .12s ease; }
.adm-mod-card:hover .adm-mod-arrow { color: #2f6fed; transform: translateX(3px); }

/* 按钮（统一高度 40px，与「搜索」按钮一致；ghost 边框不改变外框高度） */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 40px;
  background: #2f6fed; color: #fff; border: 0;
  border-radius: 8px; padding: 0 20px; font-size: 14px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.adm-btn:hover { background: #2257c4; }
.adm-btn.ghost { background: #fff; color: #2f6fed; border: 1px solid #cdd8ee; }
.adm-btn.ghost:hover { background: #eef3ff; }
.adm-btn.danger { background: #e23b3b; }
.adm-btn.danger:hover { background: #c62f2f; }

/* 批量操作栏（多选/全选/批量删除/编辑） */
.adm-batch-bar {
  display: flex; align-items: center; gap: 14px;
  background: #f6f8fc; border: 1px solid #e6eaf1; border-radius: 10px;
  padding: 8px 14px; margin: 12px 0;
  position: sticky; top: 0; z-index: 20;
}
.adm-batch-bar label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.adm-batch-bar .adm-sel-count { color: #8a93a3; font-size: 13px; }
.adm-sel-item { width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }

/* 工具栏"编辑"按钮：未选中/多选时禁用，恰好选中 1 条时启用 */
.adm-batch-edit {
  padding: 7px 16px; border: 1px solid #2f6fed; border-radius: 8px;
  background: #fff; color: #2f6fed; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.adm-batch-edit:hover:not(:disabled) { background: #2f6fed; color: #fff; }
.adm-batch-edit:disabled {
  opacity: .45; cursor: not-allowed; border-color: #dfe4ec; color: #9aa3b2;
}
.adm-gb-item { display: flex; align-items: flex-start; gap: 10px; }
.adm-gb-item .adm-gb-sel { padding-top: 2px; }
.adm-gb-item .adm-gb-body { flex: 1; min-width: 0; }
/* 照片网格中的选择框 */
.photo-card { position: relative; }
.photo-card .ph-sel {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 18px; height: 18px; cursor: pointer;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9); border-radius: 4px;
}

/* 表单 */
.adm-form { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 4px 16px rgba(31,45,61,.06); max-width: 520px; }
/* 文章编辑等含大编辑区的表单：宽度对齐首页主体内容区（1100px） */
.adm-form.adm-post-form { max-width: 1100px; }
.adm-post-form .rte { margin-bottom: 6px; }
.adm-post-form .rte-surface { min-height: 420px; }
.adm-form label { display: block; font-size: 13px; color: #55607a; margin: 14px 0 6px; }
.adm-form input[type=text],
.adm-form input[type=url],
.adm-form input[type=number],
.adm-form textarea,
.adm-form select {
  width: 100%; border: 1px solid #dfe4ec; border-radius: 8px;
  padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.adm-form textarea { min-height: 70px; resize: vertical; }
.adm-form input[type=file] { font-size: 13px; margin-top: 4px; }
.adm-prev { margin: 6px 0 10px; }
.adm-prev img { max-width: 160px; max-height: 120px; border-radius: 8px; display: block; }
.adm-check { font-size: 13px; color: #6b7686; display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }
.adm-radios { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 4px; }
.adm-radio { font-size: 14px; color: #34455c; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* 两栏布局 */
.adm-two { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; align-items: start; }
.adm-panel { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 4px 16px rgba(31,45,61,.06); }

/* 链接列表 */
.adm-link-list { list-style: none; margin: 0; padding: 0; }
.adm-link-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eef1f6; }
.adm-link-item:last-child { border-bottom: 0; }
.adm-link-thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; flex: 0 0 48px; background: #eef1f6; display: flex; align-items: center; justify-content: center; }
.adm-link-thumb img { width: 100%; height: 100%; object-fit: cover; }
.adm-link-ini { font-weight: 700; color: #2f6fed; font-size: 20px; }
.adm-link-info { flex: 1; min-width: 0; }
.adm-link-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.adm-link-url { font-size: 12px; color: #8a93a3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-link-ops { display: flex; gap: 12px; font-size: 13px; }
.adm-link-btn { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: #2f6fed; }
.adm-link-btn:hover { text-decoration: underline; }
.adm-del { color: #e23b3b !important; }

/* IP 管理 */
.adm-sel-all { width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }
.adm-ip-form { max-width: 560px; }
.adm-ip-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.adm-ip-grid .adm-ip-full { grid-column: 1 / -1; }
.adm-table-wrap { overflow-x: auto; }

/* 用户管理：栏目授权 */
.adm-perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.adm-perm-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid #eceef2; border-radius: 8px; padding: 6px 10px;
  background: #fafbfe; font-size: 13px;
}
.adm-perm-item label { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; font-size: 13px; color: #55607a; }
.adm-perm-item input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; }
.adm-perm-name { font-weight: 600; color: #2b3a4d; }
.adm-perm-item.is-lock { border-color: #ffe08a; background: #fffbea; }

/* 栏目拖拽排序 */
.adm-link-item { cursor: default; }
.adm-seq {
  flex: 0 0 26px; width: 26px; height: 26px; line-height: 26px; text-align: center;
  background: #2f6fed; color: #fff; border-radius: 50%; font-size: 12px; font-weight: 600;
}
.adm-drag-handle {
  flex: 0 0 auto; cursor: grab; color: #b6bfce; font-size: 18px; line-height: 1;
  user-select: none; padding: 0 4px; letter-spacing: -2px;
}
.adm-drag-handle:active { cursor: grabbing; }
.adm-link-item.dragging { opacity: .45; background: #eef3ff; border-radius: 8px; }
.adm-sortbar { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; flex-wrap: wrap; }
.adm-sort-hint { font-size: 13px; color: #8a93a3; }
.adm-sort-status { font-size: 13px; }
.adm-sort-status.pending { color: #d98a00; }
.adm-sort-status.ok { color: #1f9d55; }
.adm-sort-status.err { color: #e23b3b; }

/* 文章搜索条 */
.adm-search { display: flex; gap: 8px; align-items: center; margin: 6px 0 18px; flex-wrap: wrap; }
.adm-search input[type=text] { flex: 1; min-width: 200px; border: 1px solid #dfe4ec; border-radius: 8px; padding: 9px 12px; font-size: 14px; }

/* 分页 */
.adm-pager { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 22px 0 6px; font-size: 13px; flex-wrap: wrap; }
.adm-pager a { background: #fff; border: 1px solid #cdd8ee; border-radius: 8px; padding: 7px 14px; color: #2f6fed; white-space: nowrap; }
.adm-pager a:hover { background: #eef3ff; }
.adm-pager-info { color: #6b7686; white-space: nowrap; }
.adm-pager-icons a, .adm-pager-icons span {
  min-width: 36px; height: 36px; line-height: 36px; padding: 0 10px;
  border-radius: 8px; font-size: 16px; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
}
.adm-pager-icons a { background: #fff; border: 1px solid #cdd8ee; color: #2f6fed; }
.adm-pager-icons a:hover { background: #2f6fed; color: #fff; border-color: #2f6fed; }
.adm-pager-disabled { color: #c0c6d4; background: #f6f8fc; border: 1px solid #e6eaf1; cursor: not-allowed; display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; line-height: 36px; padding: 0 10px; border-radius: 8px; font-size: 16px; text-align: center; }
.adm-pager-per select { font-size: 13px; }
.adm-badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 500; }
.adm-badge.s0 { background: #f0f0f0; color: #999; }
.adm-badge.s1 { background: #e6f6ec; color: #1f9d55; }
.adm-badge.s2 { background: #fff4e0; color: #d98a00; }
.adm-badge-top { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }
/* 阅读量徽章：浅蓝底 + 高对比深蓝字，保证与背景对比度（遵循 WCAG AA），且与整体蓝色调统一 */
.adm-badge-views { background: #e6f0fb; color: #1d4ed8; font-weight: 600; }
/* 评论量徽章：浅青绿底 + 高对比深青绿字（与阅读量徽章同款浅底深字模式，色相区分） */
.adm-badge-comments { background: #e6faf3; color: #0f766e; font-weight: 600; }

/* 行内勾选（如“置顶”） */
.adm-check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #334155; margin: 4px 0; cursor: pointer; }
.adm-check-line input { width: 16px; height: 16px; accent-color: #2563eb; cursor: pointer; }

/* 留言管理 */
.adm-gb-list { list-style: none; margin: 16px 0 0; padding: 0; }
.adm-gb-item { background: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 2px 10px rgba(31,45,61,.05); }
.adm-gb-head { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.adm-gb-nick { font-weight: 600; color: #2f6fed; }
.adm-gb-time { color: #9aa3b2; }
.adm-gb-loc { color: #8a93a3; background: #f1f3f7; border-radius: 10px; padding: 1px 8px; order: 5; margin-left: auto; }
.adm-gb-pending { color: #b76e00; background: #fff4e0; border: 1px solid #ffd591; border-radius: 10px; padding: 1px 8px; font-weight: 600; }
.adm-approve { color: #1f9d55 !important; background: #eafaf0; border: 1px solid #b7e6c8; border-radius: 10px; padding: 1px 10px; font-weight: 600; text-decoration: none; }
.adm-approve:hover { background: #d8f5e4; }
.adm-gb-head .adm-del { order: 6; }
.adm-gb-content { margin: 6px 0 0; font-size: 14px; color: #2b3a4d; white-space: pre-wrap; word-break: break-word; }
.adm-gb-empty { color: #9aa3b2; }

/* 表格型列表（评论管理等） */
.adm-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(31,45,61,.06); }
.adm-table th { text-align: left; font-size: 12px; font-weight: 600; color: #8a93a3; padding: 12px 10px; background: #f7f9fc; border-bottom: 1px solid #eef1f6; white-space: nowrap; }
.adm-table td { padding: 12px 10px; font-size: 14px; color: #2b3a4d; border-bottom: 1px solid #f1f3f7; vertical-align: top; white-space: nowrap; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table tbody tr:hover { background: #fafbfe; }
.adm-cell-content { color: #5b6675; line-height: 1.6; max-width: 360px; }
.adm-empty { color: #9aa3b2; padding: 24px 0; }
.adm-tip { font-size: 13px; color: #8a93a3; }

/* 登录页 */
.adm-login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.adm-login-box { background: #fff; padding: 32px 36px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.08); width: 340px; max-width: 92vw; }
.adm-login-box h1 { font-size: 20px; margin: 0 0 18px; }
.adm-login-box label { display: block; font-size: 13px; color: #55607a; margin: 12px 0 6px; }
.adm-login-box input { width: 100%; border: 1px solid #dfe4ec; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.adm-login-box button { margin-top: 18px; width: 100%; background: #2f6fed; color: #fff; border: 0; border-radius: 8px; padding: 11px; font-size: 15px; cursor: pointer; }
.adm-login-box .adm-err { color: #e23b3b; font-size: 13px; margin-top: 10px; }
.adm-back { text-align: center; margin-top: 14px; font-size: 13px; }

/* 响应式 */
@media (max-width: 860px) {
  .adm-cards { grid-template-columns: 1fr; }
  .adm-two { grid-template-columns: 1fr; }
}

/* 移动端（手机）响应式 */
@media (max-width: 640px) {
  .container { padding: 0 10px; }
  .adm-main { padding: 14px 0 30px; }
  .adm-h1 { font-size: 19px; }

  /* 表格：横向滚动，不压缩列宽 */
  .adm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -10px;
    padding: 0 10px;
  }
  .adm-table { min-width: 640px; font-size: 13px; }
  .adm-table th, .adm-table td { padding: 10px 8px; font-size: 13px; }

  /* 翻页：紧凑居中，自动换行 */
  .adm-pager { gap: 6px; margin: 16px 0 4px; justify-content: center; }
  .adm-pager-info { font-size: 12px; order: -1; width: 100%; text-align: center; margin-bottom: 4px; }
  .adm-pager-icons a,
  .adm-pager-icons span.adm-pager-disabled {
    min-width: 32px; height: 32px; line-height: 32px; padding: 0 6px; font-size: 14px; border-radius: 6px;
  }
  .adm-pager-per { margin-left: 0 !important; }

  /* 搜索栏 */
  .adm-search { flex-direction: column; align-items: stretch; }
  .adm-search input[type=text] { min-width: 0; }

  /* 批量操作栏 */
  .adm-batch-bar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }

  /* 折叠面板：移动端按钮文字强制单行不折行（分行规则见文末同名媒体块，置于基础规则之后以确保覆盖） */
  .adm-ip-summary { padding: 12px 14px; gap: 8px; font-size: 14px; }
  .adm-ip-summary-btn { padding: 8px 18px; font-size: 14px; }
  .adm-ip-cols { padding: 0 10px 12px; gap: 10px; }

  /* 工作台模块卡片 */
  .adm-mod-grid { grid-template-columns: 1fr; }
  .adm-mod-card { padding: 12px 14px; }
  .adm-mod-ico { flex: 0 0 36px; width: 36px; height: 36px; font-size: 17px; }

  /* 表单 */
  .adm-form { padding: 14px; border-radius: 10px; }
  .adm-panel { padding: 14px; border-radius: 10px; }

  /* 登录框 */
  .adm-login-box { padding: 24px 20px; width: auto; max-width: 94vw; }

  /* 照片网格 */
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* 网址收藏：分类筛选 + 分组标题 + 描述 */
.adm-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.adm-filter a { font-size: 13px; color: #667085; padding: 4px 13px; background: #fff; border: 1px solid #eceef2; border-radius: 999px; transition: all .15s ease; }
.adm-filter a.active, .adm-filter a:hover { background: #2f6fed; color: #fff; border-color: #2f6fed; }
.adm-group-title { font-size: 14px; color: #33415c; margin: 18px 0 8px; padding-left: 8px; border-left: 3px solid #2f6fed; }
.adm-group-title:first-of-type { margin-top: 0; }
.adm-link-desc { font-size: 12px; color: #9aa3b2; margin-top: 2px; }
/* 收藏列表：favicon 加载成功时覆盖首字母，失败移除后回退字母 */
.adm-link-thumb { position: relative; }
.adm-link-thumb img { object-fit: contain; padding: 5px; background: #fff; }

/* 相册：列表缩略图 */
.album-thumb { font-size: 22px; }
.album-thumb img { object-fit: cover; }

/* 照片管理：网格 + 卡片 */
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .photo-grid { grid-template-columns: repeat(2, 1fr); } }
.photo-card { background: #fff; border: 1px solid #eceef2; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(31,45,61,.05); }
.photo-img { height: 150px; background: #eef1f6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-img img { width: 100%; height: 100%; object-fit: cover; }
.photo-edit { padding: 10px 12px 12px; display: grid; gap: 8px; }
.photo-edit input[type=text], .photo-edit textarea, .photo-edit select {
  width: 100%; border: 1px solid #dfe4ec; border-radius: 8px; padding: 7px 9px; font-size: 13px; font-family: inherit;
}
.photo-edit textarea { min-height: 46px; resize: vertical; }
.photo-ops { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; }
.photo-ops .adm-del { margin-left: auto; }

/* ===== 博客富文本编辑器（零依赖 contenteditable） ===== */
/* 注意：.rte 不能设置 overflow:hidden，否则会生成滚动容器导致内部 sticky 失效 */
.rte { border: 1px solid #d9dee6; border-radius: 10px; margin-bottom: 6px; position: relative; }
.rte-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 10px;
  background: #f4f6f9; border-bottom: 1px solid #d9dee6;
  /* 冻结（吸附）：滚动越过原始位置后固定在顶部导航栏下方视口顶部 */
  position: sticky; top: 56px; z-index: 11; border-radius: 10px 10px 0 0;
}
/* 固定态：悬浮工具栏样式，与正文拉开层级、加投影，但不遮挡（见说明） */
.rte-toolbar.is-stuck { box-shadow: 0 6px 16px rgba(31,45,61,.13); border-radius: 0; background: #eef1f6; }
/* 下拉框：固定宽度，覆盖 .adm-form select 的 width:100% 继承 */
.rte-sel { height: 34px; min-width: 76px; max-width: 120px; border: 1px solid #d9dee6; border-radius: 6px; background: #fff; font-size: 13px; padding: 0 6px; color: #33415c; flex-shrink: 0; line-height: 1.4; }
.rte-toolbar select { width: auto; flex: none; }
.rte-sep { width: 1px; height: 20px; background: #cdd4e0; margin: 0 3px; flex-shrink: 0; }
.rte-btn { height: 32px; min-width: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: #fff; cursor: pointer; font-size: 14px; color: #33415c; line-height: 1; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.rte-btn:hover { background: #e9eef6; }
.rte-btn.active { background: #2f6fed; color: #fff; }
.rte-btn.locked { background: #1f9d55; color: #fff; }
.rte-btn svg.ic { width: 18px; height: 18px; display: block; pointer-events: none; }
.rte-surface.rte-painting { cursor: copy; }
.rte-color { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: #33415c; cursor: pointer; padding: 0 6px; height: 32px; border: 1px solid #d9dee6; border-radius: 6px; background: #fff; flex-shrink: 0; }
.rte-color .cc { font-weight: 700; line-height: 1; }
.rte-color .cc-text { border-bottom: 3px solid #e03131; padding-bottom: 1px; }
.rte-color .cc-bg { background: #ffe066; padding: 0 3px; border-radius: 3px; }
.rte-color input[type=color] { width: 22px; height: 22px; border: none; background: none; padding: 0; cursor: pointer; }
.rte-surface { min-height: 320px; max-height: 640px; overflow: auto; padding: 16px 18px; background: #fff; font-size: 15px; line-height: 1.7; color: #1f2d3d; border-radius: 0 0 10px 10px; }
.rte-surface:focus { outline: none; }
.rte-surface h1 { font-size: 26px; } .rte-surface h2 { font-size: 22px; } .rte-surface h3 { font-size: 19px; }
.rte-surface h4 { font-size: 17px; } .rte-surface h5 { font-size: 15px; } .rte-surface h6 { font-size: 14px; }
.rte-surface blockquote { margin: 10px 0; padding: 8px 14px; border-left: 4px solid #2f6fed; background: #f4f7ff; color: #4a5568; }
.rte-surface pre { background: #1e2530; color: #e6edf3; padding: 12px 14px; border-radius: 8px; overflow: auto; font-family: Consolas, "Courier New", monospace; }
.rte-surface table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.rte-surface th, .rte-surface td { border: 1px solid #cfd6e0; padding: 6px 10px; min-width: 60px; }
.rte-surface img { max-width: 100%; height: auto; }
.rte-surface a { color: #2f6fed; }

/* IP 管理：说明栏 + 折叠面板 */
.adm-ip-notice {
  background: #f0f6ff; border: 1px solid #cddcf5; border-radius: 10px;
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px; color: #33415c; line-height: 1.7;
}
.adm-ip-collapse { border: 1px solid #e6eaf1; border-radius: 12px; background: #fff; box-shadow: 0 4px 16px rgba(31,45,61,.06); }
.adm-ip-summary {
  display: flex; align-items: center;
  gap: 10px;
  padding: 14px 18px; cursor: pointer; font-weight: 600; color: #34455c; user-select: none;
}
.adm-ip-summary::-webkit-details-marker { display: none; }
.adm-ip-summary::before { content: '▸'; margin-right: 8px; transition: transform .15s ease; }
.adm-ip-collapse[open] .adm-ip-summary::before { transform: rotate(90deg); }
.adm-ip-cols { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 0 14px 14px; }
/* 折叠面板内的说明文字：占满剩余宽度并自然换行，去掉全局 .adm-tip 的下边距避免垂直错位 */
.adm-ip-summary .adm-tip { margin: 0; min-width: 0; flex: 1 1 auto; line-height: 1.4; }
/* 「新增记录」按钮：蓝底白字；文字强制单行、禁止被压缩 */
.adm-ip-summary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 40px;
  background: #2f6fed;
  color: #fff;
  border: 0;
  padding: 0 26px; border-radius: 8px;
  font-weight: 600; font-size: 15px; letter-spacing: 1px;
  white-space: nowrap; flex: 0 0 auto;
}
.adm-ip-summary-btn:hover { background: #2257c4; }
.adm-ip-collapse[open] .adm-ip-summary-btn {
  background: #2f6fed; color: #fff; border-color: #2f6fed;
}
.adm-ip-collapse[open] .adm-ip-summary-btn:hover { background: #2257c4; }
/* 移动端折叠面板：按钮与说明分两行显示（按钮行 + 说明行），
   说明文字独占整行自然换行，按钮文字始终保持单行。
   置于基础规则之后，确保覆盖上方 .adm-ip-summary .adm-tip 的 flex 简写。 */
@media (max-width: 640px) {
  .adm-ip-summary { flex-wrap: wrap; row-gap: 6px; }
  .adm-ip-summary .adm-tip { flex: 1 1 100%; }
}
/* 无 MAC 地址记录行：淡黄色高亮 */
.adm-table tbody tr.ip-row-no-mac,
.adm-table tbody tr.ip-row-no-mac:hover {
  background: #fff8dc;
}

/* 分类徽标 */
.adm-cat-badge {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  background: #eef3ff; color: #2f6fed; font-size: 12px; white-space: nowrap;
}
/* 分类管理列表 */
.adm-cat-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 4px; }
.adm-cat-item {
  display: flex; align-items: center; gap: 12px;
  background: #f7f9fc; border: 1px solid #eef1f6; border-radius: 10px; padding: 10px 14px;
}

/* 编辑器：表情符号面板（绝对定位于 .rte 内） */
.rte-emoji-panel {
  display: none; position: absolute; top: 48px; left: 10px; z-index: 30;
  width: 300px; max-height: 220px; overflow: auto; background: #fff;
  border: 1px solid #d9dee6; border-radius: 10px; box-shadow: 0 8px 24px rgba(31,45,61,.16);
  padding: 8px; display: none; grid-template-columns: repeat(8, 1fr); gap: 2px;
}
.rte-emoji-panel.open { display: grid; }
.rte-emoji-panel button { border: 0; background: none; font-size: 20px; padding: 4px; cursor: pointer; border-radius: 6px; line-height: 1; }
.rte-emoji-panel button:hover { background: #eef3ff; }

/* 编辑器：自动保存草稿状态条 + 恢复提示 */
.rte-draft { font-size: 12px; color: #8a93a3; margin: 4px 2px 0; min-height: 16px; }
.rte-restore { background: #fff8e6; border: 1px solid #ffe08a; border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #7a5b00; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; }
.rte-restore[hidden] { display: none; }
.rte-restore button { font: inherit; border: 1px solid #d9c178; background: #fff; border-radius: 6px; padding: 3px 12px; cursor: pointer; }
.rte-restore button.primary { background: #2f6fed; color: #fff; border-color: #2f6fed; }

/* 编辑器：从相册选择 模态框 */
.rte-modal { position: fixed; inset: 0; z-index: 1000; display: none; }
.rte-modal.open { display: block; }
.rte-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.rte-modal-box { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(880px, 94vw); max-height: 86vh; background: #fff; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.rte-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #eceef2; font-size: 16px; font-weight: 600; }
.rte-modal-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: #8a93a3; }
.rte-modal-tabs { display: flex; gap: 8px; padding: 12px 18px 0; }
.rte-tab { border: 1px solid #d9dee6; background: #fff; border-radius: 999px; padding: 5px 14px; font-size: 13px; cursor: pointer; color: #475569; }
.rte-tab.active { background: #2f6fed; color: #fff; border-color: #2f6fed; }
.rte-modal-body { padding: 14px 18px 18px; overflow: auto; }
.rte-album-panel[hidden] { display: none; }
.rte-photo-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 680px) { .rte-photo-grid { grid-template-columns: repeat(3, 1fr); } }
.rte-photo { cursor: pointer; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #eef1f6; aspect-ratio: 1/1; }
.rte-photo:hover { border-color: #2f6fed; }
.rte-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rte-modal-empty { color: #9aa3b2; padding: 20px 0; }
.rte-modal-tip { font-size: 12.5px; color: #667085; line-height: 1.6; margin: 0 0 10px; }
.rte-textarea { width: 100%; min-height: 130px; padding: 10px 12px; font-size: 13.5px; line-height: 1.7; color: #1f2d3d; border: 1px solid #d8dee9; border-radius: 8px; resize: vertical; font-family: inherit; box-sizing: border-box; }
.rte-textarea:focus { outline: none; border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.12); }
.rte-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid #eceef2; background: #fafbfd; }
