/* ===== 后台主框架 ===== */
.lm-app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--topbar-h) 1fr; grid-template-areas: "sidebar topbar" "sidebar main"; min-height: 100vh; }
.lm-sidebar { grid-area: sidebar; background: linear-gradient(180deg, #2bb673 0%, #25a164 70%, #1d8a55 100%); color: #fff; padding: 18px 0; position: sticky; top:0; height: 100vh; display: flex; flex-direction: column; }
.lm-brand { display: flex; align-items: center; gap: 10px; padding: 4px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.15); }
.lm-brand-leaf { font-size: 24px; }
.lm-brand-title { font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.lm-brand-sub { font-size: 11px; opacity: .8; letter-spacing: 1px; }
.lm-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.lm-nav-item { display: flex; align-items: center; gap: 10px; padding: 5px 18px; color: rgba(255,255,255,.88); font-size: 13px; transition: all .2s; }
.lm-nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.lm-nav-item.active { background: rgba(255,255,255,.2); color:#fff; font-weight: 600; position: relative; }
.lm-nav-item.active::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: #fff; }
.lm-nav-ico { font-size: 15px; width: 18px; text-align: center; }
.lm-side-foot { padding: 10px 18px; font-size: 11px; color: rgba(255,255,255,.7); border-top: 1px solid rgba(255,255,255,.15); }

.lm-topbar { grid-area: topbar; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; box-shadow: 0 1px 4px rgba(0,0,0,.04); position: sticky; top: 0; z-index: 10; }
.lm-topbar-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.lm-topbar-right { display: flex; align-items: center; gap: 8px; }
.lm-user { display: flex; align-items: center; gap: 6px; padding: 4px 12px; background: var(--brand-soft); border-radius: 20px; font-size: 13px; }
.lm-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color:#fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.lm-role { font-size: 11px; color: var(--muted); padding-left: 6px; border-left: 1px solid var(--line-2); margin-left: 4px; }

.lm-main { grid-area: main; padding: 18px 24px 60px; }

/* 工具栏 */
.lm-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.lm-toolbar .lm-search { flex: 1; min-width: 200px; max-width: 320px; }
.lm-toolbar .lm-search .lm-input { padding-left: 32px; background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a98a8' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") no-repeat 10px center; }
.lm-toolbar .spacer { flex: 1; }

/* 表单页面 */
.lm-form { background: #fff; border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow); }
.lm-form h3 { margin: 4px 0 18px; font-size: 15px; color: var(--ink); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.lm-form .lm-form-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; gap: 10px; }

/* 详情视图 */
.lm-detail { background:#fff; border-radius: var(--radius); padding: 20px 26px; box-shadow: var(--shadow); }
.lm-detail h2 { margin: 0 0 10px; font-size: 18px; color: var(--ink); }
.lm-detail .meta { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.lm-detail .meta span { margin-right: 14px; }
.lm-detail .desc { color: var(--ink-2); font-size: 14px; line-height: 1.8; padding: 12px 14px; background: var(--brand-soft); border-radius: 6px; border-left: 3px solid var(--brand); }
.lm-kv { display:grid; grid-template-columns: 120px 1fr; gap: 8px 14px; margin-top: 14px; }
.lm-kv dt { color: var(--muted); font-size: 12.5px; }
.lm-kv dd { margin: 0; color: var(--ink); font-size: 13.5px; }

/* 大屏 */
.lm-screen { background: linear-gradient(180deg, #f4fbf7 0%, #e8f8f1 100%); padding: 18px; min-height: calc(100vh - var(--topbar-h)); }
.lm-screen-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 14px; }
.lm-screen-card { background: rgba(255,255,255,.92); border: 1px solid var(--brand-light); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 4px 16px rgba(43,182,115,.08); }
.lm-screen-title { font-size: 14px; color: var(--brand-3); font-weight: 600; margin-bottom: 10px; padding-left: 8px; border-left: 3px solid var(--brand); }
.lm-screen-row { display:flex; justify-content:space-between; padding: 5px 0; font-size: 12.5px; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.lm-screen-row:last-child { border-bottom: 0; }
.lm-screen-num { font-size: 26px; font-weight: 700; color: var(--brand-3); }
.lm-screen-rolling { height: 240px; overflow: hidden; }
.lm-screen-rolling ul { list-style: none; padding: 0; margin: 0; animation: roll 18s linear infinite; }
.lm-screen-rolling li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; color: var(--ink-2); }
@keyframes roll { from { transform: translateY(0) } to { transform: translateY(-50%) } }

/* 登录 */
.lm-login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #2bb673 0%, #25a164 50%, #1d8a55 100%); }
.lm-login-card { width: 380px; background: #fff; border-radius: 16px; padding: 32px 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.lm-login-card h1 { text-align: center; color: var(--brand-3); margin: 0 0 4px; font-size: 20px; }
.lm-login-card .sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.lm-login-card .lm-field { margin-bottom: 14px; }
.lm-login-card .lm-btn { width: 100%; padding: 10px; font-size: 14px; }
.lm-login-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 11.5px; }

/* ===== 远程数据同步状态条 ===== */
.lm-remote-bar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 10px 14px; margin: 12px 0 18px;
  border-radius: 10px; font-size: 12.5px;
  border: 1px solid;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.lm-remote-bar code { background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 4px; font-size: 11.5px; }
.lm-remote-bar .sep { margin: 0 6px; color: #b0bcc5; }
.lm-remote-bar .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
  box-shadow: 0 0 6px currentColor;
}
.lm-remote-ok { background: linear-gradient(95deg, #f0fbf5 0%, #e3f7ec 100%); border-color: #2bb673; color: #1d6a3f; }
.lm-remote-ok .dot { background: #2bb673; color: #2bb673; animation: pulse-dot 1.4s infinite; }
.lm-remote-ok .ok { color: #1d8a55; font-weight: 600; }
.lm-remote-fail { background: linear-gradient(95deg, #fff8ef 0%, #fdebdc 100%); border-color: #f5a623; color: #8a5a1f; }
.lm-remote-fail .dot { background: #f5a623; color: #f5a623; }
.lm-remote-fail .fail { color: #c9761d; font-weight: 600; }
.lm-remote-bar .muted { color: #8a98a8; }
.lm-remote-bar-r { display: flex; gap: 8px; }

/* 区块小标题 */
.lm-section-title {
  display: flex; align-items: baseline; gap: 8px;
  margin: 18px 0 10px; font-size: 14px; font-weight: 600; color: var(--ink, #2a3a4c);
}
.lm-section-title small { font-weight: normal; color: var(--muted, #8a98a8); font-size: 12px; }

/* ===== 后台工作台动态效果 ===== */
.lm-stat-wp {
  position: relative; overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease;
  opacity: 0; transform: translateY(16px);
  animation: kpi-in .8s var(--d, 0s) ease-out forwards;
}
.lm-stat-wp:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 28px rgba(43,182,115,.18);
}
.lm-stat-wp .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.lm-stat-wp::after {
  content:""; position: absolute; left:0; bottom:0; height:3px; width:0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  animation: bar-grow 1.2s .8s ease-out forwards;
}

/* 工作台顶部统计卡：强制一行 6 卡不换行（minmax(0,1fr) 允许压缩），
   只有窗口很窄时才降列，正常桌面永远一行 */
.lm-stat-grid-wp6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.lm-stat-grid-wp6 .lm-stat { padding: 16px 12px; min-width: 0; }
.lm-stat-grid-wp6 .lm-stat .num { font-size: 24px; white-space: nowrap; }
@media (max-width: 960px)  { .lm-stat-grid-wp6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .lm-stat-grid-wp6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 快捷入口磁贴 */
.lm-shortcut {
  display:flex; align-items:center; gap:10px;
  padding: 14px 12px;
  background: linear-gradient(135deg, #fff, var(--brand-soft));
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13.5px;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
  position: relative; overflow: hidden;
}
.lm-shortcut::before {
  content:""; position: absolute; left:0; top:0; height:100%; width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  opacity: 0; transition: opacity .25s ease;
}
.lm-shortcut:hover {
  transform: translateX(4px) translateY(-2px);
  box-shadow: 0 10px 22px rgba(43,182,115,.18);
  background: linear-gradient(135deg, #fff, #e8f8f1);
}
.lm-shortcut:hover::before { opacity: 1; }
.lm-shortcut-ico { font-size: 22px; }
.lm-shortcut-txt { font-weight: 500; }

/* 卡片入场 */
.lm-fade-up { opacity: 0; transform: translateY(20px); animation: fade-up .7s ease-out forwards; }
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }
@keyframes kpi-in { to { opacity: 1; transform: translateY(0); } }
@keyframes bar-grow { from { width: 0 } to { width: 100% } }
