/* ============================================================
   器材出入库（仓库模块）· 网页版样式
   风格：与管理后台一致（Element 系浅色：白卡片 + #f0f2f5 背景 + #409EFF 主色）
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    background: #f0f2f5;
    color: #303133;
    font-size: 14px;
    line-height: 1.5;
}

/* ==================== 顶栏 ==================== */
.wh-topbar {
    height: 50px; background: #fff; border-bottom: 1px solid #e6e6e6;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px; position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
}
.wh-brand { display: flex; align-items: center; gap: 10px; }
.wh-emblem {
    width: 32px; height: 32px; border-radius: 6px; background: #409EFF;
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700;
}
.wh-title-block { display: flex; flex-direction: column; line-height: 1.25; }
.wh-title-main { font-size: 15px; font-weight: 600; }
.wh-title-sub { font-size: 11px; color: #909399; }
.wh-topbar-right { display: flex; align-items: center; gap: 14px; }
.wh-user { font-size: 13px; color: #606266; }
.wh-link { font-size: 13px; color: #409EFF; text-decoration: none; }
.wh-link:hover { text-decoration: underline; }

/* ==================== 布局 ==================== */
.wh-layout {
    display: flex; gap: 14px; padding: 64px 16px 20px;
    min-height: 100%; align-items: flex-start;
}
.wh-side {
    width: 268px; flex: 0 0 268px; background: #fff; border-radius: 8px;
    border: 1px solid #ebeef5; display: flex; flex-direction: column;
    max-height: calc(100vh - 84px); position: sticky; top: 64px;
}
.wh-side-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid #f0f2f5; font-weight: 600; font-size: 14px;
}
.wh-scene-list { padding: 10px; overflow-y: auto; flex: 1; min-height: 80px; }
.wh-side-foot {
    display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #f0f2f5;
}
.wh-side-foot .wh-btn { flex: 1; }

.wh-scene-card {
    border: 1px solid #ebeef5; border-radius: 8px; padding: 10px 12px;
    margin-bottom: 8px; cursor: pointer; transition: all .15s; background: #fff;
}
.wh-scene-card:hover { border-color: #c6e2ff; background: #f7fbff; }
.wh-scene-card.active { border-color: #409EFF; background: #ecf5ff; }
.wh-scene-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.wh-scene-meta { display: flex; gap: 10px; font-size: 12px; color: #909399; }
.wh-scene-note { font-size: 12px; color: #a8abb2; margin-top: 4px; }

.wh-main { flex: 1; background: #fff; border-radius: 8px; border: 1px solid #ebeef5; padding: 16px; min-width: 0; }

/* ==================== 按钮 ==================== */
.wh-btn {
    display: inline-block; padding: 6px 14px; border-radius: 6px; border: 1px solid #409EFF;
    background: #409EFF; color: #fff; font-size: 13px; cursor: pointer;
    text-decoration: none; transition: all .15s; line-height: 1.6;
}
.wh-btn:hover { background: #66b1ff; border-color: #66b1ff; }
.wh-btn.plain { background: #fff; color: #606266; border-color: #dcdfe6; }
.wh-btn.plain:hover { color: #409EFF; border-color: #c6e2ff; background: #ecf5ff; }
.wh-btn.danger { background: #fff; color: #f56c6c; border-color: #fbc4c4; }
.wh-btn.danger:hover { background: #fef0f0; border-color: #f56c6c; }
.wh-btn.sm { padding: 3px 10px; font-size: 12px; }

/* ==================== 详情区 ==================== */
.wh-detail-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid #f0f2f5;
}
.wh-detail-title { font-size: 17px; font-weight: 600; }
.wh-detail-sub { font-size: 12px; color: #909399; margin-top: 3px; }
.wh-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wh-warn { color: #e6a23c; font-weight: 600; }

/* ==================== 表格 ==================== */
.wh-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.wh-table th {
    background: #fafafa; color: #606266; font-weight: 600; text-align: left;
    padding: 9px 10px; border-bottom: 1px solid #ebeef5; white-space: nowrap;
}
.wh-table td { padding: 9px 10px; border-bottom: 1px solid #f5f7fa; }
.wh-table tr:hover td { background: #fafcff; }
.wh-num { text-align: center; font-variant-numeric: tabular-nums; }
.wh-total { font-weight: 700; color: #303133; }
.wh-cat { font-weight: 500; }
.wh-unit { font-size: 12px; color: #909399; font-weight: 400; }
.wh-nowrap { white-space: nowrap; }
.wh-plus { color: #67c23a; font-weight: 600; }
.wh-minus { color: #f56c6c; font-weight: 600; }
.wh-row-alert td { background: #fff8f8; }
.wh-row-alert:hover td { background: #fff2f2; }
.wh-badge-alert {
    display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px;
    background: #fef0f0; color: #f56c6c; border: 1px solid #fbc4c4;
}
.wh-badge-ok {
    display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px;
    background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8;
}
.wh-ops { white-space: nowrap; }
.wh-ops-head { width: 1%; }
.wh-mini {
    padding: 2px 9px; margin-right: 4px; font-size: 12px; border-radius: 5px;
    border: 1px solid #dcdfe6; background: #fff; color: #606266; cursor: pointer;
}
.wh-mini:hover { color: #409EFF; border-color: #c6e2ff; background: #ecf5ff; }
.wh-mini.ok { color: #67c23a; border-color: #c2e7b0; }
.wh-mini.ok:hover { background: #f0f9eb; }
.wh-mini.danger { color: #f56c6c; border-color: #fbc4c4; }
.wh-mini.danger:hover { background: #fef0f0; }
.wh-mini.plain { color: #909399; }

.wh-alert-bar {
    margin-top: 14px; padding: 10px 12px; border-radius: 6px; font-size: 13px;
    background: #fdf6ec; color: #e6a23c; border: 1px solid #faecd8;
}

/* ==================== 空态 / 无权限 ==================== */
.wh-empty { padding: 48px 16px; text-align: center; color: #a8abb2; font-size: 14px; }
.wh-empty-sub { font-size: 12px; color: #c0c4cc; }
.wh-noperm { max-width: 460px; margin: 90px auto; background: #fff; border: 1px solid #ebeef5;
    border-radius: 10px; padding: 34px 26px; text-align: center; }
.wh-noperm-icon { font-size: 40px; margin-bottom: 12px; }
.wh-noperm-title { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.wh-noperm-sub { font-size: 13px; color: #909399; line-height: 1.8; margin-bottom: 18px; }

/* ==================== 弹层 ==================== */
.wh-modal-mask {
    display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
    align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.wh-modal-mask.show { display: flex; }
.wh-modal { background: #fff; border-radius: 10px; width: 100%; max-width: 560px; max-height: 88vh;
    display: flex; flex-direction: column; overflow: hidden; }
.wh-modal-head { display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #f0f2f5; font-size: 15px; font-weight: 600; }
.wh-modal-close { border: none; background: none; font-size: 22px; line-height: 1; color: #909399; cursor: pointer; }
.wh-modal-close:hover { color: #f56c6c; }
.wh-modal-body { padding: 16px 18px; overflow-y: auto; }
.wh-modal-foot { display: flex; justify-content: flex-end; gap: 10px;
    padding: 12px 18px; border-top: 1px solid #f0f2f5; }

/* ==================== 表单 ==================== */
.wh-field { margin-bottom: 14px; }
.wh-field label { display: block; font-size: 13px; color: #606266; margin-bottom: 6px; }
.wh-field input[type="text"], .wh-field input[type="number"], .wh-field select {
    width: 100%; padding: 8px 10px; border: 1px solid #dcdfe6; border-radius: 6px;
    font-size: 13px; color: #303133; outline: none; background: #fff;
}
.wh-field input:focus, .wh-field select:focus { border-color: #409EFF; }
.wh-static { padding: 8px 10px; background: #f5f7fa; border-radius: 6px; font-size: 13px; color: #303133; }
.wh-req { color: #f56c6c; font-size: 12px; }
.wh-hint { font-size: 12px; color: #a8abb2; margin-top: 6px; line-height: 1.6; }

/* ==================== 流水页签 ==================== */
.wh-log-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.wh-tab { padding: 4px 14px; font-size: 13px; border: 1px solid #dcdfe6; background: #fff;
    color: #606266; border-radius: 16px; cursor: pointer; }
.wh-tab.active { background: #409EFF; border-color: #409EFF; color: #fff; }
.wh-modal-body .wh-table { margin-top: 0; }

/* ==================== 轻提示 ==================== */
.wh-toast {
    position: fixed; left: 50%; top: 72px; transform: translate(-50%, -12px);
    background: #303133; color: #fff; padding: 9px 18px; border-radius: 6px;
    font-size: 13px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 300;
    max-width: 80vw;
}
.wh-toast.show { opacity: 1; transform: translate(-50%, 0); }
.wh-toast.err { background: #f56c6c; }

/* ==================== 窄屏（手机浏览器可用） ==================== */
@media (max-width: 860px) {
    .wh-layout { flex-direction: column; padding: 60px 10px 16px; }
    .wh-side { width: 100%; flex: none; position: static; max-height: none; }
    .wh-scene-list { max-height: 240px; }
    .wh-table { font-size: 12px; }
    .wh-table th, .wh-table td { padding: 7px 6px; }
}
