/* ==========================================================================
   现有页面外观覆盖 —— 把 web/js/pages/* 用的旧类名映射到原版视觉
   目的：不重写 JS 逻辑，只换皮。原版实测值见 replica.css / replica_devices.css
   ========================================================================== */

/* ---------- 先把 app.css 的深色主题变量换成原版的亮色 ----------
   app.css 是深色终端风格（--bg:#0d1117），原版是浅灰亮色。
   选用 html:root 提高优先级，确保压过 app.css 里的 :root。 */
html:root {
    --bg: #f5f5f5;
    --bg-2: #ffffff;
    --bg-3: #fafafa;
    --border: #e4e4e7;
    --border-2: #d4d4d8;
    --fg: #1e2329;
    --fg-2: #71717a;
    --fg-3: #a1a1aa;
    --accent: #0958d9;
    --accent-2: #006fee;
    --ok: #22c55e;
    --warn: #f59e0b;
    --danger: #e33b54;
}

/* ---------- 统计条（原版是彩色 pill，不是白卡片） ---------- */
.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.stat.card {
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    box-shadow: none;
}

.stat.card .k {
    font-size: 13px;
    color: #1d4ed8;
    white-space: nowrap;
}

.stat.card .v {
    font-size: 13px;
    font-weight: 600;
    color: #1d4ed8;
    margin-top: 0;
    white-space: nowrap;
}

.stat.card .v.ok { color: #15803d; }
.stat.card .v.muted { color: #a1a1aa; }

/* 第二/三个 pill 换色，贴近原版多彩效果 */
.stat.card:nth-child(2) {
    background: #f0fdf4;
    border-color: #dcfce7;
}
.stat.card:nth-child(2) .k,
.stat.card:nth-child(2) .v { color: #15803d; }

.stat.card:nth-child(3) {
    background: #fdf2f8;
    border-color: #fce7f3;
}
.stat.card:nth-child(3) .k,
.stat.card:nth-child(3) .v { color: #be185d; }

.stat.card:nth-child(4) {
    background: #f5f3ff;
    border-color: #ede9fe;
}
.stat.card:nth-child(4) .k,
.stat.card:nth-child(4) .v { color: #6d28d9; }

.stat.card:nth-child(5) {
    background: #fffbeb;
    border-color: #fef3c7;
}
.stat.card:nth-child(5) .k,
.stat.card:nth-child(5) .v { color: #b45309; }

.stat.card:nth-child(6) {
    background: #ecfeff;
    border-color: #cffafe;
}
.stat.card:nth-child(6) .k,
.stat.card:nth-child(6) .v { color: #0e7490; }

/* ---------- 筛选区（原版：白色卡片容器 + 字段等宽 + 按钮右对齐） ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
}

/* 字段宽度自适应：一行放得下 4-6 个，不出现孤零零的空档 */
/* 设备列表有 5 个筛选 + 3 个按钮，基准压到 118px 才排得进一行 */
.filters .f {
    flex: 0 1 118px;
    min-width: 96px;
}

.filters .f.grow {
    flex: 1 1 220px;
}

/* 搜索/重置按钮固定在右端，与最后一个字段底部对齐 */
.filters .actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
    height: 40px;
}

.filters .f label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

.filters input,
.filters select,
.form-input,
.form-select {
    height: 40px;
    padding: 0 14px;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    background: #fafafa;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.filters input:focus,
.filters select:focus,
.form-input:focus,
.form-select:focus {
    border-color: var(--color-primary);
    background: #fff;
}

/* ---------- 按钮 ---------- */
.btn,
button.btn,
.btn-sm,
.btn-xs {
    height: 40px;
    padding: 0 16px;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    background: #fff !important;
    color: #1e2329 !important;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s;
}

.btn:hover, .btn-sm:hover, .btn-xs:hover { background: #f4f4f5 !important; }

.btn.primary,
.btn-sm.primary,
.btn-xs.primary {
    background: #006fee !important;
    border-color: #006fee !important;
    color: #fff !important;
}

.btn.primary:hover,
.btn-sm.primary:hover,
.btn-xs.primary:hover { background: #0060d0 !important; }

/* app.css 的 .btn-xs 是深色小块（#21262d），必须覆盖 */
.btn-sm, .btn-xs {
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 8px;
}

/* 危险按钮（删除） */
.btn-xs.danger,
.btn-sm.danger,
.btn.danger,
.btn-xs.dangerous {
    background: #fff !important;
    border-color: #fecaca !important;
    color: #be123c !important;
}

.btn-xs.danger:hover,
.btn-sm.danger:hover,
.btn-xs.dangerous:hover { background: #fef2f2 !important; }

/* 操作列按钮带轻阴影（原版 B包/B加固/编辑/详情 均有此效果） */
.btn-xs,
.btn-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.btn-xs:hover:not(:disabled),
.btn-sm:hover:not(:disabled) {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
    transform: translateY(-1px);
    transition: box-shadow 0.15s, transform 0.15s;
}
.btn-xs:active:not(:disabled),
.btn-sm:active:not(:disabled) {
    box-shadow: none;
    transform: translateY(0);
}

/* 表格内的操作按钮组 */
.row-actions,
td .row-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

/* 标签名单元格：图标/文字保持深色 */
.tag-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1e2329;
    font-weight: 500;
}

/* 标签名文字：app.css 里 .tag-name-text 用了 var(--fg)，
   但变量覆盖被更具体的选择器挡住，这里直接给颜色 */
.tag-name-text,
.tag-name-cell .tag-name-text {
    color: #1e2329 !important;
    font-weight: 500;
    font-size: 13px;
}

/* 标签颜色点 */
.tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    flex-shrink: 0;
    display: inline-block;
}

/* ---------- 表格 ----------
   app.css 里有 .data-table th { background:#161b22 }（深色），
   class + 元素的选择器优先级高于 table thead th，
   所以这里用 .data-table thead th / table.data-table thead th 提高优先级。 */
table,
table.data-table,
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e4e4e7;
    color: #1e2329;
    table-layout: auto;
}

/* 表格容器允许横向滚动，而不是把内容裁掉 */
.table-scroll,
.list-scroll,
.panel-body {
    overflow-x: auto;
    background: transparent;
}

table thead th,
table.data-table thead th,
.data-table thead th {
    background: #fafafa !important;
    height: 40px;
    padding: 1px 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e2329 !important;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #f5f5f5 !important;
    position: sticky;
    top: 0;
    z-index: 2;
}

table tbody td,
table.data-table tbody td,
.data-table tbody td {
    padding: 8px 12px !important;
    border-bottom: 1px solid #f5f5f5 !important;
    vertical-align: middle;
    color: #1e2329 !important;
    background: #fff;
    font-size: 13px !important;
}

table tbody tr,
.data-table tbody tr {
    height: 56px;
    transition: background-color 0.12s;
}

/* app.css 里这里硬编码了 #1a2029（深色），必须覆盖 */
table tbody tr:hover,
table tbody tr:hover td,
.data-table tbody tr:hover,
.data-table tbody tr:hover td { background: #fafafa !important; }

table tbody tr:last-child td,
.data-table tbody tr:last-child td { border-bottom: none !important; }

table .num {
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, monospace;
    font-size: 13px;
}

table .dim { color: #a1a1aa; }

/* 链接型 device_id */
table a { color: #0958d9; text-decoration: none; }
table a:hover { text-decoration: underline; }

/* ---------- 分页 ---------- */
.pager {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.pager button {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    color: #1e2329;
    font-family: inherit;
}

.pager button:hover:not(:disabled) { background: #f4f4f5; }
.pager button:disabled { color: #d4d4d8; cursor: not-allowed; }

.pager button.on,
.pager button.active {
    background: #7c3aed;
    color: #fff;
    font-weight: 500;
}

/* app.css 里 pager 的 input / select 用了深色底，必须覆盖 */
.pager input,
.pager select,
.pager-jump input {
    background: #fff !important;
    color: #1e2329 !important;
    border: 1px solid #e4e4e7 !important;
    border-radius: 8px !important;
    height: 32px;
    padding: 0 8px;
    font-size: 14px;
    font-family: inherit;
}

/* ---------- 通用小件 ---------- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px;
    background: #f4f4f5;
    color: #1e2329;
    white-space: nowrap;
    border: none;
}

.chip.ok, .chip-success { background: #f0fdf4; color: #15803d; border: none; }
.chip.warn, .chip-warning { background: #fffbeb; color: #b45309; border: none; }
.chip.err, .chip-danger { background: #fef2f2; color: #be123c; border: 1px solid #fecaca; }
.chip.muted, .chip-dim { background: transparent; color: #71717a; border: none; }

/* 电量：原版是数字 + 电量条，不是胶囊 */
.chip.chip-danger:has(+ .sub),
.cell-stack .chip {
    background: transparent;
    border: none;
    padding: 0;
    height: auto;
    font-size: 15px;
    font-weight: 600;
    color: #1e2329;
}

/* 单元格堆叠：上行主值、下行副值 */
.cell-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.25;
}

.cell-stack .sub,
.cell-stack .cell-sub {
    font-size: 12px;
    color: #a1a1aa;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #d4d4d8;
    display: inline-block;
    flex-shrink: 0;
}

.dot.on { background: #22c55e; }

.muted { color: var(--text-secondary); }
.spacer { flex: 1; }

/* ---------- 页面标题（原版内页没有大标题，只有内容区） ---------- */
/* app.css 的 .panel-title 是深色面板标题，这里改成原版的轻标题行 */
.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
    padding: 0;
    background: transparent;
    border: none;
    height: auto;
}

/* 卡片容器：保留白底 + 细边框（与侧边栏、顶栏同一套视觉） */
.card {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* 筛选卡片自己已有内边距，不再叠加 */
.filters.card {
    padding: 14px 16px;
}

/* 表格卡片内部不重复描边 */
.table-card {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    overflow: hidden;
}

.filters-bare { justify-content: flex-end; }

.filters .actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* 列表容器 */
.panel,
.list-wrap,
.page-host { background: transparent; }

/* 弹窗（对齐原版圆角与阴影） */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
    max-width: 560px;
    width: calc(100% - 48px);
    max-height: calc(100vh - 96px);
    overflow: auto;
}

.modal-box .modal-head {
    padding: 20px 24px 12px;
    font-size: 17px;
    font-weight: 600;
}

.modal-box .modal-body { padding: 0 24px 16px; }
.modal-box .modal-foot {
    padding: 12px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 表单 */
.form-body { display: flex; flex-direction: column; gap: 14px; }

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row label {
    font-size: 13px;
    color: #3f3f46;
    font-weight: 500;
}

.btn-row { display: flex; gap: 10px; justify-content: flex-end; }

/* toast */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 10px;
    background: #18181b;
    color: #fff;
    font-size: 14px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.toast.ok { background: #15803d; }
.toast.err { background: #be123c; }

/* 空态 */
.table-empty {
    padding: 40px 20px;
    text-align: center;
    color: #a1a1aa;
    font-size: 14px;
}

.table-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.table-empty-text {
    color: #a1a1aa;
    font-size: 14px;
}

/* ---------- 编译打包 — 编辑弹窗图标/背景图预览 ---------- */
.order-preview-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.order-preview-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.order-icon-lg {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #e4e4e7;
    background: #f4f4f5;
}
.order-icon-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: #f4f4f5;
    border: 1px dashed #d4d4d8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #a1a1aa;
}
.order-bg-preview {
    width: 120px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e4e4e7;
    background: #f4f4f5;
}
.order-bg-placeholder {
    width: 120px;
    height: 72px;
    border-radius: 8px;
    background: #f4f4f5;
    border: 1px dashed #d4d4d8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #a1a1aa;
}


/* =====================================================================
   设备列表 — 屏幕状态列三种状态（亮屏/息屏/黑屏）
   ===================================================================== */
.screen-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
}
.screen-chip--on {
    color: #15803d;
    background: transparent;
}
.screen-chip--on .screen-chip__icon { font-size: 14px; }
.screen-chip--on .screen-chip__text { color: #15803d; font-weight: 500; }

.screen-chip--sleep {
    background: transparent;
}
.screen-chip--sleep .screen-chip__icon { font-size: 14px; }
.screen-chip--sleep .screen-chip__text { color: #a1a1aa; }

.screen-chip--off {
    background: #27272a;
    border-radius: 8px;
    padding: 3px 10px;
}
.screen-chip--off .screen-chip__icon { color: #71717a; font-size: 12px; }
.screen-chip--off .screen-chip__text { color: #a1a1aa; }

/* =====================================================================
   终端页 — Android 版本 pill（顶栏品牌信息旁）
   ===================================================================== */
.term-identity__android-pill {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    background: #166534;
    color: #bbf7d0;
    font-size: 11px;
    font-weight: 500;
    margin-top: 2px;
    white-space: nowrap;
}
.term-identity__android-pill:empty { display: none; }

/* =====================================================================
   终端页 — 锁屏验证状态按钮（动态红/绿）
   ===================================================================== */
.term-action-btn--keyguard {
    background: #be123c;
    color: #fff;
    border-color: #be123c;
}
.term-action-btn--keyguard:hover { background: #9f1239; border-color: #9f1239; }
.term-action-btn--keyguard.unlocked {
    background: #15803d;
    border-color: #15803d;
}
.term-action-btn--keyguard.unlocked:hover { background: #166534; border-color: #166534; }

/* =====================================================================
   终端页 — 静音/震动权限警告文本（橙色，对齐原版）
   ===================================================================== */
#term-mute-warn {
    color: #f97316;
    font-size: 12px;
    padding: 4px 0 2px;
    line-height: 1.4;
}

/* =====================================================================
   设备列表 — 快捷时间段筛选器宽度
   ===================================================================== */
.f--quick-range { min-width: 120px; }

/* =====================================================================
   管理员页 — 指定IP登录列图标按钮
   ===================================================================== */
.ip-cell {
    display: grid;
    grid-template-columns: 1fr 26px;
    gap: 8px;
    align-items: center;
}
.ip-text {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    word-break: break-all;
}
.ip-edit-icon {
    font-size: 22px;
    color: #006fee;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ip-edit-icon:hover { color: #0958d9; }

/* =====================================================================
   网络质量弹窗 — 详情 + 详细诊断 accordion
   ===================================================================== */
.net-modal-body {
    padding: 4px 0;
}
.net-modal-subtitle {
    font-size: 12px;
    color: #71717a;
    margin-bottom: 8px;
}
.net-modal-grade {
    font-size: 18px;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 12px;
}
.net-modal-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f4f4f5;
    flex-wrap: wrap;
}
.net-modal-row__label {
    flex: 1;
    font-size: 13px;
    color: #3f3f46;
    min-width: 100px;
}
.net-modal-row__sub {
    font-size: 11px;
    color: #a1a1aa;
    margin-top: 2px;
}
.net-modal-row__val {
    display: flex;
    align-items: baseline;
    gap: 2px;
}
.net-modal-big {
    font-size: 20px;
    font-weight: 700;
    color: #1e2329;
}
.net-modal-unit {
    font-size: 12px;
    color: #71717a;
}
.net-modal-row__status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}
.net-modal-row__status.ok {
    background: #dcfce7;
    color: #15803d;
}
.net-modal-icmp {
    width: 100%;
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #71717a;
    margin-top: 4px;
}
.net-modal-icmp span:nth-child(even) {
    font-weight: 600;
    color: #3f3f46;
}
.net-diag-btn {
    margin-top: 12px;
    background: none;
    border: none;
    color: #006fee;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    font-weight: 500;
}
.net-diag-btn:hover { color: #0958d9; }
.net-diag-body {
    margin-top: 8px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 8px 12px;
}
.net-diag-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
    color: #3f3f46;
}
.net-diag-row:last-child { border-bottom: none; }
.net-diag-row span:last-child {
    font-weight: 500;
    color: #1e2329;
    text-align: right;
}

/* =====================================================================
   固定右侧列（操作列）背景色修复 —— app.css 写死了深色，这里覆盖为亮色
   ===================================================================== */
.data-table th.col-fixed-right {
    background: #f5f5f5 !important;
}
.data-table td.col-fixed-right {
    background: #ffffff !important;
}
.data-table tbody tr:hover td.col-fixed-right {
    background: #f5f7fa !important;
}

/* =====================================================================
   设备标签页 — 颜色圆点 chip + 图标操作按钮
   ===================================================================== */
.tag-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.tag-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tag-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
.tag-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
/* 各色值对齐原版 HeroUI 语义色 */
.tag-color-chip--ok       { background: #dcfce7; color: #15803d; }
.tag-color-chip--ok .tag-color-dot { background: #22c55e; }
.tag-color-chip--warn     { background: #fff7ed; color: #c2410c; }
.tag-color-chip--warn .tag-color-dot { background: #f97316; }
.tag-color-chip--danger   { background: #fff1f2; color: #be123c; }
.tag-color-chip--danger .tag-color-dot { background: #f43f5e; }
.tag-color-chip--primary  { background: #eff6ff; color: #1d4ed8; }
.tag-color-chip--primary .tag-color-dot { background: #3b82f6; }
.tag-color-chip--purple   { background: #faf5ff; color: #7e22ce; }
.tag-color-chip--purple .tag-color-dot { background: #a855f7; }
.tag-color-chip--default  { background: #f4f4f5; color: #71717a; }
.tag-color-chip--default .tag-color-dot { background: #a1a1aa; }

.tag-action-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}
.tag-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #71717a;
    font-size: 18px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.15s;
}
.tag-icon-btn:hover { color: #1d4ed8; background: #eff6ff; }
.tag-icon-btn--danger { color: #e11d48; }
.tag-icon-btn--danger:hover { color: #be123c; background: #fff1f2; }

/* =====================================================================
   刷新图标按钮（设备标签页刷新）
   ===================================================================== */
.btn-icon-refresh {
    background: none;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    color: #71717a;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}
.btn-icon-refresh:hover { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }

/* =====================================================================
   Switch toggle 完全重写 — 纯 inline-block 方案，不用 position:absolute/::after
   避免 table-layout:fixed 下 td 裁切伪元素问题
   ===================================================================== */
.sw { display: inline-flex; align-items: center; cursor: pointer; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw .sw-track {
  display: inline-flex; align-items: center; justify-content: flex-start;
  width: 36px; height: 20px; border-radius: 999px;
  background: #d4d4d8; transition: background .16s;
  padding: 3px; box-sizing: border-box; flex-shrink: 0;
  gap: 0;
}
.sw .sw-spacer {
  display: inline-block; width: 0; height: 14px;
  transition: width .16s; flex-shrink: 0;
}
.sw .sw-thumb {
  display: inline-block;
  width: 14px; height: 14px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.sw input:checked + .sw-track { background: #17c964; }
.sw input:checked + .sw-track .sw-spacer { width: 16px; }
.sw input:focus-visible + .sw-track { outline: 2px solid #006fee; outline-offset: 2px; }
.sw input:disabled + .sw-track { opacity: .5; cursor: not-allowed; }
/* 禁掉旧的 ::after */
.sw .sw-track::after { display: none !important; }

/* =====================================================================
   编译打包页 — 统计卡片彩色渐变样式
   ===================================================================== */
.stat-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.order-stat-card {
    flex: 1; min-width: 140px;
    padding: 14px 18px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.order-stat-k {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}
.order-stat-v {
    font-size: 22px;
    font-weight: 700;
}

/* =====================================================================
   设备列表 — 两行筛选栏布局（对齐原版）
   ===================================================================== */
.dev-filter-card {
    padding: 10px 14px 10px;
    margin-bottom: 10px;
    overflow-x: auto;
}
.dev-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: max-content;
}
.dev-filter-row--1 {
    margin-bottom: 6px;
}
.dev-filter-row--2 {
    align-items: center;
    margin-bottom: 0;
}
.dev-filter-row .f { min-width: 110px; }
.dev-filter-row .f--keyword { min-width: 160px; }

/* 日期范围选择器 */
.dev-daterange {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.dev-daterange .date-range-input {
    width: 148px !important;
    font-size: 12px;
    padding: 5px 7px;
    border-radius: 8px;
}
.dev-daterange__sep {
    color: #71717a;
    font-size: 12px;
    white-space: nowrap;
}
.dev-daterange__icon {
    background: none;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    padding: 5px 7px;
    cursor: pointer;
    color: #71717a;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
}
.dev-daterange__icon:hover { color: #006fee; border-color: #bfdbfe; background: #eff6ff; }
.dev-filter-row { align-items: flex-end; gap: 6px; }
/* 所有筛选字段统一高度对齐：label + 控件底部基准线一致 */
.dev-filter-row .f {
    display: inline-flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
}
.dev-filter-row .f > label {
    font-size: 12px;
    color: #71717a;
    margin-bottom: 4px;
    white-space: nowrap;
    line-height: 1.4;
    height: 17px;
    display: block;
    overflow: hidden;
}
/* 日期/搜索/按钮行内对齐到底部 */
.dev-filter-row > .dev-daterange,
.dev-filter-row > .dev-search-kw,
.dev-filter-row > .btn-sm,
.dev-filter-row > .btn-icon-refresh {
    align-self: flex-end;
    margin-bottom: 0;
}
/* 日期范围内部垂直居中 */
.dev-daterange { align-items: center; }

/* 设备列表 — 设备ID输入框宽度对齐其他筛选下拉 */
.dev-filter-row .f--device-id { min-width: 110px; max-width: 160px; }
.dev-filter-row .f--device-id .form-input { width: 140px; }

/* =====================================================================
   设备列表 — 统计卡片彩色 chip（对齐原版）
   ===================================================================== */
.dev-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    flex: 1;
    min-width: 120px;
}
.dev-stat-icon { font-size: 14px; }
.dev-stat-label { flex: 1; }
.dev-stat-val { font-weight: 700; font-size: 15px; }

/* 设备列表 — 筛选栏控件宽度收紧，确保一行放下所有元素 */
.dev-search-kw { width: 62px !important; min-width: 62px !important; flex-shrink: 0; }
.dev-filter-row { gap: 6px; }
.dev-filter-row--2 { align-items: center; }
.dev-filter-row .f--device-id,
.dev-filter-row .f--device-id .form-input { width: 90px !important; min-width: 90px !important; max-width: 90px !important; }
.dev-daterange .date-range-input { width: 78px !important; font-size: 11px; padding: 4px 2px; }
.dev-filter-row .f select { max-width: 80px; min-width: 60px; font-size: 12px; padding: 4px 2px; }
.dev-filter-row .f { min-width: 60px; flex-shrink: 0; }
.dev-filter-row .f:nth-child(5) select,
.dev-filter-row .f:nth-child(5) { max-width: 80px; min-width: 70px; }
.dev-filter-row .btn-sm,
.dev-filter-row .btn-icon-refresh { flex-shrink: 0; }

/* 设备列表筛选卡片 panel 放开 overflow，让一行内容完整显示 */
.dev-filter-card.panel { overflow-x: auto; overflow-y: visible; }
.dev-filter-row { min-width: 0; }

/* 强制筛选栏所有 input/select 等高，消除设备ID偏高问题 */
.dev-filter-row .f > input,
.dev-filter-row .f > select {
    height: 32px;
    box-sizing: border-box;
}

/* =====================================================================
   编译打包 — 打包弹窗多列布局 + 分区标题蓝色左边框
   ===================================================================== */
.fp-section {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e2329;
    margin: 8px 0 6px;
}
.fp-section__bar {
    display: inline-block;
    width: 4px;
    height: 15px;
    background: #006fee;
    border-radius: 2px;
    flex-shrink: 0;
}
.fp-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}
.fp-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 4px;
}
.switch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
}
.switch-grid .switch-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f4f4f5;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: #374151;
}
.modal-box .form-body .form-row { border-bottom: none; margin-bottom: 0; }
.modal-box .fp-row-3 .form-row,
.modal-box .fp-row-2 .form-row { margin-bottom: 0; }
.modal-box .form-body { padding: 4px 0; }
.form-row + .fp-section { margin-top: 10px; }

/* 打包弹窗 — 进一步压缩内部间距 */
.modal-box .form-body { padding: 2px 0 0; }
.modal-box .form-row { padding: 4px 0; }
.modal-box .form-row .form-label { margin-bottom: 3px; font-size: 12px; }
.fp-row-3 + .fp-section,
.fp-row-2 + .fp-section,
.switch-grid + .fp-section { margin-top: 6px; }

/* 屏幕阅读器面板（panelC）和投屏面板（panelE）等宽对称，铺满剩余空间 */
.term-panel--c { flex: 1 1 0; min-width: 240px; }
.term-panel--e { flex: 1 1 0; min-width: 240px; }
.term-panel--c .term-phone { width: 100%; height: 100%; padding: 4px; }
.term-panel--e .term-phone { width: 100%; height: 100%; padding: 4px; }
.term-panel--c .term-phone__frame { width: 100%; height: 100%; min-height: 0; }
.term-panel--e .term-phone__frame { width: 100%; height: 100%; min-height: 0; }
.term-panel--c .term-phone__frame::before { display: none; }
.term-panel--e .term-phone__frame::before { display: none; }
.term-panel--c .screen-panel { position: relative; overflow: hidden; flex: 1; min-height: 0; }
/* DOM wireframe 阅读器 */
.reader-panel-dom { background: #fff !important; }
.reader-phone-inner { position: absolute !important; inset: 0 !important; }
.reader-nodes-wrap { position: absolute; inset: 0; }
/* 右侧投屏截图：object-fit cover，铺满不留黑边 */
.term-panel--e .screen-panel {
  background: #000 !important;
  flex: 1;
  min-height: 0;
}
.term-panel--e .screen-panel img,
.term-panel--c .screen-panel img {
  object-fit: cover !important;
}
