/* ========================================
   数据大屏 - 蓝色科技主题 V2
   布局：左巡检对象 | 中数据概览 | 右待整治
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #0a1628;
  --bg-secondary: #0d1f3c;
  --bg-panel: rgba(13, 31, 60, 0.85);
  --border-color: rgba(30, 136, 229, 0.3);
  --accent: #1e88e5;
  --accent-light: #42a5f5;
  --accent-glow: rgba(30, 136, 229, 0.4);
  --text-primary: #e3f2fd;
  --text-secondary: #90caf9;
  --text-muted: #5c7a9a;
  --warning: #ffa726;
  --danger: #ff6b6b;
  --success: #66bb6a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ============ 背景粒子画布 ============ */
#bgCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============ 顶部标题栏 ============ */
.screen-header {
  position: relative;
  z-index: 10;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: linear-gradient(180deg, rgba(13,31,60,0.95) 0%, rgba(10,22,40,0.9) 100%);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
  font-size: 13px;
  color: var(--text-secondary);
}

.header-right { justify-content: flex-end; }

.header-deco {
  color: var(--accent);
  font-size: 10px;
}

.screen-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  background: linear-gradient(180deg, #e3f2fd, #42a5f5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex: 1;
  text-align: center;
}

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(102, 187, 106, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(102, 187, 106, 0); }
}

/* ============ 主体三栏布局 ============ */
.screen-body {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  min-height: 0;
}

/* ============ 面板通用 ============ */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30,136,229,0.08);
  flex-shrink: 0;
}

.panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-count {
  font-size: 12px;
  color: var(--accent-light);
  background: rgba(30,136,229,0.15);
  padding: 2px 10px;
  border-radius: 10px;
}

.panel-body {
  flex: 1;
  overflow: hidden;
}

/* ============ 左侧面板：巡检对象 ============ */
.panel-left {
  width: 280px;
  flex-shrink: 0;
}

.scroll-list {
  overflow-y: auto;
  padding: 8px;
}

.scroll-list::-webkit-scrollbar {
  width: 3px;
}

.scroll-list::-webkit-scrollbar-thumb {
  background: rgba(30,136,229,0.3);
  border-radius: 3px;
}

/* 行业分组（折叠） */
.industry-group {
  margin-bottom: 6px;
}

.industry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(30,136,229,0.12);
  border: 1px solid rgba(30,136,229,0.22);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s;
}

.industry-header:hover {
  background: rgba(30,136,229,0.22);
  border-color: var(--accent-light);
}

.industry-arrow {
  font-size: 10px;
  color: var(--accent-light);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.industry-group.expanded .industry-arrow {
  transform: rotate(90deg);
}

.industry-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.industry-count {
  font-size: 11px;
  color: var(--accent-light);
  background: rgba(30,136,229,0.18);
  padding: 1px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.industry-targets {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}

.industry-group.expanded .industry-targets {
  max-height: 3000px;
}

.industry-targets .target-item {
  margin: 6px 0 0 0;
}

.target-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: rgba(30,136,229,0.06);
  border: 1px solid rgba(30,136,229,0.1);
  border-radius: 6px;
  transition: all 0.3s;
  animation: slideIn 0.4s ease;
}

.target-item:hover {
  background: rgba(30,136,229,0.15);
  border-color: var(--accent-light);
  transform: translateX(4px);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.target-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1565c0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.target-info {
  flex: 1;
  min-width: 0;
}

.target-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.target-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.target-status.active {
  background: rgba(102, 187, 106, 0.15);
  color: var(--success);
}

.target-status.inactive {
  background: rgba(120, 144, 156, 0.15);
  color: var(--text-muted);
}

.list-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============ 中间面板：数据概览 ============ */
.panel-center {
  flex: 1;
  min-width: 0;
}

.center-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.center-scroll::-webkit-scrollbar {
  width: 3px;
}

.center-scroll::-webkit-scrollbar-thumb {
  background: rgba(30,136,229,0.3);
  border-radius: 3px;
}

/* 统计卡片网格 */
.overview-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 12px 16px;
}

.overview-cards.today-cards {
  grid-template-columns: repeat(3, 1fr);
}

.bs-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(30,136,229,0.06);
  border: 1px solid rgba(30,136,229,0.1);
  border-radius: 8px;
  transition: all 0.3s;
}

.bs-card:hover {
  background: rgba(30,136,229,0.12);
  border-color: var(--accent-light);
  transform: translateY(-2px);
}

.bs-card-icon {
  font-size: 30px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(30,136,229,0.12);
  flex-shrink: 0;
}

.bs-card-icon.warning {
  background: rgba(255,167,38,0.15);
}

.bs-card-icon.danger {
  background: rgba(255,107,107,0.15);
}

.bs-card-icon.success {
  background: rgba(102,187,106,0.15);
}

.bs-card-body {
  flex: 1;
  min-width: 0;
}

.bs-card-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1.1;
}

.bs-card-val.warning { color: var(--warning); }
.bs-card-val.danger { color: var(--danger); }
.bs-card-val.success { color: var(--success); }

.bs-card-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 最近巡检记录表格 */
.recent-table-wrap {
  padding: 0 16px 16px;
}

.bs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bs-table thead th {
  padding: 8px 10px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  white-space: nowrap;
}

.bs-table tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(30,136,229,0.08);
  color: var(--text-secondary);
  white-space: nowrap;
}

.bs-table tbody tr {
  transition: background 0.2s;
}

.bs-table tbody tr:hover {
  background: rgba(30,136,229,0.06);
}

.bs-table .td-name {
  color: var(--text-primary);
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bs-table .td-status-pending {
  color: var(--danger);
}

.bs-table .td-status-good {
  color: var(--success);
}

/* ============ 右侧面板：待整治隐患 ============ */
.panel-right {
  width: 340px;
  flex-shrink: 0;
}

.pending-item {
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255,107,107,0.06);
  border: 1px solid rgba(255,107,107,0.15);
  border-radius: 6px;
  transition: all 0.3s;
  animation: slideIn 0.4s ease;
}

.pending-item:hover {
  background: rgba(255,107,107,0.12);
  border-color: rgba(255,107,107,0.35);
}

.pending-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pending-hazard-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-severity {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  color: #fff;
  flex-shrink: 0;
  margin-left: 8px;
}

.pending-severity.serious {
  background: #ff6b6b;
}

.pending-severity.general {
  background: #ffa726;
}

.pending-severity.minor {
  background: #42a5f5;
}

.pending-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pending-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pending-target {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ============ 底部栏 ============ */
.screen-footer {
  position: relative;
  z-index: 10;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(10,22,40,0.9);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* ============ 响应式 ============ */
@media (max-width: 1200px) {
  .panel-left { display: none; }
  .panel-right { width: 280px; }
}

@media (max-width: 900px) {
  .panel-right { display: none; }
  .screen-title { font-size: 20px; letter-spacing: 3px; }
  .overview-cards { grid-template-columns: repeat(2, 1fr); }
}
