/* ==========================================================================
   LM 账号系统 前端样式
   兼容性目标：老 Android WebView / IE11+
   - 不使用 CSS 变量、grid、flex gap
   - 布局以 flexbox 为主，并通过 html.no-flex 提供 float 回退
   - 所有颜色写死，避免 var()
   ========================================================================== */

/* ---------- reset ---------- */
html, body, div, span, h1, h2, h3, h4, p, a, img, ul, ol, li, form, label,
table, thead, tbody, tfoot, tr, th, td, input, select, textarea, button {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #1f2937;
    background: #f4f7fb;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

ul, ol { list-style: none; }
table { border-collapse: collapse; border-spacing: 0; }
a { color: #2f6fed; text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button { font-family: inherit; outline: none; }
img { max-width: 100%; }

.hide { display: none !important; }
.clearfix:after { content: ""; display: table; clear: both; }
.text-muted { color: #8a93a3; }
.text-danger { color: #ef4444; }
.text-success { color: #16a34a; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt10 { margin-top: 10px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.mb10 { margin-bottom: 10px; }
.mb16 { margin-bottom: 16px; }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #d5dce8;
    border-radius: 8px;
    background: #ffffff;
    color: #38445c;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    -moz-transition: background .15s, border-color .15s, opacity .15s;
    -webkit-transition: background .15s, border-color .15s, opacity .15s;
    transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: #f5f8fd; border-color: #b9c6dd; }
.btn:active { background: #eaf0fa; }
.btn[disabled], .btn.btn-disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: #2f6fed; border-color: #2f6fed; color: #ffffff; }
.btn-primary:hover { background: #2a63d4; border-color: #2a63d4; }
.btn-primary:active { background: #2556bc; }

.btn-danger { background: #ef4444; border-color: #ef4444; color: #ffffff; }
.btn-danger:hover { background: #dc3838; border-color: #dc3838; }

.btn-success { background: #16a34a; border-color: #16a34a; color: #ffffff; }
.btn-success:hover { background: #148f42; border-color: #148f42; }

.btn-ghost { background: transparent; border-color: transparent; color: #2f6fed; padding: 4px 6px; }
.btn-ghost:hover { background: #eef2f7; border-color: transparent; }

.btn-block { display: block; width: 100%; }
.btn-sm { padding: 4px 10px; font-size: 12px; line-height: 18px; border-radius: 6px; }
.btn-lg { padding: 12px 20px; font-size: 16px; line-height: 22px; }

/* ==========================================================================
   表单
   ========================================================================== */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #55607a;
}
.form-label .req { color: #ef4444; margin-left: 2px; }

.input, .select, .textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d5dce8;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    font-size: 14px;
    line-height: 20px;
    -webkit-appearance: none;
    appearance: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: #2f6fed; }
.input[disabled], .select[disabled] { background: #f2f4f8; color: #8a93a3; }
.textarea { min-height: 84px; resize: vertical; }
.select {
    background-image: none;
    padding-right: 12px;
}
.hint { margin-top: 5px; font-size: 12px; color: #8a93a3; line-height: 1.5; }
.hint-ok { color: #16a34a; }
.hint-err { color: #ef4444; }

/* 横向表单行（flex + float 回退）
   注意：宽度类必须带 .form-row 前缀，否则会被 .form-row .col 的 width:100% 覆盖 */
.form-row { margin: 0 -6px; }
.form-row .col {
    float: left;
    padding: 0 6px;
    width: 100%;
}
.form-row:after { content: ""; display: table; clear: both; }
.flex .form-row { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.flex .form-row .col { float: none; }
.form-row .col-2 { width: 50%; }
.form-row .col-3 { width: 33.3333%; }
.form-row .col-4 { width: 25%; }

.inline-fields { font-size: 0; }
.inline-fields > * { font-size: 14px; }
.flex .inline-fields { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-align-items: flex-end; -ms-flex-align: end; align-items: flex-end; }
.inline-fields .grow { -webkit-box-flex: 1; -webkit-flex: 1 1 auto; -ms-flex: 1 1 auto; flex: 1 1 auto; margin-right: 8px; }
.flex .inline-fields .grow { margin-bottom: 0; }
.no-flex .inline-fields .grow { display: inline-block; width: 68%; vertical-align: bottom; }

.inline-check { display: inline-block; margin-right: 16px; font-size: 13px; color: #55607a; cursor: pointer; }
.inline-check input { margin-right: 5px; vertical-align: middle; }

/* ==========================================================================
   卡片 / 布局
   ========================================================================== */
.page-card {
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    -webkit-box-shadow: 0 2px 10px rgba(31, 41, 55, .06);
    box-shadow: 0 2px 10px rgba(31, 41, 55, .06);
    padding: 20px;
}
.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    padding-bottom: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid #eef2f7;
}
.panel-title .sub { font-size: 12px; font-weight: 400; color: #8a93a3; margin-left: 8px; }
.section-desc { font-size: 13px; color: #8a93a3; margin-bottom: 14px; }

/* ==========================================================================
   登录页
   ========================================================================== */
.login-page {
    min-height: 100%;
    padding: 30px 14px 50px;
    background: #f4f7fb;
}
.login-box {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    -webkit-box-shadow: 0 6px 24px rgba(31, 41, 55, .08);
    box-shadow: 0 6px 24px rgba(31, 41, 55, .08);
    padding: 26px 22px 24px;
}
.login-brand { text-align: center; margin-bottom: 6px; }
.login-brand .logo-mark {
    display: inline-block;
    width: 46px;
    height: 46px;
    line-height: 46px;
    border-radius: 8px;
    background: #2f6fed;
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
}
.login-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 4px;
    word-break: break-all;
}
.login-sub { text-align: center; font-size: 12px; color: #8a93a3; margin-bottom: 16px; }

.announce {
    position: relative;
    background: #fff8e6;
    border: 1px solid #ffe2a8;
    border-radius: 8px;
    color: #8a5a00;
    font-size: 13px;
    padding: 10px 12px 10px 34px;
    margin-bottom: 16px;
    word-break: break-word;
}
.announce:before {
    content: "!";
    position: absolute;
    left: 10px;
    top: 10px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 50%;
    background: #f0a30a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

/* 选项卡 */
.tabs {
    font-size: 0;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 18px;
}
.flex .tabs { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; }
.tab {
    display: inline-block;
    font-size: 14px;
    color: #7b869c;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-right: 4px;
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
}
.flex .tab { -webkit-box-flex: 1; -webkit-flex: 1 1 auto; -ms-flex: 1 1 auto; flex: 1 1 auto; text-align: center; }
.tab.active { color: #2f6fed; border-bottom-color: #2f6fed; font-weight: 700; }
.tab[disabled] { opacity: .45; cursor: not-allowed; }

.pane { display: none; }
.pane.active { display: block; }

/* 卡密向导步骤 */
.step { margin-bottom: 16px; }
.step-head {
    font-size: 13px;
    color: #55607a;
    margin-bottom: 8px;
    font-weight: 700;
}
.step-head .step-no {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background: #e8eefb;
    color: #2f6fed;
    font-size: 11px;
    margin-right: 6px;
}
.step-body { padding-left: 0; }
.step-locked { opacity: .5; }

.card-verify-result { margin-top: 10px; font-size: 13px; }
.card-verify-ok { color: #16a34a; }
.card-verify-bad { color: #ef4444; }

.captcha-box {
    margin-top: 8px;
    padding: 10px;
    background: #f7f9fc;
    border: 1px dashed #d5dce8;
    border-radius: 8px;
}
.captcha-img {
    display: inline-block;
    vertical-align: middle;
    width: 120px;
    height: 40px;
    border: 1px solid #eef2f7;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
    cursor: pointer;
}
.captcha-img svg { display: block; width: 120px; height: 40px; }
.captcha-row { margin-top: 8px; }
.captcha-row .input { display: inline-block; width: 140px; vertical-align: middle; }
.captcha-row .input-captcha { width: 46px; }

/* ==========================================================================
   面板页
   ========================================================================== */
.topbar {
    position: relative;
    height: 54px;
    background: #ffffff;
    border-bottom: 1px solid #eef2f7;
    padding: 0 14px;
    z-index: 20;
    -webkit-box-shadow: 0 1px 4px rgba(31, 41, 55, .04);
    box-shadow: 0 1px 4px rgba(31, 41, 55, .04);
}
.flex .topbar { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-align-items: center; -ms-flex-align: center; align-items: center; }
.no-flex .topbar { line-height: 54px; }
.topbar:after { content: ""; display: table; clear: both; }

.topbar-brand {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    float: left;
    line-height: 54px;
    max-width: 40%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.flex .topbar-brand { float: none; -webkit-box-flex: 0; -webkit-flex: 0 1 auto; -ms-flex: 0 1 auto; flex: 0 1 auto; }
.topbar-brand .logo-dot {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    border-radius: 6px;
    background: #2f6fed;
    color: #ffffff;
    font-size: 12px;
    text-align: center;
    margin-right: 8px;
    vertical-align: middle;
}
.topbar-right {
    float: right;
    line-height: 54px;
    font-size: 13px;
    color: #55607a;
}
.flex .topbar-right {
    float: none;
    margin-left: auto;
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
}
.topbar-right .who { margin-right: 8px; }
.topbar-right .who-name { color: #1f2937; font-weight: 700; }

/* 身份标签 */
.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 18px;
    vertical-align: middle;
    white-space: nowrap;
}
.badge-admin { background: #fde8e8; color: #c62828; }
.badge-sub { background: #fff0dd; color: #b26a00; }
.badge-svip { background: #e6f0ff; color: #2f6fed; }
.badge-user { background: #eef2f7; color: #55607a; }
.badge-ok { background: #e6f7ec; color: #16a34a; }
.badge-off { background: #eef2f7; color: #8a93a3; }
.badge-danger { background: #fde8e8; color: #ef4444; }
.badge-warn { background: #fff7e6; color: #b26a00; }

/* 管理员查看视角横幅 */
#view-banner {
    padding: 10px 14px;
    font-size: 13px;
    color: #ffffff;
}
#view-banner:after { content: ""; display: table; clear: both; }
#view-banner .vb-text { float: left; padding-top: 3px; }
#view-banner .vb-text:before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: #ffffff;
    vertical-align: 1px;
}
#view-banner .vb-action { float: right; }
.banner-admin { background: #ef4444; }
.banner-sub { background: #f59e0b; }
.vb-action .btn { background: rgba(255, 255, 255, .92); border-color: transparent; color: #1f2937; }

/* 主体：左侧深色侧栏 + 内容区 */
.panel-body { min-height: 300px; }
.panel-body:after { content: ""; display: table; clear: both; }
.sidebar {
    width: 190px;
    background: #1f2937;
    color: #ffffff;
    float: left;
    min-height: 100%;
}
.flex .panel-body { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-align-items: stretch; -ms-flex-align: stretch; align-items: stretch; }
.flex .sidebar { float: none; -webkit-box-flex: 0; -webkit-flex: 0 0 190px; -ms-flex: 0 0 190px; flex: 0 0 190px; }
.no-flex .sidebar { min-height: 600px; }

.side { padding: 8px 0; }
.flex .side { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; }
.side-group {
    padding: 12px 16px 4px;
    font-size: 11px;
    letter-spacing: 1px;
    color: #7b869c;
    text-transform: uppercase;
}
.side-item {
    display: block;
    padding: 11px 16px;
    font-size: 14px;
    color: #cdd5e0;
    cursor: pointer;
    border-left: 3px solid transparent;
    -webkit-user-select: none;
    user-select: none;
}
.side-item:hover { background: #2a3546; color: #ffffff; }
.side-item.active { background: #2f6fed; color: #ffffff; border-left-color: #8fb4ff; }
.side-item .ico { margin-right: 8px; font-size: 14px; }

.main {
    padding: 18px;
    float: right;
    width: 100%;
    margin-left: -190px;
    padding-left: 208px;
}
.flex .main {
    float: none;
    width: auto;
    margin-left: 0;
    padding-left: 18px;
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 auto;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
}

.section { display: none; }
.section.active { display: block; }

/* 统计块 */
.stat-grid { margin: 0 -6px; }
.stat-grid:after { content: ""; display: table; clear: both; }
.flex .stat-grid { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.stat {
    float: left;
    width: 25%;
    padding: 0 6px 12px;
}
.flex .stat { float: none; -webkit-box-flex: 0; -webkit-flex: 0 0 25%; -ms-flex: 0 0 25%; flex: 0 0 25%; }
.stat-inner {
    background: #f7f9fc;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.stat-num { font-size: 20px; font-weight: 700; color: #2f6fed; line-height: 1.3; word-break: break-all; }
.stat-key { font-size: 12px; color: #8a93a3; margin-top: 2px; }

/* 键值展示 */
.kv-list { border: 1px solid #eef2f7; border-radius: 8px; overflow: hidden; }
.kv {
    font-size: 13px;
    border-bottom: 1px solid #eef2f7;
    padding: 10px 12px;
}
.kv:last-child { border-bottom: 0; }
.flex .kv { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; }
.kv-k {
    color: #8a93a3;
    width: 110px;
    float: left;
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 110px;
    -ms-flex: 0 0 110px;
    flex: 0 0 110px;
}
.flex .kv-k { float: none; }
.kv-v { color: #1f2937; word-break: break-all; float: none; }
.flex .kv-v { -webkit-box-flex: 1; -webkit-flex: 1 1 auto; -ms-flex: 1 1 auto; flex: 1 1 auto; min-width: 0; }
.no-flex .kv { padding-left: 122px; position: relative; }
.no-flex .kv .kv-k { position: absolute; left: 12px; top: 10px; }

/* 专属 Key 展示条 */
.key-box {
    margin-top: 4px;
    background: #f7f9fc;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 10px 12px;
}
.key-text {
    display: inline-block;
    vertical-align: middle;
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 13px;
    color: #1f2937;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 6px;
    padding: 4px 8px;
    max-width: 100%;
    word-break: break-all;
    margin-right: 8px;
    margin-bottom: 4px;
}

/* ==========================================================================
   表格
   ========================================================================== */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #eef2f7;
    border-radius: 8px;
}
.table { width: 100%; min-width: 720px; font-size: 13px; background: #ffffff; }
.table th, .table td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid #eef2f7;
    white-space: nowrap;
    vertical-align: middle;
}
.table thead th {
    background: #f7f9fc;
    color: #55607a;
    font-weight: 700;
    font-size: 12px;
}
.table tbody tr:nth-child(even) { background: #fafcfe; }
.table tbody tr:hover { background: #f2f7ff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-key {
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 12px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table .ops { white-space: normal; }
.table .ops .btn { margin: 2px 4px 2px 0; }

.empty {
    padding: 26px 10px;
    text-align: center;
    color: #8a93a3;
    font-size: 13px;
}
.loading {
    padding: 26px 10px;
    text-align: center;
    color: #8a93a3;
    font-size: 13px;
}
.loading .spin {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    border: 2px solid #d5dce8;
    border-top-color: #2f6fed;
    border-radius: 50%;
    vertical-align: -2px;
    -webkit-animation: lm-spin .8s linear infinite;
    animation: lm-spin .8s linear infinite;
}
@-webkit-keyframes lm-spin { to { -webkit-transform: rotate(360deg); } }
@keyframes lm-spin { to { transform: rotate(360deg); } }

/* 列表工具栏 */
.toolbar { margin-bottom: 12px; }
.toolbar:after { content: ""; display: table; clear: both; }
.flex .toolbar { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.toolbar .tb-item { margin: 0 8px 8px 0; float: left; }
.flex .toolbar .tb-item { float: none; }
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; display: inline-block; }

/* 操作结果提示区 */
.result-box {
    margin-top: 12px;
    border: 1px solid #cfe0ff;
    background: #f2f7ff;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #25509f;
    word-break: break-all;
}
.result-box .rk {
    font-family: Menlo, Consolas, "Courier New", monospace;
    background: #ffffff;
    border: 1px solid #dbe6fb;
    border-radius: 6px;
    padding: 3px 7px;
    display: inline-block;
    margin: 3px 6px 3px 0;
}

/* 功能勾选区 */
.feature-cols { margin: 0 -8px; }
.feature-cols:after { content: ""; display: table; clear: both; }
.flex .feature-cols { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.feature-col { float: left; width: 50%; padding: 0 8px 12px; }
.flex .feature-col { float: none; -webkit-box-flex: 0; -webkit-flex: 1 1 300px; -ms-flex: 1 1 300px; flex: 1 1 300px; }
.feature-col-title { font-size: 13px; font-weight: 700; color: #55607a; margin-bottom: 8px; }
.feature-item {
    display: block;
    padding: 7px 10px;
    border: 1px solid #eef2f7;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 13px;
    cursor: pointer;
    background: #ffffff;
}
.feature-item:hover { border-color: #c9d6ee; }
.feature-item input { margin-right: 8px; vertical-align: middle; }
.feature-item.disabled { background: #f5f6f8; color: #a0a8b6; cursor: not-allowed; }
.feature-item .soon {
    float: right;
    font-size: 11px;
    color: #b26a00;
    background: #fff7e6;
    border-radius: 8px;
    padding: 0 6px;
}

/* 子面板（带标题的分组框） */
.subpanel {
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    background: #ffffff;
}
.subpanel-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}
.danger-zone { border-color: #f5c2c2; background: #fffafa; }
.danger-zone .subpanel-title { color: #ef4444; }

/* ==========================================================================
   Toast 提示
   ========================================================================== */
.toast-box {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 9999;
    width: 290px;
    max-width: 86%;
}
.toast {
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-left: 4px solid #2f6fed;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: #1f2937;
    margin-bottom: 8px;
    word-break: break-word;
    -webkit-box-shadow: 0 4px 16px rgba(31, 41, 55, .14);
    box-shadow: 0 4px 16px rgba(31, 41, 55, .14);
    opacity: 1;
    -webkit-transition: opacity .3s, -webkit-transform .3s;
    transition: opacity .3s, transform .3s;
}
.toast-success { border-left-color: #16a34a; }
.toast-error { border-left-color: #ef4444; }
.toast-warn { border-left-color: #f59e0b; }
.toast-info { border-left-color: #2f6fed; }
.toast-hide { opacity: 0; -webkit-transform: translateX(14px); transform: translateX(14px); }

/* ==========================================================================
   移动端（<768px）
   ========================================================================== */
@media screen and (max-width: 767px) {
    .main { padding: 12px; padding-left: 12px; }
    .flex .main { padding-left: 12px; }
    .panel-body, .flex .panel-body { -webkit-box-orient: vertical; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; }
    .no-flex .panel-body { display: block; }
    .sidebar, .flex .sidebar {
        width: 100%;
        float: none;
        -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        min-height: 0;
    }
    .no-flex .sidebar { min-height: 0; }
    .side, .flex .side {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding: 0;
        -webkit-box-orient: horizontal;
        -webkit-flex-direction: row;
        -ms-flex-direction: row;
        flex-direction: row;
        font-size: 0;
    }
    .no-flex .side { font-size: 0; }
    .side-group { display: none; }
    .side-item {
        display: inline-block;
        font-size: 13px;
        padding: 12px 14px;
        border-left: 0;
        border-bottom: 3px solid transparent;
        -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
    }
    .side-item.active { border-left-color: transparent; border-bottom-color: #8fb4ff; }
    .side-item .ico { margin-right: 4px; }

    .stat, .flex .stat { width: 50%; -webkit-flex: 0 0 50%; -ms-flex: 0 0 50%; flex: 0 0 50%; }
    .form-row .col-2, .form-row .col-3, .form-row .col-4 { width: 100%; }
    .feature-col { width: 100%; }
    .kv-k, .flex .kv-k { -webkit-flex: 0 0 88px; -ms-flex: 0 0 88px; flex: 0 0 88px; width: 88px; }
    .no-flex .kv { padding-left: 100px; }
    .topbar-brand { max-width: 42%; font-size: 14px; }
    .topbar-right .who { display: none; }
    .topbar-right .who-name { display: none; }
    .login-box { padding: 20px 16px; }
    .toast-box { width: auto; left: 14px; right: 14px; }
    #view-banner .vb-text { float: none; }
    #view-banner .vb-action { float: none; margin-top: 8px; }

    /* 设备管理 */
    .dev-help-label { display: block; width: auto; margin-bottom: 6px; }
    .cmd-pager { text-align: left; }
    .cmd-pager .cmd-page-info { display: block; margin-bottom: 8px; }
    .modal-mask { padding: 12px; }
    .modal { margin: 12px auto; }
    .modal-body { max-height: 68vh; }
}

/* ==========================================================================
   设备管理
   ========================================================================== */
/* 接入说明卡 */
.dev-help {
    border: 1px solid #eef2f7;
    border-radius: 8px;
    background: #f7f9fc;
    padding: 14px;
}
.dev-help-title { font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 10px; }
.dev-help-row { margin-bottom: 10px; font-size: 13px; }
.dev-help-row:last-child { margin-bottom: 0; }
.dev-help-label {
    display: inline-block;
    width: 100px;
    color: #55607a;
    vertical-align: middle;
    margin-right: 8px;
}
.dev-help-row .hint { display: inline; margin-left: 6px; }
.dev-help .key-box { margin-top: 6px; background: #ffffff; }

/* 命令行示例 */
.cmd-code {
    display: block;
    margin: 6px 0 0;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 6px;
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #1f2937;
    white-space: pre;
    overflow-x: auto;
}

/* 在线状态点 */
.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 50%;
    vertical-align: middle;
}
.dot-on { background: #16a34a; -webkit-box-shadow: 0 0 0 2px #e6f7ec; box-shadow: 0 0 0 2px #e6f7ec; }
.dot-off { background: #c4ccd8; }

.dev-sub { font-size: 11px; color: #8a93a3; margin-top: 2px; }
.cell-cmd {
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 12px;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 命令输出弹窗 */
.cmd-inline {
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 12px;
    color: #1f2937;
    word-break: break-all;
}
.cmd-output {
    margin: 0;
    padding: 12px;
    background: #1f2937;
    color: #e6edf3;
    border-radius: 8px;
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 52vh;
    overflow: auto;
}

/* 命令记录分页 */
.cmd-pager { margin-top: 10px; text-align: right; }
.cmd-pager .cmd-page-info { margin-right: 10px; font-size: 12px; color: #8a93a3; }
.cmd-pager .btn { margin-left: 6px; }

/* 设备一键部署卡 */
.dep-actions { margin-bottom: 4px; }
.dep-actions .btn { margin: 0 8px 8px 0; }
.dep-zone {
    border: 1px solid #dbe6fb;
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
}
.dep-zone-title { font-size: 13px; font-weight: 700; color: #55607a; margin-bottom: 8px; }
.dep-cmd-row { margin-bottom: 10px; }
.dep-cmd-row .cmd-code { margin-bottom: 6px; }
.dep-alt-label { font-size: 12px; color: #8a93a3; margin: 2px 0; }
.dep-meta { font-size: 13px; color: #55607a; margin: 4px 0; line-height: 2; }
.dep-meta > span { margin-right: 14px; white-space: nowrap; }
.dep-meta b { color: #1f2937; }
.dep-meta .btn { margin-left: 4px; }
.dep-dl-row { margin-bottom: 6px; }
.dep-dl-label { font-size: 13px; color: #55607a; margin-right: 4px; }
#dep-dl-arch { min-width: 220px; margin-right: 8px; }
#dep-dl-link.btn-disabled { opacity: .5; cursor: not-allowed; }
.dep-key-row { margin-top: 12px; }
.dep-tpl-form { margin-top: 12px; }

@media screen and (max-width: 767px) {
    .dep-meta > span { display: inline-block; margin-right: 10px; }
    .dep-meta .btn { margin-left: 0; margin-right: 6px; }
    #dep-dl-arch { min-width: 0; width: auto; max-width: 60%; }
}

/* 弹窗 */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: rgba(31, 41, 55, .5);
    padding: 24px 14px;
    overflow: auto;
}
.flex .modal-mask {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: flex-start;
}
.modal {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 40px auto;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    -webkit-box-shadow: 0 10px 40px rgba(31, 41, 55, .3);
    box-shadow: 0 10px 40px rgba(31, 41, 55, .3);
    overflow: hidden;
}
.modal-head { position: relative; padding: 12px 46px 12px 16px; border-bottom: 1px solid #eef2f7; }
.modal-title { font-size: 15px; font-weight: 700; color: #1f2937; }
.modal-close {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 30px;
    height: 30px;
    line-height: 28px;
    text-align: center;
    font-size: 20px;
    color: #8a93a3;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
}
.modal-close:hover { background: #f2f5fa; color: #1f2937; }
.modal-body { padding: 14px 16px; max-height: 64vh; overflow: auto; }
.modal-foot { padding: 10px 16px; border-top: 1px solid #eef2f7; text-align: right; }
.modal-foot .btn { margin-left: 8px; }

/* ============ 专属客户端（按用户真编译，P3） ============ */
.bld-disk { font-size: 13px; color: #55607a; font-weight: 700; }
.bld-tc-err { color: #ef4444; }
.bld-row-stale td { background: #fff7f7; }

/* ============ 插件管理（P6） ============ */
.plg-zone-title { font-size: 13px; font-weight: 700; color: #55607a; margin-bottom: 8px; }
.plg-admin-zone {
    border: 1px solid #eef2f7;
    background: #fafbfd;
    border-radius: 8px;
    padding: 12px;
}
.plg-form { margin-bottom: 4px; }

/* 服务器插件库卡片 */
.plg-card {
    border: 1px solid #e6ecf5;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.plg-card-off { opacity: .75; background: #fafbfd; }
.plg-card-head { line-height: 22px; }
.plg-card-head .badge { margin-left: 8px; }
.plg-name { font-size: 14px; font-weight: 700; color: #1f2937; }
.plg-ver { font-size: 12px; color: #8a93a3; margin: 0 8px; }
.plg-pid { font-size: 11px; color: #8a93a3; margin-left: 8px; font-family: Menlo, Consolas, "Courier New", monospace; }
.plg-desc { font-size: 12px; color: #55607a; margin-top: 4px; line-height: 1.6; }
.plg-meta { font-size: 12px; color: #8a93a3; margin-top: 6px; line-height: 1.9; }
.plg-meta > span { margin-right: 14px; white-space: nowrap; }
.plg-card-ops { margin-top: 8px; }
.plg-card-ops .btn { margin-right: 8px; }

/* 已安装插件行 */
.plg-inst-row {
    display: block;
    border: 1px solid #e6ecf5;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.flex .plg-inst-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
}
.no-flex .plg-inst-row:after { content: ""; display: table; clear: both; }
.no-flex .plg-inst-ops { float: right; line-height: 30px; }
.plg-inst-ops .btn { margin-left: 8px; }
.plg-inst-row .badge .spin-sm {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid #c4ccd8;
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: -1px;
    -webkit-animation: lm-spin 1s linear infinite;
    animation: lm-spin 1s linear infinite;
}

/* 插件界面层（弹层内 renderer 容器） */
.modal-plg { max-width: 860px; }
.plg-ui-loading {
    position: absolute;
    left: 16px;
    top: 15px;
    font-size: 12px;
    color: #8a93a3;
}
.plg-ui-loading .spin {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #dbe6fb;
    border-top-color: #2f6fed;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: -2px;
    -webkit-animation: lm-spin 1s linear infinite;
    animation: lm-spin 1s linear infinite;
}
.plg-ui-loading em { font-style: normal; }
.plg-ui-frame {
    display: block;
    width: 100%;
    height: 58vh;
    min-height: 320px;
    border: 1px solid #eef2f7;
    border-radius: 6px;
    background: #ffffff;
}
/* 设备专属插件页面（非弹窗） */
.plg-page-body {
    margin-top: 14px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 8px;
}
.plg-page-body .plg-ui-frame { height: 72vh; }
.dev-plugin-view .dev-detail-bar { flex-wrap: wrap; }
#dev-plugin-view .plg-ui-loading { margin-left: 8px; }
.plg-ui { font-size: 13px; }
.pu-block { margin-bottom: 14px; }
.pu-block-title { font-size: 13px; font-weight: 700; color: #55607a; margin-bottom: 8px; }
.pu-block-title .btn { margin-left: 8px; }
.pu-divider { border: 0; border-top: 1px solid #eef2f7; margin: 14px 0; }
.pu-btn-bar .btn { margin: 0 8px 8px 0; }
.pu-search { margin-bottom: 12px; }
.pu-search .input { width: 60%; margin-right: 8px; }
.pu-log {
    margin: 0;
    padding: 12px;
    background: #1f2937;
    color: #e6edf3;
    border-radius: 8px;
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 220px;
    overflow: auto;
}
.pu-progress-head { margin-bottom: 6px; font-size: 12px; color: #55607a; }
.pu-progress-pct { float: right; font-weight: 700; color: #1f2937; }
.pu-progress-track {
    height: 10px;
    background: #eef2f7;
    border-radius: 5px;
    overflow: hidden;
}
.pu-progress-fill {
    height: 100%;
    width: 0;
    background: #2f6fed;
    border-radius: 5px;
    -webkit-transition: width .3s;
    transition: width .3s;
}
.pu-stats .stat-inner { min-width: 140px; }
.pu-range-row .input[type="range"] { width: 70%; vertical-align: middle; }
.pu-range-val { margin-left: 10px; color: #2f6fed; }
.pu-radio-group .inline-check { margin-right: 14px; }
.pu-toggle-track { display: none; }

/* tab_group */
.pu-tab-head { border-bottom: 1px solid #eef2f7; margin-bottom: 12px; }
.pu-tab-btn {
    display: inline-block;
    padding: 8px 14px;
    margin-right: 4px;
    font-size: 13px;
    color: #55607a;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
.pu-tab-btn:hover { color: #2f6fed; }
.pu-tab-btn.active { color: #2f6fed; border-bottom-color: #2f6fed; font-weight: 700; }
.pu-tab-pane:after { content: ""; display: table; clear: both; }

@media screen and (max-width: 767px) {
    .pu-search .input { width: 100%; margin-bottom: 8px; }
}

/* 单设备详情视图 */
.dev-detail-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.dev-detail-title { font-size: 15px; font-weight: 700; color: #1f2937; }
.dev-detail-card {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 14px 16px;
}
.dev-detail-ops { display: flex; flex-wrap: wrap; gap: 8px; }
#grp-dev-list .table td:first-child { text-align: center; }
/* 登录页文字链接（忘记密码 / 返回登录） */
.link { color: #2f6fed; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ==========================================================================
   设备卡片网格（单设备管理列表）
   ========================================================================== */
.dev-grid {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 0 -8px;
}
.dev-card {
    position: relative;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    width: 33.333%;
    padding: 0 8px 16px;
    cursor: pointer;
}
.dev-card-inner, .dev-card { }
.dev-card-top {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e9ecf0;
    border-radius: 14px 14px 0 0;
    padding: 16px 16px 10px;
    -webkit-transition: border-color .15s;
    transition: border-color .15s;
}
.dev-card:hover .dev-card-top { border-color: #c7d2fe; }
.dev-card:hover .dev-card-foot { border-color: #c7d2fe; }
.dev-card-id { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-align-items: center; align-items: center; min-width: 0; }
.dev-card-ico {
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-right: 12px;
    border-radius: 12px;
    background: #eef2ff;
    text-align: center;
    line-height: 44px;
    font-size: 20px;
}
.dev-card-meta { min-width: 0; }
.dev-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.dev-card-sn {
    font-family: Menlo, Consolas, "Courier New", monospace;
    font-size: 12px;
    color: #8a93a3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.dev-card-ops { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-flex-shrink: 0; flex-shrink: 0; }
.icon-btn {
    width: 30px;
    height: 30px;
    margin-left: 4px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8a93a3;
    font-size: 14px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    -webkit-transition: background .15s, color .15s;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: #f1f4f9; color: #2563eb; }
.icon-btn.danger:hover { background: #fdecec; color: #ef4444; }
.dev-card-foot {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-align-items: center;
    align-items: center;
    background: #fbfcfe;
    border: 1px solid #e9ecf0;
    border-top: 0;
    border-radius: 0 0 14px 14px;
    padding: 8px 16px;
    font-size: 12px;
    color: #55607a;
}
.dev-card-foot .dot { margin-right: 5px; }
.dev-card-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 8px;
    background: #eef2f7;
    color: #55607a;
    font-size: 11px;
}
.dev-card-time { margin-left: auto; color: #98a1af; }
@media (max-width: 900px) { .dev-card { width: 50%; } }
@media (max-width: 600px) { .dev-card { width: 100%; } }
