* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; padding: 20px; }
.app-container { max-width: 1400px; margin: 0 auto; }
.app-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn-logout { padding: 8px 18px; background: #ff4d4f; color: white; border: none; border-radius: 6px; cursor: pointer; }
.gateway-bar { display: flex; align-items: center; gap: 15px; background: white; padding: 15px 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.gateway-bar select { padding: 8px 12px; font-size: 16px; min-width: 280px; border: 1px solid #d9d9d9; border-radius: 6px; }
.btn-secondary { padding: 8px 16px; background: white; margin: 10px;border: 1px solid #d9d9d9; font-size: 18px;border-radius: 20px; cursor: pointer; }
.btn-primary { padding: 8px 20px; background: #1890ff; color: white; border: none; border-radius: 20px; cursor: pointer; }
.btn-warning { padding: 8px 16px; background: #fff1f0; border: 1px solid #ffccc7; color: #ff4d4f; border-radius: 20px; cursor: pointer; }
.update-time { margin-left: auto; color: #666; font-size: 14px; }
.main-view { background: white; border-radius: 16px; padding: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); min-height: 400px; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: white; padding: 30px; border-radius: 16px; width: 420px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* 仪表盘卡片 */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.sensor-card { background: #fafafa; border-radius: 12px; padding: 20px; border: 1px solid #e8e8e8; cursor: pointer; transition: all 0.2s; }
.sensor-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.08); border-color: #1890ff; }
.sensor-card h3 { margin-bottom: 10px; }
.sensor-card .metric { font-size: 28px; font-weight: 600; margin: 10px 0; }
.sensor-card .metric small { font-size: 14px; font-weight: normal; color: #666; }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.online { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.offline { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
/* 电源卡片专用 */
.power-card .metric-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}
.power-card .temp-row {
    font-size: 20px;
    color: #555;
    border-top: 1px dashed #ddd;
    padding-top: 8px;
    margin-top: 5px;
}
.power-card .set-info {
    font-size: 15px;
    color: #2c3e50;
    background: #f0f7ff;
    padding: 5px 8px;
    border-radius: 6px;
    margin-top: 8px;
}
.power-panel .panel-row {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
        font-size: 18px;
}
.status-badge.online { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.status-badge.offline { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.status-badge.alarm { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.status-badge.normal { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.btn-small {
    padding: 2px 8px;
    font-size: 13px;
    margin-left: 5px;
    cursor: pointer;
}
.params-panel {
    margin-top: 15px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 13px;
    border: 1px solid #ddd;
    font-size: 18px;
}
.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}
.param-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge.cv { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.status-badge.cc { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.status-badge.normal { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.status-badge.alarm { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }
.btn-small {
    margin: 0 4px;
}
.power-toggle-btn {
    font-weight: bold;
    transition: background-color 0.2s;
}




.power-toggle-btn {
    font-weight: bold;
    transition: background-color 0.2s;
}
#protectActionRow {
    justify-content: flex-end;
    margin-top: 8px;
}

.power-toggle-btn {
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.power-toggle-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}


.power-action-btn {
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: opacity 0.2s;
    min-width: 80px;
}
.power-action-btn:hover {
    opacity: 0.85;
}
#output-status.status-badge.online {
    background: #f6ffed;
    color: #52c41a;
    border-color: #b7eb8f;
}
#output-status.status-badge.offline {
    background: #fff2f0;
    color: #ff4d4f;
    border-color: #ffccc7;
}

.onoffswitch {
    position: relative; width: 80px;
    -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
}
.onoffswitch-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.onoffswitch-label {
    display: block; overflow: hidden; cursor: pointer;
    border: 2px solid #999999; border-radius: 20px;
}
.onoffswitch-inner {
    display: block; width: 200%; margin-left: -100%;
    transition: margin 0.3s ease-in 0s;
}
.onoffswitch-inner:before, .onoffswitch-inner:after {
    display: block; float: left; width: 50%; height: 30px; padding: 0; line-height: 30px;
    font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;
    box-sizing: border-box;
}
.onoffswitch-inner:before {
    content: "ON";
    padding-left: 10px;
    background-color: #52c41a; color: #FFFFFF;
}
.onoffswitch-inner:after {
    content: "OFF";
    padding-right: 10px;
    background-color: #EEEEEE; color: #999999;
    text-align: right;
}
.onoffswitch-switch {
    display: block; width: 18px; margin: 6px;
    background: #FFFFFF;
    position: absolute; top: 0; bottom: 0;
    right: 46px;
    border: 2px solid #999999; border-radius: 20px;
    transition: all 0.3s ease-in 0s; 
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
    margin-left: 0;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
    right: 0px; 
}

.battery-icon.charging .battery-level {
  background: linear-gradient(90deg, #1e40af, #2563eb, #1e40af);
  background-size: 200% 100%;
  animation: charging-marquee 1.2s linear infinite;
}
@keyframes charging-marquee {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}


.alarm-panel {
    background: #fff7e6;
    border-left: 4px solid #ff9800;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.alarm-item {
    color: #333;
}

  /* 链接自颜色 */
  .versionInfo a:link {color: #059669;} /* 绿色 */
  .versionInfo a:visited {color: #4d7c0f;}
  .versionInfo a:hover {color: #eab308;}