.mqtt-platform {
  width: min(1200px, 100%);
}

.platform-topbar {
  align-items: center;
}

.platform-topbar h1 {
  color: #ffffff;
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.32);
}

.platform-view {
  display: none;
}

.platform-view.active {
  display: block;
}

/* === 梦幻玻璃面板 === */
.panel {
  border-radius: 18px;
  padding: 24px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(240, 244, 255, 0.84) 100%
  );
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(139, 168, 232, 0.4);
  box-shadow:
    0 8px 32px rgba(75, 60, 120, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}

.panel:hover {
  box-shadow:
    0 12px 40px rgba(75, 60, 120, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border-color: rgba(107, 141, 214, 0.55);
}

.panel h2,
.panel h3,
.module-head h2 {
  margin: 0;
  color: var(--text-deep, #2D1B4E);
  letter-spacing: 0;
}

.panel h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.panel h3,
.module-head h2 {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
}

.panel-desc {
  margin: 8px 0 0;
  color: var(--text-sub, #6A5A8A);
  line-height: 1.7;
}

.platform-home-panel {
  width: min(760px, 100%);
  margin: 0 auto;
}

.module-entry-stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

/* === 模块入口卡片 === */
.module-entry {
  width: 100%;
  border: 1.5px solid rgba(139, 168, 232, 0.35);
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(240, 244, 255, 0.88) 100%
  );
  padding: 20px 24px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 8px;
  color: var(--text-deep, #2D1B4E);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 18px rgba(75, 60, 120, 0.08);
  position: relative;
  overflow: hidden;
}

.module-entry::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, var(--dream-soft, #8BA8E8), var(--accent-pink, #E8A0C8));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.module-entry strong {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.3;
  color: var(--text-deep, #2D1B4E);
}

.module-entry span {
  color: var(--text-sub, #6A5A8A);
  line-height: 1.65;
}

.module-entry:hover {
  transform: translateY(-3px);
  border-color: rgba(107, 141, 214, 0.55);
  box-shadow:
    0 14px 36px rgba(75, 60, 120, 0.14),
    0 0 0 1px rgba(107, 141, 214, 0.1);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(232, 238, 252, 0.92) 100%
  );
}

.module-entry:hover::before {
  opacity: 1;
}

.module-entry:active {
  transform: translateY(-1px);
  transition-duration: 0.1s;
}

/* === 模块头部导航 === */
.module-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px 22px;
  border-radius: 18px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(240, 244, 255, 0.82) 100%
  );
  border: 1px solid rgba(139, 168, 232, 0.38);
  box-shadow:
    0 8px 28px rgba(75, 60, 120, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.module-nav,
.btn-row,
.inline-switches,
.file-picker-row,
.meta-chip-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-nav,
.wrap-row,
.inline-switches,
.file-picker-row,
.meta-chip-group {
  flex-wrap: wrap;
}

.module-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bottom-gap {
  margin-bottom: 28px;
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.triple-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.double-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label,
.field-block {
  display: grid;
  gap: 6px;
  color: var(--text-sub, #6A5A8A);
  font-size: 0.92rem;
  line-height: 1.4;
}

/* === 输入框 === */
input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1.5px solid rgba(139, 168, 232, 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-deep, #2D1B4E);
  padding: 10px 14px;
  font: inherit;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

textarea {
  resize: vertical;
  min-height: 130px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(107, 141, 214, 0.75);
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 4px rgba(107, 141, 214, 0.1),
    0 2px 10px rgba(107, 141, 214, 0.08);
}

input:disabled {
  background: rgba(240, 244, 255, 0.6);
  color: var(--text-muted, #9A8AB0);
}

.switch-group {
  margin: 14px 0;
}

.switch-group label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  color: var(--text-main, #4A3A6A);
}

.switch-group input {
  width: auto;
}

/* === 按钮 === */
.action-btn,
.tiny-btn,
.file-picker span {
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  color: #ffffff;
  background: linear-gradient(135deg, var(--dream-soft, #8BA8E8), var(--dream-deep, #4A6FC0));
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.action-btn::before,
.tiny-btn::before,
.file-picker span::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0) 35%,
    rgba(255, 255, 255, 0.22) 50%,
    rgba(255, 255, 255, 0) 65%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.action-btn:hover::before,
.tiny-btn:hover::before,
.file-picker span:hover::before {
  transform: translateX(100%);
}

.action-btn {
  padding: 12px 18px;
  min-height: 44px;
}

.tiny-btn {
  padding: 9px 14px;
  min-height: 36px;
  color: var(--text-deep, #2D1B4E);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 244, 255, 0.88));
  border-color: rgba(139, 168, 232, 0.4);
}

.action-btn:hover,
.tiny-btn:hover,
.file-picker span:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(75, 60, 120, 0.18);
}

.tiny-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 238, 252, 0.92));
  border-color: rgba(107, 141, 214, 0.5);
}

.action-btn.glow {
  background: linear-gradient(135deg, #68C8A8, #58B898);
}

.action-btn.glow:hover {
  box-shadow: 0 10px 24px rgba(88, 184, 152, 0.25);
}

.action-btn.mute {
  color: var(--text-main, #4A3A6A);
  background: linear-gradient(135deg, rgba(240, 244, 255, 0.92), rgba(232, 238, 252, 0.88));
  border-color: rgba(139, 168, 232, 0.35);
}

.action-btn.mute:hover {
  background: linear-gradient(135deg, rgba(240, 244, 255, 0.96), rgba(224, 232, 248, 0.92));
}

.action-btn.danger {
  background: linear-gradient(135deg, #E09090, #D47878);
}

.action-btn.danger:hover {
  box-shadow: 0 10px 24px rgba(212, 120, 120, 0.25);
}

.action-btn:disabled,
.tiny-btn:disabled,
.file-picker input:disabled + span {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

/* === 状态标签 === */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent);
}

.status-offline {
  color: var(--text-sub, #6A5A8A);
  background: rgba(240, 244, 255, 0.8);
  border-color: rgba(139, 168, 232, 0.3);
}

.status-online {
  color: #2D8A6A;
  background: rgba(88, 184, 152, 0.14);
  border-color: rgba(88, 184, 152, 0.3);
}

.status-wait {
  color: #A08030;
  background: rgba(240, 200, 128, 0.16);
  border-color: rgba(240, 200, 128, 0.3);
}

.status-error {
  color: #A05050;
  background: rgba(212, 120, 120, 0.14);
  border-color: rgba(212, 120, 120, 0.28);
}

.field-block {
  margin-top: 14px;
}

/* === 信息框 / 日志框 === */
.info-box {
  height: 300px;
  margin-top: 14px;
  overflow: auto;
  border-radius: 14px;
  border: 1.5px solid rgba(139, 168, 232, 0.3);
  background: linear-gradient(
    180deg,
    rgba(25, 20, 45, 0.94) 0%,
    rgba(18, 15, 35, 0.96) 100%
  );
  color: #C8D8F0;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 10px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.info-box:empty::before {
  content: "暂无内容";
  color: rgba(168, 188, 224, 0.4);
}

.log-entry {
  border-left: 3px solid var(--dream-soft, #8BA8E8);
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  word-break: break-word;
  transition: background 0.2s ease;
}

.log-entry:hover {
  background: rgba(255, 255, 255, 0.08);
}

.log-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.log-head strong {
  color: #F2F5FC;
  font-size: 0.93rem;
}

.log-head time,
.log-entry small {
  color: rgba(168, 188, 224, 0.6);
  font-size: 0.78rem;
}

.log-detail {
  margin-top: 5px;
  color: #C8D8F0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.log-success {
  border-left-color: #78D8B8;
}

.log-warn {
  border-left-color: #E8C880;
}

.log-error {
  border-left-color: #E8A0A0;
}

#deviceManageView .device-module-head,
#deviceManageView .device-cross-grid,
#deviceManageView .device-connect-panel,
#deviceManageView .device-command-panel,
#deviceManageView .device-log-panel {
  width: min(1200px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.device-connect-panel {
  box-shadow:
    0 8px 32px rgba(75, 60, 120, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.device-connect-actions {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.device-connect-actions .status-badge {
  justify-self: end;
  min-width: 158px;
}

.fixed-topic-line {
  margin: 12px 0 0;
  color: var(--text-muted, #9A8AB0);
  line-height: 1.65;
  font-size: 0.9rem;
}

/* === 传感器卡片 === */
.device-cross-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px auto 16px;
}

.sensor-card {
  position: relative;
  min-height: 170px;
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(240, 244, 255, 0.88) 100%
  );
  border: 1.5px solid rgba(139, 168, 232, 0.35);
  box-shadow:
    0 8px 28px rgba(75, 60, 120, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  display: grid;
  gap: 8px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 不同传感器用不同色彩 */
#temperatureCard {
  border-color: rgba(107, 141, 214, 0.4);
}
#temperatureCard .sensor-value span {
  background: linear-gradient(135deg, #6B8DD6, #8BA8E8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#humidityCard {
  border-color: rgba(232, 160, 200, 0.4);
}
#humidityCard .sensor-value span {
  background: linear-gradient(135deg, #E8A0C8, #F0B8D8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#lightCard {
  border-color: rgba(176, 144, 216, 0.4);
}
#lightCard .sensor-value span {
  background: linear-gradient(135deg, #B090D8, #C8A8E8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#soundCard {
  border-color: rgba(128, 212, 192, 0.4);
}
#soundCard .sensor-value span {
  background: linear-gradient(135deg, #58B898, #80D4C0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sensor-node-card {
  cursor: pointer;
}

.sensor-node-card:hover {
  transform: translateY(-3px);
  border-color: rgba(107, 141, 214, 0.55);
  box-shadow:
    0 14px 36px rgba(75, 60, 120, 0.14),
    0 0 0 1px rgba(107, 141, 214, 0.1);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(232, 238, 252, 0.92) 100%
  );
}

.sensor-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.sensor-card strong {
  font-size: 1.08rem;
  color: var(--text-deep, #2D1B4E);
}

.group-topic-tag {
  color: var(--text-muted, #9A8AB0);
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(200, 210, 240, 0.45);
  border: 1px solid rgba(139, 168, 232, 0.22);
}

.sensor-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-deep, #2D1B4E);
}

.sensor-value span {
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  font-weight: 700;
  line-height: 1;
  overflow-wrap: anywhere;
}

.sensor-node-card.is-empty .sensor-value span {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 600;
  color: var(--text-muted, #9A8AB0);
  -webkit-text-fill-color: var(--text-muted, #9A8AB0);
  background: none;
}

.sensor-value em {
  font-style: normal;
  color: var(--text-sub, #6A5A8A);
}

.sensor-node-card.is-empty .sensor-value em {
  color: var(--text-muted, #9A8AB0);
  font-size: 0.92rem;
}

.sensor-state-text {
  color: var(--text-sub, #6A5A8A);
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(139, 168, 232, 0.25);
  background: rgba(240, 244, 255, 0.65);
  padding: 4px 10px;
}

.sensor-node-card.is-empty .sensor-state-text {
  color: var(--text-muted, #9A8AB0);
}

/* === 节点详情弹窗 === */
.node-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.node-modal.active {
  display: flex;
}

.node-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 15, 45, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.node-modal-content {
  position: relative;
  width: min(640px, 100%);
  max-height: 80vh;
  border-radius: 18px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(240, 244, 255, 0.92) 100%
  );
  border: 1px solid rgba(139, 168, 232, 0.45);
  box-shadow:
    0 20px 60px rgba(75, 60, 120, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.node-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(139, 168, 232, 0.25);
}

.node-modal-header h3 {
  margin: 0;
  color: var(--text-deep, #2D1B4E);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
}

.node-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid rgba(139, 168, 232, 0.35);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-sub, #6A5A8A);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.node-modal-close:hover {
  background: rgba(240, 244, 255, 0.95);
  border-color: rgba(107, 141, 214, 0.5);
  color: var(--text-deep, #2D1B4E);
}

.node-modal-body {
  padding: 16px 22px 22px;
  overflow: auto;
}

.node-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}

.node-table th,
.node-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(139, 168, 232, 0.2);
}

.node-table th {
  color: var(--text-sub, #6A5A8A);
  font-weight: 600;
  font-size: 0.85rem;
  background: rgba(240, 244, 255, 0.6);
  position: sticky;
  top: 0;
}

.node-table th:first-child {
  border-radius: 10px 0 0 10px;
}

.node-table th:last-child {
  border-radius: 0 10px 10px 0;
}

.node-table td {
  color: var(--text-deep, #2D1B4E);
}

.node-table td.offline {
  color: var(--text-muted, #9A8AB0);
}

.node-table .node-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.node-status.online {
  color: #2D8A6A;
  background: rgba(88, 184, 152, 0.14);
}

.node-status.offline {
  color: #A05050;
  background: rgba(212, 120, 120, 0.12);
}

.node-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.node-table tr:hover td {
  background: rgba(240, 244, 255, 0.5);
}

.device-command-panel {
  margin: 0 auto 16px;
}

.device-log-panel {
  margin-top: 0;
}

.command-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.command-input-row input {
  flex: 1;
  min-width: 260px;
}

.control-topic-tag {
  color: var(--text-sub, #6A5A8A);
  background: rgba(200, 210, 240, 0.45);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.84rem;
  border: 1px solid rgba(139, 168, 232, 0.22);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.device-log-box,
.boot-log-box {
  height: 280px;
}

/* === 依赖提示 === */
.dependency-notice {
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  color: #8A7030;
  background: linear-gradient(135deg, rgba(245, 225, 170, 0.22), rgba(240, 210, 150, 0.18));
  border: 1.5px solid rgba(240, 200, 128, 0.35);
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dependency-notice.hidden {
  display: none;
}

/* === 文件选择器 === */
.file-picker {
  display: inline-flex;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--dream-soft, #8BA8E8), var(--dream-deep, #4A6FC0));
  border-radius: 12px;
  color: #ffffff;
  font-weight: 500;
}

/* === 元数据芯片 / 统计卡片 === */
.meta-chip,
.stat-card {
  border-radius: 12px;
  border: 1px solid rgba(139, 168, 232, 0.28);
  background: rgba(240, 244, 255, 0.7);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  color: var(--text-sub, #6A5A8A);
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.compact-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
  min-height: 76px;
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(232, 238, 252, 0.8);
  border-color: rgba(139, 168, 232, 0.45);
}

.stat-label {
  color: var(--text-muted, #9A8AB0);
  font-size: 0.84rem;
}

.stat-card strong {
  color: var(--text-deep, #2D1B4E);
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.wide-card {
  grid-column: 1 / -1;
}

.control-row {
  margin-top: 14px;
}

/* === 进度条 === */
.progress-block {
  margin-top: 18px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-main, #4A3A6A);
  margin-bottom: 8px;
}

.progress-bar {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(200, 210, 240, 0.55);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.08);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8BA8E8, #6B8DD6, #E8A0C8);
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 0 16px rgba(107, 141, 214, 0.35);
}

#bootStageText[data-tone="success"] {
  color: #2D8A6A;
}

#bootStageText[data-tone="error"] {
  color: #A05050;
}

#bootStageText[data-tone="wait"] {
  color: #8A7030;
}

@media (max-width: 900px) {
  .module-head {
    align-items: stretch;
    flex-direction: column;
  }

  .two-columns,
  .triple-grid,
  .double-grid {
    grid-template-columns: 1fr;
  }

  .module-nav {
    justify-content: flex-start;
  }

  .device-connect-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .device-connect-actions .status-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .mqtt-platform {
    padding-inline: 12px;
  }

  .panel,
  .module-head {
    padding: 16px;
  }

  .device-cross-grid,
  .stats-grid,
  .compact-stats {
    grid-template-columns: 1fr;
  }

  .sensor-card {
    min-height: 145px;
  }

  .status-badge {
    width: 100%;
  }

  .action-btn,
  .tiny-btn,
  .file-picker,
  .file-picker span {
    width: 100%;
    justify-content: center;
  }

  .node-modal-content {
    max-height: 90vh;
    border-radius: 14px;
  }

  .node-modal-header {
    padding: 14px 16px;
  }

  .node-modal-body {
    padding: 12px 16px 16px;
  }

  .node-table th,
  .node-table td {
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  .history-grid {
    grid-template-columns: 1fr;
  }

  .history-chart-wrap {
    min-height: 220px;
  }
}

/* === 历史数据图表 === */
#deviceManageView .history-panel {
  width: min(1200px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.history-select {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(139, 168, 232, 0.4);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-deep, #2D1B4E);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

.history-select:focus {
  border-color: rgba(107, 141, 214, 0.65);
  box-shadow: 0 0 0 3px rgba(107, 141, 214, 0.1);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.history-chart-wrap {
  min-height: 280px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(240, 244, 255, 0.6) 100%
  );
  border: 1px solid rgba(139, 168, 232, 0.25);
}

.history-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.history-chart-head h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-deep, #2D1B4E);
  font-weight: 600;
}

.history-node-select {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1.5px solid rgba(139, 168, 232, 0.4);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-deep, #2D1B4E);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  width: auto;
  min-width: 90px;
}

.history-node-select:focus {
  border-color: rgba(107, 141, 214, 0.65);
  box-shadow: 0 0 0 3px rgba(107, 141, 214, 0.1);
}

.history-node-select:disabled {
  background: rgba(240, 244, 255, 0.6);
  color: var(--text-muted, #9A8AB0);
  cursor: not-allowed;
}

.history-chart-wrap canvas {
  width: 100% !important;
  height: 220px !important;
}
