/* ============================================
   一网统管 · 事件处置中心 — 样式
   沫阳镇域数字乡村一体化平台 v2.1
   与平台主样式（深空科技系 / 暗色玻璃拟态）保持一致
   ============================================ */

/* ===== 顶栏入口按钮 ===== */
.btn-event {
  background: rgba(179,136,255,0.15);
  border: 1px solid rgba(179,136,255,0.3);
  color: var(--purple);
}
.btn-event:hover { background: rgba(179,136,255,0.25); }
.btn-event.has-todo { animation: ecBlink 2.4s ease-in-out infinite; }
@keyframes ecBlink {
  0%, 100% { box-shadow: 0 0 0 rgba(179,136,255,0); }
  50% { box-shadow: 0 0 14px rgba(179,136,255,0.45); }
}

/* ===== 遮罩 & 抽屉 ===== */
#ecOverlay {
  position: fixed; inset: 0; z-index: 349;
  background: rgba(0,0,0,0.55);
  display: none; opacity: 0;
  transition: opacity var(--transition-speed);
}
#ecOverlay.show { display: block; opacity: 1; }
#ecPanel {
  position: fixed; top: 0; right: -1200px;
  width: 1180px; max-width: 100vw; height: 100vh;
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(0,200,255,0.13), transparent 60%),
    radial-gradient(720px 480px at 6% 6%, rgba(179,136,255,0.12), transparent 62%),
    radial-gradient(760px 620px at 55% 118%, rgba(0,230,118,0.08), transparent 62%),
    repeating-radial-gradient(circle at 0 0, rgba(255,255,255,0.035) 0 1px, transparent 1px 26px),
    linear-gradient(158deg, rgba(10,16,36,0.985) 0%, rgba(7,12,26,0.985) 55%, rgba(5,9,18,0.99) 100%);
  backdrop-filter: blur(22px);
  border-left: 1px solid var(--border);
  box-shadow: -18px 0 60px rgba(0,0,0,0.5);
  z-index: 350;
  display: flex; flex-direction: column;
  transition: right 0.38s cubic-bezier(.22,.61,.36,1);
}
#ecPanel.show { right: 0; }

.ec-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, rgba(0,200,255,0.06), transparent);
}
.ec-head h3 { font-size: 16px; color: var(--cyan); display: flex; align-items: center; gap: 8px; }
.ec-head .ec-sub { font-size: 11px; color: var(--text-dim); font-weight: 400; margin-left: 4px; }
.ec-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ===== KPI 条 ===== */
.ec-kpis {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  padding: 14px 20px 6px;
}
.ec-kpi {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  transition: var(--transition-speed);
}
.ec-kpi:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.ec-kpi .ek-head { display: flex; align-items: center; justify-content: space-between; }
.ec-kpi .ek-label { font-size: 12px; color: var(--text-dim); }
.ec-kpi .ek-ic { font-size: 15px; }
.ec-kpi .ek-val { font-size: 24px; font-weight: 800; line-height: 1.25; margin-top: 2px; }
.ec-kpi .ek-unit { font-size: 11px; font-weight: 400; color: var(--text-dim); margin-left: 4px; }
.ec-kpi .ek-sub { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* ===== 工具栏 ===== */
.ec-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.ec-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ec-tab {
  padding: 6px 12px; border-radius: 20px; font-size: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer;
  transition: var(--transition-speed);
  display: flex; align-items: center; gap: 6px;
}
.ec-tab:hover { color: var(--text); border-color: var(--border-hover); }
.ec-tab.active { background: rgba(0,200,255,0.15); border-color: var(--cyan); color: var(--cyan); font-weight: 600; }
.ec-tab-n {
  font-size: 10px; padding: 0 6px; border-radius: 9px;
  background: rgba(0,200,255,0.18); color: var(--cyan);
}
.ec-tab.active .ec-tab-n { background: rgba(0,200,255,0.3); }
.ec-toolbar .ec-search {
  margin-left: auto; width: 220px;
  background: rgba(10,16,36,0.7);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; font-size: 12px; color: var(--text);
  font-family: inherit; outline: none;
}
.ec-toolbar .ec-search:focus { border-color: var(--cyan); }
.ec-toolbar select {
  background: rgba(10,16,36,0.7); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 10px; font-size: 12px;
  color: var(--text); font-family: inherit; outline: none; cursor: pointer;
}

/* ===== 主体两栏 ===== */
.ec-main { flex: 1; display: flex; min-height: 0; }
.ec-list {
  width: 430px; flex-shrink: 0; overflow-y: auto;
  padding: 12px; border-right: 1px solid var(--border);
}
.ec-detail { flex: 1; overflow-y: auto; padding: 16px 20px 40px; }
.ec-list::-webkit-scrollbar, .ec-detail::-webkit-scrollbar { width: 6px; }
.ec-list::-webkit-scrollbar-thumb, .ec-detail::-webkit-scrollbar-thumb {
  background: rgba(0,200,255,0.2); border-radius: 3px;
}

/* ===== 事件卡片 ===== */
.ec-item {
  background: var(--glass);
  border: 1px solid var(--border);
  border-left: 3px solid rgba(0,200,255,0.4);
  border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px;
  cursor: pointer; transition: var(--transition-speed);
}
.ec-item:hover { border-color: var(--border-hover); transform: translateX(2px); }
.ec-item.active { background: rgba(0,200,255,0.1); border-color: var(--cyan); }
.ec-item.overdue { border-left-color: var(--red); background: rgba(255,82,82,0.06); }
.ec-item .ei-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ec-item .ei-id { font-size: 10px; color: var(--text-dim); font-family: ui-monospace, Consolas, monospace; }
.ec-item .ec-st { margin-left: auto; }
.ec-item .ei-title { font-size: 13px; color: var(--text); line-height: 1.45; margin-bottom: 6px; }
.ec-item .ei-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--text-dim); }
.ec-item .ei-warn { color: var(--amber); }
.ec-item .ei-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 7px; padding-top: 7px;
  border-top: 1px dashed rgba(80,200,255,0.12);
  font-size: 10px; color: var(--text-dim);
}
.ec-item .ei-src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-item .ei-over { color: var(--red); font-weight: 600; }
.ec-item .ei-urge { font-size: 10px; color: var(--amber); margin-top: 6px; }

/* ===== 等级 / 状态徽章 ===== */
.ec-lv, .ec-st {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  font-weight: 600; white-space: nowrap;
}
.ec-lv-red { background: rgba(255,82,82,0.18); color: var(--red); }
.ec-lv-amber { background: rgba(255,193,7,0.18); color: var(--amber); }
.ec-lv-cyan { background: rgba(0,200,255,0.15); color: var(--cyan); }
.st-pending { background: rgba(255,193,7,0.18); color: var(--amber); }
.st-processing { background: rgba(0,200,255,0.15); color: var(--cyan); }
.st-closed { background: rgba(0,230,118,0.15); color: var(--green); }
.st-overdue { background: rgba(255,82,82,0.18); color: var(--red); }

/* ===== 详情区 ===== */
.ed-head { margin-bottom: 14px; }
.ed-head h3 { font-size: 16px; color: var(--text); line-height: 1.5; margin-top: 8px; }
.ed-tags { display: flex; gap: 8px; align-items: center; }
.ed-id {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  font-size: 11px; color: var(--text-dim);
  font-family: ui-monospace, Consolas, monospace;
}
.ec-mini {
  font-size: 10px; padding: 2px 8px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  font-family: inherit; transition: var(--transition-speed);
}
.ec-mini:hover { border-color: var(--cyan); color: var(--cyan); }
.ec-mini-danger:hover { border-color: var(--red); color: var(--red); }

.ed-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 14px;
}
.ed-cell {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 10px;
}
.ed-cell span { display: block; font-size: 10px; color: var(--text-dim); margin-bottom: 3px; }
.ed-cell b { font-size: 12px; color: var(--text); font-weight: 600; }
.ed-cell .ed-none { color: var(--amber); font-style: normal; font-weight: 400; }
.ed-cell .ed-over { color: var(--red); }

.ed-result {
  background: rgba(0,230,118,0.07);
  border: 1px solid rgba(0,230,118,0.22);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.ed-result .er-title { font-size: 12px; color: var(--green); font-weight: 600; margin-bottom: 6px; }
.ed-result .er-body { font-size: 13px; color: var(--text); line-height: 1.6; }
.ed-result .er-meta { font-size: 11px; color: var(--text-dim); margin-top: 8px; }

/* ===== 时间线 ===== */
.ed-timeline { margin-bottom: 16px; }
.ed-timeline .et-title { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.ec-tl { position: relative; padding-left: 18px; }
.ec-tl::before {
  content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px;
  width: 1px; background: linear-gradient(180deg, var(--cyan), rgba(0,200,255,0.05));
}
.tl-item { position: relative; padding-bottom: 14px; }
.tl-dot {
  position: absolute; left: -17px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 8px rgba(0,200,255,0.6);
}
.tl-body {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px;
}
.tl-head { display: flex; justify-content: space-between; gap: 10px; }
.tl-head b { font-size: 12px; color: var(--cyan); font-weight: 600; }
.tl-head span { font-size: 10px; color: var(--text-dim); }
.tl-note { font-size: 12px; color: var(--text); line-height: 1.6; margin-top: 4px; }
.tl-actor { font-size: 10px; color: var(--text-dim); margin-top: 6px; }

/* ===== 操作区 ===== */
.ea-box {
  background: rgba(0,200,255,0.045);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
}
.ea-box .ea-title { font-size: 13px; color: var(--cyan); font-weight: 600; margin-bottom: 10px; }
.ea-box .ea-split { height: 1px; background: var(--border); margin: 16px 0; }
.ea-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ea-row label {
  width: 68px; flex-shrink: 0; font-size: 12px; color: var(--text-dim);
  padding-top: 8px;
}
.ea-row input, .ea-row select, .ea-row textarea {
  flex: 1; background: rgba(10,16,36,0.75);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: 12px; color: var(--text);
  font-family: inherit; outline: none; resize: vertical;
}
.ea-row input:focus, .ea-row select:focus, .ea-row textarea:focus { border-color: var(--cyan); }
.ea-row textarea { min-height: 62px; }
.ea-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; padding-left: 78px; }

.ec-btn {
  padding: 8px 16px; border-radius: 10px; font-size: 12px; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  font-family: inherit; transition: var(--transition-speed);
  display: inline-flex; align-items: center; gap: 6px;
}
.ec-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.ec-btn-primary { background: var(--cyan); border-color: var(--cyan); color: #04121b; font-weight: 600; }
.ec-btn-primary:hover { color: #04121b; box-shadow: 0 0 18px rgba(0,200,255,0.45); }
.ec-btn-ok { background: rgba(0,230,118,0.16); border-color: rgba(0,230,118,0.4); color: var(--green); }
.ec-btn-ok:hover { border-color: var(--green); color: var(--green); background: rgba(0,230,118,0.25); }
.ec-btn-danger { background: rgba(255,82,82,0.14); border-color: rgba(255,82,82,0.35); color: var(--red); }
.ec-btn-danger:hover { border-color: var(--red); color: var(--red); background: rgba(255,82,82,0.24); }

/* ===== 空状态 ===== */
.ec-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; min-height: 240px; gap: 8px;
  color: var(--text-dim); font-size: 13px; text-align: center; padding: 30px;
}
.ec-empty .ee-ic { font-size: 40px; opacity: 0.6; }
.ec-empty .ee-sub { font-size: 11px; line-height: 1.8; opacity: 0.75; }

/* ===== 统计视图 ===== */
.ec-stats { padding: 4px 0; }
.ec-block {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; margin-bottom: 12px;
}
.ec-block .eb-title { font-size: 12px; color: var(--text); font-weight: 600; margin-bottom: 12px; }
.ec-trend { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.et-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.et-bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.et-bar { width: 12px; border-radius: 3px 3px 0 0; min-height: 2px; transition: height 0.4s ease; }
.et-created { background: linear-gradient(180deg, var(--cyan), rgba(0,200,255,0.25)); }
.et-closed { background: linear-gradient(180deg, var(--green), rgba(0,230,118,0.2)); }
.et-label { font-size: 10px; color: var(--text-dim); margin-top: 6px; }
.et-num { font-size: 10px; color: var(--text-dim); }
.ec-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 11px; color: var(--text-dim); }
.ec-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.lg-created { background: var(--cyan); }
.lg-closed { background: var(--green); }

.ec-bars { display: flex; flex-direction: column; gap: 8px; }
.ec-bar { display: flex; align-items: center; gap: 10px; }
.ec-bar .eb-name { width: 90px; font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.ec-bar .eb-track {
  flex: 1; height: 8px; border-radius: 4px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
.ec-bar .eb-track i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, rgba(0,200,255,0.5), var(--cyan));
  transition: width 0.4s ease;
}
.ec-bar .eb-track i.i-purple { background: linear-gradient(90deg, rgba(179,136,255,0.5), var(--purple)); }
.ec-bar .eb-val { width: 34px; text-align: right; font-size: 11px; color: var(--text); }

/* ===== 新建事件弹窗 ===== */
#ecModal {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
#ecModal.show { display: flex; }
.em-box {
  width: 620px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
  background: rgba(10,16,36,0.98);
  border: 1px solid var(--border-hover);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
  padding: 20px 22px;
  animation: emIn 0.24s ease;
}
@keyframes emIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.em-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.em-head h3 { font-size: 15px; color: var(--cyan); }
.em-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.em-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.em-field.full { grid-column: 1 / -1; }
.em-field label { font-size: 12px; color: var(--text-dim); }
.em-field input, .em-field select, .em-field textarea {
  background: rgba(6,11,20,0.8); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; font-size: 12px; color: var(--text);
  font-family: inherit; outline: none; resize: vertical;
}
.em-field input:focus, .em-field select:focus, .em-field textarea:focus { border-color: var(--cyan); }
.em-field textarea { min-height: 70px; }
.em-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ===== 响应式 ===== */
@media (max-width: 1400px) {
  #ecPanel { width: 1080px; }
  .ec-kpis { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1180px) {
  #ecPanel { width: 100vw; right: -100vw; }
  .ec-list { width: 360px; }
  .ed-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .ec-main { flex-direction: column; }
  .ec-list { width: auto; max-height: 42vh; border-right: none; border-bottom: 1px solid var(--border); }
  .ec-kpis { grid-template-columns: repeat(2, 1fr); }
  .em-grid { grid-template-columns: 1fr; }
}
/* ===== 告警中心的「转为事件工单」按钮 ===== */
.alert-item .ai-actions { margin-top: 8px; display: flex; gap: 8px; }
.alert-item .ai-btn {
  font-size: 11px; padding: 4px 12px; border-radius: 8px; cursor: pointer;
  background: rgba(179,136,255,0.12);
  border: 1px solid rgba(179,136,255,0.35);
  color: var(--purple); font-family: inherit;
  transition: var(--transition-speed);
}
.alert-item .ai-btn:hover { background: rgba(179,136,255,0.25); box-shadow: 0 0 12px rgba(179,136,255,0.3); }
/* ===== 协同状态栏（v2.2） ===== */
.ec-head-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ec-status {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--border); width: fit-content;
}
.ecs-online { background: rgba(0,230,118,0.10); border-color: rgba(0,230,118,0.35); color: var(--green); }
.ecs-offline { background: rgba(255,193,7,0.10); border-color: rgba(255,193,7,0.35); color: var(--amber); }
.ecs-local { background: rgba(255,255,255,0.04); color: var(--text-dim); }
.ecs-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 8px currentColor;
}
.ecs-online .ecs-dot { animation: ecPulse 2s ease-in-out infinite; }
@keyframes ecPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.ecs-sep { opacity: 0.35; }

/* 离线待同步标记 */
.ec-off {
  font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600;
  background: rgba(255,193,7,0.18); color: var(--amber); white-space: nowrap;
}

/* 无操作权限时的说明 */
.ea-note { font-size: 12px; color: var(--text-dim); line-height: 1.7; }

/* 登录页演示账号提示 */
.login-hint {
  margin-top: 12px; font-size: 11px; line-height: 1.7;
  color: var(--text-dim); text-align: center; opacity: 0.85;
}