@import url('https://cdn.jsdelivr.net/npm/bootswatch@5.3.0/dist/flatly/bootstrap.min.css');

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 30px;
  table-layout: fixed;
  word-break: break-word;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: center; /* ✅ 添加水平居中 */
  vertical-align: middle; /* ✅ 添加垂直居中 */
}

th {
  background-color: #e0e0e0;
  padding: 12px;
  font-size: 18px;
  text-align: center;  /* ✅ 水平居中 */
  vertical-align: middle;  /* ✅ 垂直居中 */
}

td {
  padding: 12px;
  text-align: center;  /* ✅ 水平居中 */
  vertical-align: middle;  /* ✅ 垂直居中 */
  border-top: 1px solid #ddd;
  font-size: 18px;
}

/* ===== Real-Time Monitor 自定义样式 ===== */
body {
  font-family: Arial, sans-serif;
  padding: 20px;
  background-color: #f7f7f7;
  font-size: 18px;
}

h1 {
  color: #333;
  font-size: 22px;
}

h2, h3 {
  color: #333;
  font-size: 20px;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 30px;
  table-layout: fixed;
  word-break: break-word;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

th {
  background-color: #e0e0e0;
  padding: 12px;
  font-size: 18px;
}

td {
  padding: 12px;
  text-align: center;
  border-top: 1px solid #ddd;
  font-size: 18px;
}

.device-title {
  font-size: 20px;
  margin-bottom: 10px;
  color: #333;
}

.update-time-inline {
  font-size: 14px;
  color: #888;
  font-weight: normal;
}

/* ===== 手机端响应式样式 ===== */
.mobile-card {
  display: none;
}

@media (max-width: 768px) {
  .pc-table {
    display: none;
  }

  .mobile-card {
    display: block;
    border-bottom: 1px solid #1f0404;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .mobile-card .grid {
    display: flex;
    flex-direction: column;
  }

  .mobile-card .grid-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
  }

  .mobile-card .grid-item span {
    display: inline;
  }

  .mobile-card .grid-item:last-child {
    border-bottom: none;
  }

  .mobile-bottom-spacer {
    height: 120px;
  }

select,
button {
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  background-color: #f9f9f9 !important;
  color: #333 !important;
  padding: 6px 12px !important;
  box-shadow: none !important;
  transition: all 0.2s ease-in-out;
}

select:hover,
button:hover {
  background-color: #e8f0fe !important;
  border-color: #90caf9 !important;
}

select:focus,
button:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(144, 202, 249, 0.3) !important;
  border-color: #64b5f6 !important;
}

/* 通用 select、button 美化 */
select,
button,
input[type="date"],
input[type="month"] {
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  background-color: #f9f9f9 !important;
  color: #333 !important;
  padding: 6px 12px !important;
  box-shadow: none !important;
  transition: all 0.2s ease-in-out;
  font-size: 14px;
}

select:hover,
button:hover,
input[type="date"]:hover,
input[type="month"]:hover {
  background-color: #eef6ff !important;
  border-color: #90caf9 !important;
}

select:focus,
button:focus,
input[type="date"]:focus,
input[type="month"]:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(144, 202, 249, 0.3) !important;
  border-color: #64b5f6 !important;
}

/* 设备标签 badge hover 效果 */
#deviceTags .badge {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 20px;
  cursor: default;
  transition: background-color 0.2s ease;
}

#deviceTags .badge:hover {
  background-color: #6fa8dc !important;
}

#deviceTags .badge span {
  margin-left: 8px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    justify-content: center;
}

.user-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 16px;
    width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.user-info p {
    margin: 6px 0;
    font-size: 14px;
}

.user-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}

.user-actions button {
    flex: 1 1 auto;
    padding: 6px 10px;
    white-space: nowrap;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 居中对话框 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

/* 💻 桌面端优化弹窗宽度 */
@media (min-width: 768px) {
    .modal-content {
        width: 480px;
    }
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.user-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px;
    width: 300px;
    transition: transform 0.2s ease;
}

.user-card:hover {
    transform: translateY(-3px);
}

.user-info p {
    margin: 6px 0;
    font-size: 14px;
    color: #333;
}

.user-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-actions button {
    flex: 1 1 auto;
    padding: 6px 10px;
    white-space: nowrap;
    font-size: 13px;
    background-color: #fff;
    border: 1px solid #333;
    cursor: pointer;
}


}
