/* SCADA 自定义样式（排版以 Bootstrap 5 为主） */

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    font-size: 14px;
}

.scada-navbar {
    background: #1f2a37;
}

.scada-navbar .navbar-brand {
    font-weight: 600;
}

.scada-navbar .nav-link {
    color: rgba(255, 255, 255, .72);
}

.scada-navbar .nav-link:hover,
.scada-navbar .nav-link.active {
    color: #fff;
}

/* 轻提示容器（页面正中显示） */
.scada-toast-wrap {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.scada-toast-wrap .alert {
    transition: opacity .3s ease;
    margin-bottom: 0;
    width: 100%;
    text-align: center;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .2);
}

.scada-fade-out {
    opacity: 0;
}

/* 登录页 */
.scada-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2a37, #16baaa);
    padding: 20px 20px 64px;
}

.scada-login .card {
    width: 100%;
    max-width: 400px;
}

/* 登录页底部版权（固定底部居中） */
.scada-login-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding: 12px;
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .75);
}

.scada-login-footer a {
    color: rgba(255, 255, 255, .9);
    text-decoration: none;
}

.scada-login-footer a:hover {
    text-decoration: underline;
}

/* 参数当前值下的相对时间 */
.param-time {
    margin-top: 2px;
    cursor: help;
}

/* 参数列表：Bootstrap 栅格排版（名称/标识、当前值、操作三列） */
.param-list {
    border-top: 1px solid #e9ecef;
}

.param-list-head {
    padding: 4px 2px;
    font-size: 12px;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
}

.param-row {
    padding: 5px 2px;
    border-bottom: 1px solid #f1f3f5;
}

.param-row:last-child {
    border-bottom: 0;
}

.param-row:hover {
    background-color: #f8f9fa;
}

.param-row .param-name {
    font-size: 13px;
    line-height: 1.3;
}

.param-row .param-id {
    font-size: 11px;
    line-height: 1.2;
    color: #adb5bd;
}

.param-row .param-value {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.param-row .param-time {
    margin-top: 1px;
    font-size: 11px;
}

.param-row .btn-set {
    padding: 1px 10px;
    font-size: 12px;
}

/* 用户头像 */
.scada-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #e9ecef;
    color: #adb5bd;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 实时数据块 */
.realtime-box {
    background: linear-gradient(160deg, #1f2a37, #2f3d4e);
    color: #fff;
    border-radius: .5rem;
    padding: 16px 12px;
    text-align: center;
    height: 100%;
}

.realtime-box .label {
    color: #9fb0c4;
    font-size: 12px;
}

.realtime-box .value {
    font-size: 26px;
    font-weight: 700;
    color: #4be0c8;
    margin: 6px 0 2px;
    word-break: break-all;
}

.realtime-box .unit {
    font-size: 12px;
    color: #9fb0c4;
}

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    background: #adb5bd;
}

.online-dot.on {
    background: #16baaa;
    box-shadow: 0 0 0 4px rgba(22, 186, 170, .2);
}

.online-dot.off {
    background: #ff5722;
}

/* 列表中的状态圆点稍大，便于识别 */
.table .online-dot {
    width: 11px;
    height: 11px;
    margin-right: 0;
}

/* 产品卡片 */
.product-card {
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    text-decoration: none;
    color: inherit;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(22, 186, 170, .15);
    border-color: #16baaa !important;
}

/* 表格中的操作列：纯图标按钮 */
.scada-actions {
    white-space: nowrap;
}

.scada-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    border-radius: .375rem;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: background-color .15s;
}

.scada-icon-btn:hover {
    background: #eef1f4;
}

.scada-icon-btn + .scada-icon-btn {
    margin-left: .125rem;
}

/* 设备列表整体字号小一号 */
.scada-list-table {
    font-size: 13px;
}

.scada-list-table .dev-link {
    color: #0d6efd;
    text-decoration: none;
}

.scada-list-table .dev-link:hover {
    text-decoration: underline;
}

.table-scroll {
    overflow-x: auto;
}

#chart {
    height: 420px;
    width: 100%;
}

@media (max-width: 576px) {
    .realtime-box .value { font-size: 20px; }
    .scada-toast-wrap { max-width: calc(100% - 32px); }
}

/* 历史曲线深色主题 */
body.scada-dark {
    background: #0f1218 !important;
    color: #c8cdd8;
}

body.scada-dark main {
    color: #c8cdd8;
}

body.scada-dark .card {
    background: #171b24;
    border-color: #262c38 !important;
    color: #c8cdd8;
}

body.scada-dark h6 {
    color: #e5e8ee;
}

body.scada-dark .text-muted {
    color: #8b93a5 !important;
}

body.scada-dark .form-control {
    background: #12161e;
    border-color: #2b3240;
    color: #e5e8ee;
}

body.scada-dark .form-control:focus {
    background: #12161e;
    border-color: #3d6fd0;
    color: #fff;
    box-shadow: 0 0 0 .2rem rgba(61, 111, 208, .25);
}

body.scada-dark .form-control::placeholder {
    color: #6b7385;
}

body.scada-dark .btn-primary {
    background: #2f6fed;
    border-color: #2f6fed;
}

body.scada-dark .btn-outline-primary {
    color: #7fb2ff;
    border-color: #35507f;
}

body.scada-dark .btn-outline-primary:hover {
    background: #1d3358;
    border-color: #35507f;
    color: #cfe3ff;
}

body.scada-dark .btn-outline-secondary {
    color: #b6bdcb;
    border-color: #39414f;
}

body.scada-dark .btn-outline-secondary:hover {
    background: #232a36;
    border-color: #4a5364;
    color: #e5e8ee;
}

body.scada-dark #chart {
    background: #12161e;
    border-radius: .25rem;
}
