/* ============================================================
   OPC 园区数字化管理平台 · 后台样式
   高端科技数据深色风格 / 纯原生 CSS，无框架
   ============================================================ */
:root {
  --bg: #070b16;
  --bg2: #0a1020;
  --panel: rgba(16, 26, 48, 0.85);
  --panel-solid: #0e1830;
  --line: rgba(0, 200, 255, 0.16);
  --line-strong: rgba(0, 200, 255, 0.4);
  --cyan: #00c8ff;
  --blue: #2f7bff;
  --text: #d8e8ff;
  --text-dim: #7d93b8;
  --green: #2fe6a8;
  --red: #ff5e7a;
  --orange: #ffb454;
  --purple: #9d7bff;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background-image:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(47, 123, 255, 0.12), transparent),
    radial-gradient(ellipse 50% 35% at 85% 100%, rgba(0, 200, 255, 0.08), transparent);
  background-attachment: fixed;
}
a { color: var(--cyan); text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0, 200, 255, 0.25); border-radius: 4px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); }

/* ================= 框架布局 ================= */
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 220px; flex-shrink: 0; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0b1226 0%, #070d1c 100%);
  border-right: 1px solid var(--line);
}
.logo {
  padding: 20px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; box-shadow: 0 0 16px rgba(0, 200, 255, 0.5);
}
.logo-text b { display: block; font-size: 15px; letter-spacing: 1px; color: #fff; }
.logo-text i { font-style: normal; font-size: 10px; color: var(--text-dim); letter-spacing: 2px; }
.menu { flex: 1; overflow-y: auto; padding: 10px 0; }
.menu-group { margin-bottom: 2px; }
.menu-group-title {
  padding: 10px 18px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  color: var(--text); font-size: 13px; user-select: none; transition: 0.2s;
}
.menu-group-title:hover { color: var(--cyan); background: rgba(0, 200, 255, 0.06); }
.menu-group-title .mi { width: 18px; text-align: center; color: var(--cyan); }
.menu-group-title .arrow { margin-left: auto; font-size: 10px; color: var(--text-dim); transition: 0.2s; }
.menu-group.open .arrow { transform: rotate(90deg); }
.menu-sub { display: none; }
.menu-group.open .menu-sub { display: block; }
.menu-item {
  display: block; padding: 8px 18px 8px 44px; color: var(--text-dim);
  font-size: 13px; transition: 0.2s; border-left: 2px solid transparent;
}
.menu-item:hover { color: var(--cyan); background: rgba(0, 200, 255, 0.06); }
.menu-item.active {
  color: var(--cyan); background: linear-gradient(90deg, rgba(0, 200, 255, 0.14), transparent);
  border-left-color: var(--cyan);
}
.menu-link {
  display: flex; align-items: center; gap: 8px; padding: 10px 18px;
  color: var(--text); font-size: 13px; transition: 0.2s; border-left: 2px solid transparent;
}
.menu-link:hover, .menu-link.active { color: var(--cyan); background: rgba(0, 200, 255, 0.08); border-left-color: var(--cyan); }
.menu-link .mi { width: 18px; text-align: center; color: var(--cyan); }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; padding: 0 20px; gap: 14px;
  background: rgba(10, 16, 32, 0.9); border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 15px; color: #fff; letter-spacing: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-user { color: var(--text-dim); font-size: 13px; }
.topbar-user b { color: var(--cyan); font-weight: normal; }
.topbar-clock { font-family: Consolas, monospace; color: var(--text-dim); font-size: 12px; }
.content-frame { flex: 1; border: none; width: 100%; background: transparent; }

/* ================= 内页 ================= */
.page { padding: 18px 20px 40px; }
.page-head { display: flex; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 17px; color: #fff; letter-spacing: 1px; position: relative; padding-left: 12px; }
.page-title::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--blue)); border-radius: 2px;
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.6);
}
.page-desc { color: var(--text-dim); font-size: 12px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* 卡片 */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin-bottom: 16px; position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.5), transparent);
}
.card-title { font-size: 14px; color: var(--cyan); margin-bottom: 12px; letter-spacing: 1px; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; position: relative; overflow: hidden; transition: 0.25s;
}
.stat-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 200, 255, 0.12); }
.stat-label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-family: Consolas, "DIN Alternate", monospace; color: #fff; line-height: 1.2; }
.stat-value em { font-style: normal; font-size: 12px; color: var(--text-dim); margin-left: 4px; }
.stat-card.hl .stat-value { color: var(--cyan); text-shadow: 0 0 12px rgba(0, 200, 255, 0.5); }
.stat-card.warn .stat-value { color: var(--orange); }
.stat-card.good .stat-value { color: var(--green); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 16px;
  border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer;
  background: rgba(0, 200, 255, 0.08); color: var(--cyan); font-size: 13px;
  transition: 0.2s; user-select: none; line-height: 1.4;
}
.btn:hover { background: rgba(0, 200, 255, 0.18); box-shadow: 0 0 12px rgba(0, 200, 255, 0.25); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #fff; border: none;
}
.btn-primary:hover { box-shadow: 0 0 16px rgba(0, 200, 255, 0.5); filter: brightness(1.1); }
.btn-danger { border-color: rgba(255, 94, 122, 0.4); color: var(--red); background: rgba(255, 94, 122, 0.08); }
.btn-danger:hover { background: rgba(255, 94, 122, 0.18); box-shadow: 0 0 12px rgba(255, 94, 122, 0.25); }
.btn-sm { padding: 3px 10px; font-size: 12px; border-radius: 4px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th {
  text-align: left; padding: 10px 12px; color: var(--cyan); font-weight: normal;
  background: rgba(0, 200, 255, 0.07); border-bottom: 1px solid var(--line-strong);
  white-space: nowrap; letter-spacing: 1px; font-size: 12px;
}
table.list td { padding: 9px 12px; border-bottom: 1px solid rgba(0, 200, 255, 0.08); color: var(--text); }
table.list tbody tr { transition: 0.15s; }
table.list tbody tr:hover { background: rgba(0, 200, 255, 0.05); }
table.list .num { font-family: Consolas, monospace; }
.empty { text-align: center; color: var(--text-dim); padding: 40px 0; }

/* 标签 */
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px;
  border: 1px solid; line-height: 1.5; white-space: nowrap;
}
.tag-cyan { color: var(--cyan); border-color: rgba(0, 200, 255, 0.4); background: rgba(0, 200, 255, 0.08); }
.tag-green { color: var(--green); border-color: rgba(47, 230, 168, 0.4); background: rgba(47, 230, 168, 0.08); }
.tag-red { color: var(--red); border-color: rgba(255, 94, 122, 0.4); background: rgba(255, 94, 122, 0.08); }
.tag-orange { color: var(--orange); border-color: rgba(255, 180, 84, 0.4); background: rgba(255, 180, 84, 0.08); }
.tag-purple { color: var(--purple); border-color: rgba(157, 123, 255, 0.4); background: rgba(157, 123, 255, 0.08); }
.tag-dim { color: var(--text-dim); border-color: rgba(125, 147, 184, 0.4); background: rgba(125, 147, 184, 0.08); }

/* 筛选栏 */
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar .tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ftab {
  padding: 5px 14px; border-radius: 20px; cursor: pointer; font-size: 12px;
  border: 1px solid var(--line); color: var(--text-dim); transition: 0.2s;
}
.ftab:hover { color: var(--cyan); border-color: var(--line-strong); }
.ftab.active { color: #fff; background: linear-gradient(135deg, var(--blue), var(--cyan)); border-color: transparent; }

/* 表单 */
input[type=text], input[type=password], input[type=number], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; padding: 8px 12px; border-radius: 6px; font-size: 13px;
  background: rgba(7, 12, 24, 0.8); border: 1px solid var(--line); color: var(--text);
  outline: none; transition: 0.2s; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 8px rgba(0, 200, 255, 0.2); }
select option { background: var(--panel-solid); color: var(--text); }
textarea { resize: vertical; min-height: 80px; }
.form { display: block; }
.form-row { display: flex; gap: 14px; margin-bottom: 12px; }
.form-item { flex: 1; min-width: 0; }
.form-item label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }
.form-item label .req { color: var(--red); margin-left: 2px; }
.form-tip { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.checkbox-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; }
.checkbox-line input { width: auto; }

/* 弹窗内表单容器（默认隐藏，layer 打开） */
.dialog-form { display: none; padding: 20px; }

/* 图片上传 */
.upload-box { display: flex; align-items: center; gap: 10px; }
.upload-preview {
  width: 90px; height: 60px; border-radius: 6px; border: 1px dashed var(--line-strong);
  object-fit: cover; background: rgba(0,0,0,0.3); display: none;
}
.upload-preview.show { display: block; }

/* 分页 */
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.pager a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--cyan); }
.pager a:hover { border-color: var(--cyan); }
.pager .disabled { opacity: 0.4; pointer-events: none; }

/* 权限勾选 */
.perm-group { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.perm-group-title { color: var(--cyan); font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.perm-items { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.perm-items label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); cursor: pointer; }
.perm-items input { width: auto; }

/* 进度条 */
.progress { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: 4px; box-shadow: 0 0 8px rgba(0,200,255,0.6); }

/* ================= 登录页 ================= */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; position: relative; overflow: hidden; }
.login-grid-bg {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0,200,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,200,255,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 30%, transparent 75%);
}
.login-box {
  width: 400px; max-width: 92vw; position: relative; z-index: 2;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px;
  padding: 36px 34px; box-shadow: 0 0 60px rgba(0, 200, 255, 0.12), inset 0 0 30px rgba(0, 200, 255, 0.03);
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo .logo-icon { margin: 0 auto 12px; width: 52px; height: 52px; font-size: 26px; border-radius: 12px; }
.login-logo h1 { font-size: 19px; color: #fff; letter-spacing: 2px; }
.login-logo p { font-size: 11px; color: var(--text-dim); letter-spacing: 3px; margin-top: 4px; }
.login-box .form-item { margin-bottom: 16px; }
.login-btn { width: 100%; justify-content: center; padding: 10px; font-size: 14px; letter-spacing: 4px; }
.login-foot { text-align: center; margin-top: 18px; font-size: 11px; color: var(--text-dim); }

/* ================= layer 深色皮肤 ================= */
.layui-layer { background: var(--panel-solid) !important; border: 1px solid var(--line-strong) !important; border-radius: 10px !important; box-shadow: 0 0 40px rgba(0, 200, 255, 0.2) !important; }
.layui-layer-title { background: rgba(0, 200, 255, 0.08) !important; color: var(--cyan) !important; border-bottom: 1px solid var(--line) !important; letter-spacing: 1px; }
.layui-layer-content { color: var(--text) !important; }
.layui-layer-setwin .layui-layer-close1 { filter: invert(0.8) sepia(1) hue-rotate(160deg) saturate(3); }
.layui-layer-btn { padding: 0 14px 12px !important; text-align: right; }
.layui-layer-btn a {
  background: rgba(0, 200, 255, 0.1) !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--cyan) !important;
  border-radius: 5px !important;
  height: 28px !important;
  line-height: 26px !important;
  padding: 0 14px !important;
  font-size: 12px !important;
  font-weight: normal !important;
  margin-left: 8px !important;
}
.layui-layer-btn .layui-layer-btn0 { background: linear-gradient(135deg, var(--blue), var(--cyan)) !important; color: #fff !important; border: none !important; }
.layui-layer-dialog .layui-layer-content { color: var(--text) !important; }
.layui-layer-msg { border-radius: 6px !important; }
.layui-layer-hui { background: rgba(10, 20, 40, 0.95) !important; color: var(--text) !important; }

/* ---------- 弹窗图标：替换 layer 自带白底精灵图 ----------
   原 icon.png 为浅色设计，在深色皮肤下是白色方块。
   这里去掉背景图，用纯 CSS 画圆形描边图标，与整体科技风一致。 */
.layui-layer-dialog .layui-layer-content .layui-layer-ico {
  background-image: none !important;
  width: 22px !important;
  height: 22px !important;
  top: 19px !important;
  left: 18px !important;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background-color: transparent !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  font-family: -apple-system, "PingFang SC", sans-serif;
}
.layui-layer-dialog .layui-layer-content .layui-layer-ico::before { color: inherit; }
.layui-layer-dialog .layui-layer-padding { padding: 20px 22px 20px 52px !important; }

/* 成功：绿色对勾 */
.layui-layer-ico1 { color: var(--green); box-shadow: 0 0 10px rgba(47, 230, 168, 0.25); }
.layui-layer-ico1::before { content: "✓"; }
/* 失败：红色叉 */
.layui-layer-ico2 { color: var(--red); box-shadow: 0 0 10px rgba(255, 94, 122, 0.25); }
.layui-layer-ico2::before { content: "✕"; }
/* 询问：橙色问号 */
.layui-layer-ico3 { color: var(--orange); box-shadow: 0 0 10px rgba(255, 180, 84, 0.25); }
.layui-layer-ico3::before { content: "?"; font-weight: 600; }
/* 锁定/提醒：青色叹号 */
.layui-layer-ico4 { color: var(--cyan); box-shadow: 0 0 10px rgba(0, 200, 255, 0.25); }
.layui-layer-ico4::before { content: "!"; font-weight: 600; }
/* 难过/警告 */
.layui-layer-ico5 { color: var(--red); }
.layui-layer-ico5::before { content: "✕"; }
/* 笑脸/成功 */
.layui-layer-ico6 { color: var(--green); }
.layui-layer-ico6::before { content: "✓"; }

/* 纯文字提示（无图标）保持内边距正常 */
.layui-layer-hui .layui-layer-content { padding: 11px 20px !important; }

/* 加载动画：改成青色旋转圈，替换原 gif */
.layui-layer-loading .layui-layer-content {
  background: none !important;
  width: 34px !important;
  height: 34px !important;
}
.layui-layer-loading .layui-layer-content::after {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0, 200, 255, 0.2);
  border-top-color: var(--cyan);
  animation: opcSpin 0.8s linear infinite;
}
.layui-layer-loading { background: transparent !important; border: none !important; box-shadow: none !important; }
@keyframes opcSpin { to { transform: rotate(360deg); } }

/* 响应式 */
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .logo-text, .menu-group-title span, .menu-group-title .arrow, .menu-sub, .menu-link span { display: none; }
  .menu-group-title { justify-content: center; padding: 12px 0; }
  .menu-link { justify-content: center; padding: 12px 0; }
  .form-row { flex-direction: column; gap: 0; }
}