/* 翔远智能称量监控系统 - 全局样式（深色科技风）
 * 
 * 2024-04 改造：适配展会一体机深色主题
 * - 全局深色背景 #0a0e1a
 * - 浮动工具条毛玻璃效果
 * - PLC状态指示灯
 * - MiniUI组件深色覆盖
 */

/* ========== 基础样式 ========== */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    font-size: 13px;
    overflow: hidden;
    background: #0a0e1a;
}

/* ========== 头部样式（深色科技风） ========== */
.app-header {
    background: linear-gradient(90deg, #001529 0%, #0a1a2e 50%, #001529 100%) !important;
    color: #fff;
    border-bottom: 1px solid #1a3a5c !important;
}

.app-header .logo {
    color: #fff;
    font-size: 17px;
    font-weight: bold;
    padding: 0 10px;
    text-shadow: 0 0 8px rgba(100, 180, 255, 0.3);
}

/* ========== PLC 状态指示灯 ========== */
.plc-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 6px currentColor;
    transition: all 0.3s ease;
}

.plc-status-online {
    background: #52c41a;
    color: #52c41a;
    box-shadow: 0 0 8px #52c41a, 0 0 16px rgba(82, 196, 26, 0.4);
    animation: pulse-green 2s ease-in-out infinite;
}

.plc-status-offline {
    background: #ff4d4f;
    color: #ff4d4f;
    box-shadow: 0 0 6px rgba(255, 77, 79, 0.5);
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px #52c41a, 0 0 16px rgba(82, 196, 26, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 4px #52c41a, 0 0 8px rgba(82, 196, 26, 0.2); }
}

.plc-status-text {
    font-size: 12px;
    font-weight: 500;
    vertical-align: middle;
}

/* ========== 浮动工具条（底部居中水平布局） ========== */
.float-toolbar {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: auto;
    background: rgba(16, 24, 48, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(100, 160, 255, 0.15);
    border-radius: 12px;
    padding: 6px 12px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.float-toolbar:hover {
    border-color: rgba(100, 160, 255, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(64, 128, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.float-toolbar-title {
    font-size: 10px;
    color: rgba(160, 196, 232, 0.7);
    text-align: center;
    letter-spacing: 2px;
    border-right: 1px solid rgba(100, 160, 255, 0.1);
    padding-right: 8px;
    margin-right: 2px;
    white-space: nowrap;
}

.float-btn {
    width: 52px;
    height: 44px;
    border-radius: 8px;
    background: rgba(30, 50, 90, 0.5);
    border: 1px solid rgba(100, 160, 255, 0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    transition: all 0.2s ease;
    user-select: none;
}

.float-btn:hover {
    background: rgba(40, 80, 160, 0.6);
    border-color: rgba(100, 180, 255, 0.4);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(64, 128, 255, 0.2);
}

.float-btn:active {
    transform: scale(0.97);
}

.float-icon {
    font-size: 18px;
    line-height: 1;
}

.float-label {
    font-size: 9px;
    color: rgba(200, 220, 255, 0.85);
    white-space: nowrap;
}

/* ========== 菜单树样式（深色适配） ========== */
/* MiniUI tree 文字实际在 <a> 标签内，默认 color:#000，必须覆盖 */
.mini-layout-region-west .mini-tree-nodetext,
.mini-layout-region-west .mini-tree-nodetext a {
    color: #fff !important;
}

.mini-layout-region-west .mini-tree-node {
    font-size: 13px;
}

/* 选中状态：MiniUI 实际使用 .mini-tree-selectedNode，覆盖 skin.css 的 #d8d8d8 浅灰背景 */
.mini-layout-region-west .mini-tree-selectedNode {
    background-color: transparent !important;
}

.mini-layout-region-west .mini-tree-selectedNode .mini-tree-nodeshow {
    background-color: #1890ff !important;
    border-color: #1890ff !important;
}

.mini-layout-region-west .mini-tree-selectedNode .mini-tree-nodetext,
.mini-layout-region-west .mini-tree-selectedNode .mini-tree-nodetext a {
    color: #fff !important;
}

/* 悬停状态：覆盖 MiniUI skin.css 的 #f2f2f2 浅色背景，改为深色 */
.mini-layout-region-west .mini-tree-node-hover {
    background-color: rgba(24, 144, 255, 0.25) !important;
}

.mini-layout-region-west .mini-tree-node-hover .mini-tree-nodeshow {
    background: rgba(24, 144, 255, 0.25) !important;
    border-color: #1890ff !important;
}

.mini-layout-region-west .mini-tree-node-hover .mini-tree-nodetext,
.mini-layout-region-west .mini-tree-node-hover .mini-tree-nodetext a {
    color: #fff !important;
}

/* west区域深色背景 */
.mini-layout-region-west .mini-layout-region-body {
    background: #0d1b2a !important;
}

.mini-layout-region-west .mini-layout-region-header {
    background: linear-gradient(90deg, #001529, #0a1a2e) !important;
    color: #fff !important;
    border-bottom: 1px solid #1a3a5c !important;
}
.mini-layout-region-west .mini-layout-region-title {
    color: #fff !important;
}
.mini-layout-proxy-west .mini-layout-region-title {
    color: #fff !important;
}

/* west region 折叠后的 proxy（左侧窄条）改为背景色 */
.mini-layout-proxy,
.mini-layout-proxy-west {
    background: #0a0e1a !important;
    border-color: #1a3a5c !important;
}

.mini-layout-proxy-hover,
.mini-layout-proxy-west.mini-layout-proxy-hover {
    background: #0d1b2a !important;
    border-color: #2563a0 !important;
}

/* ========== Tab样式（深色适配） ========== */
.mini-tabs-headers {
    background: #0a0e1a !important;
    border-bottom: 1px solid #1a3a5c !important;
}

.mini-tab {
    border-radius: 4px 4px 0 0;
    background: #0d1b2a !important;
    color: #8899aa !important;
    border: 1px solid #1a3a5c !important;
    border-bottom: none !important;
}

.mini-tab-active {
    background: #0f2340 !important;
    color: #fff !important;
    font-weight: bold !important;
    border-top: 2px solid #1890ff !important;
}

.mini-tab-hover {
    background: #132840 !important;
    color: #a0c4e8 !important;
}

.mini-tabs-bodys {
    background: #0a0e1a !important;
    border: none !important;
}

/* ========== 按钮样式增强 ========== */
.mini-button {
    border-radius: 4px;
}

.mini-button-primary {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

/* ========== 表单样式（深色覆盖） ========== */
.mini-textbox, .mini-combobox, .mini-datepicker, .mini-spinner {
    border-radius: 4px;
}

.mini-panel-header {
    background: linear-gradient(90deg, #001529, #0a1a2e) !important;
    color: #a0c4e8 !important;
    font-weight: bold;
    border-bottom: 1px solid #1a3a5c !important;
}

.mini-panel-body {
    background: #0d1b2a !important;
}

/* ========== 数据表格样式（深色覆盖） ========== */
.mini-datagrid-header {
    background: #0f2340 !important;
    color: #a0c4e8 !important;
}

.mini-datagrid-header-inner {
    background: #0f2340 !important;
}

.mini-datagrid-row-selected {
    background: rgba(24, 144, 255, 0.2) !important;
}

.mini-datagrid-row-hover {
    background: rgba(24, 144, 255, 0.1) !important;
}

.mini-datagrid-row {
    background: #0d1b2a;
    color: #c8d8e8;
}

.mini-datagrid-row-alt {
    background: #0a1628;
}

/* ========== 弹窗/窗口样式（深色覆盖） ========== */
.mini-window {
    background: #0d1b2a !important;
    border: 1px solid #1a3a5c !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

.mini-window .mini-panel-header {
    background: linear-gradient(90deg, #001529, #0a1a2e) !important;
    color: #a0c4e8 !important;
}

.mini-window .mini-panel-body {
    background: #0d1b2a !important;
    color: #c8d8e8 !important;
}

.mini-messagebox {
    background: #0d1b2a !important;
    border: 1px solid #1a3a5c !important;
    color: #c8d8e8 !important;
}

.mini-messagebox-content {
    color: #c8d8e8 !important;
}

/* ========== 状态指示器 ========== */
.status-online {
    background-color: #52c41a;
}

.status-offline {
    background-color: #ff4d4f;
}

.status-warning {
    background-color: #faad14;
}

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0e1a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #1a3a5c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563a0;
}

/* ========== 响应式布局 ========== */
@media screen and (max-width: 1366px) {
    .logo {
        font-size: 15px !important;
    }

    .float-toolbar {
        bottom: 6px;
        padding: 5px 10px;
        gap: 6px;
    }

    .float-btn {
        width: 46px;
        height: 40px;
    }

    .float-icon {
        font-size: 16px;
    }

    .float-label {
        font-size: 8px;
    }
}
