:root {
  --primary: #2f6fed;
  --primary-dark: #1f56c8;
  /* 分页/导航等控件用的品牌色：之前缺这个变量，导致 .current 页码背景透明 + 白字＝看起来空白 */
  --brand: #2f6fed;
  --brand-dark: #1f56c8;
  --bg: #f4f6fb;
  --sidebar: #1e2a44;
  --sidebar-2: #263554;
  --text: #26334d;
  --muted: #77839b;
  --border: #e5e9f2;
  --success: #18a058;
  --warning: #d48806;
  --danger: #d9363e;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.side-cols { display: flex; flex-shrink: 0; }
.sidebar {
  background: var(--sidebar); color: #cdd6eb; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.site-col { width: 216px; border-right: 1px solid rgba(255,255,255,.08); }
.site-col .panel-head a { color: #6ea8ff; font-weight: 700; }
.menu-col { width: 168px; background: #fff; border-right: 1px solid var(--border); }
.menu-col .panel-head { color: #5d6b84; }
.menu-col .side-link { color: #3b4a63; }
.menu-col .side-link:hover { background: #f2f6fd; color: #0d3b8f; }
.menu-col .side-link.active { background: #eaf1ff; color: #0d3b8f; border-left-color: var(--primary); font-weight: 600; }
/* 功能菜单层级：一级分组=浅底加粗，二级菜单项=缩进、字号小一点、颜色浅一点 */
.menu-group { border-bottom: 1px solid #f0f3f9; }
.menu-group-head {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px; cursor: pointer;
  color: #26344d; font-weight: 800; font-size: 14px; user-select: none;
  background: #f5f8fd; letter-spacing: .2px;
}
.menu-group-head:hover { background: #e9f0fb; color: var(--primary); }
.menu-group-head .arrow { font-size: 11px; width: 12px; text-align: center; color: #93a3bd; }
.menu-group-items.hidden { display: none; }
.menu-group-items { padding: 2px 0 4px; }
.menu-group-items .side-link {
  padding: 7px 16px 7px 32px; font-size: 13px; color: #5b6b86; font-weight: 400;
  border-left: 3px solid transparent; gap: 0;
}
.menu-group-items .side-link:hover { background: #f2f6fd; color: var(--primary); }
.menu-group-items .side-link.active {
  background: #eaf1ff; color: #0d3b8f; border-left-color: var(--primary); font-weight: 700;
}
/* 功能菜单里没有子项的单项（发布机器）：比二级项更醒目一点 */
.menu-col .side-link.side-single {
  font-size: 14px; font-weight: 700; color: #26344d; padding: 10px 16px; border-bottom: 1px solid #f0f3f9;
}
.menu-col .side-link.side-single:hover { background: #e9f0fb; color: var(--primary); }
.menu-col .side-link.side-single.active { background: #eaf1ff; color: #0d3b8f; border-left-color: var(--primary); }

/* ===== 最左侧栏底部：客户留言 / 数据概览 / 敏感词 / 管理员设置（同级、加粗白色） ===== */
.side-func-nav { border-top: 1px solid rgba(255,255,255,.12); margin-top: 6px; padding: 6px 0 10px; flex-shrink: 0; }
.side-func-link {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  color: #ffffff; font-size: 14px; font-weight: 700; letter-spacing: .2px;
  border-left: 3px solid transparent; text-decoration: none;
}
.side-func-link:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.side-func-link.active { background: var(--sidebar-2); color: #fff; border-left-color: var(--primary); }
.side-func-link .side-func-label { flex: 1; }
/* 客户留言未处理红点（实心圆） */
.msg-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #ef4444; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(239,68,68,.22);
}
/* 搜索命中高亮 */
.side-link.search-hit, .side-func-link.search-hit, .admin-link.search-hit { box-shadow: inset 0 0 0 1px currentColor; }
/* 左侧搜索：结果面板 */
.side-search-wrap { position: relative; padding: 0 0 8px; }
.side-search-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30; max-height: 280px; overflow-y: auto;
  background: #1b2130; border: 1px solid #39415a; border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.35); margin-top: 2px;
}
.side-search-hit {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; color: #dfe6f3; font-size: 13px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.05);
}
.side-search-hit:last-child { border-bottom: 0; }
.side-search-hit:hover { background: #2a3347; color: #fff; text-decoration: none; }
.side-search-hit b { font-weight: 700; color: #fff; }
.side-search-hit span { color: #7f8ba6; font-size: 12px; }
.sidebar .brand { padding: 18px 20px; font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand small { display: block; font-size: 11px; color: #8fa0c4; font-weight: 400; margin-top: 2px; }
.side-group { padding: 12px 14px 6px; font-size: 11px; color: #7f90b3; text-transform: uppercase; letter-spacing: .5px; }
.side-panel { border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: 12px; }
.side-panel:last-child { border-bottom: none; }
.side-panel .panel-head, .panel-head {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 6px;
  font-size: 11px; color: #7f90b3; text-transform: uppercase; letter-spacing: .5px;
}
.side-panel .panel-head a, .panel-head a { color: #7f90b3; font-size: 12px; text-transform: none; }
.side-panel .panel-head a:hover, .panel-head a:hover { color: #fff; }
.site-select-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.domain-list { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 12px; }
.domain-group { padding: 0 12px; margin-bottom: 4px; }
.domain-root { display: flex; align-items: center; gap: 4px; }
.domain-root .toggle { cursor: pointer; color: #8fa0c4; width: 16px; text-align: center; user-select: none; }
.domain-root label { color: #e3e9f5; font-weight: 600; }
.domain-children { padding-left: 8px; }
.domain-children label { color: #b9c5dd; }
.domain-children.hidden { display: none; }
.site-select-links {
  position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; align-items: center; justify-content: center;
  padding: 8px 8px; background: var(--sidebar); border-bottom: 1px solid rgba(255,255,255,.08);
  flex-wrap: nowrap;
}
.site-select-links .btn, .site-select-links .site-count-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 0 4px; flex-wrap: nowrap; }
.site-count-row .site-count-text { color: #8fa0c4; font-size: 12px; white-space: nowrap; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.site-count-row .site-pick-select {
  margin-left: auto; flex: none; width: 68px; height: 24px; min-height: 24px;
  padding: 0 4px; font-size: 12px; line-height: 22px; text-align: center;
  border: 1px solid #39415a; border-radius: 6px; background: #1f2534; color: #dfe6f3; cursor: pointer;
}
.site-pick-select { white-space: nowrap; flex: none; }
.site-select-links .btn { padding: 4px 6px; }
.site-select-links .btn-primary { padding: 4px 8px; }
.site-select-links .site-pick-select { width: 58px; padding: 0 1px; font-size: 11.5px; }
.site-select-links .btn {
  padding: 4px 10px; font-size: 12px; justify-content: center; text-align: center; background: #33415f; color: #dbe3f2;
}
.site-select-links .btn:hover { background: #3d4d70; color: #fff; }
.site-select-links .btn-primary { background: var(--primary); color: #fff; }
.side-link {
  display: flex; align-items: center; gap: 9px; padding: 9px 16px; color: #cdd6eb; font-size: 14px;
  border-left: 3px solid transparent;
}
.side-link:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.side-link.active { background: var(--sidebar-2); color: #fff; border-left-color: var(--primary); }
/* 详情页表单顶部的「描述与 TDK」块（标题后面那一组） */
.tdk-box {
  border: 1px solid #e2eaf8; background: #f8fbff; border-radius: 8px;
  padding: 12px 14px 4px; margin: 6px 0 14px;
}
.tdk-box .tdk-head { font-weight: 700; font-size: 14px; color: #1d4ed8; margin-bottom: 8px; }
.tdk-box .field { margin-bottom: 10px; }

/* 管理员设置：和最左侧栏的「客户留言管理/数据概览/敏感词管理」同级（加粗白色），可折叠 */
.admin-nav { border-top: 1px solid rgba(255,255,255,.10); margin-top: 2px; padding-bottom: 6px; flex-shrink: 0; }
.admin-nav .panel-head { color: #7f90b3; }
.admin-nav-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: #ffffff; letter-spacing: .2px; user-select: none;
  border-left: 3px solid transparent;
}
.admin-nav-head:hover { background: var(--sidebar-2); color: #fff; }
.admin-nav-head .arrow { font-size: 11px; width: 11px; color: #9fb0cd; }
.admin-nav-items.hidden { display: none; }
.admin-nav .admin-link { font-size: 13px; padding: 7px 16px 7px 32px; color: #b9c5dd; }
.admin-nav .admin-link.active { background: var(--sidebar-2); color: #fff; border-left-color: var(--primary); font-weight: 700; }
/* 左侧栏滚动条：细一点、浅一点，别再出现又粗又黑的条 */
.site-col, .site-col .domain-list, .menu-col {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
}
.menu-col { scrollbar-color: rgba(15,23,42,.14) transparent; }
.site-col::-webkit-scrollbar, .site-col .domain-list::-webkit-scrollbar, .menu-col::-webkit-scrollbar { width: 6px; height: 6px; }
.site-col::-webkit-scrollbar-track, .site-col .domain-list::-webkit-scrollbar-track, .menu-col::-webkit-scrollbar-track { background: transparent; }
.site-col::-webkit-scrollbar-thumb, .site-col .domain-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 6px; }
.site-col::-webkit-scrollbar-thumb:hover, .site-col .domain-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.26); }
.menu-col::-webkit-scrollbar-thumb { background: rgba(15,23,42,.14); border-radius: 6px; }
.menu-col::-webkit-scrollbar-thumb:hover { background: rgba(15,23,42,.26); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid var(--border); padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10;
}
.topbar h1, .topbar .topbar-title { margin: 0; font-size: 18px; font-weight: 600; }
.topbar .user { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.content { padding: 24px; }

/* 站点多选栏 */
.site-bar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.site-bar .group { margin: 6px 0; }
.site-bar .group-name { font-weight: 600; margin-right: 8px; }
.site-bar label { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; cursor: pointer; }

/* 卡片 */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 14px; font-size: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat .num { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat .label { color: var(--muted); font-size: 13px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
/* 标题列稍窄一点，其余列不换行，避免右侧内容被挤掉 */
th.col-title, td.col-title { white-space: normal; width: 300px; max-width: 300px; min-width: 220px; }
td.col-title a { word-break: break-word; }
td .cell-sub { color: var(--muted); font-size: 12px; }
/* tag标签列：允许换行，避免标签多时把表格撑宽 */
th.col-tags, td.col-tags { white-space: normal; min-width: 120px; max-width: 240px; }
td.col-tags .tag-pill { margin: 2px 4px 2px 0; }
th { background: #f8fafd; color: #5a6884; font-weight: 600; font-size: 13px; white-space: nowrap; }
tr:hover td { background: #fafcff; }
.table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
/* 操作列是 <td>，必须保持 table-cell：之前给它加了 display:flex，
   单元格脱离表格布局后行高与横向分割线整体错位（编辑/删除那一列会凸出来）。
   这里还原成表格单元格，用内部元素的 inline-flex + 间距实现原来的排版。 */
td.table-actions { display: table-cell; vertical-align: middle; white-space: nowrap; }
td.table-actions > * { display: inline-flex; align-items: center; vertical-align: middle; }
td.table-actions > * + * { margin-left: 8px; }
/* 编辑是 <a>、删除是 <button>，两者字号和内边距不一致会一高一低，这里统一成一样高 */
.table-actions .btn-link,
.table-actions .btn.btn-sm.btn-link,
.table-actions button.btn-link {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; min-width: 40px; padding: 0 8px;
  font-size: 13px; line-height: 1; border-radius: 6px;
}
/* 机构管理 / 采样中心管理等「动态列」表：列多时自动换行，表格占满宽度、不出现横向滚动条 */
.table-fit { width: 100%; table-layout: fixed; }
.table-fit th, .table-fit td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  font-size: 13px;
}
.table-fit th:first-child, .table-fit td:first-child { width: 42px; }
.table-fit th:nth-child(2), .table-fit td:nth-child(2) { width: 58px; }
/* 操作列放得下「编辑 删除」两个按钮，避免换成两行 */
.table-fit th:last-child, .table-fit td:last-child { width: 124px; }
.table-fit td.table-actions > * + * { margin-left: 6px; }
/* 首页设置：每张轮播图一块卡片 */
.banner-row { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 12px; background: #fff; }
.banner-row .row { margin-bottom: 4px; }

/* 表单 */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], input[type=url],
select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > label.field { flex: 1; min-width: 220px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 7px;
  border: 1px solid transparent; cursor: pointer; font-size: 14px; font-family: inherit; background: #eef2f8; color: var(--text);
  box-shadow: none;
}
button, .btn, .btn-link, a.btn { box-shadow: none !important; outline: none !important; }
button:focus, .btn:focus, .btn-link:focus, a.btn:focus { outline: none !important; box-shadow: none !important; }
/* <button> 默认带浏览器原生立体边框（就是编辑/删除按钮上的“浮雕阴影”），这里彻底去掉 */
button, input[type=submit], input[type=button] {
  appearance: none; -webkit-appearance: none; background-image: none;
  border: 0; box-shadow: none !important;
}
button:focus-visible, .btn:focus-visible, .btn-link:focus-visible, a.btn:focus-visible,
button:active, .btn:active, .btn-link:active {
  outline: none !important; box-shadow: none !important; border-color: transparent;
}
.btn:hover { filter: brightness(.97); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-link { background: none; color: var(--primary); padding: 3px 6px; box-shadow: none; }
.btn-link.danger { color: var(--danger); }
.apply-site-btn { font-weight: 700; box-shadow: none; background: var(--success); color: #fff; }
.apply-site-btn:hover { background: var(--success); filter: brightness(.95); }
.top-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.top-actions select { max-width: 240px; }

/* 弹窗 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(18, 28, 48, .5); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: 12px; padding: 20px 24px; width: min(760px, 96vw);
  max-height: 90vh; overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head .close { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }

/* 客户留言表：列多，压缩列宽并让操作列吸附右侧，保证「处理/修改/删除」始终可见 */
.msg-table th, .msg-table td { white-space: nowrap; padding: 8px 8px; font-size: 13px; }
.msg-table td.msg-content { max-width: 180px; white-space: normal; word-break: break-all; font-size: 12px; color: #475569; line-height: 1.5; }
.msg-table td.msg-ip { font-size: 12px; color: #64748b; }
.msg-table thead th { font-size: 13px; }
.msg-table th:last-child, .msg-table td:last-child {
  position: sticky; right: 0; background: #fff; z-index: 1;
  box-shadow: -8px 0 10px -8px rgba(15, 23, 42, .28);
}
.msg-table thead th:last-child { background: #f8fafc; }

/* 栏目设置弹框 */
.column-manage { display: flex; flex-direction: column; }
.column-manage .brand-manage-list { max-height: 300px; }
.column-manage .row input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; }
/* 栏目设置：一级域名分组（可折叠，默认收起） */
.col-group {
  border: 1px solid #e3ebf8; border-radius: 8px; margin-bottom: 10px; background: #fff;
}
.col-group > summary {
  cursor: pointer; padding: 10px 14px; background: #f5f8fd; border-radius: 8px;
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: #26344d;
  list-style: none; user-select: none;
}
.col-group > summary::-webkit-details-marker { display: none; }
.col-group > summary::before { content: '▸'; color: #1d4ed8; font-weight: 700; }
.col-group[open] > summary::before { content: '▾'; }
.col-group[open] > summary { border-radius: 8px 8px 0 0; border-bottom: 1px solid #e3ebf8; }
.col-group > summary .hint { font-weight: 400; }
.col-group-body { padding: 12px 14px 14px; }
.col-group-add { margin-bottom: 10px; }
.col-group-add input {
  width: 100%; padding: 10px 12px; font-size: 14px; border-radius: 8px;
  border: 2px dashed #2563eb; background: #f4f8ff; color: #1e3a8a;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.col-group-add input::placeholder { color: #5b8def; font-weight: 600; }
.col-group-add input:hover { border-color: #1d4ed8; background: #eaf2ff; }
.col-group-add input:focus {
  outline: none; border-color: #1d4ed8; border-style: solid; background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.modal-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 0 4px; border-top: 1px solid #eef2f7;
  /* 分组多的时候，保存按钮贴在弹框底部一直可见 */
  position: sticky; bottom: -20px; background: #fff; z-index: 2;
}
.modal-foot .hint { flex: 1; min-width: 220px; }
.column-table-wrap { max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.column-table { width: 100%; border-collapse: collapse; }
.column-table th { background: #f8fafc; font-size: 13px; color: #475569; }
.column-table th, .column-table td { padding: 8px 10px; border-bottom: 1px solid #eef2f7; }
.column-table td input[type=text] { width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; }
.column-table td input[type=number] { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; }
.col-inline-form { display: contents; }

/* 表头设置横向 */
.header-setting-row { display: flex; flex-wrap: wrap; gap: 8px; }
.header-setting-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 7px; background: #fff; font-size: 13px;
}
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; background: #eaf1ff; color: var(--primary); padding: 3px 10px; border-radius: 20px; font-size: 13px; }
.tag-chip.empty { background: #f0f2f7; color: var(--muted); }
.tag-chip a { cursor: pointer; color: var(--danger); text-decoration: none; }

/* 标签 / 徽章 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; }
.badge-green { background: #e6f7ef; color: var(--success); }
.badge-gray { background: #eef2f8; color: var(--muted); }
.badge-orange { background: #fff4e0; color: var(--warning); }
.badge-red { background: #fdecec; color: var(--danger); }
.tag-pill { display: inline-flex; align-items: center; gap: 4px; background: #eaf1ff; color: var(--primary); padding: 2px 9px; border-radius: 20px; font-size: 12px; margin: 2px 3px 2px 0; }

/* 提示 */
.alert { padding: 11px 15px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #e6f7ef; color: var(--success); }
.alert-error { background: #fdecec; color: var(--danger); }
.alert-warning { background: #fff4e0; color: var(--warning); }

/* 分页 */
.pagination { display: flex; gap: 6px; margin: 16px 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 编辑器 */
.editor-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
#editor { min-height: 360px; }

/* 媒体选择器 */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.media-item img { width: 100%; height: 100px; object-fit: cover; display: block; background: #f0f2f7; }
.media-item .m-body { padding: 8px; }
.media-item .m-body input { font-size: 12px; }
.thumb { width: 60px; height: 42px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; white-space: normal; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .left, .toolbar .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar form { flex-wrap: nowrap; }
.toolbar select { max-width: 180px; }
.toolbar input[type=text] { max-width: 190px; }
.toolbar input[type=file] { max-width: 220px; font-size: 12px; }
.toolbar .btn { white-space: nowrap; flex-shrink: 0; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.checkbox-group label { display: inline-flex; align-items: center; gap: 6px; margin: 3px 10px 3px 0; }

/* GEO / AI 优化 */
.muted { color: var(--muted); font-size: 12px; }
.img-field { display: flex; gap: 8px; align-items: center; }
/* 流程 / 样本「关联图片」：多图缩略图 + 移除 */
.module-images-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.module-image-card { position: relative; width: 112px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.module-image-card img { width: 100px; height: 76px; object-fit: cover; border-radius: 5px; background: #e9eef5; }
.module-image-card .btn-link { font-size: 12px; }
.img-field input { flex: 1; }
.pill-ok { display: inline-block; padding: 5px 12px; border-radius: 999px; background: #e8f1ff; color: #2563eb; font-size: 13px; font-weight: 600; }
.card code { background: #f2f4f8; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* 域名管理：按层级折叠 */
.domain-child-row { display: none; }
.domain-child-row.show { display: table-row; }
.tree-toggle {
  display: inline-block; width: 20px; height: 20px; line-height: 18px; text-align: center;
  margin-right: 6px; border-radius: 4px; background: #e8eefb; color: #2f6fed; font-size: 12px;
  cursor: pointer; vertical-align: middle; padding: 0;
}
.tree-toggle.placeholder { background: none; cursor: default; }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e2a44, #2f6fed); }
.login-card { background: #fff; border-radius: 14px; padding: 38px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card p { color: var(--muted); margin: 0 0 22px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .side-cols { flex-direction: column; width: 100%; }
  .sidebar, .site-col, .menu-col { width: 100%; height: auto; position: static; }
  .content { padding: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .row > label.field { min-width: 100%; }
}

/* 图片文件缺失时的占位（媒体库里指向已删除文件的记录） */
img.img-broken{background:#eef2f8 url('data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'80\' height=\'60\'><rect width=\'100%\' height=\'100%\' fill=\'%23eef2f8\'/><text x=\'50%\' y=\'54%\' font-size=\'12\' fill=\'%2394a3b8\' text-anchor=\'middle\'>图片缺失</text></svg>') center/100% 100% no-repeat;min-height:60px;display:block;}

/* ===== 主导航栏目表格：不横向滚动，列宽固定，超长内容省略号 ===== */
.nav-table-wrap { overflow-x: hidden; }
.nav-table { table-layout: fixed; width: 100%; }
.nav-table th, .nav-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; padding-right: 8px; }
.nav-table td.table-actions { overflow: hidden; text-overflow: clip; white-space: normal; }
.nav-table td.table-actions .btn-link { display: inline; margin: 0 4px 2px 0; padding: 2px 4px; font-size: 12px; }
.nav-table td.table-actions form { display: inline; }
.nav-table td.table-actions .table-actions { flex-wrap: wrap; }

/* ===== 主导航栏目分页 ===== */
.nav-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 2px; flex-wrap: wrap; }
.nav-pager-total { color: var(--muted); font-size: 12px; }
.nav-pager .pagination { display: flex; gap: 6px; align-items: center; }
.nav-pager .pagination a { min-width: 30px; height: 30px; line-height: 28px; text-align: center; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; color: #4b5563; font-size: 13px; text-decoration: none; }
.nav-pager .pagination a:hover { border-color: var(--brand); color: var(--brand); }
.nav-pager .pagination a.current { background: var(--brand, #2f6fed); border-color: var(--brand, #2f6fed); color: #fff; }

/* ===== 列表「共 N 条」 ===== */
.list-total { color: var(--muted); font-size: 13px; align-self: center; }
.list-total b { color: var(--brand, #2563eb); font-size: 15px; }

/* ===== 通用分页（底部「共 N 条」+ 左右箭头 + 最多 10 个页码） ===== */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 2px; flex-wrap: wrap; }
.pager-total { color: var(--muted); font-size: 13px; }
.pager-total b { color: var(--brand, #2563eb); font-size: 15px; }
.pager-pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager-pages a { min-width: 30px; height: 30px; line-height: 28px; text-align: center; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; color: #4b5563; font-size: 13px; text-decoration: none; }
.pager-pages a:hover { border-color: var(--brand); color: var(--brand); }
.pager-pages a.current { background: var(--brand, #2f6fed); border-color: var(--brand, #2f6fed); color: #fff; }
.pager-pages a.pager-arrow { font-size: 16px; line-height: 26px; padding: 0 6px; }
.pager-pages a.is-disabled { color: #cbd5e1; border-color: #eef2f7; cursor: not-allowed; }
.pager-pages a.is-disabled:hover { color: #cbd5e1; border-color: #eef2f7; }
.pager-gap { color: #94a3b8; padding: 0 2px; font-size: 13px; }

/* ===== 左侧站点树（品牌 → 一级域名 → 城市级别 → 二级域名） ===== */
.site-node { padding-left: 0; }
.site-line { display: flex; align-items: center; gap: 4px; }
.site-children { padding-left: 0; }
.city-line { display: flex; align-items: center; gap: 4px; color: #9fb0cf; font-size: 12px; }
.city-name { color: #9fb0cf; }
.city-children { padding-left: 18px; }
.city-children .city-item { display: block; color: #b9c5dd; font-size: 12px; padding: 1px 0; }
.city-empty { color: #5f6b85; font-size: 12px; padding: 1px 0 1px 18px; }
.site-children.hidden, .city-children.hidden, .domain-children.hidden { display: none; }

/* ===== 左侧站点树 / 功能菜单：悬浮一律手型 ===== */
.site-col .domain-root,
.site-col .site-line,
.site-col .city-line,
.site-col .site-item,
.site-col .city-item,
.site-col label.site-item,
.site-col .toggle,
.menu-col .side-link,
.menu-col .menu-group-head,
.site-bar label,
a, button, .btn, .btn-link { cursor: pointer; }
.site-col .domain-root:hover,

.site-col input[type=checkbox] { cursor: pointer; }

/* 栏目设置弹框：操作结果提示条 */
.columns-modal-msg { margin: 10px 0 2px; padding: 9px 12px; border-radius: 6px; font-size: 13px; }
.columns-modal-msg.is-ok { background: #e8f7ee; color: #16794a; border: 1px solid #b7e4c9; }
.columns-modal-msg.is-err { background: #fdeaea; color: #b42318; border: 1px solid #f5c2c0; }

/* ===== 左侧站点树（参考图规格）===== */
.site-select-links .btn { padding: 4px 10px; }
.site-pick-hint { font-size: 11px; color: #a9b3c6; line-height: 1.5; margin: 4px 0 6px; padding: 0 18px; }

/* 品牌行 */
.domain-root .brand-name { color: #ffffff; font-size: 14px; }
.domain-root .brand-count { margin-left: 6px; font-size: 11px; color: #8fa0c4; background: #262e40; border-radius: 8px; padding: 0 6px; }

/* 每一级：缩进 0 / 20 / 40 / 60，行高 42，端口靠右 */
.site-node { position: relative; }
.site-node.lv1 { --pad: 0px; }
.site-node.lv2 { --pad: 20px; }
.site-node.lv3 { --pad: 40px; }
.site-node.lv4 { --pad: 60px; }
.site-node.lv5 { --pad: 80px; }

.site-line {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  height: 42px;
  padding-left: var(--pad, 0px);
  padding-right: 8px;
  box-sizing: border-box;
  cursor: default;
  transition: background .14s;
}
.site-line:hover { background: rgba(255, 255, 255, 0.06); }
.site-line.is-checked { background: rgba(59, 130, 246, 0.18); }

/* L 型连接线：2px、#475570 */
.site-node:not(.lv1) > .site-line::before {
  content: '';
  position: absolute;
  left: calc(var(--pad) - 10px);
  top: 0;
  height: 100%;
  width: 2px;
  background: #475570;
}
.site-node:not(.lv1):last-child > .site-line::before { height: 21px; }
.site-node:not(.lv1) > .site-line::after {
  content: '';
  position: absolute;
  left: calc(var(--pad) - 10px);
  top: 20px;
  width: 10px;
  height: 2px;
  background: #475570;
  border-bottom-left-radius: 4px;
}

/* 复选框 */
.site-line .site-check { flex: none; width: 15px; height: 15px; margin: 0 1px 0 0; cursor: pointer; }

/* 箭头：复选框和文字中间；收起 ▶，展开 ▼ */
.site-line .toggle {
  flex: none;
  width: 14px;
  text-align: center;
  font-size: 10px;
  line-height: 14px;
  color: #93a3bd;
  cursor: pointer;
  user-select: none;
  transition: transform .15s;
}
.site-line .toggle:hover { color: #ffffff; }
.site-line .toggle-empty { visibility: hidden; }

/* 名称与端口 */
.site-line .site-item { display: flex; align-items: center; min-width: 0; flex: 1 1 auto; cursor: pointer; margin-left: 0; padding-left: 0; }
.site-line .site-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-line .site-port { flex: none; margin-left: auto; font-size: 12px; color: #8496b2; }

/* 字号与颜色逐级递减 */
.site-line.lv1 .site-name { font-size: 14px; color: #ffffff; font-weight: 600; }
.site-line.lv1 .site-port { color: #9aa8c2; }
.site-line.lv2 .site-name { font-size: 13px; color: #e2e8f0; }
.site-line.lv2 .site-port { color: #a8b6cd; }
.site-line.lv3 .site-name { font-size: 12.5px; color: #a1b3d6; }
.site-line.lv3 .site-port { color: #8a9cbd; }
.site-line.lv4 .site-name { font-size: 12px; color: #8496b2; }
.site-line.lv4 .site-port { color: #71829e; }
.site-line.lv5 .site-name { font-size: 12px; color: #8496b2; }

.site-empty { padding: 2px 0 2px 22px; color: #5f6b85; font-size: 12px; }


/* 单选模式：勾选框显示成圆形，便于区分 */
body.site-single-mode .site-check { border-radius: 50%; }

/* 折叠三角：站点树 / 品牌行 / 功能菜单 / 管理员设置 统一同一种大小 */
.site-line .toggle,
.domain-root .toggle,
.menu-group-head .arrow,
.admin-nav-head .arrow {
  font-size: 11px;
  line-height: 1;
  width: 12px;
  min-width: 12px;
  text-align: center;
  color: #93a3bd;
  user-select: none;
  cursor: pointer;
}


/* 左侧栏底部功能区固定 */
.sidebar.site-col { display: flex; flex-direction: column; }
.sidebar.site-col .domain-list { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.side-func-nav {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding-top: 10px;
  background: inherit;
  z-index: 6;
}


/* 左侧栏：树区域独立滚动 */
.sidebar.site-col { height: 100vh; max-height: 100vh; overflow: hidden; position: sticky; top: 0; }
.sidebar.site-col .site-select-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.sidebar.site-col .domain-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}
/* 滚动条细化，避免遮住树里的字 */
.sidebar.site-col .domain-list::-webkit-scrollbar { width: 8px; }
.sidebar.site-col .domain-list::-webkit-scrollbar-thumb { background: #46506b; border-radius: 4px; }
.sidebar.site-col .domain-list::-webkit-scrollbar-track { background: transparent; }
.side-func-nav { flex: 0 0 auto; position: sticky; bottom: 0; margin-top: 0; background: inherit; z-index: 6; }


/* 左侧栏修正 v2 */
.side-cols { height: 100vh; max-height: 100vh; overflow: hidden; }
.sidebar.site-col {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
}
.sidebar.site-col .site-select-form {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
}
.sidebar.site-col .domain-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: calc(100vh - 340px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
.side-func-nav {
  position: static !important;
  flex: 0 0 auto !important;
  background: #1b2130 !important;
  border-top: 1px solid rgba(255, 255, 255, .10) !important;
  padding-top: 8px !important;
  margin-top: 0 !important;
  z-index: 7 !important;
}


/* 底部菜单强制固定 v3 */
.sidebar.site-col .side-func-nav {
  position: fixed !important;
  bottom: 0 !important;
  margin: 0 !important;
  background: #1b2130 !important;
  border-top: 1px solid rgba(255, 255, 255, .12) !important;
  box-shadow: 0 -6px 14px rgba(0, 0, 0, .30) !important;
  z-index: 9999 !important;
}


/* 后台整页固定框架 v4 */
html, body { height: 100% !important; overflow: hidden !important; }
body { display: flex !important; align-items: stretch !important; }

/* 左侧两列 */
.side-cols {
  flex: 0 0 auto !important;
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: stretch !important;
}
.sidebar.site-col, .sidebar.menu-col {
  height: 100vh !important;
  max-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.sidebar.site-col .domain-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
}
/* 底部功能菜单：在侧栏内部固定于底部（不再用 fixed，避免脱离布局） */
.sidebar.site-col .side-func-nav {
  position: static !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  background: #1b2130 !important;
  border-top: 1px solid rgba(255, 255, 255, .12) !important;
  box-shadow: none !important;
}

/* 右侧主区：内部滚动 */
.main {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  height: 100vh !important;
  max-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.main .content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}


/* 固定框架 v5（仅后台页面） */
/* ① 先把 v4 的全局限制复原（登录页、其它页面不再被拉成整屏） */
html, body { height: auto !important; overflow: visible !important; }
body { display: block !important; }

/* ② 只有后台页面（JS 会加 dsh-shell 类）才启用固定框架 */
body.dsh-shell { height: 100vh !important; max-height: 100vh !important; overflow: hidden !important; display: flex !important; align-items: stretch !important; }
body.dsh-shell .side-cols {
  flex: 0 0 auto !important; height: 100vh !important; max-height: 100vh !important;
  overflow: hidden !important; display: flex !important; align-items: stretch !important;
}
body.dsh-shell .sidebar.site-col,
body.dsh-shell .sidebar.menu-col {
  height: 100vh !important; max-height: 100vh !important;
  display: flex !important; flex-direction: column !important; overflow: hidden !important;
}
body.dsh-shell .sidebar.site-col .domain-list {
  flex: 1 1 auto !important; min-height: 0 !important; max-height: none !important; overflow-y: auto !important;
}
body.dsh-shell .sidebar.site-col .side-func-nav {
  position: static !important; flex: 0 0 auto !important; margin: 0 !important;
  background: #1b2130 !important; border-top: 1px solid rgba(255,255,255,.12) !important; box-shadow: none !important;
}
body.dsh-shell .main {
  flex: 1 1 auto !important; min-width: 0 !important; height: 100vh !important; max-height: 100vh !important;
  display: flex !important; flex-direction: column !important; overflow: hidden !important;
}
body.dsh-shell .main .content { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; overflow-x: hidden !important; }


/* 框架 v6：登录居中 + 主区铺满 */
/* ① 登录页保持居中（.login-page 自己是 flex 居中，不能被 block 覆盖） */
html, body { height: auto !important; overflow: visible !important; }
body:not(.login-page) { display: block !important; }
body.login-page { display: flex !important; align-items: center !important; justify-content: center !important; min-height: 100vh !important; }

/* ② 后台页面：主区铺满剩余宽度 */
body.dsh-shell { display: flex !important; height: 100vh !important; overflow: hidden !important; }
body.dsh-shell .side-cols { flex: 0 0 auto !important; height: 100vh !important; overflow: hidden !important; }
body.dsh-shell .main {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
body.dsh-shell .main .content {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* ③ 数据总览：统计卡片横向排列 */
body.dsh-shell .stat-grid,
.stat-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  gap: 14px !important;
  align-content: start !important;
  width: 100% !important;
}
.stat-grid > * { min-width: 0 !important; }


/* 框架 v7：.app 铺满 */
body.dsh-shell { display: flex !important; height: 100vh !important; overflow: hidden !important; }
body.dsh-shell .app {
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100vh !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  overflow: hidden !important;
}
body.dsh-shell .app > .side-cols { flex: 0 0 auto !important; height: 100vh !important; overflow: hidden !important; }
body.dsh-shell .app > .main {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
body.dsh-shell .app > .main > .content {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* 发布机器图片资源槽位 */
.pm-image-slot { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: #fafbfd; }
.pm-image-slot-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pm-image-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pm-image-item { width: 104px; padding: 5px; border: 1px solid var(--border); border-radius: 6px; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pm-image-item img { width: 94px; height: 70px; object-fit: cover; border-radius: 4px; background: #e9eef5; }
.pm-image-item .btn-link { font-size: 12px; }
.pm-random-cell { white-space: normal !important; overflow: hidden; }

/* 两列菜单各自折叠 */
.side-collapse-btn{margin-left:auto;background:transparent;border:1px solid #39415a;color:#cfd8e3;border-radius:4px;width:22px;height:22px;line-height:1;cursor:pointer;font-size:12px;padding:0;}
.side-collapse-btn:hover{background:#2a3242;color:#fff;}
.sidebar.is-collapsed{flex:0 0 46px !important;width:46px !important;min-width:46px !important;padding-left:6px !important;padding-right:6px !important;overflow:hidden;}
.sidebar.is-collapsed > *:not(.panel-head):not(.brand){display:none !important;}
.sidebar.is-collapsed .panel-head > span,
.sidebar.is-collapsed .panel-head > a{display:none !important;}
.sidebar.is-collapsed .panel-head{justify-content:center;}
