* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
}

/* 登录页 */
.login-container {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  width: 420px;
  padding: 45px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-title {
  text-align: center;
  margin-bottom: 35px;
}

.login-title h2 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.login-subtitle {
  margin: 0;
  color: #909399;
  font-size: 14px;
}

/* 主布局 */
.layout-container {
  height: 100vh;
}

.layout-container>.el-aside {
  background-color: #304156;
}

.layout-container .el-header {
  background-color: white;
  border-bottom: 1px solid #e6e6e6;
  padding: 0;
}

.layout-container .el-main {
  background-color: #f0f2f5;
  padding: 20px;
}

/* 侧边栏 */
.sidebar {
  height: 100%;
  background-color: #304156;
}

.sidebar .logo {
  height: 60px;
  line-height: 60px;
  text-align: center;
  color: white;
  font-size: 18px;
  font-weight: bold;
  background-color: #263445;
}

.sidebar .el-menu {
  border-right: none;
}

/* 顶栏 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 20px;
}

.header-left .title {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  font-weight: 500;
}

/* 通用页面头部 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h2 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

/* 通用搜索/筛选栏 */
.search-bar,
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

/* 通用分页 */
.pagination-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

/* 仪表盘 */
.dashboard-container .page-header {
  background: white;
  padding: 20px;
  border-radius: 4px;
}

.dashboard-container .stats-row {
  margin-bottom: 20px;
}

.stat-card {
  height: 120px;
}

.stat-content {
  display: flex;
  align-items: center;
  height: 100%;
}

.stat-icon {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
}

.station-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.device-icon {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.online-icon {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: #333;
  line-height: 1.2;
}

.stat-label {
  font-size: 14px;
  color: #909399;
  margin-top: 4px;
}

.alarm-card {
  background: white;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header span {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.empty-tip {
  text-align: center;
  padding: 40px 0;
  color: #909399;
  font-size: 14px;
}

/* 加油站管理 */
.stations-container,
.devices-container,
.alarms-container,
.comm-logs-container,
.users-container {
  background: white;
  padding: 20px;
  border-radius: 4px;
}

.device-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #ebeef5;
}

.device-section h4 {
  margin: 0 0 15px 0;
  font-size: 14px;
  color: #333;
}

.device-group {
  display: flex;
  margin-bottom: 10px;
}

.device-label {
  width: 80px;
  color: #606266;
  font-size: 14px;
}

.device-content {
  flex: 1;
}

.no-device {
  color: #909399;
  font-size: 14px;
}

/* 设备管理 */
.low-battery {
  color: #E6A23C;
  font-weight: 500;
}

/* 设备监控 */
.monitor-container {
  background: #f5f7fa;
  padding: 20px;
  min-height: calc(100vh - 120px);
}

.monitor-container .page-header {
  background: white;
  padding: 15px 20px;
  border-radius: 4px;
}

.monitor-container .header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.monitor-container .stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.monitor-container .stat-card {
  border-radius: 8px;
  height: auto;
}

.monitor-container .stat-content {
  gap: 15px;
  height: auto;
}

.monitor-container .stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  font-size: 24px;
  margin-right: 0;
}

.monitor-container .stat-icon.total {
  background: #e6f7ff;
  color: #1890ff;
}

.monitor-container .stat-icon.online {
  background: #f6ffed;
  color: #52c41a;
}

.monitor-container .stat-icon.offline {
  background: #fff2f0;
  color: #ff4d4f;
}

.monitor-container .stat-icon.warning {
  background: #fffbe6;
  color: #faad14;
}

.monitor-container .stat-value {
  font-size: 28px;
}

.monitor-container .stat-label {
  font-size: 14px;
  color: #999;
}

.monitor-container .filter-bar {
  background: white;
  padding: 15px 20px;
  border-radius: 4px;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  min-height: 200px;
}

.device-card {
  border-radius: 8px;
  transition: all 0.3s;
}

.device-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.device-card.offline {
  border-left: 3px solid #ff4d4f;
}

.device-card.low-bat {
  border-left: 3px solid #faad14;
}

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.device-body {
  font-size: 14px;
}

.device-imei {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.device-station,
.device-time,
.device-battery {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  margin-bottom: 6px;
}

.battery-warning {
  color: #faad14;
  font-weight: 500;
}

.update-info {
  margin-top: 20px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

.auto-refresh-hint {
  color: #52c41a;
}

/* 通讯记录 */
.payload-text {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  color: #409EFF;
}

.payload-detail {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: monospace;
  font-size: 12px;
  background: #f5f5f5;
  padding: 10px;
  border-radius: 4px;
}

.no-data {
  color: #909399;
}

@media (max-width: 768px) {
  .monitor-container .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================================== */
/* Scheme 5: Station Overview Cards   */
/* with Inline Device Chips           */
/* ================================== */

.station-overview-wrapper {
  padding: 4px 0;
}

.overview-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.station-cards-area {
  min-height: 200px;
}

/* Individual Station Card */
.station-overview-card {
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 12px;
  margin-bottom: 16px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

.station-overview-card:hover {
  border-color: #c5d0de;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.07);
}

/* Card Header */
.soc-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f1f4f8;
  position: relative;
}

.soc-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.soc-name {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 0.3px;
}

.soc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7a8d;
  flex-wrap: wrap;
}

.soc-sep {
  color: #d4dae3;
}

.soc-code {
  font-family: "SF Mono", "Consolas", monospace;
  color: #5a7896;
  font-size: 12px;
  background: #f0f4f8;
  padding: 1px 6px;
  border-radius: 4px;
}

.soc-phone {
  color: #8896a6;
}

.soc-comm {
  margin-left: 4px;
}

/* Detail Grid - Labeled Info Rows */
.soc-detail-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px;
  padding: 10px 0 2px;
}

.soc-detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.soc-detail-icon {
  color: #94a3b8;
  font-size: 15px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.soc-detail-label {
  color: #94a3b8;
  font-size: 12px;
  min-width: 42px;
  flex-shrink: 0;
}

.soc-detail-value {
  color: #334155;
  font-weight: 500;
}

.soc-detail-tag {
  margin-left: 6px;
}

.soc-actions {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 4px;
}

/* Device Chips Area */
.soc-devices {
  padding: 14px 20px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 44px;
}

.soc-no-device {
  font-size: 13px;
  color: #b0bec5;
  font-style: italic;
}

/* Device Chip */
.device-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: default;
}

.device-chip.is-online {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #a7f3d0;
  color: #065f46;
}

.device-chip.is-offline {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border-color: #fecaca;
  color: #991b1b;
}

.device-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.is-online .chip-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  animation: pulse-green 2s infinite;
}

.is-offline .chip-dot {
  background: #ef4444;
}

@keyframes pulse-green {

  0%,
  100% {
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
  }

  50% {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
  }
}

.chip-imei {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.chip-type {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.06);
  cursor: help;
}

.chip-lastseen {
  font-size: 11px;
  color: inherit;
  opacity: 0.7;
  margin-left: 2px;
}

.chip-unbind {
  padding: 0 !important;
  margin-left: 2px !important;
  opacity: 0;
  transition: opacity 0.2s;
}

.device-chip:hover .chip-unbind {
  opacity: 1;
}

.overview-pagination {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

/* ========== 加油站双栏布局 ========== */
.station-layout {
  display: flex;
  gap: 16px;
  height: calc(100vh - 180px);
}

.station-tree-panel {
  width: 280px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8ecf1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tree-search {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.tree-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.tree-body .el-tree {
  background: transparent;
  --el-tree-node-hover-bg-color: #f0f7ff;
}

.tree-body .el-tree-node.is-current > .el-tree-node__content {
  background-color: #e6f0ff;
  color: #409eff;
}

.station-detail-panel {
  flex: 1;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8ecf1;
  overflow-y: auto;
  padding: 20px;
}

.tree-node-content {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  width: 100%;
  padding-right: 8px;
}

.tree-node-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.tree-node-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-node-badge {
  font-size: 11px;
  color: #999;
  margin-left: auto;
  flex-shrink: 0;
}

/* 站点信息卡片 */
.station-info-card {
  border: 1px solid #e8ecf1;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.info-header h3 {
  margin: 0;
  font-size: 18px;
  color: #1a1a2e;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-item {
  font-size: 14px;
  line-height: 1.6;
}

.info-label {
  color: #94a3b8;
  margin-right: 8px;
  min-width: 56px;
  display: inline-block;
}

/* 设备区域 */
.detail-content .device-section {
  border: 1px solid #e8ecf1;
  border-radius: 8px;
  padding: 16px 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h4 {
  margin: 0;
  font-size: 15px;
  color: #333;
}

.overview-content, .empty-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex-direction: column;
  color: #999;
}

.overview-content .overview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 600px;
}

.overview-stat-card {
  text-align: center;
  padding: 24px 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e8ecf1;
}

.overview-stat-card .stat-number {
  font-size: 28px;
  font-weight: 600;
  color: #1a1a2e;
}

.overview-stat-card .stat-desc {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 4px;
}

/* 权限绑定树 */
.perm-tree-card {
  max-height: 350px;
  overflow-y: auto;
}

/* ===== 站点信息摘要（紧凑3行） ===== */
.station-info-summary {
  margin-bottom: 20px;
  border-radius: 8px;
}

.station-info-summary .info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ebeef5;
}

.station-info-summary .info-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
}

.station-info-summary .info-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.station-info-summary .info-address {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #606266;
}

.station-info-summary .info-address .el-icon {
  color: #409EFF;
  font-size: 16px;
  flex-shrink: 0;
}

.station-info-summary .info-contact {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: #303133;
}

.station-info-summary .info-contact .contact-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.station-info-summary .info-contact .el-icon {
  color: #67C23A;
  font-size: 15px;
}

.station-info-summary .info-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #909399;
}

.station-info-summary .info-meta .meta-time {
  margin-left: auto;
}

/* ===== 站点详情内设备卡片补充 ===== */

/* 在线设备绿色左边框（仅站点详情内） */
.detail-content .device-card:not(.offline):not(.low-bat) {
  border-left: 3px solid #67C23A;
}

/* 设备卡片底部（解绑按钮） */
.device-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  text-align: right;
}

/* 站点详情内设备网格间距微调 */
.detail-content .device-grid {
  gap: 16px;
}

.detail-content .device-card {
  min-height: 140px;
}