/* ============================================================
   化工园区综合管理系统 - 主题样式
   配色复刻原站：背景 #0a1628 / 卡片 #0f1e35 / 主色 #2563eb
   ============================================================ */
:root {
  --background: #0a1628;
  --foreground: #e8edf5;
  --card: #0f1e35;
  --card-foreground: #e8edf5;
  --primary: #2563eb;
  --primary-foreground: #ffffff;
  --muted: #162440;
  --muted-foreground: #64809e;
  --accent: #1a3560;
  --accent-foreground: #60a5fa;
  --border: rgba(37, 99, 235, 0.2);
  --input: rgba(37, 99, 235, 0.12);
  --destructive: #ef4444;
  --chart-1: #3b82f6;
  --chart-2: #1d4ed8;
  --chart-3: #10b981;
  --chart-4: #f59e0b;
  --chart-5: #8b5cf6;
  --tech-cyan: #00d4ff;
  --tech-green: #22c55e;
  --tech-orange: #f97316;
  --radius: 0.5rem;
  --sidebar-width: 232px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  overflow: hidden;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(37,99,235,.35); border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }

.app { display: flex; height: 100vh; min-width: 1200px; }

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, #0c1c34 0%, #091426 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #00d4ff);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 0 16px rgba(37,99,235,.45);
}
.logo-title { font-size: 14px; font-weight: 700; letter-spacing: .5px; }
.logo-sub { font-size: 10px; color: var(--muted-foreground); letter-spacing: 1px; margin-top: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }

.nav-item { margin-bottom: 2px; }

.nav-main {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(232,237,245,.72);
  font-size: 13.5px;
  transition: all .15s;
  position: relative;
  user-select: none;
}
.nav-main svg:first-child { flex-shrink: 0; opacity: .85; }
.nav-main:hover { background: rgba(37,99,235,.08); color: var(--foreground); }
.nav-main.active {
  background: rgba(37,99,235,.16);
  color: var(--accent-foreground);
  font-weight: 600;
}
.nav-main.active::before {
  content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 2px; background: var(--primary);
}
.nav-main .chev { margin-left: auto; transition: transform .2s; opacity: .6; }
.nav-main.open .chev { transform: rotate(180deg); }

.badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff; font-size: 10px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
}
.badge-red { background: var(--destructive); }

.nav-sub { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.nav-sub.open { max-height: 300px; }
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 26px;
  font-size: 12.5px;
  color: var(--muted-foreground);
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.nav-sub-item svg { flex-shrink: 0; opacity: .75; }
.nav-sub-item:hover { color: var(--foreground); background: rgba(37,99,235,.08); }
.nav-sub-item.active { color: var(--accent-foreground); background: rgba(37,99,235,.12); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: rgba(37,99,235,.06); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 12.5px; font-weight: 600; }
.user-role { font-size: 10.5px; color: var(--muted-foreground); }

/* ---------------- 主区域 ---------------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(15,30,53,.5);
  backdrop-filter: blur(8px);
}
.page-title { font-size: 16px; font-weight: 700; }
.breadcrumb { font-size: 11px; color: var(--muted-foreground); margin-top: 2px; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.park-select {
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--foreground);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  outline: none;
  max-width: 180px;
  cursor: pointer;
}
.park-select:focus { border-color: var(--primary); }
.park-select option { background: #0f1e35; color: var(--foreground); }

.search-box {
  display: flex; align-items: center; gap: 6px;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--muted-foreground);
}
.search-box input {
  background: transparent; border: none; outline: none;
  color: var(--foreground); font-size: 12.5px; width: 160px;
}
.search-box input::placeholder { color: var(--muted-foreground); }

.clock { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

.content { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }

/* ---------------- 通用卡片 ---------------- */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,.35), transparent);
}
.panel-title {
  font-size: 13px; font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.panel-title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--tech-cyan));
}
.panel-title .extra { margin-left: auto; font-size: 11px; color: var(--muted-foreground); font-weight: 400; }

/* ---------------- 首页统计卡 ---------------- */
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  transition: all .2s;
  cursor: pointer;
}
.stat-card:hover { border-color: rgba(37,99,235,.45); transform: translateY(-1px); }
.stat-icon {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-label { font-size: 11.5px; color: var(--muted-foreground); }
.stat-value { font-size: 21px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-value .unit { font-size: 12px; font-weight: 500; color: var(--muted-foreground); margin-left: 3px; }
.stat-sub { font-size: 10.5px; color: var(--muted-foreground); margin-top: 2px; }
.stat-sub .up { color: var(--tech-green); }

/* 颜色辅助 */
.c-primary { color: var(--chart-1); } .bg-primary-soft { background: rgba(59,130,246,.12); }
.c-orange { color: var(--chart-4); } .bg-orange-soft { background: rgba(245,158,11,.12); }
.c-green { color: var(--chart-3); } .bg-green-soft { background: rgba(16,185,129,.12); }
.c-warning { color: #fbbf24; }
.c-purple { color: var(--chart-5); } .bg-purple-soft { background: rgba(139,92,246,.12); }
.c-cyan { color: var(--tech-cyan); } .bg-cyan-soft { background: rgba(0,212,255,.12); }
.c-danger { color: var(--destructive); } .bg-danger-soft { background: rgba(239,68,68,.12); }

/* ---------------- 首页布局 ---------------- */
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 14px; }
.grid-1-1-1 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 地图（原站 SVG 示意图复刻） */
.map-wrap { position: relative; height: 400px; }
@keyframes pulse-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.35); }
}
.park-dot circle:last-child { transform-origin: center; transform-box: fill-box; }
.prov-path:hover { filter: brightness(1.2); }

/* 地图图例 */
.map-legend {
  display: flex; gap: 18px; align-items: center;
  padding: 8px 2px 0;
  font-size: 11px; color: var(--muted-foreground);
}
.map-legend .legend-item { display: flex; align-items: center; gap: 6px; }
.map-legend .legend-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }

.map-tooltip {
  position: absolute;
  background: #0f1e35;
  border: 1px solid rgba(37,99,235,.4);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.map-tooltip .t-name { font-weight: 600; color: var(--tech-cyan); margin-bottom: 4px; }
.map-tooltip .t-row { color: var(--foreground); line-height: 1.7; }

/* TOP10 列表 */
.top-list { display: flex; flex-direction: column; gap: 6px; }
.top-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 6px;
  background: rgba(37,99,235,.05);
  font-size: 12px;
  transition: background .15s;
}
.top-item:hover { background: rgba(37,99,235,.12); }
.top-rank {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--muted); color: var(--muted-foreground);
}
.top-item:nth-child(1) .top-rank { background: linear-gradient(135deg,#f59e0b,#f97316); color: #fff; }
.top-item:nth-child(2) .top-rank { background: linear-gradient(135deg,#3b82f6,#2563eb); color: #fff; }
.top-item:nth-child(3) .top-rank { background: linear-gradient(135deg,#10b981,#059669); color: #fff; }
.top-name { width: 52px; font-weight: 600; }
.top-parks { color: var(--muted-foreground); }
.top-output { margin-left: auto; color: var(--tech-cyan); font-variant-numeric: tabular-nums; }
.top-bar {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--muted);
  overflow: hidden;
}
.top-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--tech-cyan)); border-radius: 2px; }

/* 等级分布 */
.level-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.level-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.level-name { font-size: 12.5px; width: 56px; }
.level-bar { flex: 1; height: 8px; background: var(--muted); border-radius: 4px; overflow: hidden; }
.level-bar-fill { height: 100%; border-radius: 4px; }
.level-val { font-size: 13px; font-weight: 700; width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

/* 核心指标 */
.core-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.core-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  transition: all .2s;
}
.core-card:hover { border-color: rgba(0,212,255,.4); }
.core-label { font-size: 11.5px; color: var(--muted-foreground); }
.core-value { font-size: 22px; font-weight: 700; margin-top: 6px; color: var(--tech-cyan); font-variant-numeric: tabular-nums; }

/* ---------------- 园区信息页 ---------------- */
.parkinfo-layout { display: grid; grid-template-columns: 250px 1fr; gap: 14px; align-items: start; }
.park-list-panel { position: sticky; top: 12px; }
.park-search-input {
  width: 100%; padding: 6px 10px; margin-bottom: 8px;
  font-size: 11.5px; color: var(--foreground);
  background: var(--muted); border: 1px solid var(--border); border-radius: 6px;
  outline: none;
}
.park-search-input:focus { border-color: var(--primary); }
.park-list { max-height: 64vh; overflow-y: auto; }
.park-list-item {
  padding: 9px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent; margin-bottom: 4px;
  transition: all .15s;
}
.park-list-item:hover { background: rgba(37,99,235,.08); }
.park-list-item.active { background: rgba(37,99,235,.14); border-color: rgba(37,99,235,.35); }
.park-list-item .pli-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.park-list-item .pli-name { font-size: 12px; font-weight: 600; color: var(--foreground); }
.park-list-item .pli-meta { font-size: 10.5px; color: var(--muted-foreground); }
.quick-locate {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted-foreground);
  margin-bottom: 14px;
}
.quick-locate button {
  padding: 4px 12px; font-size: 11.5px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); color: var(--muted-foreground);
  background: transparent; transition: all .15s;
}
.quick-locate button:hover { color: var(--primary); border-color: rgba(37,99,235,.4); background: rgba(37,99,235,.05); }
.park-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 14px;
}
.park-name { font-size: 20px; font-weight: 700; }
.park-badges { display: flex; gap: 8px; margin-top: 6px; }
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 12px;
  font-size: 11px;
}
.tag-blue { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }
.tag-green { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }
.tag-orange { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.3); }
.tag-purple { background: rgba(139,92,246,.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,.3); }
.tag-cyan { background: rgba(0,212,255,.12); color: var(--tech-cyan); border: 1px solid rgba(0,212,255,.3); }

.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.info-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.info-item .k { font-size: 10.5px; color: var(--muted-foreground); }
.info-item .v { font-size: 13.5px; font-weight: 600; margin-top: 4px; }

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  text-align: left; padding: 8px 10px;
  color: var(--muted-foreground); font-weight: 500; font-size: 11.5px;
  border-bottom: 1px solid var(--border);
  background: rgba(37,99,235,.05);
  white-space: nowrap;
}
.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(37,99,235,.1);
  color: var(--foreground);
}
.data-table tr:hover td { background: rgba(37,99,235,.06); }
.data-table tr:last-child td { border-bottom: none; }

.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 10px; font-size: 11px;
}
.st-active { background: rgba(16,185,129,.15); color: #6ee7b7; }
.st-focus { background: rgba(245,158,11,.15); color: #fcd34d; }
.st-wait { background: rgba(139,92,246,.15); color: #c4b5fd; }
.st-potential { background: rgba(59,130,246,.15); color: #93c5fd; }
.st-pending { background: rgba(239,68,68,.15); color: #fca5a5; }
.st-handling { background: rgba(245,158,11,.15); color: #fcd34d; }
.st-resolved { background: rgba(16,185,129,.15); color: #6ee7b7; }

.prob-bar { width: 70px; height: 6px; background: var(--muted); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.prob-bar-fill { height: 100%; border-radius: 3px; }

/* ---------------- 消息页 ---------------- */
.msg-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.msg-tab {
  padding: 6px 14px; border-radius: 16px;
  font-size: 12.5px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted-foreground);
  transition: all .15s;
}
.msg-tab:hover { color: var(--foreground); }
.msg-tab.active { background: rgba(37,99,235,.2); border-color: var(--primary); color: #93c5fd; }

.msg-list { display: flex; flex-direction: column; gap: 10px; }
.msg-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.msg-item:hover { border-color: rgba(37,99,235,.45); }
.msg-item.unread::before {
  content: ""; position: absolute; left: 6px; top: 18px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.msg-head { display: flex; align-items: center; gap: 10px; }
.msg-title { font-size: 13.5px; font-weight: 600; flex: 1; }
.msg-time { font-size: 11px; color: var(--muted-foreground); }
.msg-body { font-size: 12px; color: var(--muted-foreground); margin-top: 8px; line-height: 1.7; }
.msg-meta { display: flex; gap: 8px; margin-top: 10px; align-items: center; }

.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pd-high { background: var(--destructive); box-shadow: 0 0 8px rgba(239,68,68,.6); }
.pd-important { background: var(--chart-4); box-shadow: 0 0 8px rgba(245,158,11,.5); }
.pd-normal { background: var(--chart-1); }
.pd-urgent { background: var(--destructive); box-shadow: 0 0 8px rgba(239,68,68,.6); }

/* ---------------- 预警页 ---------------- */
.alert-filters { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.alert-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: all .15s;
}
.alert-card:hover { transform: translateX(2px); }
.alert-card.al-urgent { border-left-color: var(--destructive); }
.alert-card.al-important { border-left-color: var(--chart-4); }
.alert-head { display: flex; align-items: center; gap: 10px; }
.alert-title { font-size: 13.5px; font-weight: 600; flex: 1; }
.alert-desc { font-size: 12px; color: var(--muted-foreground); margin-top: 8px; line-height: 1.7; }
.alert-foot { display: flex; gap: 12px; margin-top: 10px; font-size: 11px; color: var(--muted-foreground); align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 6px;
  font-size: 12px; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--input); color: var(--foreground);
  transition: all .15s;
}
.btn:hover { border-color: var(--primary); background: rgba(37,99,235,.15); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-sm { padding: 3px 10px; font-size: 11px; }

/* ---------------- HTML代码类型页 ---------------- */
.code-block {
  background: #0b1628;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.8;
  color: #93c5fd;
  overflow-x: auto;
  white-space: pre;
}
.code-block .tag-hl { color: #f472b6; }
.code-block .attr-hl { color: #fbbf24; }
.code-block .str-hl { color: #6ee7b7; }
.code-block .cmt-hl { color: #64748b; }

/* ---------------- AI 建议卡 ---------------- */
.ai-card {
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(0,212,255,.06));
  border: 1px solid rgba(0,212,255,.25);
  border-radius: 10px;
  padding: 14px 16px;
}
.ai-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(37,99,235,.15);
  font-size: 12.5px; line-height: 1.6;
}
.ai-item:last-child { border-bottom: none; }
.ai-idx {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  background: rgba(0,212,255,.15); color: var(--tech-cyan);
  font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}

.section-anchor { scroll-margin-top: 10px; }

.empty { text-align: center; color: var(--muted-foreground); padding: 40px 0; font-size: 12.5px; }

/* 图表容器 */
.chart-box { width: 100%; height: 220px; }
.chart-box-sm { width: 100%; height: 160px; }

/* ---------------- AI 智能分析面板 ---------------- */
.ai-panel-box {
  background: rgba(15,30,53,.6);
  border: 1px solid rgba(37,99,235,.18);
  border-radius: 8px;
  padding: 12px 14px;
}
.ai-panel-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--foreground);
  margin-bottom: 4px;
}
.ai-panel-head .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ai-panel-sub { font-size: 10.5px; color: var(--muted-foreground); margin-bottom: 8px; }
.ai-subhead { font-size: 12px; font-weight: 600; color: var(--foreground); margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.ai-text { font-size: 11.5px; color: #a8c0e8; line-height: 1.7; }

/* AI 记录条目（丢标分析/装置提醒） */
.ai-record {
  background: rgba(37,99,235,.05);
  border: 1px solid rgba(37,99,235,.12);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 7px;
}
.ai-record:last-child { margin-bottom: 0; }
.ai-record-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; }
.ai-record-meta { font-size: 10.5px; color: var(--muted-foreground); margin: 4px 0; }
.ai-record-tip { font-size: 11px; color: #93c5fd; line-height: 1.6; }
.ai-record-tip b { color: var(--tech-cyan); font-weight: 600; }

/* ---------------- HTML 标签类型页 ---------------- */
.pr-btn {
  padding: 3px 10px; font-size: 11px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); color: var(--muted-foreground);
  background: transparent; transition: all .15s;
}
.pr-btn.active { color: var(--primary); border-color: var(--primary); background: rgba(37,99,235,.1); }
.tag-list { overflow-y: auto; max-height: 62vh; padding-right: 4px; }
.tag-type-item {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; margin-bottom: 6px; transition: all .15s;
}
.tag-type-item:hover { background: rgba(37,99,235,.08); }
.tag-type-item.active { background: rgba(37,99,235,.14); border-color: rgba(37,99,235,.35); }
.tti-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.chart-box-lg { width: 100%; height: 300px; }

/* 产业链 */
.chain-row { display: flex; gap: 8px; }
.chain-stage {
  flex: 1;
  background: rgba(37,99,235,.08);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
  position: relative;
  transition: all .2s;
}
.chain-stage:hover { border-color: var(--tech-cyan); background: rgba(0,212,255,.08); }
.chain-stage:not(:last-child)::after {
  content: "→";
  position: absolute; right: -11px; top: 50%;
  transform: translateY(-50%);
  color: var(--tech-cyan); font-size: 14px; z-index: 2;
}
.chain-stage .st-name { font-size: 12px; font-weight: 600; }
.chain-stage .st-num { font-size: 16px; font-weight: 700; color: var(--tech-cyan); margin-top: 6px; }
.chain-stage .st-sub { font-size: 10.5px; color: var(--muted-foreground); margin-top: 4px; }

/* Toast */
#toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f1e35;
  border: 1px solid rgba(0,212,255,.4);
  color: var(--foreground);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 12.5px;
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 推送消息 / 预警中心（三栏布局） ---------------- */
.tri-page { display: flex; gap: 12px; height: calc(100vh - 56px - 40px); min-height: 460px; overflow: hidden; }
.tri-list { width: 320px; flex-shrink: 0; }
.tri-list.wide { width: 384px; }
.tri-detail { flex: 1; min-width: 0; }
.tri-side { width: 224px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.panel-flex { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.panel-head { padding: 12px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.panel-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.panel-body { flex: 1; overflow-y: auto; min-height: 0; padding: 20px; }

/* 筛选胶囊 */
.mp-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.mp-filter {
  padding: 2px 9px; font-size: 11px; border-radius: 999px;
  background: var(--muted); color: var(--muted-foreground);
  border: none; cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.mp-filter:hover { color: var(--foreground); }
.mp-filter.active { background: rgba(37,99,235,.2); color: var(--accent-foreground); }
.mp-cat { padding: 2px 8px; font-size: 11px; border-radius: 4px; background: transparent; border: none; color: var(--muted-foreground); cursor: pointer; transition: all .15s; }
.mp-cat:hover { color: var(--foreground); }
.mp-cat.active { background: rgba(37,99,235,.2); color: var(--accent-foreground); }

/* 消息列表项 */
.mp-item { padding: 10px 14px; border-bottom: 1px solid rgba(37,99,235,.08); cursor: pointer; transition: background .15s; }
.mp-item:hover { background: rgba(22,36,64,.5); }
.mp-item.active { background: rgba(37,99,235,.08); box-shadow: inset 2px 0 0 var(--primary); }
.mp-row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.mp-title { font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.mp-title.read { color: var(--muted-foreground); }
.mp-title.unread { color: var(--foreground); font-weight: 500; }
.mp-row2 { display: flex; align-items: center; justify-content: space-between; margin-left: 14px; font-size: 11px; }
.mp-time { color: var(--muted-foreground); }

/* 类型小徽章 */
.type-badge { padding: 1px 6px; border-radius: 4px; font-size: 10.5px; display: inline-flex; align-items: center; gap: 4px; }
.tb-policy { background: rgba(139,92,246,.15); color: #c4b5fd; }
.tb-market { background: rgba(37,99,235,.15); color: #93c5fd; }
.tb-park { background: rgba(16,185,129,.15); color: #6ee7b7; }
.tb-alert { background: rgba(239,68,68,.15); color: #fca5a5; }

/* 内联 lucide SVG 图标对齐 */
.type-badge svg, .dt-meta .item svg, .stat-line .l svg, .al-icon svg,
.dt-actions svg, .pr-badge svg, .mp-item svg, .panel-title svg {
  display: inline-block; vertical-align: middle; flex-shrink: 0;
}

/* 详情头部 */
.dt-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.dt-title { font-size: 13.5px; font-weight: 700; line-height: 1.4; flex: 1; }
.dt-meta { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--muted-foreground); }
.dt-meta .item { display: inline-flex; align-items: center; gap: 4px; }
.dt-content { font-size: 13px; color: rgba(232,237,245,.8); line-height: 1.75; margin-bottom: 16px; }
.dt-analysis { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }
.dt-analysis .t { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.dt-analysis .c { font-size: 12px; color: var(--muted-foreground); line-height: 1.75; }
.dt-actions { display: flex; align-items: center; gap: 8px; }
.act-btn {
  padding: 6px 16px; font-size: 12px; border-radius: 4px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted-foreground); cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.act-btn:hover { color: var(--foreground); border-color: rgba(37,99,235,.3); }
.act-btn.primary { background: rgba(37,99,235,.2); border-color: rgba(37,99,235,.3); color: #93c5fd; }
.act-btn.primary:hover { background: rgba(37,99,235,.3); }
.act-btn.danger { background: rgba(239,68,68,.2); border-color: rgba(239,68,68,.3); color: #fca5a5; }
.act-btn.danger:hover { background: rgba(239,68,68,.3); }

/* 开关 */
.switch { width: 32px; height: 16px; border-radius: 999px; display: flex; align-items: center; padding: 0 2px; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch.on { background: rgba(37,99,235,.6); }
.switch.off { background: var(--muted); }
.switch .knob { width: 12px; height: 12px; border-radius: 50%; transition: all .2s; }
.switch.on .knob { background: var(--primary); margin-left: auto; }
.switch.off .knob { background: var(--muted-foreground); }

/* 统计行 */
.stat-line { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 4px 0; }
.stat-line .l { display: inline-flex; align-items: center; gap: 6px; }
.stat-line .v { color: var(--foreground); font-weight: 500; }

/* 预警优先级 */
.warning-urgent { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.35); }
.warning-important { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.35); }
.warning-normal { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.35); }
.pr-badge { padding: 4px 8px; border-radius: 4px; font-size: 12px; display: inline-block; }
.st-badge { padding: 4px 8px; border-radius: 4px; font-size: 12px; display: inline-block; }
.stb-active { background: rgba(239,68,68,.15); color: #fca5a5; }
.stb-handling { background: rgba(245,158,11,.15); color: #fcd34d; }
.stb-resolved { background: rgba(16,185,129,.15); color: #6ee7b7; }

.pr-pill { padding: 2px 9px; font-size: 11px; border-radius: 999px; background: transparent; border: none; color: var(--muted-foreground); cursor: pointer; transition: all .15s; }
.pr-pill:hover { color: var(--foreground); }
.pr-pill.active-all { background: var(--muted); color: var(--foreground); }
.pr-pill.active-urgent { background: rgba(239,68,68,.2); color: #fca5a5; }
.pr-pill.active-important { background: rgba(245,158,11,.2); color: #fcd34d; }
.pr-pill.active-normal { background: rgba(37,99,235,.2); color: #93c5fd; }

/* 预警列表项 */
.al-item { padding: 12px 14px; border-bottom: 1px solid rgba(37,99,235,.08); cursor: pointer; transition: background .15s; }
.al-item:hover { background: rgba(22,36,64,.4); }
.al-item.active { background: rgba(37,99,235,.08); box-shadow: inset 2px 0 0 var(--primary); }
.al-row1 { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.al-icon { flex-shrink: 0; margin-top: 1px; }
.al-title { font-size: 12px; font-weight: 500; line-height: 1.45; color: var(--foreground); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.al-row2 { display: flex; align-items: center; gap: 8px; margin-left: 21px; font-size: 11px; }
.al-cat { color: var(--muted-foreground); }
.al-time { color: var(--muted-foreground); margin-left: auto; }
.al-status { padding: 1px 6px; border-radius: 999px; font-size: 10.5px; }

/* 预警详情 */
.al-desc { font-size: 12px; color: var(--muted-foreground); line-height: 1.75; margin-bottom: 12px; padding: 12px; background: rgba(22,36,64,.35); border-radius: 8px; }
.al-advice { margin-bottom: 12px; padding: 12px; border-radius: 8px; border: 1px solid rgba(245,158,11,.2); background: rgba(245,158,11,.05); }
.al-advice .t { font-size: 12px; font-weight: 600; color: var(--chart-4); margin-bottom: 6px; }
.al-advice .c { font-size: 12px; color: var(--muted-foreground); line-height: 1.75; }

/* 处置进度条 */
.hp-row { margin-bottom: 10px; }
.hp-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.hp-head .l { color: var(--muted-foreground); }
.hp-head .v { font-weight: 700; }
.hp-track { height: 6px; background: var(--muted); border-radius: 999px; overflow: hidden; }
.hp-fill { height: 100%; border-radius: 999px; transition: width .3s; }

/* ---------- 设计逻辑按钮 ---------- */
.design-logic-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: #00d4ff;
  background: linear-gradient(135deg, rgba(0,212,255,.12), rgba(37,99,235,.12));
  border: 1px solid rgba(0,212,255,.35);
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.design-logic-btn:hover {
  background: linear-gradient(135deg, rgba(0,212,255,.22), rgba(37,99,235,.22));
  border-color: rgba(0,212,255,.6);
  box-shadow: 0 0 14px rgba(0,212,255,.25);
}
.design-logic-btn svg { flex-shrink: 0; }

/* ---------- 设计逻辑弹窗 ---------- */
.dl-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(4,10,22,.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s;
}
.dl-mask.show { opacity: 1; }
.dl-dialog {
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  background: #0d1a30;
  border: 1px solid rgba(0,212,255,.25);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 40px rgba(0,212,255,.08);
  transform: translateY(16px) scale(.97);
  transition: transform .25s;
  overflow: hidden;
}
.dl-mask.show .dl-dialog { transform: translateY(0) scale(1); }
.dl-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(0,212,255,.05));
}
.dl-title-wrap { display: flex; align-items: center; gap: 12px; }
.dl-title-icon { color: #fbbf24; }
.dl-title { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.dl-sub { font-size: 11.5px; color: var(--muted-foreground); margin-top: 2px; }
.dl-close {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--muted-foreground);
  cursor: pointer; transition: all .15s;
}
.dl-close:hover { background: var(--muted); color: var(--foreground); }
.dl-body { padding: 20px 24px; overflow-y: auto; }

/* 架构图 */
.dl-arch { margin-bottom: 22px; }
.dl-arch-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.dl-arch-node {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 10px; font-size: 12.5px;
  border: 1px solid; min-width: 210px;
}
.dl-arch-node b { font-size: 13px; }
.dl-arch-node span { color: var(--muted-foreground); font-size: 11px; margin-left: auto; }
.dl-arch-node svg { flex-shrink: 0; }
.dl-arch-node.t1 { border-color: rgba(0,212,255,.4); background: rgba(0,212,255,.07); color: #00d4ff; }
.dl-arch-node.t2 { border-color: rgba(37,99,235,.45); background: rgba(37,99,235,.1); color: #60a5fa; }
.dl-arch-node.t3 { border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.08); color: #34d399; }
.dl-arch-arrow { color: var(--muted-foreground); }

.dl-section { margin-bottom: 22px; }
.dl-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; margin-bottom: 10px; color: #7dd3fc;
}
.dl-section p { font-size: 12.5px; color: var(--muted-foreground); line-height: 1.9; margin: 0; }
.dl-section p b, .dl-card b, .dl-arch-node b { color: var(--foreground); }

.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dl-card {
  padding: 13px; border-radius: 10px;
  background: rgba(22,36,64,.45); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 7px; transition: all .2s;
}
.dl-card:hover { border-color: rgba(0,212,255,.4); transform: translateY(-2px); }
.dl-card b { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.dl-card span { font-size: 11.5px; color: var(--muted-foreground); line-height: 1.75; }
.ic-blue { color: #60a5fa; } .ic-green { color: #34d399; } .ic-purple { color: #a78bfa; }
.ic-cyan { color: #00d4ff; } .ic-orange { color: #fbbf24; } .ic-red { color: #f87171; }

/* 色板 */
.dl-colors { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dl-color {
  flex: 1; min-width: 110px; padding: 10px 12px; border-radius: 8px;
  background: rgba(22,36,64,.45); border: 1px solid var(--border);
  font-size: 11px; color: var(--muted-foreground); line-height: 1.6;
}
.dl-color i {
  display: block; height: 26px; border-radius: 6px; margin-bottom: 6px;
  background: var(--c); border: 1px solid rgba(255,255,255,.12);
}
.dl-color code { color: #7dd3fc; font-size: 10.5px; }

/* 数据流 */
.dl-flow {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 10px;
  background: rgba(22,36,64,.45); border: 1px solid var(--border); border-radius: 10px;
}
.dl-flow-node {
  padding: 5px 12px; border-radius: 7px; font-size: 11.5px;
  background: rgba(37,99,235,.14); border: 1px solid rgba(37,99,235,.35); color: #93c5fd;
}
.dl-flow-arr { color: #00d4ff; font-size: 13px; }

@media (max-width: 760px) {
  .dl-grid { grid-template-columns: 1fr; }
  .dl-arch-row { flex-direction: column; }
  .dl-arch-arrow svg { transform: rotate(0); }
}
