/* ==========================================================================
   Console Design System v2  ·  Ninyao 租户后台
   从零重写的完整视觉层，取代 console.css / console-content.css /
   ui-system.css / console-responsive.css 四份历史样式叠加。
   作用域：body.cx（仅租户后台）。类名接口保持与现有视图兼容，
   因此业务视图无需改动 form / name / csrf / hx-* 等契约。
   ========================================================================== */

/* ---------- 1. 令牌 ---------- */
body.cx{
  --cx-navy:#0B1533;
  --cx-navy-2:#101E46;
  --cx-brand:#2B5BFF;
  --cx-brand-soft:#EEF2FF;
  --cx-mint:#10BFA0;
  --cx-mint-soft:#E6F9F4;
  --cx-red:#F05252;
  --cx-red-soft:#FFF1F1;
  --cx-amber:#F5A524;
  --cx-amber-soft:#FFF6E5;
  --cx-ink:#0C1633;
  --cx-text:#3A4763;
  --cx-muted:#8491AB;
  --cx-line:#E9EEF7;
  --cx-line-soft:#F0F3F9;
  --cx-bg:#F5F7FB;
  --cx-surface:#FFFFFF;
  --cx-radius:14px;
  --cx-radius-sm:9px;
  --cx-shadow:0 1px 2px rgba(16,32,72,.04),0 8px 24px rgba(16,32,72,.03);
  --cx-side-w:252px;
  /* 侧栏品牌行与右侧顶栏共用同一高度，避免两条头部分界线错开 */
  --cx-head-h:64px;
  /* 覆盖 app.css 的旧 :root 变量，让视图内联 var(--line) / var(--blue) 等自动跟随新体系 */
  --ink:#0C1633;--muted:#8491AB;--line:#E9EEF7;--soft:#F5F7FB;
  --blue:#2B5BFF;--blue-soft:#EEF2FF;
  --green:#0A8F78;--green-soft:#E6F9F4;
  --amber:#B97806;--amber-soft:#FFF6E5;
  --red:#D04545;--red-soft:#FFF1F1;
  margin:0;
  background:var(--cx-bg);
  color:var(--cx-text);
  font:12px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",Inter,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
body.cx *,body.cx *::before,body.cx *::after{box-sizing:border-box}
body.cx ::selection{background:var(--cx-brand);color:#fff}

/* ---------- 2. 作用域内基础重置（压过 app.css 的通用规则） ---------- */
body.cx a{color:inherit;text-decoration:none}
body.cx a:hover{text-decoration:none}
body.cx a:not([class]):hover{color:var(--cx-brand)}
body.cx h1,body.cx h2,body.cx h3,body.cx h4{color:var(--cx-ink);font-weight:700;margin:0;line-height:1.35}
body.cx h1{font-size:24px;letter-spacing:-.4px}
body.cx h2{font-size:16px}
body.cx h3{font-size:14px}
body.cx p{margin:0 0 10px}
body.cx p:last-child{margin-bottom:0}
body.cx ul,body.cx ol{margin:0;padding:0;list-style:none}
body.cx code{
  font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;
  background:#F2F5FB;border:1px solid var(--cx-line);border-radius:6px;padding:2px 6px;color:#4A5B85;
}
body.cx b,body.cx strong{font-weight:700;color:var(--cx-ink)}
body.cx .muted,body.cx .small.muted{color:var(--cx-muted)}
body.cx .small{font-size:12.5px}
body.cx label{display:block;font-size:13px;font-weight:600;color:var(--cx-text);margin:0 0 6px}
body.cx .ico{width:17px;height:17px;flex:0 0 auto;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

/* ---------- 3. 布局骨架 ---------- */
body.cx .app-shell{display:flex;min-height:100vh;align-items:stretch}
body.cx .nav-toggle{position:absolute;width:0;height:0;opacity:0;pointer-events:none}
body.cx .nav-mask{display:none}
body.cx .content{
  flex:1 1 auto;min-width:0;margin-left:var(--cx-side-w);
  display:flex;flex-direction:column;min-height:100vh;background:var(--cx-bg);
}
body.cx .content > main{flex:1 1 auto;min-width:0;padding:0;margin:0;min-height:0}
/* 宽度统一：main 内「任意层级」的 .wrap 一律铺满，压过 app.css 的
   .wrap{max-width:1080px;margin:0 auto}。只给最外层容器留白，这样无论
   整页加载、htmx 局部换页，还是以后视图里自带 .wrap，都不会忽宽忽窄。 */
body.cx .content > main .wrap{
  max-width:1080px;margin:0 auto;
}
body.cx .content > main > .wrap#main-content,
body.cx .content > main > .wrap{
  padding:28px 32px 40px;
}
/* 未登录页面（登录 / 团队邀请）没有导航，侧栏与留白一并收起 */
body.cx.cx-no-nav .sidebar{display:none}
body.cx.cx-no-nav .content{margin-left:0}
body.cx.cx-no-nav .nav-burger{display:none}
body.cx .content > footer{
  padding:16px 32px 22px;color:var(--cx-muted);font-size:12px;
}
body.cx .content > footer .wrap{max-width:none;padding:0;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;border:0}
body.cx .content > footer a{color:var(--cx-muted)}
body.cx .content > footer a:hover{color:var(--cx-brand)}

/* ---------- 4. 侧栏 ---------- */
body.cx .sidebar{
  /* 不写 inset 简写：部分移动 WebView 不支持，会退化成 height:auto 导致菜单被裁掉且无法滚动 */
  position:fixed;top:0;left:0;bottom:0;right:auto;
  width:var(--cx-side-w);height:100vh;height:100dvh;max-height:100vh;
  z-index:40;display:block;padding:0;border:0;
  overflow-y:auto;overflow-x:hidden;
  -webkit-overflow-scrolling:touch;overscroll-behavior:contain;
  /* 桌面端隐藏滚动条，仍可滚轮 / 触控板滚动；抽屉态在 <=980px 断点恢复可见 */
  scrollbar-width:none;scrollbar-color:transparent transparent;
  background:linear-gradient(178deg,#0B1533 0%,#0E1B40 58%,#0A122C 100%);
  color:#C6D2EE;
  box-shadow:1px 0 0 rgba(255,255,255,.05);
}
body.cx .sidebar::-webkit-scrollbar{display:none;width:0;height:0}
body.cx .sidebar::-webkit-scrollbar-track{background:rgba(255,255,255,.06);border-radius:9px}
body.cx .sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.3);border-radius:9px}
/* 头部区吸顶：品牌行 + 公司名称 / 服务状态卡片始终可见。
   滚动容器是整个侧栏（不是菜单区），头部用 sticky 覆盖在滚动内容之上，
   不依赖 flex 高度计算，兼容性最稳。 */
body.cx .sidebar__head{
  position:sticky;top:0;z-index:5;
  background:#0B1533;
  border-bottom:1px solid rgba(255,255,255,.06);
  box-shadow:0 6px 14px rgba(6,12,30,.16);
}
body.cx .sidebar__close{
  display:none;width:28px;height:28px;margin-left:8px;flex:0 0 28px;
  place-items:center;border-radius:8px;color:#AEBBD8;
  background:rgba(255,255,255,.08);cursor:pointer;
}
body.cx .sidebar__close:hover{background:rgba(255,255,255,.16);color:#fff}
body.cx .sidebar__close .ico{width:16px;height:16px}
body.cx .sidebar__brand{
  display:flex;align-items:center;gap:11px;height:var(--cx-head-h);flex:0 0 var(--cx-head-h);
  padding:0 20px;color:#fff;font-size:16px;font-weight:750;letter-spacing:-.2px;
  border-bottom:1px solid rgba(255,255,255,.07);
}
body.cx .sidebar__brand .brand-mark,
body.cx .sidebar__brand > span:first-child{
  width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;
  border-radius:10px;background:linear-gradient(140deg,#3A6BFF,#2B5BFF 55%,#5A4BFF);
  box-shadow:0 5px 14px rgba(43,91,255,.36);
}
body.cx .sidebar__brand .brand-mark .ico{width:18px;height:18px;color:#fff;stroke-width:2.1}
/* 租户后台品牌图标：换成自带蓝紫圆角底板的 SVG。
   img. 前缀提高特异性，压过上面 .brand-mark 的蓝色渐变方块，避免出现「CSS 方块 + SVG 底板」两层叠加。
   :not(.px) 把作用域限定在租户后台；平台后台由 admin-v3.css 的 body.cx.px 规则单独处理。
   代理白标域名仍走原来的 span 方块，不受这段影响。 */
body.cx:not(.px) .sidebar__brand img.brand-mark--ny{
  width:32px;height:32px;flex:0 0 32px;display:block;object-fit:contain;
  background:none;box-shadow:none;border-radius:10px;
  filter:drop-shadow(0 4px 12px rgba(43,91,255,.34));
}
body.cx .cx-brand-badge{
  margin-left:auto;padding:2px 7px;border-radius:6px;font-size:10px;font-weight:650;
  letter-spacing:.3px;color:#8BE6D1;background:rgba(16,191,160,.13);border:1px solid rgba(16,191,160,.2);
}
body.cx .sidebar__ws{
  margin:16px 14px 8px;padding:13px 13px 11px;border-radius:12px;
  background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.07);
}
body.cx .sidebar__ws-row{display:flex;align-items:center;gap:10px}
body.cx .sidebar__ws .ws-logo{
  width:32px;height:32px;flex:0 0 32px;display:grid;place-items:center;border-radius:9px;
  background:linear-gradient(140deg,#10BFA0,#0EA88D);color:#fff;font-size:14px;font-weight:750;
}
body.cx .sidebar__ws-detail{min-width:0;display:flex;flex-direction:column;gap:2px}
body.cx .sidebar__ws-detail b{
  color:#fff;font-size:13px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.cx .sidebar__ws-detail span{
  font-size:11px;color:#8494BC;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.cx .sidebar__ws-meta{
  display:flex;align-items:center;gap:7px;margin-top:11px;padding-top:10px;
  border-top:1px solid rgba(255,255,255,.07);font-size:11px;color:#8494BC;
}
body.cx .sidebar__ws-meta i{width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:var(--cx-mint);box-shadow:0 0 0 3px rgba(16,191,160,.16)}
body.cx .sidebar__ws-meta span{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.cx .sidebar__ws-meta a{color:#8BE6D1;font-weight:650;flex:0 0 auto}
body.cx .sidebar__ws-meta a:hover{color:#fff}
/* 菜单保持普通块级单列，由 .sidebar 统一滚动；不再单独开滚动容器，
   避免窄屏下 flex 高度不确定时内容被裁切却滚不动。 */
body.cx .sidebar-nav{
  display:block;overflow:visible;
  padding:6px 10px 18px;
}
body.cx .sidebar-group{
  padding:18px 12px 7px;font-size:10.5px;font-weight:700;letter-spacing:1.4px;
  text-transform:uppercase;color:#64749F;
}
body.cx .sidebar-link{
  position:relative;display:flex;align-items:center;gap:11px;
  min-height:38px;padding:0 12px;margin:2px 0;border-radius:9px;
  color:#AEBBD8;font-size:13.2px;font-weight:520;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}
body.cx .sidebar-link .ico{width:16px;height:16px;color:#7C8CB8;transition:color .18s ease}
body.cx .sidebar-link:hover{background:rgba(255,255,255,.07);color:#fff}
body.cx .sidebar-link:hover .ico{color:#B9C8EE}
body.cx .sidebar-link.on{
  background:linear-gradient(90deg,rgba(43,91,255,.38),rgba(43,91,255,.13));
  color:#fff;font-weight:700;box-shadow:inset 0 0 0 1px rgba(130,167,255,.2);
}
body.cx .sidebar-link.on::before{
  content:"";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:0 3px 3px 0;
  background:var(--cx-mint);box-shadow:0 0 10px rgba(16,191,160,.5);
}
body.cx .sidebar-link.on .ico{color:#8BE6D1}
body.cx .sidebar-link__txt{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.cx .sidebar-link__badge{
  flex:0 0 auto;min-width:18px;height:18px;padding:0 5px;border-radius:9px;
  display:grid;place-items:center;background:var(--cx-mint);color:#062A24;
  font-size:10.5px;font-weight:800;
}
body.cx .sidebar__foot{
  flex:0 0 auto;padding:12px 18px 18px;border-top:1px solid rgba(255,255,255,.07);
  display:flex;flex-direction:column;gap:11px;
}
body.cx .sidebar__foot a{
  display:flex;align-items:center;gap:9px;color:#8494BC;font-size:12.5px;
}
body.cx .sidebar__foot a:hover{color:#8BE6D1}
body.cx .sidebar__foot .ico{width:15px;height:15px}

/* ---------- 5. 顶栏 ---------- */
body.cx .topbar{
  position:sticky;top:0;z-index:30;height:var(--cx-head-h);flex:0 0 var(--cx-head-h);
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:0 32px;background:rgba(255,255,255,.94);backdrop-filter:blur(12px);
  border-bottom:1px solid var(--cx-line);
}
body.cx .tb-left{display:flex;align-items:center;gap:12px;min-width:0}
body.cx .tb-title{font-size:15px;font-weight:680;color:var(--cx-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.cx .nav-burger{display:none;width:34px;height:34px;border-radius:9px;place-items:center;background:#F2F5FB;color:var(--cx-text);cursor:pointer}
body.cx .nav-burger .ico{width:19px;height:19px}
body.cx .tb-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
body.cx .env-tag{
  display:inline-flex;align-items:center;gap:7px;height:28px;padding:0 11px;
  border-radius:20px;background:var(--cx-mint-soft);color:#0A8F78;
  font-size:11.5px;font-weight:650;
}
body.cx .env-tag i{width:6px;height:6px;border-radius:50%;background:var(--cx-mint)}
body.cx .icon-btn{
  width:32px;height:32px;display:grid;place-items:center;border-radius:9px;
  background:#F5F7FC;border:1px solid var(--cx-line);color:var(--cx-text);
  transition:background .18s,color .18s,border-color .18s;
}
body.cx .icon-btn:hover{background:var(--cx-brand-soft);border-color:#D8E2FF;color:var(--cx-brand)}
body.cx .icon-btn .ico{width:16px;height:16px}
body.cx .tb-user{display:flex;align-items:center;gap:8px;font-size:12.5px;font-weight:620;color:var(--cx-text)}
body.cx .tb-user .avatar{
  width:28px;height:28px;display:grid;place-items:center;border-radius:9px;
  background:linear-gradient(140deg,#3A6BFF,#2B5BFF);color:#fff;font-size:12px;font-weight:750;
}
body.cx .tb-actions form{margin:0}

/* ---------- 6. 页头 ---------- */
body.cx .page-head{
  display:flex;align-items:flex-end;justify-content:space-between;gap:18px;flex-wrap:wrap;
  margin:0 0 22px;padding:0;background:none;border:0;box-shadow:none;
}
body.cx .page-head__main{min-width:0}
body.cx .page-head__title{font-size:23px;font-weight:760;letter-spacing:-.5px;color:var(--cx-ink);margin:0}
body.cx .page-head__desc{font-size:12.8px;color:var(--cx-muted);margin:5px 0 0;font-weight:450}
body.cx .page-head__actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
body.cx .content > main > .wrap > h1:first-child{
  font-size:23px;font-weight:760;letter-spacing:-.5px;margin:0 0 22px;color:var(--cx-ink);
}

/* ---------- 7. 按钮 ---------- */
body.cx .btn,
body.cx button.btn,
body.cx a.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  height:36px;padding:0 15px;border-radius:var(--cx-radius-sm);
  border:1px solid var(--cx-brand);background:var(--cx-brand);color:#fff;
  font-size:13px;font-weight:640;line-height:1;cursor:pointer;white-space:nowrap;
  box-shadow:0 2px 6px rgba(43,91,255,.16);
  transition:background .18s,border-color .18s,box-shadow .18s,transform .18s,color .18s;
}
body.cx .btn:hover{background:#1F49E6;border-color:#1F49E6;box-shadow:0 5px 14px rgba(43,91,255,.26);color:#fff;text-decoration:none}
body.cx .btn:active{transform:translateY(1px)}
body.cx .btn .ico{width:15px;height:15px;color:inherit}
body.cx .btn.sm,body.cx button.btn.sm,body.cx a.btn.sm{height:31px;padding:0 12px;font-size:12.3px;border-radius:8px}
body.cx .btn.ghost,body.cx button.btn.ghost,body.cx a.btn.ghost{
  background:#fff;border-color:var(--cx-line);color:var(--cx-text);box-shadow:none;
}
body.cx .btn.ghost:hover{background:#F7F9FE;border-color:#D6E0F5;color:var(--cx-brand);box-shadow:0 2px 8px rgba(16,32,72,.05)}
body.cx .btn.primary,body.cx .btn.new{background:var(--cx-brand);border-color:var(--cx-brand);color:#fff}
body.cx .btn.danger,body.cx .btn.err{background:#fff;border-color:#F6CFCF;color:var(--cx-red);box-shadow:none}
body.cx .btn.danger:hover{background:var(--cx-red-soft);border-color:#F0B6B6;color:#C93C3C}
body.cx .btn:disabled,body.cx .btn[disabled]{opacity:.5;cursor:not-allowed;box-shadow:none}
body.cx .btn:focus-visible,
body.cx a:focus-visible,
body.cx button:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(43,91,255,.22)}
/* 原生文件选择框：按钮套用 .btn.ghost.sm 视觉，状态文字缩小淡化 */
body.cx input[type=file]{font-family:inherit;font-size:12px;color:#8A97AE}
body.cx input[type=file]::file-selector-button{
  height:31px;padding:0 12px;margin-right:10px;border:1px solid var(--cx-line);border-radius:8px;
  background:#fff;color:var(--cx-brand);font-family:inherit;font-size:12.3px;font-weight:640;
  cursor:pointer;transition:background .18s,border-color .18s;
}
body.cx input[type=file]::file-selector-button:hover{background:#F7F9FE;border-color:#D6E0F5}

/* ---------- 8. 面板 / 卡片（统一单面板，杜绝套娃边框） ---------- */
body.cx .card,
body.cx .panel,
body.cx .section-card,
body.cx .cms-panel,
body.cx .chart-card{
  background:var(--cx-surface);border:1px solid var(--cx-line);border-radius:var(--cx-radius);
  box-shadow:var(--cx-shadow);margin:0 0 20px;padding:0;overflow:hidden;
}
body.cx .card > h3,
body.cx .panel > h3,
body.cx .chart-card > h3{margin:0;padding:16px 20px 0;font-size:14px}
body.cx .card > p,
body.cx .panel > p,
body.cx .card > .small,
body.cx .panel > .small{padding:10px 20px 16px;margin:0;color:var(--cx-muted);font-size:12.5px}
body.cx .card > form,
body.cx .panel > form,
body.cx .card > table,
body.cx .panel > table{margin:0}
body.cx .card > .card,
body.cx .panel > .panel,
body.cx .section-card > .card,
body.cx .card > .section-card{
  border:0;box-shadow:none;border-radius:0;margin:0;padding:0;background:transparent;
}
body.cx .section{background:none;border:0;padding:0;margin:0;box-shadow:none}
body.cx .section-card__head,
body.cx .cms-panel__bar,
body.cx .chart-card__head,
body.cx .section__head{
  display:flex;align-items:center;gap:9px;min-height:52px;padding:12px 20px;
  border-bottom:1px solid var(--cx-line-soft);background:transparent;
}
body.cx .section-card__head > .ico,
body.cx .cms-panel__title > i{width:16px;height:16px;color:var(--cx-brand)}
body.cx .section-card__title,
body.cx .cms-panel__title,
body.cx .chart-card__title,
body.cx .section__title{
  font-size:14.5px;font-weight:700;color:var(--cx-ink);margin:0;display:flex;align-items:center;gap:8px;
}
body.cx .section-card__title small,
body.cx .cms-panel__title small{font-size:12px;font-weight:600;color:var(--cx-muted);margin-left:4px}
body.cx .section-card__actions,
body.cx .section__actions{margin-left:auto;display:flex;align-items:center;gap:8px}
body.cx .chart-card__sub{font-size:12px;color:var(--cx-muted);margin-left:auto}
body.cx .cms-panel__foot{
  padding:12px 20px;border-top:1px solid var(--cx-line-soft);
  background:#FCFDFE;color:var(--cx-muted);font-size:12px;
}
body.cx .cms-panel__bar--entries{justify-content:space-between;flex-wrap:wrap;gap:10px}

/* ---------- 9. 表格（全宽贴边） ---------- */
body.cx .dtable__scroll{overflow-x:auto;padding:0;margin:0;border:0;background:transparent}
body.cx table,
body.cx .cms-table,
body.cx .cms-panel__table,
body.cx table.cx-table{
  width:100%;border-collapse:collapse;margin:0;font-size:12px;background:transparent;
}
body.cx table thead th{
  background:#FAFBFE;color:#7A88A5;font-size:12px;font-weight:700;
  letter-spacing:.35px;text-transform:none;text-align:left;
  padding:11px 11px;border-bottom:1px solid var(--cx-line);white-space:nowrap;
}
body.cx table thead th:first-child{padding-left:20px}
body.cx table thead th:last-child{padding-right:20px}
body.cx table tbody td{
  padding:12px 16px;border-bottom:1px solid var(--cx-line-soft);
  color:var(--cx-text);vertical-align:middle;font-size:13px;
}
body.cx table tbody td:first-child{padding-left:20px}
body.cx table tbody td:last-child{padding-right:20px}
body.cx table tbody tr{transition:background .15s ease}
body.cx table tbody tr:hover{background:#FAFCFF}
body.cx table tbody tr:last-child td{border-bottom:0}
body.cx table tbody td a:not(.btn):not(.cx-act){color:var(--cx-brand);font-weight:600}
body.cx table tbody td a:not(.btn):not(.cx-act):hover{text-decoration:underline}
/* 内容列表：栏目名弱化成常规细字；置顶权重做成 1px 红框 + 10px 红字的小标签 */
body.cx .cms-panel table.cms-table tbody td a.cms-col-link{font-weight:600;font-size:12px}
body.cx .cms-pin{
  display:inline-block;padding:1px 6px;border:1px solid var(--cx-red);border-radius:5px;
  color:var(--cx-red);font-size:10px;font-weight:500;line-height:1.5;white-space:nowrap;
}
body.cx table tbody td .small,
body.cx table tbody td .muted{color:var(--cx-muted);font-size:12px}
body.cx table tbody td[colspan]{padding:22px 20px;text-align:center;color:var(--cx-muted)}

/* ---------- 10. 表单控件 ---------- */
body.cx input[type=text],body.cx input[type=email],body.cx input[type=password],
body.cx input[type=number],body.cx input[type=url],body.cx input[type=search],
body.cx input[type=date],body.cx input[type=tel],
body.cx select,body.cx textarea,
body.cx .input{
  width:100%;max-width:100%;height:38px;padding:0 12px;
  border:1px solid #E1E8F4;border-radius:var(--cx-radius-sm);
  background:#fff;color:var(--cx-ink);font:13.5px/1.5 inherit;
  box-shadow:0 1px 2px rgba(16,32,72,.025);
  transition:border-color .18s,box-shadow .18s,background .18s;
  outline:none;
}
body.cx textarea{height:auto;min-height:96px;padding:10px 12px;resize:vertical;line-height:1.65}
body.cx select{
  appearance:none;padding-right:32px;cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238491AB' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 11px center;
}
body.cx input:focus,body.cx select:focus,body.cx textarea:focus,body.cx .input:focus{
  border-color:#A8BFFF;background:#fff;
  box-shadow:0 0 0 3px rgba(43,91,255,.13);
}
body.cx input::placeholder,body.cx textarea::placeholder{color:#AEB9CD}
body.cx input[type=checkbox],body.cx input[type=radio]{
  width:15px;height:15px;accent-color:var(--cx-brand);cursor:pointer;vertical-align:middle;
}
body.cx .field,body.cx .form-grid > div{margin-bottom:16px;min-width:0}
body.cx .field__label{display:block;font-size:13px;font-weight:650;color:var(--cx-text);margin-bottom:6px}
body.cx .field__hint{font-size:12px;color:var(--cx-muted);margin-top:6px}
body.cx .req{color:var(--cx-red);margin-left:2px}
body.cx .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px}
body.cx .row{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin:0}
body.cx .row > div{flex:1 1 180px;min-width:0}
body.cx .row > div > label{margin-bottom:6px}
body.cx .kv{display:grid;grid-template-columns:140px 1fr;gap:10px 16px;font-size:13px}
body.cx .kv > dt,body.cx .kv > .k{color:var(--cx-muted)}
body.cx .grid{display:grid;gap:16px}
body.cx .rt:not(textarea){display:flex;align-items:center;gap:8px;flex-wrap:wrap}

/* ---------- 11. 状态标签 / 圆点 ---------- */
body.cx .tag{
  display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 9px;
  border-radius:20px;background:#F1F4FA;border:1px solid #E6EBF5;
  color:#6E7C98;font-size:11.5px;font-weight:650;white-space:nowrap;
}
body.cx .tag::before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor;opacity:.75}
body.cx .tag.ok,body.cx .tag.won,body.cx .tag.active,
body.cx .tag.published,body.cx .tag.enabled{background:var(--cx-mint-soft);border-color:#C9F0E5;color:#0A8F78}
body.cx .tag.new,body.cx .tag.info,body.cx .tag.pending{background:var(--cx-brand-soft);border-color:#D8E2FF;color:#2B5BFF}
body.cx .tag.warn,body.cx .tag.contacted,body.cx .tag.draft{background:var(--cx-amber-soft);border-color:#FBE6BC;color:#B97806}
body.cx .tag.err,body.cx .tag.lost,body.cx .tag.spam,
body.cx .tag.disabled,body.cx .tag.off{background:var(--cx-red-soft);border-color:#F8D7D7;color:#D04545}
body.cx .cx-dot{
  display:inline-block;width:9px;height:9px;border-radius:50%;vertical-align:middle;
  background:var(--cx-mint);box-shadow:0 0 0 4px rgba(16,191,160,.14);
}
body.cx .cx-dot--off,body.cx .cx-dot--red{
  background:var(--cx-red);box-shadow:0 0 0 4px rgba(240,82,82,.13);
}
body.cx .cx-dot--amber{background:var(--cx-amber);box-shadow:0 0 0 4px rgba(245,165,36,.14)}
body.cx .cx-status{display:inline-flex;align-items:center;gap:9px}

/* ---------- 12. 图标操作按钮（统一渲染层输出） ---------- */
body.cx .cx-acts{display:inline-flex;align-items:center;gap:5px;flex-wrap:nowrap}
body.cx .cx-act,
body.cx a.cx-act,
body.cx button.cx-act{
  position:relative;width:28px;height:28px;flex:0 0 28px;margin:2px 5px 2px 0;
  display:inline-grid;place-items:center;padding:0;
  border-radius:8px;border:1px solid #E9EEF7;background:#F8FAFD;
  color:#6E7C98;cursor:pointer;font-size:0;line-height:1;
  transition:background .16s,color .16s,border-color .16s,transform .16s,box-shadow .16s;
}
body.cx .cx-act .ico{width:15px;height:15px;stroke-width:1.9}
body.cx .cx-act:hover{
  background:var(--cx-brand-soft);border-color:#D6E1FF;color:var(--cx-brand);
  box-shadow:0 3px 8px rgba(43,91,255,.1);transform:translateY(-1px);
}
body.cx .cx-act--danger,body.cx a.cx-act--danger,body.cx button.cx-act--danger{
  background:#FFF7F7;border-color:#FBE3E3;color:#DC6262;
}
body.cx .cx-act--danger:hover{background:#FDECEC;border-color:#F6CFCF;color:#C93C3C;box-shadow:0 3px 8px rgba(240,82,82,.12)}
body.cx .cx-act[data-tip]:hover::after{
  content:attr(data-tip);position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);
  padding:5px 9px;border-radius:7px;background:#1A2748;color:#fff;
  font-size:11px;font-weight:600;line-height:1.3;white-space:nowrap;z-index:60;
  box-shadow:0 6px 16px rgba(10,20,50,.2);pointer-events:none;
}
body.cx .cx-sep{width:1px;height:16px;flex:0 0 1px;background:var(--cx-line);margin:0 3px}
body.cx .cx-act-form{display:inline-flex;align-items:center;gap:5px;margin:0}
/* 栏目管理等「服务端直出图标」的页面复用同一套 .cx-act 组件，
   只补容器内间距与导航标签，不再维护第二套按钮皮肤 */
body.cx .cx-acts .cx-act{margin:2px 0}
body.cx .cx-navtag{height:20px;padding:0 8px;border-radius:20px;background:#F1F4FA;color:#7A88A5;font-size:11px;font-weight:650;display:inline-flex;align-items:center}

/* ---------- 13. 统计卡 / 图表 / 仪表盘 ---------- */
body.cx .stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}
body.cx .stat{
  position:relative;overflow:hidden;background:#fff;border:1px solid var(--cx-line);
  border-radius:var(--cx-radius);padding:18px 20px 16px;box-shadow:var(--cx-shadow);
}
body.cx .stat::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--cx-brand);opacity:.85;
}
body.cx .stat--accent::before{background:var(--cx-mint)}
body.cx .stat__blob{
  position:absolute;right:-46px;top:-56px;width:150px;height:100px;border-radius:50%;
  background:radial-gradient(circle,rgba(43,91,255,.055),transparent 68%);pointer-events:none;
}
body.cx .stat__top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;position:relative}
body.cx .stat__label{font-size:12.5px;font-weight:620;color:var(--cx-muted)}
body.cx .stat__ico{
  width:32px;height:32px;display:grid;place-items:center;border-radius:10px;
  background:var(--cx-brand-soft);color:var(--cx-brand);
}
body.cx .stat--accent .stat__ico{background:var(--cx-mint-soft);color:#0A8F78}
body.cx .stat__ico .ico{width:17px;height:17px}
body.cx .stat__value{font-size:29px;font-weight:760;letter-spacing:-1px;color:var(--cx-ink);line-height:1.25;margin:10px 0 6px;position:relative}
body.cx .stat__foot{display:flex;align-items:center;gap:8px;position:relative;min-height:18px}
body.cx .stat__foot-text{font-size:12px;color:var(--cx-muted)}
body.cx .stat__delta{display:inline-flex;align-items:center;gap:3px;font-size:11.5px;font-weight:700;color:#0A8F78}
body.cx .stat__delta.is-down{color:var(--cx-red)}
body.cx .stat__delta-ico{width:9px;height:9px;fill:currentColor}

/* ---------- 13.1 工作台统计卡：对齐 MOBAN KPI 视觉（只换皮肤，数据不动） ----------
   参考稿：左上小图标 + 灰蓝标题 / 深藏青大数字 / 灰蓝脚注 / 右上角与图标同色系的圆形浅色装饰
   用 .stat-grid > .stat 限定范围，避免影响主站 design.php 里同名的 .stat */
body.cx .stat-grid > .stat{
  --st:#2B5BFF; --st-soft:#EEF2FF;
  background:#fff;border:1px solid #E7EBF4;border-radius:12px;
  padding:17px 18px;box-shadow:0 4px 18px rgba(16,32,80,.06);
  position:relative;overflow:hidden;min-width:0;
}
/* 去掉左侧彩色竖条（含主指标卡的薄荷绿竖条） */
body.cx .stat-grid > .stat::before,
body.cx .stat-grid > .stat--accent::before{content:none;display:none}
/* 右上角圆形浅色背景装饰：与图标同色系，不再用原来的蓝色径向光斑 */
body.cx .stat-grid > .stat .stat__blob{
  right:-24px;top:-24px;width:80px;height:80px;border-radius:50%;
  background:var(--st-soft);opacity:.6;pointer-events:none;
}
/* 图标从右上角的大圆角方块，移到标题左侧，变成 15px 纯色线条小图标 */
body.cx .stat-grid > .stat .stat__top{
  display:flex;align-items:center;justify-content:flex-start;gap:7px;
  position:relative;z-index:1;
}
body.cx .stat-grid > .stat .stat__label{
  order:2;font-size:12.5px;font-weight:400;color:#485775;
}
body.cx .stat-grid > .stat .stat__ico,
body.cx .stat-grid > .stat.stat--accent .stat__ico{
  order:1;width:15px;height:15px;border-radius:0;background:none;
  display:inline-flex;align-items:center;justify-content:center;color:var(--st);
}
body.cx .stat-grid > .stat .stat__ico .ico{width:15px;height:15px;color:inherit}
/* 数字与脚注 */
body.cx .stat-grid > .stat .stat__value{
  font-size:27px;font-weight:830;letter-spacing:-.035em;line-height:1.25;
  color:#0C1633;margin:9px 0 0;position:relative;z-index:1;
}
body.cx .stat-grid > .stat .stat__foot{
  margin-top:8px;gap:8px;min-height:0;position:relative;z-index:1;
}
body.cx .stat-grid > .stat .stat__foot-text{font-size:12px;color:#8792AA}
body.cx .stat-grid > .stat .stat__delta{font-size:12px;font-weight:700;color:#10BFA0}
body.cx .stat-grid > .stat .stat__delta.is-down{color:#F05252}
/* 四张卡各一主题色：蓝 / 绿 / 紫 / 橙，圆形装饰随图标颜色同步 */
body.cx .stat-grid > .stat:nth-child(2){--st:#10BFA0;--st-soft:#E7F9F4}
body.cx .stat-grid > .stat:nth-child(3){--st:#7155E8;--st-soft:#F0EDFF}
body.cx .stat-grid > .stat:nth-child(4){--st:#F5A524;--st-soft:#FFF6E5}
@media (max-width:760px){
  body.cx .stat-grid > .stat{padding:15px 16px}
}

body.cx .dash-grid{display:grid;grid-template-columns:1.55fr 1fr;gap:18px;margin-bottom:20px}
body.cx .dash-grid--feed{grid-template-columns:1.35fr 1fr}
body.cx .chart-card__body{padding:14px 20px 4px}
body.cx .trend-chart{width:100%;height:210px;display:block}
body.cx .chart-grid{stroke:#EEF2F9;stroke-width:1}
body.cx .chart-x{fill:#9AA7BE;font-size:10px}
body.cx .trend-top{fill:none;stroke:var(--cx-brand);stroke-width:2.4;stroke-linecap:round}
body.cx .trend-conv{fill:none;stroke:var(--cx-mint);stroke-width:2.1;stroke-linecap:round;stroke-dasharray:5 4}
body.cx .chart-empty{padding:60px 0;text-align:center;color:var(--cx-muted);font-size:13px}
body.cx .legend{display:flex;gap:16px;padding:6px 20px 18px;font-size:12px;color:var(--cx-muted)}
body.cx .legend__item{display:inline-flex;align-items:center;gap:6px}
body.cx .legend__dot{width:8px;height:8px;border-radius:50%;background:var(--cx-brand)}
body.cx .legend__dot--ok{background:var(--cx-mint)}
body.cx .donut-wrap{display:flex;align-items:center;gap:16px;padding:16px 20px 20px;flex-wrap:wrap}
body.cx .donut{width:140px;height:140px;flex:0 0 140px}
body.cx .donut-total{fill:var(--cx-ink);font-size:24px;font-weight:750;text-anchor:middle}
body.cx .donut-cap{fill:var(--cx-muted);font-size:10px;text-anchor:middle}
body.cx .donut-legend{flex:1 1 160px;min-width:140px;display:grid;gap:8px}
body.cx .dl{display:flex;align-items:center;gap:8px;font-size:12.5px}
body.cx .dl__dot{width:8px;height:8px;border-radius:50%;flex:0 0 8px}
body.cx .dl__label{flex:1 1 auto;color:var(--cx-text)}
body.cx .dl__val{font-weight:700;color:var(--cx-ink)}
body.cx .feed{padding:4px 0}
body.cx .feed__item{
  display:flex;align-items:center;gap:11px;padding:11px 20px;
  border-bottom:1px solid var(--cx-line-soft);
}
body.cx .feed__item:last-child{border-bottom:0}
body.cx .feed__ico{
  width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;border-radius:9px;
  background:var(--cx-brand-soft);color:var(--cx-brand);
}
body.cx .feed__ico .ico{width:15px;height:15px}
body.cx .feed__ico.s-won{background:var(--cx-mint-soft);color:#0A8F78}
body.cx .feed__ico.s-lost,body.cx .feed__ico.s-spam{background:var(--cx-red-soft);color:var(--cx-red)}
body.cx .feed__ico.s-quoted{background:var(--cx-amber-soft);color:#B97806}
body.cx .feed__body{flex:1 1 auto;min-width:0}
body.cx .feed__title{font-size:13px;color:var(--cx-text);margin:0}
body.cx .feed__title b{color:var(--cx-ink)}
body.cx .feed__meta{font-size:11.5px;color:var(--cx-muted);margin-top:2px}
body.cx .feed__time{font-size:11.5px;color:var(--cx-muted);flex:0 0 auto}

/* ---------- 14. 提示 / 空态 / 折叠说明 ---------- */
body.cx .alert{
  display:block;border-radius:11px;padding:12px 15px;margin:0 0 18px;
  font-size:12.8px;line-height:1.7;border:1px solid transparent;
}
body.cx .alert.info{background:#F0F5FF;border-color:#DBE6FF;color:#3554A8}
body.cx .alert.ok{background:var(--cx-mint-soft);border-color:#C9F0E5;color:#0A8F78}
body.cx .alert.warn{background:var(--cx-amber-soft);border-color:#FBE6BC;color:#A96F04}
body.cx .alert.err{background:var(--cx-red-soft);border-color:#F8D7D7;color:#C33C3C}
body.cx .alert b{color:inherit}
body.cx .alert a{color:inherit;text-decoration:underline;font-weight:650}
body.cx .empty--icon,body.cx .cms-panel__empty{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:52px 20px;text-align:center;color:var(--cx-muted);font-size:13px;
}
body.cx .empty__ico{
  width:50px;height:50px;display:grid;place-items:center;border-radius:15px;
  background:#F2F5FB;color:#A6B2C9;margin-bottom:12px;
}
body.cx .empty__ico .ico{width:23px;height:23px}
body.cx .empty--icon p{margin:0}
body.cx .cx-note{
  margin:10px 0 0;font-size:12px;color:var(--cx-muted);line-height:1.65;
}
body.cx details.cx-more{
  margin:8px 0 0;font-size:12.4px;color:var(--cx-muted);
}
/* 折叠标签只在极少数超长说明上出现，压到最小：非粗体、10px */
body.cx details.cx-more > summary{
  display:inline-flex;align-items:center;gap:5px;cursor:pointer;
  color:#7A88A5;font-size:10px;font-weight:400;list-style:none;
}
body.cx details.cx-more > summary::-webkit-details-marker{display:none}
body.cx details.cx-more > summary::before{content:"ⓘ";font-size:10px}
body.cx details.cx-more > summary:hover{color:var(--cx-brand)}
body.cx details.cx-more > div{padding:8px 0 2px;line-height:1.7}

/* ---------- 15. 筛选 / 批量条 ---------- */
body.cx .cms-filter,body.cx .cms-filter--inline{
  display:inline-flex;align-items:center;gap:8px;flex-wrap:nowrap;margin:0;
}
body.cx .cms-filter > label,
body.cx .cms-filter--inline > label{
  margin:0;font-size:12.5px;font-weight:620;color:var(--cx-muted);white-space:nowrap;
}
body.cx .cms-filter select,
body.cx .cms-filter--inline select{width:196px;height:32px;padding:0 30px 0 11px;font-size:12.5px}
body.cx .cms-filter .btn,
body.cx .cms-filter--inline .btn{height:32px;font-size:12.3px}
body.cx .cms-bulkbar,body.cx .cms-bulkbar--inline{
  display:flex;align-items:center;gap:9px;flex-wrap:wrap;
  padding:11px 20px;background:#FCFDFE;border-bottom:1px solid var(--cx-line-soft);
}
body.cx .cms-bulkbar > label{margin:0;font-size:12.5px;font-weight:650;color:var(--cx-text);white-space:nowrap}
body.cx .cms-bulkbar select{width:auto;min-width:112px;height:31px;font-size:12.5px;padding:0 30px 0 10px}
body.cx .cms-bulkbar .btn{height:31px}
body.cx .cms-bulkbar .muted{margin-left:auto;font-size:12px}
body.cx .cms-tabs{
  display:flex;align-items:center;gap:22px;padding:0;margin:0 0 18px;
  border-bottom:1px solid var(--cx-line);background:none;
}
body.cx .cms-tabs a{
  display:inline-flex;align-items:center;gap:6px;padding:0 2px 12px;
  color:var(--cx-muted);font-size:13.5px;font-weight:620;border-bottom:2px solid transparent;
}
body.cx .cms-tabs a:hover{color:var(--cx-brand)}
body.cx .cms-tabs a.active,body.cx .cms-tabs a.on{border-bottom-color:var(--cx-brand);color:var(--cx-brand);font-weight:700}

/* ---------- 16. 扩展组件（表单页 / 栏目 / 媒体选择器 / 分页） ---------- */
body.cx .section-card__body{padding:18px 20px}
body.cx .select,body.cx .textarea{display:block;min-width:0}
body.cx .row-actions{
  display:inline-flex;align-items:center;gap:5px;flex-wrap:nowrap;
}
body.cx .cms-panel--entries .cms-panel__bar{flex-wrap:wrap}
body.cx .cms-bulkbar__hint{margin-left:auto;font-size:12px;color:var(--cx-muted)}
body.cx .cms-check{width:15px;height:15px;accent-color:var(--cx-brand);cursor:pointer}
body.cx .rel-sel{min-width:160px}
body.cx .legend__dot--brand{background:var(--cx-brand)}
body.cx .pager{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;
  padding:14px 20px;border-top:1px solid var(--cx-line-soft);background:#FCFDFE;
}
body.cx .pager a,body.cx .pager span{
  display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:30px;padding:0 9px;
  border-radius:8px;border:1px solid var(--cx-line);background:#fff;
  color:var(--cx-text);font-size:12.5px;font-weight:620;
}
body.cx .pager a:hover{border-color:#C9D7FF;color:var(--cx-brand);background:var(--cx-brand-soft)}
body.cx .pager .active,body.cx .pager .on{background:var(--cx-brand);border-color:var(--cx-brand);color:#fff}
body.cx .callout{
  background:#F0F5FF;border:1px solid #DBE6FF;border-radius:11px;
  padding:12px 15px;font-size:12.8px;color:#3554A8;line-height:1.7;
}
body.cx .check-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
body.cx .form-actions{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:16px 20px;border-top:1px solid var(--cx-line-soft);background:#FCFDFE;
}
body.cx .hint,body.cx .mp-empty-hint{font-size:12px;color:var(--cx-muted);line-height:1.7}
body.cx .link-action--danger{background:var(--cx-red-soft);color:var(--cx-red)}
body.cx .link-action--danger:hover{background:#FDECEC;color:#C93C3C}
body.cx .mp-open{flex:0 0 auto}
body.cx .mp-hidden{display:contents}
body.cx .mp-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px}
body.cx .mp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(108px,1fr));gap:10px}
body.cx .mp-thumb{
  position:relative;overflow:hidden;border-radius:10px;border:1px solid var(--cx-line);
  background:#F7F9FD;padding:0;cursor:pointer;aspect-ratio:1;
}
body.cx .mp-thumb img{width:100%;height:100%;object-fit:cover;display:block}
body.cx .mp-thumb.is-sel{border-color:var(--cx-brand);box-shadow:0 0 0 2px rgba(43,91,255,.14)}
body.cx .mb-3{margin-bottom:12px}
body.cx .mt-3{margin-top:12px}
body.cx .inline{display:inline-flex;align-items:center;gap:8px}
body.cx .full{width:100%}
body.cx .channels-table th:last-child{white-space:nowrap}

/* ---------- 17. 其它细节 ---------- */
/* console-ui.js 会给表格套 .tbl-scroll：新体系里它只负责横向滚动，不产生第二层边框 */
body.cx .tbl-scroll{overflow-x:auto;margin:0;padding:0;border:0;background:transparent}
body.cx .tbl-hint{display:none!important}
body.cx .card > .tbl-scroll > table,
body.cx .panel > .tbl-scroll > table,
body.cx .section-card > .tbl-scroll > table{margin:0}
body.cx .linkbtn,body.cx .link-action{
  display:inline-flex;align-items:center;height:26px;padding:0 9px;border-radius:7px;
  background:#F3F6FC;color:var(--cx-brand);font-size:12.2px;font-weight:640;
  border:1px solid transparent;
}
body.cx .linkbtn:hover,body.cx .link-action:hover{background:var(--cx-brand-soft);border-color:#D8E2FF;color:#1F49E6}
body.cx .slug-status{font-size:12px;color:var(--cx-muted)}
body.cx hr{border:0;border-top:1px solid var(--cx-line);margin:18px 0}
body.cx .content ::-webkit-scrollbar{width:8px;height:8px}
body.cx .content ::-webkit-scrollbar-thumb{background:#D8E0EE;border-radius:9px}
body.cx .content ::-webkit-scrollbar-track{background:transparent}

/* ---------- 17. 响应式 ---------- */
@media (max-width:1180px){
  body.cx .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.cx .dash-grid,body.cx .dash-grid--feed{grid-template-columns:1fr}
}
@media (max-width:980px){
  body.cx{--cx-side-w:0px}
  body.cx .sidebar{width:252px;transform:translateX(-100%);transition:transform .24s ease;box-shadow:12px 0 32px rgba(8,16,40,.24)}
  body.cx .nav-toggle:checked ~ .app-shell .sidebar{transform:translateX(0)}
  body.cx .nav-toggle:checked ~ .app-shell .nav-mask{
    display:block;position:fixed;top:0;right:0;bottom:0;left:0;z-index:35;background:rgba(8,16,40,.42);
  }
  body.cx .content{margin-left:0}
  body.cx .nav-burger{display:grid}
  /* 抽屉态（平板 / 手机）恢复可见滚动条：手指滑动时需要明确「下面还有菜单」 */
  body.cx .sidebar{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.3) rgba(255,255,255,.06)}
  body.cx .sidebar::-webkit-scrollbar{display:block;width:7px;height:auto}
  body.cx .content > main > .wrap#main-content,
  body.cx .content > main > .wrap{padding:22px 20px 32px}
  body.cx .topbar{padding:0 20px}
  body.cx .content > footer{padding:14px 20px 20px}
  /* 抽屉态沿用全局「侧栏滚动 + 头部 sticky」，不要在这里把 sticky 改回 relative */
  body.cx .sidebar-nav{display:block}
}
@media (max-width:760px){
  body.cx .form-grid{grid-template-columns:1fr}
  body.cx .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  body.cx .page-head{align-items:flex-start;flex-direction:column;gap:12px}
  body.cx .cms-panel__bar--entries{align-items:flex-start;flex-direction:column}
  body.cx .cms-filter,body.cx .cms-filter--inline{flex-wrap:wrap}
  body.cx .cms-filter select,body.cx .cms-filter--inline select{width:auto;min-width:150px;flex:1 1 150px}
  body.cx .cms-bulkbar .muted{margin-left:0;width:100%}
  body.cx .env-tag,body.cx .tb-user{display:none}
  body.cx table thead th,body.cx table tbody td{padding-left:12px;padding-right:12px}
  body.cx table thead th:first-child,body.cx table tbody td:first-child{padding-left:14px}
  body.cx table thead th:last-child,body.cx table tbody td:last-child{padding-right:14px}
  /* ---- 手机端：正常宽度抽屉（不满屏），右侧露出遮罩，点击可关 ----
     整个侧栏仍是纵向滚动容器，头部 sticky 吸顶；菜单保持一列，
     内容区栅格一律单列；宽度与 <=980px 抽屉一致，超窄屏用 max-width 兜底。 */
  body.cx .sidebar{width:252px;max-width:86vw;height:100vh;height:100dvh;box-shadow:12px 0 32px rgba(8,16,40,.28)}
  body.cx .sidebar__brand{padding:0 18px}
  body.cx .sidebar__close{display:grid}
  body.cx .sidebar__ws{margin-left:16px;margin-right:16px}
  body.cx .sidebar-nav{display:block;padding:6px 14px 20px}
  /* 移动端多为隐藏式滚动条，给一条常驻提示，明确下面还有菜单 */
  body.cx .sidebar__head::after{
    content:"↓ 上下滑动查看全部菜单";
    display:block;padding:0 18px 9px;
    color:#7C8CB8;font-size:11px;font-weight:650;letter-spacing:.2px;
  }
  body.cx .stat-grid{grid-template-columns:1fr}
  body.cx .kv{grid-template-columns:1fr}
  body.cx .wrap#main-content [style*="grid-template-columns"]{grid-template-columns:1fr!important}
  body.cx .content > main > .wrap#main-content,
  body.cx .content > main > .wrap{padding:18px 14px 30px}
  body.cx .topbar{padding:0 14px}
  body.cx .content > footer{padding:12px 14px 18px}
}
@media (max-width:480px){
  body.cx .cms-tabs{gap:14px;overflow-x:auto}
}
/* ==========================================================================
   18. 表单 / 内容卡片留白
   历史视图的表单卡片是 <div class="card"><h3>…</h3><label>…</label><input>…</div>，
   而统一面板为了让列表表格左右贴边，把全部 .card/.panel 设成了 padding:0，
   于是 label / input 全部顶到卡片边框。这里按「卡片内是否含表格」分流：
     · 含 table    → 列表型卡片，继续 padding:0（表格贴边，不做改动）
     · 不含 table  → 内容 / 表单型卡片，补统一内边距与表单行距
   ========================================================================== */
:is(body.cx .card,body.cx .panel):not(:has(table)):not(.stat):not(.chart-card):not(.cx-table-panel){
  padding:20px 22px 22px;
  margin-bottom:22px;
}
/* 标题与说明原本各自带零散 padding，改由卡片内边距统一提供，避免叠加成双倍 */
:is(body.cx .card,body.cx .panel):not(:has(table)) > h3{
  padding:0;margin:0 0 16px;font-size:14.5px;font-weight:700;color:var(--cx-ink);
}
:is(body.cx .card,body.cx .panel):not(:has(table)) > p,
:is(body.cx .card,body.cx .panel):not(:has(table)) > .small{
  padding:0;margin:0 0 12px;color:var(--cx-muted);font-size:12.5px;
}
/* 卡片内相邻块之间给呼吸感；紧跟 label 的控件不额外加，保持「标签 6px 控件」的紧凑组合。
   .rt-bar / .rt-surface 是富文本编辑器被拆开的两片，必须紧贴（见 18.1），不参与自动留白 */
:is(body.cx .card,body.cx .panel):not(:has(table)) > * + *:not(:is(input,select,textarea,.rt-bar,.rt-surface)){
  margin-top:14px;
}
/* 表单标签独立成行（内联 display:flex 的单选标签由内联样式自行覆盖） */
:is(body.cx .card,body.cx .panel):not(:has(table)) label,
body.cx .section-card__body label{
  display:block;margin:0 0 6px;font-size:13px;font-weight:650;color:var(--cx-text);
}
/* 视图里匿名两列栅格用内联 gap:0 20px，行距为 0，用子元素 margin 补回来 */
:is(body.cx .card,body.cx .panel):not(:has(table)) [style*="grid-template-columns"] > div{
  margin-bottom:14px;
}
/* 卡片内直接子控件与下一组之间留白 */
:is(body.cx .card,body.cx .panel):not(:has(table)) > :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]){
  margin-bottom:14px;
}
:is(body.cx .card,body.cx .panel):not(:has(table)) > :is(input,select,textarea):last-child{
  margin-bottom:0;
}
/* 小屏收敛留白，避免窄屏下内容区被两侧内边距吃掉 */
@media (max-width:760px){
  :is(body.cx .card,body.cx .panel):not(:has(table)):not(.stat):not(.chart-card):not(.cx-table-panel){
    padding:16px 16px 18px;
  }
}
/* ==========================================================================
   18.1 富文本编辑器：工具栏与正文框连成一个整体
   editor.js 把 <textarea class="rt"> 升级成 .rt-bar + .rt-surface 两个相邻兄弟。
   「添加 / 编辑内容」的正文框恰好是 .card 的直接子元素，会被 18 节「相邻块
   14px 呼吸」在两片之间插进空隙，看起来像两个分离的框；同页的多语言正文、
   自定义字段编辑器包在 .cms-locale / .row > div 里不受影响，所以只有第一个异常。
   不改 DOM、不改 editor.js（AI 翻译靠 previousElementSibling 找 surface），
   只把编辑器组合从卡片留白规则里摘出来，并补一条高特异性兜底。
   ========================================================================== */
body.cx .rt-bar,
body.cx .rt-surface{margin-top:0}
body.cx :is(.card,.panel,.section-card,.cms-panel) > :is(.rt-bar,.rt-surface),
body.cx :is(.card,.panel,.section-card,.cms-panel) > .rt-bar + .rt-surface{margin-top:0}
/* 源码模式：editor.js 会清掉内联 display:none，此时 textarea 要正常块级显示，
   不能被第 10 节的 .rt flex 规则误伤成一行 flex 容器 */
body.cx textarea.rt{display:block}

@media (prefers-reduced-motion:reduce){
  body.cx *,body.cx *::before,body.cx *::after{transition:none!important;animation:none!important}
}

/* ==========================================================================
   19. 移动端宽表格：横向滑动 + 首列吸左 + 滑动提示
   列表卡片为圆角裁切统一用了 overflow:hidden，小屏时表格被压到视口宽度，
   右侧「状态 / 操作」列被直接裁掉、也无法滚动。这里只在 <=980px 把「含表格
   的卡片」变成横向滚动容器，并给表格一个最小宽度防止列被挤压；不改 DOM、
   不依赖 JS，栏目 / 内容 / 产品 / 询盘等所有列表页一次生效。
   ========================================================================== */
@media (max-width:980px){
  :is(body.cx .card,body.cx .panel,body.cx .section-card,body.cx .cms-panel,body.cx .chart-card):has(table){
    overflow-x:auto;overflow-y:hidden;
    -webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
    scrollbar-width:thin;
  }
  :is(body.cx .card,body.cx .panel,body.cx .section-card,body.cx .cms-panel,body.cx .chart-card):has(table) table{
    min-width:720px;
  }
  /* 7 列及以上的宽表多留一点，避免操作图标二次换行 */
  :is(body.cx .card,body.cx .panel,body.cx .section-card,body.cx .cms-panel):has(table) table:has(thead th:nth-child(7)){
    min-width:860px;
  }
  /* 横向滑动时首列吸左，滑到最右仍看得出行归属 */
  :is(body.cx .card,body.cx .panel,body.cx .section-card,body.cx .cms-panel):has(table) table thead th:first-child,
  :is(body.cx .card,body.cx .panel,body.cx .section-card,body.cx .cms-panel):has(table) table tbody td:first-child{
    position:sticky;left:0;z-index:2;background:#fff;
    box-shadow:8px 0 12px -10px rgba(16,32,72,.3);
  }
  :is(body.cx .card,body.cx .panel,body.cx .section-card,body.cx .cms-panel):has(table) table thead th:first-child{
    background:#FAFBFE;z-index:3;
  }
  /* 小屏才出现的提示，明确告诉用户右侧还有列 */
  :is(body.cx .card,body.cx .panel,body.cx .section-card,body.cx .cms-panel):has(table)::before{
    display:block;padding:8px 14px;
    background:#F7F9FE;border-bottom:1px solid var(--cx-line-soft);
    color:var(--cx-muted);font-size:11.5px;font-weight:650;text-align:center;white-space:nowrap;
  }
}
/* ==========================================================================
   20. 顶栏通知铃铛（挂在「查看网站」右侧，沿用同款 .icon-btn）
   ========================================================================== */
body.cx .cx-notify{position:relative;flex:0 0 auto}
body.cx .cx-notify__btn{position:relative;padding:0;cursor:pointer}
body.cx .cx-notify__dot{
  position:absolute;top:5px;right:5px;width:7px;height:7px;border-radius:50%;
  background:#F05252;border:1.5px solid #fff;pointer-events:none;
  box-shadow:0 0 0 1px rgba(240,82,82,.18);
}
body.cx .cx-notify__panel{
  position:absolute;top:calc(100% + 10px);right:0;z-index:60;
  width:268px;display:none;overflow:hidden;
  background:#fff;border:1px solid var(--cx-line);border-radius:12px;
  box-shadow:0 14px 38px rgba(16,32,72,.16);
}
body.cx .cx-notify.is-open .cx-notify__panel{display:block}
body.cx .cx-notify__head{
  padding:12px 16px;border-bottom:1px solid var(--cx-line);
  font-size:13px;font-weight:700;color:var(--cx-ink);
}
body.cx .cx-notify__empty{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;
  padding:26px 16px;color:var(--cx-muted);font-size:12.5px;
}
body.cx .cx-notify__empty .ico{width:24px;height:24px;opacity:.5}
body.cx .cx-notify__more{
  display:flex;align-items:center;justify-content:center;gap:6px;
  padding:10px 16px;border-top:1px solid var(--cx-line);
  font-size:12.5px;font-weight:650;color:var(--cx-brand);
}
body.cx .cx-notify__more .ico{width:14px;height:14px}
body.cx .cx-notify__more:hover{background:var(--cx-brand-soft)}
/* 账户名可能比公司名长，限宽避免把顶栏右侧操作区撑破 */
body.cx .tb-user > span:last-child{
  max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
@media (max-width:760px){
  body.cx .cx-notify__panel{width:268px;max-width:calc(100vw - 28px);right:-4px}
}

/* ===== 报价单打印（v1.x）：只输出单据本体，隐藏整套后台外壳 =====
   仅作用于 .quote-sheet 视图（body.cx 内），不影响其它后台页打印。 */
@page{size:A4;margin:14mm}
@media print{
  /* 后台外壳一律不打印：侧栏 / 顶栏 / 通知 / 遮罩 / 各种按钮与返回链接 */
  body.cx .sidebar,
  body.cx .nav-mask,
  body.cx .nav-toggle,
  body.cx .topbar,
  body.cx header.top,
  body.cx .cx-notify,
  body.cx .alert,
  body.cx .no-print{display:none!important}
  /* 拆掉 flex 外壳与留白，让正文从纸张顶端满幅铺开 */
  body.cx .app-shell,
  body.cx .content,
  body.cx .content>main{display:block!important;min-height:0!important;background:#fff!important}
  body.cx .content{margin-left:0!important}
  body.cx .content>main,
  body.cx .content>main>.wrap,
  body.cx .content>main>.wrap#main-content{padding:0!important;margin:0!important;max-width:none!important}
  /* 单据本体：去掉卡片边框/圆角/阴影与内部留白，表格线保留以便打印清晰 */
  body.cx .quote-sheet{border:0!important;border-radius:0!important;box-shadow:none!important;padding:0!important;margin:0!important}
  body.cx .quote-sheet table{border:1px solid #b9c2ce!important}
  /* 明细表按 colgroup 固定列宽并强制换行，避免 7 列超出纸张被裁掉 */
  body.cx .quote-sheet table.qitems{table-layout:fixed;width:100%!important}
  body.cx .quote-sheet table.qitems th,
  body.cx .quote-sheet table.qitems td{overflow-wrap:anywhere;word-break:break-word}
  body.cx .quote-sheet th,
  body.cx .quote-sheet td{border:1px solid #d2d9e2!important}
  body.cx .quote-sheet tr{break-inside:avoid;page-break-inside:avoid}
}
