/* AI生成 */
/*! ============================================================
 *  backend-modern 设计系统层
 *  方向：专业控制台 · 卡片化
 *  说明：backend-modern.css 为基线（沿用默认组件契约），
 *        本文件只做视觉重定义，最后加载，优先级更高。
 *  ============================================================ */

:root {
  --font-size-base: 14px;
  --color-primary: #2563eb;
  --color-primary-strong: #1d4ed8;
  --color-primary-hover: #1d4ed8;
  --color-primary-soft: rgba(37, 99, 235, 0.08);
  --color-surface: #ffffff;
  --color-surface-muted: #f6f7f9;
  --color-background: #f6f7f9;
  --color-text: #1f2937;
  --color-text-strong: #0f172a;
  --color-text-muted: #6b7280;
  --color-border: #e8ebf0;
  --color-border-input: #dfe3e9;
  --color-border-hover: #c3c9d4;
  --color-table-border: #eef1f5;
  --color-focus-ring: rgba(37, 99, 235, 0.16);
  --color-switch-off: #e5e7eb;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --head-h: 64px;
  --side-w: 240px;
  --side-w-min: 76px;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -12px rgba(16, 24, 40, 0.12);
  --shadow-card-hover: 0 2px 4px rgba(16, 24, 40, 0.05), 0 16px 32px -16px rgba(16, 24, 40, 0.18);
  --shadow-btn: 0 1px 2px rgba(37, 99, 235, 0.24), 0 4px 12px -4px rgba(37, 99, 235, 0.35);
  --shadow-btn-hover: 0 2px 4px rgba(37, 99, 235, 0.26), 0 8px 20px -6px rgba(37, 99, 235, 0.42);
  --shadow-btn-active: inset 0 1px 2px rgba(0, 0, 0, 0.12);
  --shadow-pop: 0 6px 16px -6px rgba(16, 24, 40, 0.14), 0 16px 40px -12px rgba(16, 24, 40, 0.18);
  --shadow-btn-base: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.night {
  --color-primary: #3b82f6;
  --color-primary-strong: #60a5fa;
  --color-primary-hover: #60a5fa;
  --color-primary-soft: rgba(59, 130, 246, 0.16);
  --color-surface: #1a1b1e;
  --color-surface-muted: #131417;
  --color-background: #131417;
  --color-text: #e3e6ea;
  --color-text-strong: #f8fafc;
  --color-text-muted: #98a0ac;
  --color-border: #2b2e33;
  --color-border-input: #343840;
  --color-border-hover: #4a4f58;
  --color-table-border: #26292e;
  --color-focus-ring: rgba(96, 165, 250, 0.28);
  --color-switch-off: #3a3e45;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-card-hover: 0 2px 6px rgba(0, 0, 0, 0.55), 0 16px 32px -16px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 6px 16px -6px rgba(0, 0, 0, 0.6), 0 20px 44px -14px rgba(0, 0, 0, 0.7);
}

body {
  font-size: var(--font-size-base);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrapper {
  background-color: var(--color-background);
  height: 100vh;
}

/* ---------- 侧栏 ---------- */
.side {
  width: var(--side-w);
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  z-index: 120;
}

.side.on {
  width: var(--side-w-min);
}

.logo {
  height: var(--head-h);
  border-bottom: 1px solid var(--color-border);
  padding: 0 20px;
  display: flex;
  align-items: center;
}

.menu {
  padding: 6px 0 0;
}

.menu ul {
  padding: 8px 12px 16px;
}

.menu .menutitle {
  margin: 18px 0 6px;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  text-transform: uppercase;
  opacity: 0.75;
}

.menu ul li.menutitle:first-child {
  margin-top: 4px;
}

.menu li {
  margin-bottom: 2px;
  list-style: none;
}

.menu li a {
  height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  transition: background-color 0.16s ease, color 0.16s ease;
}

.menu li a .ico {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  flex: none;
}

.menu li a .ico::before {
  font-size: 18px;
  line-height: 1;
}

.menu li a:hover {
  background: var(--color-surface-muted);
  color: var(--color-text-strong);
}

.menu li.on a {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 600;
  position: relative;
}

.menu li.on a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  transform: translateY(-50%);
}

.menu li.on .ico::before {
  color: var(--color-primary);
}

.side.on .menu li a {
  justify-content: center;
  padding: 0;
}

.side.on .menu li a .ico {
  margin-right: 0;
}

.side.on .menu li a::before {
  display: none;
}

.side.on .menu .menutitle {
  height: 1px;
  margin: 10px 8px;
  padding: 0;
  background: var(--color-border);
  font-size: 0;
  opacity: 1;
  overflow: hidden;
}

.sidefoot {
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
}

.sidefoot-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex: none;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.side.on .sidefoot {
  padding: 14px 0;
  justify-content: center;
}

.side.on .sidefoot-text {
  display: none;
}

/* ---------- 主区域 ---------- */
.main {
  padding-left: calc(var(--side-w) + 1px);
}

.main.on {
  padding-left: calc(var(--side-w-min) + 1px);
}

/* ---------- 顶栏 ---------- */
.head {
  height: var(--head-h);
  padding: 0 24px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.menuico {
  position: static;
  float: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex: none;
  transition: background-color 0.16s ease;
}

.menuico:hover {
  background: var(--color-surface-muted);
}

.menuico span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-text);
}

.headcrumb {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
  overflow: hidden;
  white-space: nowrap;
}

.headcrumb a {
  color: var(--color-text-muted);
}

.headcrumb a:hover {
  color: var(--color-primary);
}

.headcrumb-sep,
.pagecrumb-sep {
  width: 12px;
  height: 12px;
  position: relative;
  flex: none;
  opacity: 0.55;
  display: inline-block;
}

.headcrumb-sep::before,
.pagecrumb-sep::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 3px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
  border-radius: 1px;
}

.headcrumb strong {
  font-weight: 600;
  color: var(--color-text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
}

.headactions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.backhome,
.theme-toggler {
  height: 34px;
  margin-right: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.backhome {
  padding: 0 12px;
  font-size: 13px;
}

.theme-toggler {
  width: 34px;
}

.backhome:hover,
.theme-toggler:hover {
  border-color: var(--color-border-hover);
  background-color: var(--color-surface-muted);
  color: var(--color-text-strong);
}

.userlink {
  align-items: center;
  gap: 10px;
  padding: 3px 8px 3px 4px;
  border-radius: var(--radius-pill);
  transition: background-color 0.16s ease;
}

.userlink:hover {
  background: var(--color-surface-muted);
}

.userimg {
  margin-right: 0;
}

.userimg img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  object-fit: cover;
}

.username {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.username strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-strong);
}

.username em {
  font-style: normal;
  font-size: 11px;
  color: var(--color-text-muted);
}

.usermenu {
  margin-top: 10px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-surface);
}

.usermenu ul {
  padding: 6px;
}

.usermenu li a {
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
}

/* ---------- 内容区 ---------- */
.content {
  height: calc(100vh - var(--head-h));
  padding: 24px 28px 40px;
  overflow-y: auto;
}

.content .title {
  margin-bottom: 20px;
}

.pagecrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.pagecrumb a {
  color: var(--color-text-muted);
}

.pagecrumb a:hover {
  color: var(--color-primary);
}

.content .title h2 {
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text-strong);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.content .title h2 ul#topmenu {
  gap: 8px;
}

.content .title h2 ul#topmenu a {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  line-height: 32px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  box-shadow: var(--shadow-btn-base);
  display: inline-block;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.content .title h2 ul#topmenu a:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-btn);
}

.pagesub {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ---------- 卡片 ---------- */
.listcard.four ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
}

.listcard.four li {
  position: relative;
  padding: 16px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.listcard.four li:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border-hover);
  transform: translateY(-1px);
}

.listcard.four li p {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.listcard.four li .num {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text-strong);
  font-variant-numeric: tabular-nums;
}

.listcard.four li .icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--color-primary);
}

.listcard.one dl,
.listcard.two dl {
  padding: 18px 20px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  background: var(--color-surface);
}

.listcard.one dl:hover,
.listcard.two dl:hover {
  box-shadow: var(--shadow-card-hover);
}

.listcard.one dl dt,
.listcard.two dl dt {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-strong);
}

.listcard.two {
  gap: 14px;
}

.listcard.two dl {
  flex: 0 0 calc(50% - 7px);
}

.listcard {
  margin-bottom: 14px;
}

.configinfo li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: 13px;
}

.configinfo li:last-child {
  border-bottom: 0;
}

.configinfo li em {
  flex: none;
  font-style: normal;
  color: var(--color-text-muted);
}

.configinfo li span {
  color: var(--color-text);
  text-align: right;
  word-break: break-all;
}

/* ---------- 表格 ---------- */
table {
  border-radius: var(--radius-md);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

table th {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

table th:first-child {
  border-top-left-radius: var(--radius-md);
}

table th:last-child {
  border-top-right-radius: var(--radius-md);
}

table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-table-border);
  color: var(--color-text);
  vertical-align: middle;
}

table tbody tr {
  background: var(--color-surface);
  transition: background-color 0.14s ease;
}

table tbody tr:hover {
  background: var(--color-surface-muted);
}

table tbody tr:last-child td {
  border-bottom: 0;
}

table.tableFull {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

/* ---------- 表单与按钮 ---------- */
.button {
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.button:hover {
  border-color: var(--color-border-hover);
  background: var(--color-surface-muted);
}

.button.is-primary,
.button[type="submit"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-btn-base);
}

.button.is-primary:hover,
.button[type="submit"]:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-btn);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="search"],
select,
textarea {
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
  outline: none;
}

/* ---------- 分页 ---------- */
.pagebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 0 4px;
  font-size: 13px;
}

.pagebar a,
.pagebar span {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.pagebar a:hover {
  border-color: var(--color-border-hover);
  background: var(--color-surface-muted);
}

.pagebar .now-page,
.pagebar span.now-page {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

/* ---------- 提示与浮层 ---------- */
.hint {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  font-size: 13px;
}

.toast {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
}

/* ---------- 登录页 ---------- */
.admin-login {
  background: radial-gradient(1200px 600px at 15% 0%, #eef4ff 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 100%, #f0f7ff 0%, transparent 55%),
              #f6f7f9;
}

.login-container {
  max-width: 420px;
  padding: 32px;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  box-shadow: 0 24px 60px -24px rgba(16, 24, 40, 0.22), 0 2px 6px rgba(16, 24, 40, 0.04);
  background: var(--color-surface);
}

.login-brand {
  text-align: center;
  margin-bottom: 22px;
}

.login-brand img {
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
}

.login-brand h1 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-strong);
}

.login-brand p {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.login-form h2 {
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-strong);
  text-align: left;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.login-form label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.login-form dd {
  margin: 0 0 14px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  height: 40px;
  padding: 0 12px;
  line-height: 40px;
  margin: 0;
  border-radius: var(--radius-sm);
}

.login-form .checkbox {
  margin-bottom: 16px;
  font-size: 13px;
}

.login-form .submit input.button {
  width: 100%;
  height: 40px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.login-form .submit input.button:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-btn-hover);
}

.captcha-img {
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.night.admin-login {
  background: radial-gradient(1000px 600px at 15% 0%, #1b2333 0%, transparent 60%), #131417;
}

/* ---------- 响应式 ---------- */
@media screen and (max-width: 1200px) {
  .listcard.four ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 860px) {
  .main,
  .main.on {
    padding-left: 0;
  }

  .side {
    width: var(--side-w);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .side.on {
    width: var(--side-w);
    transform: translateX(0);
    box-shadow: var(--shadow-pop);
  }

  .side.on .menutitle {
    height: auto;
    margin: 18px 0 6px;
    padding-left: 10px;
    background: none;
    font-size: 11px;
  }

  .side.on .menu li a {
    justify-content: flex-start;
    padding: 0 12px;
    font-size: 14px;
  }

  .side.on .menu li a .ico {
    margin-right: 10px;
  }

  .side.on .sidefoot-text {
    display: inline;
  }

  .fademask.on {
    display: block;
  }

  .content {
    padding: 18px 16px 32px;
  }

  .head {
    padding: 0 14px;
  }

  .headcrumb {
    display: none;
  }

  .backhome {
    display: none;
  }
}

@media screen and (max-width: 640px) {
  .listcard.four ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .listcard.two dl {
    flex: 1 0 100%;
  }

  .content .title h2 {
    font-size: 20px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 统计卡片：分组数据条 ---------- */
.listcard.four li {
  padding-bottom: 22px;
}

.listcard.four li .ratio {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-muted);
  overflow: hidden;
}

.listcard.four li .ratio i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: #2563eb;
  transition: width 0.4s ease;
}

.listcard.four li.g-engage .ratio i {
  background: #10b981;
}

.listcard.four li.g-engage .icon {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.listcard.four li.g-site .ratio i {
  background: #8b5cf6;
}

.listcard.four li.g-site .icon {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

.night .listcard.four li.g-engage .icon {
  color: #34d399;
}

.night .listcard.four li.g-site .icon {
  color: #a78bfa;
}

/* ---------- 列表页容器 ---------- */
.postlist {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  background: var(--color-surface);
  font-size: 13px;
  margin-bottom: 14px;
}

.tr {
  padding: 12px 15px;
  border-bottom: 1px solid var(--color-table-border);
}

.tr.thead {
  padding: 4px 15px;
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.tr:not(.thead):hover {
  background: var(--color-surface-muted);
}

.tr a {
  color: var(--color-text);
}

.tr a:hover {
  color: var(--color-primary);
}

.tr .td-id {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.tr .td-title {
  font-weight: 500;
  color: var(--color-text-strong);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-full {
  flex: 1;
  min-width: 0;
}

.td-pick {
  flex: 0 0 42px;
  width: 42px;
  display: flex;
  align-items: center;
}

.td-pick a {
  font-size: 12px;
  color: var(--color-text-muted);
}

.td-pick a:hover {
  color: var(--color-primary);
}

input[type="checkbox"] {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1px solid var(--color-border-input);
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* 状态标签 */
.tr .td-status span {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.tr .td-status span.draft {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}

.tr .td-status span.review {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.night .tr .td-status span {
  color: #4ade80;
}

.night .tr .td-status span.review {
  color: #fbbf24;
}

/* ------------------------------------------------------------
 * 行操作（编辑 / 删除）
 * 基线 backend-modern.css 把 .td-action a 定义成 20x20 图标按钮，并用
 * .edit/.del { font-size: 0 } 隐藏文字、仅靠 ::before 显示 zblog 图标。
 * 本主题模板却把这些链接改成了中文「编辑 / 删除」，上层又把 font-size
 * 放回 12px —— 两个汉字被塞进 20px 宽的盒子里逐字换行，于是出现
 * 「图标在上 + 竖排文字」的破损态（分类/标签/用户/文章/页面/附件管理页）。
 * 这里统一重定义为 30px 高的横向「图标 + 文字」按钮，与 PluginMng 的
 * .button 组件共用同一套高度、圆角、焦点环与语义色；只作用于 a，
 * 不会误伤筛选区的 <select class="edit">。
 * ------------------------------------------------------------ */
.tr .td-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 148px;
  width: 148px;
  min-width: 0;
  white-space: nowrap;
}

.tr .td-action a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  height: 30px;
  min-width: 64px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: none;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

/* 基线 ::before 是 zblog 图标字体；颜色跟随按钮文字，避免夜间 / hover 脱节 */
.tr .td-action a.edit::before,
.tr .td-action a.del::before {
  flex: none;
  font-family: zblog;
  font-size: 14px;
  line-height: 1;
  color: currentColor;
}

.tr .td-action a:hover {
  border-color: var(--color-border-hover);
  background: var(--color-surface-muted);
}

.tr .td-action a.edit:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

/* #b91c1c on #fef2f2 = 5.95:1，比 #dc2626（4.41:1）更稳地满足 AA */
.tr .td-action a.del:hover {
  color: #b91c1c;
  border-color: #fca5a5;
  background: #fef2f2;
}

.tr .td-action a.edit:hover::before,
.tr .td-action a.del:hover::before {
  color: currentColor;
}

/* 焦点用实线轮廓（primary 对底色 >= 5:1），淡色 ring 只作辅助光晕 */
.tr .td-action a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

/* 夜间 primary #3b82f6 作 12px 文字只有 3.97:1，改用亮一档的蓝 */
.night .tr .td-action a.edit:hover {
  color: #bfdbfe;
}

.night .tr .td-action a.del:hover {
  color: #fca5a5;
  border-color: #7f1d1d;
  background: rgba(220, 38, 38, 0.12);
}

/* 基线在 480px 把 .td-action 变成整行（order:3）；上面的固定宽度会盖掉它，
   这里按同样语义还原，避免手机上按钮被压出容器 */
@media screen and (max-width: 480px) {
  .tr .td-action {
    /* 基线已把 .tr 改成 column，flex-basis 此时作用于「高度」，
       所以只能用 auto + width:100%，不能用 flex: 0 0 100% */
    flex: 0 0 auto;
    width: 100%;
    padding-top: 10px;
    border-top: 1px dashed var(--color-table-border);
  }

  /* 手机端放大触摸目标 */
  .tr .td-action a {
    height: 36px;
    min-width: 72px;
  }
}

/* ---------- 批量操作条 ---------- */
.batchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  color: var(--color-text-muted);
}

.batchbar strong {
  color: var(--color-primary);
  font-weight: 600;
}

.batchbar .button {
  height: 30px;
  font-size: 12px;
}

/* 原生模板里 float 的批量按钮，统一成正常流式按钮 */
form > input.button[type="submit"][name^="all_"] {
  float: none;
  height: 32px;
  margin: 8px 8px 0 0;
  font-size: 12px;
}

/* ---------- 空态 ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px 60px;
  text-align: center;
  background: var(--color-surface);
}

.empty-state-ico {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: var(--color-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.empty-state-ico i::before {
  font-size: 24px;
}

.empty-state-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-strong);
}

.empty-state-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--color-text-muted);
  max-width: 340px;
}

.empty-state .button {
  height: 34px;
}

@media screen and (max-width: 860px) {
  .tr .td-cate,
  .tr .td-author,
  .tr .td-cmt {
    display: none;
  }

  .batchbar {
    flex-wrap: wrap;
  }
}

/* ---------- 暗色切换按钮：内联 SVG 图标（真正 DOM 元素，不依赖图标字体） ---------- */
.theme-toggler {
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggler::before {
  content: none !important;
  display: none !important;
}

.theme-toggler .tt-ico {
  width: 16px;
  height: 16px;
  display: block;
  flex: none;
}

.theme-toggler .tt-sun {
  display: none;
}

.theme-toggler.dark .tt-moon {
  display: none;
}

.theme-toggler.dark .tt-sun {
  display: block;
}

/* 暗色下：给按钮明确的对比度，图标随 currentColor 转浅色 */
.night .theme-toggler {
  background-color: #24252a;
  border-color: #3a3d44;
  color: #e5e7eb;
}

/* ============================================================
 * 模块管理 ModuleMng · 拖拽布局
 * 背景：本页模板使用 .module-layout / .widget-* / .siderbar-* 类名，
 *      其布局规则原本由 zb_system/css/admin2.css 提供；本主题未引入该表，
 *      基线 backend-modern.css 也不含这些规则，导致页面退化为无样式文本流。
 *      此处按主题设计令牌补齐，并顺带做卡片化、拖放反馈与响应式。
 * ============================================================ */
.module-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding-bottom: 24px;
}

.module-layout form#edit {
  display: none;
}

.widget-left,
.widget-right {
  min-width: 0;
}

.widget-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- 左侧：可用模块池 ---- */
.widget-list-group {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.widget-list-header {
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 650;
  color: var(--color-text-strong);
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
}

.widget-list-note {
  padding: 10px 16px 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.widget-list-content {
  display: grid;
  gap: 8px;
  padding: 12px 16px 16px;
  min-height: 60px;
}

/* ---- 模块卡片 ---- */
.widget {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px 8px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--mod-accent, var(--color-primary));
  border-radius: var(--radius-md);
  cursor: move;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.widget:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.widget:focus-within {
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.5;
  color: var(--color-text-strong);
}

.widget-title .module-icon {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--mod-accent, var(--color-primary));
  font-size: 14px;
  line-height: 1;
}

.widget-action {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  margin-left: auto;
}

.widget-action a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}

.widget-action a:hover,
.widget-action a:focus-visible {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.widget-action i {
  font-size: 13px;
  line-height: 1;
}

.funid {
  display: none !important;
}

/* 模块来源：用左侧色条区分，不依赖背景块 */
.widget_source_system      { --mod-accent: #64748b; }
.widget_source_user        { --mod-accent: #2563eb; }
.widget_source_theme       { --mod-accent: #0f9d70; }
.widget_source_themeinclude{ --mod-accent: #d97706; }
.widget_source_plugin      { --mod-accent: #8b5cf6; }
.widget_source_other       { --mod-accent: #94a3b8; }

.night .widget_source_system      { --mod-accent: #94a3b8; }
.night .widget_source_user        { --mod-accent: #60a5fa; }
.night .widget_source_theme       { --mod-accent: #34d399; }
.night .widget_source_themeinclude{ --mod-accent: #fbbf24; }
.night .widget_source_plugin      { --mod-accent: #c4b5fd; }
.night .widget_source_other       { --mod-accent: #a8b3c2; }

/* ---- 右侧：侧栏投放区 ---- */
.widget-right {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  align-items: start;
}

.siderbar-list {
  min-width: 0;
}

.siderbar-drop {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.siderbar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  color: var(--color-text-strong);
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  user-select: none;
}

.siderbar-header:hover {
  color: var(--color-primary);
}

.siderbar-header .roll {
  display: none;
  width: 16px;
  height: 16px;
}

.siderbar-header .ui-icon {
  position: relative;
  display: inline-block;
  flex: none;
  width: 12px;
  height: 12px;
  margin-left: auto;
  background: none;
  text-indent: 0;
  overflow: visible;
}

.siderbar-header .ui-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--color-text-muted);
  border-bottom: 1.5px solid var(--color-text-muted);
  transform: rotate(45deg);
  transition: transform .16s ease;
}

.siderbar-header.clicked .ui-icon::after {
  transform: rotate(-45deg);
}

.siderbar-sort-list {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 96px;
  padding: 12px 14px 16px;
}

.siderbar-note {
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px dashed var(--color-border-input);
  border-radius: var(--radius-sm);
}

/* 已有模块的侧栏：计数提示弱化为文字；虚线框只用于真正的空侧栏。
   :has() 为渐进增强，不支持时退回上面的占位框样式，功能不受影响。 */
.siderbar-sort-list:has(.widget) .siderbar-note {
  padding: 0 0 2px;
  font-size: 11px;
  text-align: left;
  border: 0;
  border-radius: 0;
}

/* ---- 拖放反馈 ---- */
.ui-sortable-placeholder {
  min-height: 38px;
  border: 1px dashed var(--color-primary);
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  visibility: visible !important;
}

.ui-sortable-helper,
.ui-draggable-dragging {
  z-index: 1000;
  box-shadow: var(--shadow-pop) !important;
  opacity: .96;
  list-style: none;
}

.widget-list.ui-droppable-hover {
  outline: 2px dashed var(--color-primary);
  outline-offset: 6px;
  border-radius: var(--radius-md);
}

.siderbar-sort-list.ui-sortable .widget {
  position: relative;
  z-index: 2;
}

/* ---- 响应式 ---- */
@media screen and (max-width: 1100px) {
  .module-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (max-width: 640px) {
  .widget-right {
    grid-template-columns: minmax(0, 1fr);
  }
  .module-layout {
    gap: 14px;
  }
  .widget-list-content,
  .siderbar-sort-list {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ============================================================
 * 插件管理 PluginMng · 操作列与配置弹层
 * 背景：基线 .td-action a 是 20x20 图标按钮，模板改成中文文案后文字被
 *      挤成竖排；插件配置页自带旧后台外壳，故用模态 iframe 承接，
 *      再由 plugin-bridge.css 在 iframe 内做视觉桥接。
 * ============================================================ */

/* ---- 操作列（纯图标按钮）---- */
.plugin-list .tr .plugin-actions-head,
.plugin-list .tr .plugin-actions {
  flex: 0 0 100px;
  width: 100px;
  min-width: 0;
}

.plugin-list .tr.thead .plugin-actions-head {
  text-align: right;
  color: var(--color-text-muted);
}

.plugin-list .tr .plugin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.plugin-list .plugin-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
}

/* 抵消基线 .ico 的 14px 右外边距，纯图标按钮内才能精确居中 */
.plugin-list .plugin-actions .button .ico {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plugin-list .plugin-actions .button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.plugin-list .plugin-actions .button.is-primary {
  color: #fff;
  box-shadow: var(--shadow-btn-base);
}

.plugin-list .plugin-actions .button.is-primary:hover {
  box-shadow: var(--shadow-btn);
}

.plugin-list .plugin-actions .button.btn-manage {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.plugin-list .plugin-actions .button.btn-manage:hover {
  color: #fff;
  background: var(--color-primary);
}

.plugin-list .plugin-actions .button.btn-disable:hover {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

.night .plugin-list .plugin-actions .button.is-primary,
.night .plugin-list .plugin-actions .button.btn-manage:hover {
  color: #0b1220;
}

.night .plugin-list .plugin-actions .button.btn-disable:hover {
  color: #fca5a5;
  border-color: #7f1d1d;
  background: rgba(220, 38, 38, 0.12);
}

/* ---- 旧配置弹层（遗留样式） ----
 * #quicklaunch-modal / #plugin-config-modal 两个全屏模态已移除，
 * 插件 / 主题配置页改由下方 .bm-workspace 内嵌工作区承接。
 * 本段 .pm-* 规则暂留：.pm-icon-btn / .pm-loading / .pm-spinner 仍被
 * 工作区复用，其余（.pm-modal/.pm-panel/.pm-backdrop/.pm-foot…）当前无
 * DOM 匹配，仅作回退备份，确认稳定后可整体清理。 */
.pm-modal[hidden] {
  display: none !important;
}

body.pm-no-scroll {
  overflow: hidden;
}

.pm-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.pm-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1080px, 100%);
  height: min(760px, 100%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: pm-in 0.18s ease-out;
}

@keyframes pm-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pm-panel { animation: none; }
  .pm-spinner { animation: none; }
}

.pm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.pm-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.pm-eyebrow {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-primary);
}

.pm-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--color-text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pm-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.pm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.pm-icon-btn:hover {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.pm-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.pm-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pm-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--color-background);
}

.pm-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.pm-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  background: var(--color-surface);
}

.pm-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: pm-spin 0.7s linear infinite;
}

@keyframes pm-spin {
  to { transform: rotate(360deg); }
}

.pm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 10px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.pm-hint {
  font-size: 12px;
  color: var(--color-text-muted);
}

.pm-foot .button {
  height: 30px;
  font-size: 12px;
}

/* ---- 内嵌工作区（插件 / 主题配置页的打开形态） ----
 * .main 加 .bm-embed-on 时工作区接管右侧内容区：左侧 .side 与顶部 .head
 * 完全不动，无遮罩、无焦点锁，菜单与顶栏在工作区打开期间仍可点击。
 * 关闭（返回按钮 / ESC / 浏览器后退）即还原 .content。 */
.bm-workspace {
  display: none;
  height: calc(100vh - var(--head-h));
  background: var(--color-background);
  overflow: hidden;
}

.main.bm-embed-on .content {
  display: none;
}

.main.bm-embed-on .bm-workspace {
  display: flex;
  flex-direction: column;
  animation: bm-ws-in 0.18s ease-out;
}

@keyframes bm-ws-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .main.bm-embed-on .bm-workspace { animation: none; }
}

.bm-workspace-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  height: 52px;
  padding: 0 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.bm-ws-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px 0 9px;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.bm-ws-back svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bm-ws-back:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.bm-ws-back:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.bm-ws-title {
  flex: 1;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 650;
  color: var(--color-text-strong);
}

.bm-ws-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.bm-workspace-body {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--color-background);
}

.bm-workspace-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media screen and (max-width: 767px) {
  .bm-workspace-head {
    height: 46px;
    padding: 0 12px;
    gap: 10px;
  }

  .bm-ws-back span {
    display: none;
  }

  .bm-ws-back {
    padding: 0 9px;
  }
}

@media screen and (max-width: 900px) {
  .plugin-list .tr .td-15,
  .plugin-list .tr .td-10 {
    display: none;
  }
  .plugin-list .tr .plugin-actions-head,
  .plugin-list .tr .plugin-actions {
    flex-basis: 88px;
    width: 88px;
  }
}

@media screen and (max-width: 767px) {
  .pm-modal { padding: 0; }
  .pm-panel {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }
  .pm-hint { display: none; }
}

@media screen and (max-width: 520px) {
  .plugin-list .tr .plugin-actions-head { display: none; }
  .plugin-list .tr .plugin-actions {
    flex: 1 1 auto;
    width: auto;
  }
  .plugin-list .plugin-actions .button {
    width: 30px;
    min-width: 30px;
    padding: 0;
  }
}

/* 窄屏：基线会把 .tr 变成居中列式卡片，图标/名称/按钮挤成一团。
   这里改成两行列表卡片：首行 logo + 名称，次行操作按钮右对齐。 */
@media screen and (max-width: 767px) {
  .plugin-list .tr {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
  }
  .plugin-list .tr .td-5 {
    flex: 0 0 32px;
    width: 32px;
  }
  .plugin-list .tr .td-full {
    flex: 1 1 calc(100% - 44px);
    width: auto;
    text-align: left;
  }
  .plugin-list .tr .plugin-actions {
    flex: 1 0 100%;
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px dashed var(--color-table-border);
  }
}

/* ============================================================
 * 顶栏「快捷入口」Quick Launch
 * 背景：插件/主题启用后经 Filter_Plugin_Admin_TopMenu 注入的入口，原先由
 *      layout_main.php 仅在后台首页标题栏输出，进入任何子页面就消失。
 *      现统一收进 layout_top.php 顶栏，全后台可见，且随插件数量可扩展。
 * ============================================================ */
.quicklaunch {
  position: relative;
  flex: none;
}

.quicklaunch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.quicklaunch-btn:hover,
.quicklaunch.is-open .quicklaunch-btn {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.quicklaunch-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.quicklaunch-btn svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quicklaunch-caret {
  width: 12px !important;
  height: 12px !important;
  opacity: 0.6;
  transition: transform 0.16s ease;
}

.quicklaunch.is-open .quicklaunch-caret {
  transform: rotate(180deg);
}

.quicklaunch-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2500;
  width: 260px;
  max-width: calc(100vw - 28px);
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}

.quicklaunch-menu[hidden] {
  display: none !important;
}

.quicklaunch-head {
  padding: 8px 10px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--color-table-border);
}

.quicklaunch-head span {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--color-text-strong);
}

.quicklaunch-head small {
  font-size: 11px;
  color: var(--color-text-muted);
}

.quicklaunch-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quicklaunch-list:empty::after {
  content: "暂无可用入口";
  display: block;
  padding: 14px 10px;
  font-size: 12px;
  text-align: center;
  color: var(--color-text-muted);
}

.quicklaunch-list > li {
  float: none;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: transparent;
}

.quicklaunch-list > li > a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}

.quicklaunch-list > li > a:hover,
.quicklaunch-list > li > a:focus-visible {
  outline: none;
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.quicklaunch-list a > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 插件/主题注入的图标：图标字体空 span 与 img 都收敛到 16px */
.quicklaunch-list a > span:empty {
  flex: none;
  width: 16px;
  height: 16px;
  overflow: visible;
}

.quicklaunch-list img,
.quicklaunch-list .aiwb-top-icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
}

@media screen and (max-width: 940px) {
  .quicklaunch-label { display: none; }
  .quicklaunch-btn { padding: 0 9px; }

  /* 窄屏下按钮靠近顶栏左侧，right:0 会让菜单向左溢出视口；
     改为固定定位并占满可用宽度。 */
  .quicklaunch-menu {
    position: fixed;
    top: calc(var(--head-h) + 8px);
    left: 14px;
    right: 14px;
    width: auto;
    max-width: none;
  }
}

/* ============================================================
 * 快捷入口 · 通用弹层（承接插件 / 主题自带页面）
 * 复用 PluginMng 配置弹层的 .pm-* 组件，这里只补三件事：
 *   1) loading 的 hidden 状态；2) 全屏模式；3) 菜单项的「控制台内打开」提示。
 * ============================================================ */
.pm-modal[hidden],
.pm-loading[hidden] {
  display: none !important;
}

.pm-modal.is-expanded {
  padding: 0;
}

.pm-modal.is-expanded .pm-panel {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.pm-modal.is-expanded .pm-backdrop {
  background: rgba(15, 23, 42, 0.82);
}

.pm-icon-btn[aria-pressed="true"] {
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
}

/* 带标记 = 不离开控制台，右侧用小窗口图标作轻量提示 */
.quicklaunch-list > li > a[data-modern-embed]::after {
  content: "";
  flex: none;
  width: 11px;
  height: 9px;
  margin-left: auto;
  border: 1px solid currentColor;
  border-top-width: 3px;
  border-radius: 2px;
  opacity: 0.32;
}

.quicklaunch-list > li > a[data-modern-embed]:hover::after,
.quicklaunch-list > li > a[data-modern-embed]:focus-visible::after {
  opacity: 0.7;
}

@media screen and (max-width: 767px) {
  /* hint 在小屏隐藏后 footer 只剩「完成」，两个弹层统一靠右 */
  .pm-modal .pm-foot { justify-content: flex-end; }
  /* 小屏下弹层本来就铺满视口，全屏按钮点了没有视觉变化，隐藏避免误导。
     两个弹层已统一为 data-bm-expand，一条规则覆盖，不再各写一份。 */
  .pm-icon-btn[data-bm-expand] { display: none; }
}

@media screen and (max-width: 520px) {
  .pm-modal-global .pm-heading { gap: 6px; }
  .pm-modal-global .pm-eyebrow { display: none; }
  .pm-modal-global .pm-tools { gap: 2px; }
}

/* ---------- 文章/页面编辑页（post-edit）修复层 ----------
 * 根因（无头浏览器实测）：
 * 1) common.js 的 niceSelect() 把原生 select 替换为块级 .nice-select，
 *    长 option 文本（如"[当前模板] single (文章 / 单页默认模板)"）把宽度撑到 280px，
 *    超过 grid 第二列 270px → 右栏顶出列边界、与左栏重叠 20px；
 * 2) 基线 #divEditRight { text-align: right } 把行内 label 推到最右缘独占一行，
 *    块级 nice-select 又独占下一行 → 标签与控件脱节；
 * 3) 基线 form.post-edit .editmod label { max-width: 65px } 截断"禁止评论"等长标签。
 * 修复：右栏改 flex 行布局 + label 定宽左对齐 + nice-select 收敛在列内。
 */

/* 右栏整体：取消右对齐，取消 end 收缩，允许占满列宽 */
#divEditRight {
  text-align: left;
  justify-self: stretch;
  min-width: 0;
}

/* 每个 .editmod 一行：label 定宽，控件填充 */
#divEditRight .editmod {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

#divEditRight .editmod label {
  flex: none;
  width: 68px;
  max-width: none;
  text-align: left;
  text-overflow: clip;
  overflow: visible;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* 控件统一填满剩余宽度（含 niceSelect 接管后的替身） */
#divEditRight .editmod select,
#divEditRight .editmod input[type="text"],
#divEditRight .nice-select {
  width: 100%;
  max-width: 100%;
  flex: 1;
  min-width: 0;
}

#divEditRight .nice-select {
  height: 36px;
  line-height: 34px;
  border-radius: var(--radius-sm);
  border-color: var(--color-border-input);
  background-color: var(--color-surface);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
}

#divEditRight .nice-select .current {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

#divEditRight .nice-select .list {
  width: 100%;
  max-width: 100%;
}

/* 置顶下拉保持窄（基线给 80px） */
#divEditRight .editmod#istop .nice-select,
#divEditRight .editmod#istop select {
  flex: none;
  width: 92px;
}

/* checkbox 接管开关（c_admin_js_add 生成 .imgcheck）在行内对齐 */
#divEditRight .editmod .imgcheck {
  flex: none;
  margin: 0;
}

/* 提交按钮：占满行宽，跟控件同列 */
#divEditRight #btnPost {
  width: 100%;
  max-width: 100%;
  flex: 1;
  height: 36px;
}

/* 左栏标题类输入不受影响，但同样解除基线 65px 标签截断 */
form.post-edit .editmod label {
  max-width: none;
}

/* 编辑器区域占满左列 */
#divEditLeft {
  min-width: 0;
}

/* 窄屏：编辑页退化为单列，右栏变全宽 */
@media screen and (max-width: 1100px) {
  form.post-edit {
    grid-template-columns: minmax(0, 1fr);
  }

  #divEditRight {
    order: -1;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
  }
}

/* ---------- 顶栏「清空缓存」固定按钮 ----------
 * 由快捷入口弹层迁出（用户需求：固定在「浏览网站」右侧）。
 * 真实端点 BuildSafeCmdURL('act=misc&type=statistic&forced=1')，
 * misc_statistic() 内部执行 CheckTemplate(forced)+CheckTemplateAdmin(forced) 强制重编译。
 */
.rebuild-btn {
  height: 34px;
  margin-right: 0;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.rebuild-btn .rb-ico {
  width: 14px;
  height: 14px;
  display: block;
  flex: none;
}

.rebuild-btn:hover {
  border-color: var(--color-border-hover);
  background-color: var(--color-surface-muted);
  color: var(--color-text-strong);
}

/* 执行中：图标旋转，禁止重复点击 */
.rebuild-btn.is-busy {
  pointer-events: none;
  opacity: 0.6;
}

.rebuild-btn.is-busy .rb-ico {
  animation: rebuild-spin 0.9s linear infinite;
}

@keyframes rebuild-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 窄屏：只留图标，与 .backhome 收窄规则一致 */
@media screen and (max-width: 860px) {
  .rebuild-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .rebuild-btn .rb-label {
    display: none;
  }
}