/* 完整产品版的实时数据状态、通用弹窗和动态列表样式。 */
.api-loading .app {
  visibility: hidden;
}

.api-loading::after {
  content: "正在读取系统数据...";
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 200;
  transform: translate(-50%, -50%);
  padding: 14px 20px;
  border: 1px solid #c7d8ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(23, 55, 91, .18);
  color: #15395f;
  font-weight: 700;
}

.live-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.live-room-grid .room-block {
  position: static;
  min-height: 94px;
  padding: 14px;
}

.live-room-grid .room-block button {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.live-room-grid .room-block strong,
.live-room-grid .room-block small {
  display: block;
  overflow-wrap: anywhere;
}

.live-room-grid .room-block small {
  margin-top: 5px;
  line-height: 1.45;
}

.live-timeline {
  margin-top: 12px;
}

.room-photo {
  width: 112px;
  min-width: 112px;
  height: 76px;
  overflow: hidden;
  border: 1px solid #d8e4f2;
  border-radius: 6px;
  background: #e9f1fa;
}

.room-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.room-identity > div:last-child {
  min-width: 0;
}

.asset-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.room-assets-layout {
  grid-template-columns: minmax(0, 1fr);
}

.asset-card h4,
.asset-meta {
  overflow-wrap: anywhere;
}

.asset-card .card-actions,
.screen-card .card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.system-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: none;
  background: rgba(9, 31, 55, .46);
}

.system-modal-backdrop.open {
  display: block;
}

.system-modal {
  position: fixed;
  z-index: 170;
  top: 50%;
  left: 50%;
  display: none;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid #cbdcf0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(8, 32, 61, .28);
}

.system-modal.open {
  display: block;
}

.system-modal-head,
.system-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
}

.system-modal-head {
  border-bottom: 1px solid #e0eaf5;
}

.system-modal-head h2 {
  margin: 0;
  font-size: 19px;
}

.system-modal-body {
  padding: 20px;
}

.system-modal-actions {
  justify-content: flex-end;
  border-top: 1px solid #e0eaf5;
}

.modal-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.modal-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dae6f3;
  border-radius: 6px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #bfd0e3;
  border-radius: 6px;
  background: #f7fafe;
  color: #59728d;
  text-align: center;
}

.system-error {
  position: fixed;
  z-index: 220;
  right: 22px;
  bottom: 22px;
  max-width: 420px;
  padding: 14px 16px;
  border: 1px solid #efb6b6;
  border-radius: 8px;
  background: #fff5f5;
  box-shadow: 0 16px 38px rgba(97, 24, 24, .16);
  color: #a42323;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.screen-card.selected {
  border-color: #2b78e4;
  box-shadow: inset 0 0 0 1px #2b78e4;
}

.integration-list {
  display: grid;
  gap: 10px;
}

.integration-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 1.8fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dce7f3;
  border-radius: 6px;
}

.integration-row > *,
.screen-card > *,
.permission-item,
.ops-layout > *,
.modal-list-row > * {
  min-width: 0;
}

.booking-integrated-panel {
  position: relative;
}

.notice-only {
  padding: 22px;
  border: 1px solid #d7e4f2;
  border-left: 4px solid #2376dc;
  background: #f6faff;
  color: #36516d;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  place-items: center;
  padding: 24px;
  background: #eef5fb;
}

.login-gate.open {
  display: grid;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid #cad9ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(21, 54, 88, .16);
}

.login-panel h1,
.login-panel p {
  margin: 0;
}

.login-panel p {
  margin-top: 5px;
  color: #64758a;
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: #465b72;
  font-size: 13px;
  font-weight: 700;
}

.login-panel input,
.login-panel select {
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #cbd9e8;
  border-radius: 7px;
  background: #fff;
}

.login-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #1769e0;
  color: #fff;
  font-weight: 800;
}

.login-error {
  min-height: 20px;
  color: #c73b3b;
  font-size: 13px;
}

@media (max-width: 1600px) {
  .device-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1200px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: flex-start;
  }

  #permissions > .grid.cols-2,
  .ops-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .asset-card {
    grid-template-columns: 1fr;
  }

  .room-identity {
    align-items: flex-start;
  }

  .asset-card .card-actions {
    justify-content: flex-start;
  }

  .room-photo {
    width: 88px;
    min-width: 88px;
    height: 66px;
  }

  .integration-row {
    grid-template-columns: 1fr;
  }

  .permission-grid {
    grid-template-columns: 1fr;
  }
}
