/* =====================================================================
   LEEAI.ME 统一设计系统  v1  （终端 / 雷达风）
   ---------------------------------------------------------------------
   用途：门户 + sx / rs / cx / ry 全站统一视觉与组件
   约定：所有样式挂在 body.leeai-ui 下；本文件为唯一设计真相源
   配色：与门户首页完全一致（浅灰底 + 墨黑 + 极光青 + 橙）
   ===================================================================== */

:root {
  /* ---- 颜色令牌 ---- */
  --l-bg: #e8eaee;
  --l-panel: #fff;
  --l-ink: #0a0a0a;
  --l-gray: #5d646f;
  --l-gray-2: #7a8089;
  --l-line: #c8ccd4;
  --l-line-soft: #dfe3e9;
  --l-teal: #00E5E5;
  --l-teal-dark: #1AA0B0;
  --l-teal-text: #1A7B8C;
  --l-orange: #ff5c1a;
  --l-orange-dark: #e04a0f;
  --l-orange-ink: #C2410C;   /* 文字级橙（白底 5.18:1），用于 hover 文字/白字小底色 */
  --l-ok: #10B981;
  --l-warn: #F59E0B;
  --l-err: #EF4444;
  --l-focus: rgba(26, 160, 176, .28);

  /* ---- 尺寸令牌 ---- */
  --l-bar-h: 40px;
  --l-nav-h: 64px;
  --l-chrome-h: calc(var(--l-bar-h) + var(--l-nav-h));
  --l-foot-h: 48px;          /* 固定页脚高度 */
  --l-maxw: 1440px;
  /* 自适应：内边距与标题字号随视口缩放（与首页同一套节奏） */
  --l-pad: clamp(16px, 2.2vw, 28px);
  --l-pad-y: clamp(18px, 2.4vw, 32px);

  /* ---- 字体 ----
     自托管 JetBrains Mono（拉丁子集）由下方 @font-face 引入：跨机器/浏览器时拉丁字符与数字渲染一致。
     CJK 不内嵌（体积过大），显式列出主流系统 CJK 字体按固定顺序回退，尽量缩小不同系统的观感差异。 */
  --l-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', 'Cascadia Code', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', 'WenQuanYi Micro Hei', 'Heiti SC', monospace;
  --l-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', 'WenQuanYi Micro Hei', 'Heiti SC', 'Segoe UI', sans-serif;

  /* ---- 造型 ---- */
  --l-shadow-hard: 12px 12px 0 var(--l-ink);
  --l-shadow-soft: 0 1px 2px rgba(0,0,0,.06);
  --l-trans: .28s cubic-bezier(.65, 0, .35, 1);
}

/* ================= 自托管字体（仅拉丁子集，跨机器一致；CJK 走系统回退） ================= */
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-800.woff2') format('woff2');
}

/* ================= 基础 ================= */
body.leeai-ui {
  background: var(--l-bg);
  color: var(--l-ink);
  font-family: var(--l-mono);
  -webkit-font-smoothing: antialiased;
}
body.leeai-ui.leeai-has-chrome {
  padding-top: var(--l-chrome-h);
  /* 为固定在底部的页脚预留空间：内容可完整滚动到底，不被遮挡 */
  padding-bottom: var(--l-foot-h);
  min-height: 100vh;
  /* 移动端动态视口（地址栏收起/展开）：用 dvh 规避固定页脚被裁切，旧浏览器回退 vh */
  min-height: 100dvh;
  box-sizing: border-box;
}
body.leeai-ui * { box-sizing: border-box; }
body.leeai-ui ::selection { background: var(--l-teal); color: var(--l-ink); }

/* 跨浏览器：锁定移动端字号，禁止浏览器对窄屏自动放大文字（这是"手机上看起来不一样"的常见根因） */
html { text-size-adjust: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
/* 跨浏览器：媒体与画布默认不溢出视口宽度 */
body.leeai-ui img, body.leeai-ui svg, body.leeai-ui canvas, body.leeai-ui video { max-width: 100%; height: auto; }
/* 跨浏览器：按钮默认继承字体（部分浏览器对 <button> 用系统等宽/无衬线，导致观感不一致） */
body.leeai-ui button { font-family: inherit; }

/* 滚动条 */
body.leeai-ui ::-webkit-scrollbar { width: 10px; height: 10px; }
body.leeai-ui ::-webkit-scrollbar-track { background: var(--l-line-soft); }
body.leeai-ui ::-webkit-scrollbar-thumb { background: var(--l-line); border: 2px solid var(--l-line-soft); }
body.leeai-ui ::-webkit-scrollbar-thumb:hover { background: var(--l-gray); }

/* 全局焦点环（无障碍） */
body.leeai-ui :focus-visible {
  outline: 2px solid var(--l-teal-dark);
  outline-offset: 2px;
}

/* 排版工具类 */
body.leeai-ui .l-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: var(--l-gray);
}
body.leeai-ui .l-title {
  font-family: var(--l-sans); font-weight: 900; letter-spacing: -.03em; line-height: 1.05;
}
body.leeai-ui .l-num { font-variant-numeric: tabular-nums; }
body.leeai-ui .l-muted { color: var(--l-gray); }

/* ================= Chrome：顶栏状态条 ================= */
.leeai-statusbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 510;
  display: flex; align-items: stretch; height: var(--l-bar-h);
  background: var(--l-ink); color: #fff;
  font-size: .7rem; letter-spacing: .15em; text-transform: uppercase;
  font-family: var(--l-mono);
}
.leeai-statusbar > div {
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  border-right: 1px solid rgba(255,255,255,.12); white-space: nowrap;
}
.leeai-statusbar > div:last-child { border-right: none; }
.leeai-statusbar .l-stretch { flex: 1; border-right: none; }
.leeai-statusbar .l-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--l-teal); box-shadow: 0 0 8px var(--l-teal);
  animation: l-pulse 1.6s ease-in-out infinite;
}
.leeai-statusbar .l-dot.alt { background: var(--l-orange); box-shadow: 0 0 8px var(--l-orange); }
.leeai-statusbar .l-clock { font-variant-numeric: tabular-nums; color: var(--l-teal); }
.leeai-statusbar .l-slabel { color: rgba(255,255,255,.5); }
@keyframes l-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ================= Chrome：导航 ================= */
.leeai-nav {
  position: fixed; top: var(--l-bar-h); left: 0; right: 0; z-index: 500;
  display: flex; align-items: stretch; height: var(--l-nav-h);
  background: var(--l-panel); border-bottom: 2px solid var(--l-ink);
  font-family: var(--l-mono);
}
.leeai-nav .l-brand {
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  border-right: 2px solid var(--l-ink); text-decoration: none; color: var(--l-ink);
  flex: none;
}
.leeai-nav .l-brand img { height: 30px; width: auto; display: block; animation: l-brand-sway 5s ease-in-out infinite; }
@keyframes l-brand-sway {
  0%, 100% { transform: perspective(500px) rotateY(-9deg); }
  50%      { transform: perspective(500px) rotateY(9deg); }
}
.leeai-nav .l-brand:hover img { animation: l-brand-flip .9s cubic-bezier(.34,1.56,.64,1); }
@keyframes l-brand-flip {
  from { transform: perspective(400px) rotateY(0deg) scale(1); }
  to   { transform: perspective(400px) rotateY(360deg) scale(1.06); }
}

/* 返回按钮（统一规范） */
.leeai-nav .l-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 18px; border: none; border-right: 1px solid var(--l-line-soft);
  background: transparent; color: var(--l-ink); cursor: pointer;
  font-family: var(--l-mono); font-size: .74rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  transition: background var(--l-trans), color var(--l-trans);
}
.leeai-nav .l-back:hover { background: var(--l-ink); color: #fff; }
.leeai-nav .l-back svg { width: 14px; height: 14px; flex: none; }

/* 面包屑 */
.leeai-nav .l-crumb {
  display: flex; align-items: center; gap: 10px; padding: 0 20px;
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--l-gray); flex: 1; min-width: 0; overflow: hidden;
}
.leeai-nav .l-crumb a { color: var(--l-gray); text-decoration: none; transition: color var(--l-trans); }
.leeai-nav .l-crumb a:hover { color: var(--l-orange-ink); }
.leeai-nav .l-crumb .l-sep { color: var(--l-line); }
.leeai-nav .l-crumb .l-cur { color: var(--l-ink); font-weight: 700; }

/* 站点快捷入口 */
.leeai-nav .l-sites {
  display: flex; align-items: stretch; border-left: 1px solid var(--l-line-soft);
}
.leeai-nav .l-sites a {
  display: flex; align-items: center; padding: 0 16px;
  font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--l-gray); text-decoration: none; border-right: 1px solid var(--l-line-soft);
  transition: background var(--l-trans), color var(--l-trans);
}
.leeai-nav .l-sites a:hover { background: #f8f9fb; color: var(--l-ink); }
.leeai-nav .l-sites a.is-active { color: var(--l-ink); background: #f8f9fb; position: relative; }
.leeai-nav .l-sites a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: var(--l-orange);
}

/* 用户区 */
.leeai-nav .l-user {
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  border-left: 1px solid var(--l-line-soft);
}
.leeai-nav .l-user .l-uname { font-size: .74rem; color: var(--l-gray); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 管理员：用户名可点击进入管理员控制台 */
.leeai-nav .l-user .l-uname--link {
  color: var(--l-ink); font-weight: 700; text-decoration: none;
  border-bottom: 1.5px solid var(--l-teal-dark); transition: color var(--l-trans), border-color var(--l-trans);
}
.leeai-nav .l-user .l-uname--link:hover { color: var(--l-orange-ink); border-color: var(--l-orange-ink); }
.leeai-nav .l-user .l-btn-login {
  display: inline-flex; align-items: center; padding: 8px 18px;
  background: var(--l-ink); color: #fff; border: none; cursor: pointer;
  font-family: var(--l-mono); font-size: .72rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background var(--l-trans);
}
.leeai-nav .l-user .l-btn-login:hover { background: var(--l-orange-ink); }

/* 移动端 */
@media (max-width: 900px) {
  .leeai-nav .l-crumb, .leeai-nav .l-sites { display: none; }
}
@media (max-width: 640px) {
  .leeai-nav .l-brand img { height: 24px; }
  .leeai-statusbar > div:nth-child(2), .leeai-statusbar > div:nth-child(3) { display: none; }
  body.leeai-ui { --l-bar-h: 34px; --l-nav-h: 54px; }
}

/* ================= Chrome：页脚（固定在视口底部，不随页面滚动 —— 与门户首页一致） ================= */
.leeai-footer {
  position: fixed; bottom: env(safe-area-inset-bottom, 0); left: 0; right: 0; z-index: 500;
  height: var(--l-foot-h); margin-top: 0;
  background: var(--l-panel);
  border-top: 2px solid var(--l-ink);
  display: flex; flex-wrap: nowrap; align-items: stretch;
  overflow-x: auto; overflow-y: hidden;
  font-size: .62rem; color: var(--l-gray);
  letter-spacing: .1em; text-transform: uppercase; font-family: var(--l-mono);
}
.leeai-footer > div {
  display: flex; align-items: center; gap: 8px; padding: 0 20px;
  border-right: 1px solid var(--l-line-soft); white-space: nowrap; height: 100%;
}
.leeai-footer > div:last-child { border-right: none; }
.leeai-footer .l-stretch { flex: 1; }
.leeai-footer .l-copy { background: var(--l-ink); color: #fff; font-weight: 700; letter-spacing: .15em; gap: 10px; }
.leeai-footer .l-copy img { width: 18px; height: 18px; display: block; animation: l-foot-wobble 3.2s ease-in-out infinite; }
.leeai-footer .l-copy:hover img { animation: l-foot-spin .8s ease; }
@keyframes l-foot-wobble { 0%,100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
@keyframes l-foot-spin { from { transform: rotate(0deg) scale(1); } to { transform: rotate(360deg) scale(1.4); } }
.leeai-footer a { color: var(--l-gray); text-decoration: none; transition: color var(--l-trans); }
.leeai-footer a:hover { color: var(--l-orange-ink); }
.leeai-footer .l-filing { display: flex; align-items: stretch; padding: 0; gap: 0; }
.leeai-footer .l-filing a {
  display: flex; align-items: center; gap: 8px; padding: 12px 20px;
  border-right: 1px solid var(--l-line-soft); transition: background var(--l-trans), color var(--l-trans);
}
.leeai-footer .l-filing a:last-child { border-right: none; }
.leeai-footer .l-filing a:hover { background: #f5f7f9; color: var(--l-ink); }
.leeai-footer .l-filing .l-ficon { width: 14px; height: 14px; flex: none; display: flex; color: var(--l-gray); }
.leeai-footer .l-filing .l-ficon svg { width: 100%; height: 100%; fill: currentColor; }
.leeai-footer .l-filing a:hover .l-ficon { color: var(--l-orange-ink); }
.leeai-footer .l-filing .l-fnum { color: var(--l-ink); font-weight: 700; letter-spacing: .05em; }
.leeai-footer .l-filing .l-flabel { color: var(--l-gray); font-size: .58rem; }
.leeai-footer .l-ver { color: var(--l-ink); font-weight: 700; }
@media (max-width: 768px) {
  body.leeai-ui { --l-foot-h: 44px; }
  .leeai-footer { flex-wrap: nowrap; }
  .leeai-footer > div { padding: 0 10px; }
  .leeai-footer .l-stretch { display: none; }
  /* 移动端只留备案号，隐藏「ICP 备案 / 公安备案」字样，保证单行不溢出 */
  .leeai-footer .l-filing .l-flabel { display: none; }
  .leeai-footer .l-filing a { padding: 0 10px; }
}

/* ================= 应用型站点（cx / ry）：限高到可视区，内部自行滚动 =================
   目的：整页不出现滚动条，顶栏与页脚始终固定；内容由应用自身的滚动容器上下滚动。
   说明：这两站是 React 产物，其根容器为 #root / #app（body 直接子元素）。
   如后续构建结构变化导致异常，删除本段即可退回"整页滚动"模式（顶栏/页脚仍固定）。 */
body.leeai-ui.leeai-has-chrome > #root,
body.leeai-ui.leeai-has-chrome > #app {
  height: calc(100vh - var(--l-chrome-h) - var(--l-foot-h));
  height: calc(100dvh - var(--l-chrome-h) - var(--l-foot-h));
  overflow: hidden;
}
body.leeai-ui.leeai-has-chrome > #root > *,
body.leeai-ui.leeai-has-chrome > #app > * { height: 100%; }

/* ================= 子站进入进度页（约 1 秒，静态标记 + chrome 收起） ================= */
.leeai-splash {
  position: fixed; inset: 0; z-index: 9800; background: var(--l-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  font-family: var(--l-mono);
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.leeai-splash.is-off { opacity: 0; visibility: hidden; pointer-events: none; }
.leeai-splash__logo { width: 56px; height: 56px; animation: l-splash-pulse 1.2s ease-in-out infinite; }
@keyframes l-splash-pulse { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: 1; } }
.leeai-splash__bar { width: 200px; height: 2px; background: rgba(26,160,176,.18); overflow: hidden; position: relative; }
.leeai-splash__bar > i { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: linear-gradient(90deg, var(--l-teal-dark), var(--l-teal)); transition: width .16s ease; }
.leeai-splash__txt { font-size: .66rem; letter-spacing: .3em; color: #156877; text-transform: uppercase; }
.leeai-splash__log { margin-top: 8px; min-height: 3em; font-size: .56rem; letter-spacing: .2em;
  color: #5d646f; text-transform: uppercase; text-align: center; }
.leeai-splash__log div { padding: 2px 0; }

/* ================= 通知铃（chrome 导航内，cx 站） ================= */
.leeai-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1.5px solid var(--l-ink); background: var(--l-panel);
  color: var(--l-ink); cursor: pointer; transition: all var(--l-trans);
}
.leeai-bell:hover { background: var(--l-ink); color: #fff; }
.leeai-bell svg { width: 16px; height: 16px; }
.leeai-bell__badge {
  position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px;
  background: var(--l-orange-ink); color: #fff; font-size: .56rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  font-variant-numeric: tabular-nums;
}
.leeai-bell__panel {
  position: fixed; top: calc(var(--l-chrome-h) + 8px); right: 20px; z-index: 9600;
  width: 320px; max-height: 60vh; max-height: 60dvh; overflow-y: auto;
  background: var(--l-panel); border: 2px solid var(--l-ink);
  box-shadow: 8px 8px 0 var(--l-ink); display: none;
}
.leeai-bell__panel.is-on { display: block; }
.leeai-bell__panel .l-bp-head {
  background: var(--l-ink); color: #fff; padding: 9px 14px;
  font-size: .64rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
}
.leeai-bell__panel .l-bp-head button {
  background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; cursor: pointer;
  font-size: .58rem; padding: 2px 8px; font-family: var(--l-mono);
}
body.leeai-ui .leeai-bell__item {
  padding: 9px 14px; border-bottom: 1px solid var(--l-line-soft);
  cursor: pointer; transition: background var(--l-trans);
}
body.leeai-ui .leeai-bell__item:hover { background: #f8f9fb; }
body.leeai-ui .leeai-bell__item.is-read { opacity: .5; }
body.leeai-ui .leeai-bell__item .l-bt { font-size: .74rem; color: var(--l-ink); }
body.leeai-ui .leeai-bell__item .l-bd { font-size: .62rem; color: var(--l-gray); margin-top: 2px; }
body.leeai-ui .leeai-bell__empty { padding: 26px; text-align: center; color: var(--l-gray); font-size: .74rem; }

/* ================= 隐藏应用自有顶栏（由页面 body 属性启用） =================
   例：cx 的 <header> 与统一顶栏重复，且其搜索/通知已由 chrome 承接 */
body.leeai-ui.leeai-has-chrome[data-leeai-hide-appbar] header:not(.leeai-nav) { display: none !important; }

/* 隐藏各站自有的旧 chrome */
body.leeai-ui.leeai-has-chrome .vi-topbar,
body.leeai-ui.leeai-has-chrome .vi-footer,
body.leeai-ui.leeai-has-chrome > footer:not(.leeai-footer),
body.leeai-ui.leeai-has-chrome .site-header,
body.leeai-ui.leeai-has-chrome .site-footer { display: none !important; }

/* ================= 组件：按钮 ================= */
body.leeai-ui .l-btn,
body.leeai-ui button.l-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: 1.5px solid var(--l-ink); background: var(--l-panel);
  color: var(--l-ink); cursor: pointer; text-decoration: none;
  font-family: var(--l-mono); font-size: .72rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  transition: background var(--l-trans), color var(--l-trans), border-color var(--l-trans);
}
body.leeai-ui .l-btn:hover { background: var(--l-ink); color: #fff; }
body.leeai-ui .l-btn--primary { background: var(--l-ink); color: #fff; }
body.leeai-ui .l-btn--primary:hover { background: var(--l-orange-ink); border-color: var(--l-orange-ink); }
body.leeai-ui .l-btn--accent { background: var(--l-teal); border-color: var(--l-teal-dark); color: var(--l-ink); }
body.leeai-ui .l-btn--accent:hover { background: var(--l-teal-text); border-color: var(--l-teal-text); color: #fff; }
body.leeai-ui .l-btn--ghost { border-color: transparent; background: transparent; color: var(--l-gray); }
body.leeai-ui .l-btn--ghost:hover { background: var(--l-line-soft); color: var(--l-ink); }
body.leeai-ui .l-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ================= 组件：输入 ================= */
/* 覆盖所有"文本类"输入（含不写 type 的裸 input），排除勾选/文件/按钮类 */
body.leeai-ui input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="color"]):not([type="range"]),
body.leeai-ui select,
body.leeai-ui textarea {
  padding: 10px 14px; border: 1.5px solid var(--l-ink); background: #fafbfc;
  color: var(--l-ink); font-family: var(--l-mono); font-size: .82rem;
  outline: none; letter-spacing: .02em; transition: box-shadow var(--l-trans), border-color var(--l-trans);
}
body.leeai-ui input:focus, body.leeai-ui select:focus, body.leeai-ui textarea:focus {
  box-shadow: 0 0 0 3px var(--l-focus); border-color: var(--l-teal-dark);
}
body.leeai-ui input::placeholder, body.leeai-ui textarea::placeholder { color: var(--l-gray); opacity: .65; }
body.leeai-ui label { font-size: .68rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--l-gray); }

/* ================= 组件：表格 ================= */
body.leeai-ui table {
  width: 100%; border-collapse: collapse; background: var(--l-panel);
  font-size: .82rem; border: 1.5px solid var(--l-ink);
}
body.leeai-ui thead th {
  background: var(--l-ink); color: #fff; text-align: left;
  font-size: .66rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  padding: 12px 14px; white-space: nowrap;
}
/* 注：不在此处加 position:sticky —— 会把粘性定位污染到应用自身的滚动容器；
   需要粘性表头的场景由具体皮肤的 .xxx thead th 显式声明 */
body.leeai-ui tbody td { padding: 11px 14px; border-top: 1px solid var(--l-line-soft); }
body.leeai-ui tbody tr:hover td { background: #f8f9fb; }
body.leeai-ui tbody tr.is-selected td { background: rgba(0,229,229,.12); }
body.leeai-ui td.l-num, body.leeai-ui th.l-num { font-variant-numeric: tabular-nums; }

/* ================= 组件：卡片 / 面板 ================= */
body.leeai-ui .l-card, body.leeai-ui .l-panel {
  background: var(--l-panel); border: 1.5px solid var(--l-ink); padding: 22px;
}
body.leeai-ui .l-card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--l-line-soft);
}
body.leeai-ui .l-stat { border: 1.5px solid var(--l-ink); background: var(--l-panel); padding: 16px 18px; }
body.leeai-ui .l-stat__num { font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
body.leeai-ui .l-stat__unit { color: var(--l-orange-ink); font-size: .95rem; margin-left: 2px; }
body.leeai-ui .l-grid { display: grid; gap: 0; }

/* ================= 组件：标签 / 徽章 ================= */
body.leeai-ui .l-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  background: var(--l-ink); color: #fff;
  font-size: .6rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}
body.leeai-ui .l-tag--teal { background: var(--l-teal); color: var(--l-ink); }
body.leeai-ui .l-tag--orange { background: var(--l-orange-ink); color: #fff; }
body.leeai-ui .l-tag--line { background: transparent; border: 1px solid var(--l-line); color: var(--l-gray); }

/* ================= 组件：弹窗 ================= */
body.leeai-ui .l-modal {
  background: var(--l-panel); border: 2px solid var(--l-ink); box-shadow: var(--l-shadow-hard);
  font-family: var(--l-mono);
}
body.leeai-ui .l-modal__head {
  background: var(--l-ink); color: #fff; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .7rem; font-weight: 700; letter-spacing: .25em; text-transform: uppercase;
}
body.leeai-ui .l-modal__head .l-close {
  width: 26px; height: 26px; background: none; border: 1px solid rgba(255,255,255,.3);
  color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; display: flex;
  align-items: center; justify-content: center; padding: 0; transition: all var(--l-trans);
}
body.leeai-ui .l-modal__head .l-close:hover { background: var(--l-orange); border-color: var(--l-orange); }

/* ================= 组件：状态（加载 / 空 / 错） ================= */
body.leeai-ui .l-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 56px 20px; color: var(--l-gray);
  border: 1.5px dashed var(--l-line); background: var(--l-panel);
  font-size: .8rem; letter-spacing: .1em;
}
body.leeai-ui .l-empty__icon { font-size: 1.6rem; opacity: .5; }
body.leeai-ui .l-loading { display: flex; align-items: center; gap: 10px; color: var(--l-gray); font-size: .78rem; }
body.leeai-ui .l-spinner {
  width: 16px; height: 16px; border: 2px solid var(--l-line); border-top-color: var(--l-teal-dark);
  border-radius: 50%; animation: l-spin .8s linear infinite;
}
@keyframes l-spin { to { transform: rotate(360deg); } }

/* ================= 组件：回到顶部 ================= */
.leeai-totop {
  position: fixed; right: 24px; bottom: calc(var(--l-foot-h) + 14px); z-index: 480;
  width: 44px; height: 44px; border: 1.5px solid var(--l-ink); background: var(--l-panel);
  color: var(--l-ink); cursor: pointer; display: none;
  align-items: center; justify-content: center; transition: all var(--l-trans);
  font-family: var(--l-mono);
}
.leeai-totop.is-on { display: flex; }
.leeai-totop:hover { background: var(--l-ink); color: #fff; }

/* ================= 内容页布局（门户内容页 / 子站通用） ================= */
body.leeai-ui .l-wrap {
  max-width: var(--l-maxw); margin: 0 auto; padding: var(--l-pad-y) var(--l-pad) 0;
}
body.leeai-ui .l-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding-bottom: 18px; margin-bottom: 28px; border-bottom: 2px solid var(--l-ink);
  position: relative;
}
body.leeai-ui .l-head::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 60px; height: 2px; background: var(--l-orange);
}
body.leeai-ui .l-head h1 {
  font-family: var(--l-sans);
  font-size: clamp(1.35rem, 1.5vw + 0.9rem, 2.1rem);
  font-weight: 900; letter-spacing: -.03em; margin: 0;
}
body.leeai-ui .l-head .l-sub { font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: var(--l-gray); }

body.leeai-ui .l-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body.leeai-ui .l-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
body.leeai-ui .l-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
@media (max-width: 900px) {
  body.leeai-ui .l-grid-2, body.leeai-ui .l-grid-3, body.leeai-ui .l-grid-4 { grid-template-columns: 1fr; }
}
body.leeai-ui .l-stack { display: flex; flex-direction: column; gap: 20px; }

/* key-value 行 */
body.leeai-ui .l-kv {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--l-line-soft); font-size: .82rem;
}
body.leeai-ui .l-kv:last-of-type { border-bottom: none; }
body.leeai-ui .l-kv > span { color: var(--l-gray); letter-spacing: .08em; }
body.leeai-ui .l-kv > b { color: var(--l-ink); font-weight: 700; }

/* 折叠块 */
body.leeai-ui .l-collapse { border-top: 1px solid var(--l-line-soft); }
body.leeai-ui .l-collapse > summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; cursor: pointer; list-style: none;
  font-size: .7rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--l-ink);
}
body.leeai-ui .l-collapse > summary::-webkit-details-marker { display: none; }
body.leeai-ui .l-collapse > summary svg { transition: transform var(--l-trans); }
body.leeai-ui .l-collapse[open] > summary svg { transform: rotate(180deg); }
body.leeai-ui .l-collapse .l-body { padding: 4px 0 16px; }

/* 表单字段 */
body.leeai-ui .l-field { margin-bottom: 18px; }
body.leeai-ui .l-field > label { display: block; margin-bottom: 8px; }
body.leeai-ui .l-field input, body.leeai-ui .l-field select, body.leeai-ui .l-field textarea { width: 100%; }
body.leeai-ui .l-help { margin-top: 6px; font-size: .68rem; color: var(--l-gray); letter-spacing: .04em; }

/* 表单提示 */
body.leeai-ui .l-alert {
  display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 14px;
  border: 1.5px solid var(--l-line); font-size: .76rem; letter-spacing: .04em;
}
body.leeai-ui .l-alert--ok { border-color: var(--l-ok); color: #065F46; background: #ECFDF5; }
body.leeai-ui .l-alert--err { border-color: var(--l-err); color: #991B1B; background: #FEF2F2; }
body.leeai-ui .l-alert--info { border-color: var(--l-teal-dark); color: var(--l-teal-text); background: #E0FFFF; }

/* 系统 / 功能入口卡（桌面图标式） */
body.leeai-ui .l-sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0; border: 1.5px solid var(--l-ink); }
body.leeai-ui .l-sys-card {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  border-right: 1.5px solid var(--l-ink); border-bottom: 1.5px solid var(--l-ink);
  background: var(--l-panel); text-decoration: none; color: inherit;
  transition: background var(--l-trans), color var(--l-trans); position: relative;
}
body.leeai-ui .l-sys-card:hover { background: var(--l-ink); color: #fff; }
body.leeai-ui .l-sys-card:hover .l-sys-ico { border-color: var(--l-teal); color: var(--l-teal); }
body.leeai-ui .l-sys-card:hover .l-sys-desc { color: rgba(255,255,255,.6); }
body.leeai-ui .l-sys-ico {
  width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--l-ink); transition: border-color var(--l-trans), color var(--l-trans);
}
body.leeai-ui .l-sys-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
body.leeai-ui .l-sys-name { font-family: var(--l-sans); font-size: .95rem; font-weight: 800; }
body.leeai-ui .l-sys-desc { font-size: .68rem; color: var(--l-gray); margin-top: 3px; letter-spacing: .06em; }
body.leeai-ui .l-sys-badge {
  position: absolute; top: 10px; right: 10px; padding: 2px 8px;
  background: var(--l-teal); color: var(--l-ink);
  font-size: .56rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}

/* 筛选栏 */
body.leeai-ui .l-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 18px; background: var(--l-panel); border: 1.5px solid var(--l-ink); margin-bottom: 20px;
}

/* ================= 组件：选项卡（通用） ================= */
body.leeai-ui .l-tabs {
  display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 20px;
  border: 1.5px solid var(--l-ink); background: var(--l-panel); width: fit-content;
}
body.leeai-ui .l-tab {
  padding: 11px 24px; cursor: pointer; border-right: 1.5px solid var(--l-ink);
  font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--l-gray); transition: all var(--l-trans); position: relative; user-select: none;
}
body.leeai-ui .l-tab:last-child { border-right: none; }
body.leeai-ui .l-tab:hover { background: #f8f9fb; color: var(--l-ink); }
body.leeai-ui .l-tab.is-on { background: var(--l-ink); color: #fff; }
body.leeai-ui .l-tab.is-on::after {
  content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px;
  margin-left: -2px; background: var(--l-teal); border-radius: 50%;
}
/* 表格行内操作按钮 */
body.leeai-ui .l-rowbtn {
  border: 1px solid var(--l-line); background: transparent; color: var(--l-ink);
  padding: 3px 10px; margin-right: 6px; cursor: pointer; font-family: var(--l-mono);
  font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  transition: all var(--l-trans);
}
body.leeai-ui .l-rowbtn:hover { background: var(--l-ink); color: #fff; border-color: var(--l-ink); }
body.leeai-ui .l-rowbtn--danger { color: #991B1B; border-color: #F09595; }
body.leeai-ui .l-rowbtn--danger:hover { background: #DC2626; border-color: #DC2626; color: #fff; }
/* 遮罩 + 弹窗容器 */
body.leeai-ui .l-overlay {
  position: fixed; inset: 0; z-index: 9400;
  background: rgba(10,10,10,.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
body.leeai-ui .l-overlay.is-on { display: flex; }

/* ================= 超宽屏：略增最大内容宽度，避免大分辨率两侧过空 ================= */
@media (min-width: 1920px) {
  body.leeai-ui { --l-maxw: 1640px; }
}

/* ================= 打印 ================= */
@media print {
  .leeai-statusbar, .leeai-nav, .leeai-totop { display: none !important; }
  body.leeai-ui.leeai-has-chrome { padding-top: 0; }
}
