/* =====================================================================
   JC 本地诊断平台 · 自写组件样式库
   视觉规格对齐原站（Element Plus 风格）：主色蓝 #409EFF、小圆角、紧凑表格。
   本文件是项目唯一 UI 样式实现，不依赖任何 UI 框架。
   ===================================================================== */

/* ---------------- 变量 ---------------- */
:root {
  --p: #409eff;          /* 主色 */
  --p-dark: #337ecc;     /* hover */
  --p-light: #66b1ff;    /* light */
  --p-bg: #ecf5ff;       /* 选中底色 */
  --p-border: #a0cfff;   /* 浅蓝边框 */
  --p-rgb: 64, 158, 255;

  --t1: #303133;         /* 主要文字 */
  --t2: #606266;         /* 次要文字 */
  --t3: #909399;         /* 辅助文字 */
  --t4: #c0c4cc;         /* 占位 */

  --line: #dcdfe6;       /* 边框 */
  --line-2: #ebeef5;     /* 浅边框/表格线 */
  --fill: #f5f7fa;       /* 表头底/填充 */
  --bg: #f5f5f5;         /* 页面背景 */
  --card: #ffffff;

  --ok: #67c23a;
  --ok-bg: #f0f9eb;
  --warn: #e6a23c;
  --warn-bg: #fdf6ec;
  --err: #f56c6c;
  --err-bg: #fef0f0;
  --info-bg: #f4f4f5;

  --r-sm: 4px;
  --r: 4px;
  --r-lg: 6px;
  --sh: 0 1px 2px rgba(0, 0, 0, .03);
  --sh-lg: 0 4px 16px rgba(0, 0, 0, .12);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------------- 基础 ---------------- */
*, *::before, *::after { box-sizing: border-box; }

/* ---------------- 图标（自写 SVG sprite） ---------------- */
.ico {
  display: inline-block; width: 1em; height: 1em; flex: none;
  vertical-align: -.14em; overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.ico use { stroke: inherit; }
/* 实心图标（play/stop/phone-fill）*/
.ico-solid { fill: currentColor; stroke: none; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.5;
  color: var(--t1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--p); text-decoration: none; }
a:hover { color: var(--p-light); }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 32px; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--r);
  background: #fff; color: var(--t2);
  font-size: 14px; font-family: inherit; line-height: 1;
  cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--p); border-color: var(--p); color: #fff; }
.btn-primary:hover { background: var(--p-light); border-color: var(--p-light); color: #fff; }

.btn-outline { background: #fff; color: var(--p); border-color: var(--p-border); }
.btn-outline:hover { background: var(--p-bg); color: var(--p); border-color: var(--p); }

.btn-ghost { background: #fff; color: var(--t2); border-color: var(--line); }
.btn-ghost:hover { background: var(--p-bg); color: var(--p); border-color: var(--p-border); }

.btn-danger { background: #fff; color: var(--err); border-color: #fbc4c4; }
.btn-danger:hover { background: var(--err); border-color: var(--err); color: #fff; }

.btn-success { background: #67c23a; border-color: #67c23a; color: #fff; }
.btn-success:hover { background: #85ce61; border-color: #85ce61; color: #fff; }

.btn-sm { height: 28px; padding: 0 11px; font-size: 13px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }

/* 文字型按钮（表格操作列） */
.btn-text {
  background: transparent; border-color: transparent; color: var(--p);
  height: auto; padding: 2px 4px; font-size: 13px;
}
.btn-text:hover { color: var(--p-light); text-decoration: underline; }
.btn-text.danger { color: var(--err); }
.btn-text.danger:hover { color: #f78989; }

/* ---------------- 表单 ---------------- */
/* 表单栅格：宽弹窗双列排布（对齐原站 el-row gutter:16 + el-col span:8）
   —— 用容器查询按弹窗自身宽度切换：窄弹窗（< 640px）保持单列，
      避免下拉框被挤压截断（现代浏览器均支持） */
.modal-body { container-type: inline-size; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-grid .field-wide { grid-column: 1 / -1; }
@container (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}
/* 不支持容器查询时的兜底：单列 */
@supports not (container-type: inline-size) {
  .form-grid { grid-template-columns: 1fr; }
}
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: block; margin-bottom: 6px;
  font-size: 14px; font-weight: 400; color: var(--t2);
}
/* 必填星号 */
.field-label .req { color: var(--err); font-style: normal; margin-left: 3px; }
/* 字段提示（对齐原站 el-form-item 说明文字） */
.field-hint { margin-top: 4px; font-size: 12px; color: var(--t3); line-height: 1.4; }

/* 单选组（对齐原站 el-radio-group） */
.radio-group { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; color: var(--t1); }
.radio input { width: 15px; height: 15px; accent-color: var(--p); cursor: pointer; margin: 0; }
.radio:hover span { color: var(--p); }
.input, .select, .textarea {
  display: block; width: 100%;
  height: 32px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: #fff; color: var(--t1);
  font-size: 14px; font-family: inherit;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.textarea { height: auto; min-height: 80px; padding: 6px 11px; line-height: 1.5; resize: vertical; }
.select {
  appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23c0c4cc' d='M5 6 0 1.4l.9-.9L5 4.6 9.1.5l.9.9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--p); box-shadow: 0 0 0 2px rgba(var(--p-rgb), .18);
}
/* 下拉/输入框：长文本（code (name)）不被截断，用省略号 + title 提示 */
.select, .input { text-overflow: ellipsis; }
.select option { max-width: 460px; }
.input::placeholder, .textarea::placeholder { color: var(--t4); }
.input:disabled, .select:disabled { background: var(--fill); color: var(--t4); cursor: not-allowed; }
.input-lg { height: 40px; padding: 0 14px; font-size: 15px; }

/* 过滤条：标签在左、控件在右（原站风格）
   —— 控件组横向紧凑排列，按钮组靠右，窄屏自动换行 */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 18px; margin-bottom: 16px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line-2);
}
.filter-item { display: flex; align-items: center; gap: 7px; }
/* 操作按钮组：连成一体，换行时整组不拆散 */
.filter-ops { display: flex; align-items: center; gap: 8px; flex: none; }
.filter-item > label { color: var(--t2); font-size: 13.5px; white-space: nowrap; }
.filter-item .input, .filter-item .select { width: auto; min-width: 118px; max-width: 210px; }
.filter-item .searchable { display: inline-flex; }
.filter-item .searchable .searchable-input { min-width: 118px; max-width: 210px; }
/* 查询 / 新增 / 导入导出按钮组：与筛选控件之间留出视觉分隔 */
.filter-item .btn { flex: none; }
/* 分隔线：仅在按钮组与筛选控件之间显示（窄屏隐藏，避免孤零零的竖线） */
.filter-bar .filter-sep {
  width: 1px; height: 20px; background: var(--line); margin: 0 2px; flex: none;
}
@media (max-width: 1100px) {
  .filter-bar .filter-sep { display: none; }
}

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: relative; width: 40px; height: 20px; flex: 0 0 40px;
  background: var(--t4); border-radius: 10px; transition: background .2s var(--ease);
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform .2s var(--ease);
}
.switch input:checked + .track { background: var(--p); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 2px rgba(var(--p-rgb), .2); }
.switch .switch-text { font-size: 14px; color: var(--t2); }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--sh);
}
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; color: var(--t1); }
/* 卡片头部行（标题 + 右侧按钮，对齐原站 card header） */
.card-head-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head-row .card-title { margin: 0; }
.card-head-row .grow { flex: 1; }
.page-title { font-size: 22px; font-weight: 500; margin: 0 0 16px; color: var(--t1); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--t1); }
.table th {
  text-align: left; font-weight: 600; color: var(--t2); white-space: nowrap;
  padding: 9px 12px; background: var(--fill); border-bottom: 1px solid var(--line-2);
}
.table td {
  padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle;
  color: var(--t1); white-space: nowrap;
}
/* 长文本列最多显示 2 行，超出省略（保持表格紧凑） */
.table td .break-all {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; max-width: 260px; vertical-align: top; line-height: 1.45;
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: var(--fill); }
.table .col-id { width: 60px; color: var(--t3); }
.table .col-act { width: 130px; white-space: nowrap; }
.table .num { font-variant-numeric: tabular-nums; }
.table .muted-cell { color: var(--t4); }
/* 序号列 */
.table .col-idx { width: 70px; color: var(--t3); text-align: center; font-variant-numeric: tabular-nums; }
.table th.col-idx { text-align: center; }
/* 可排序表头 */
.table th.sortable { cursor: pointer; user-select: none; transition: background .15s var(--ease), color .15s var(--ease); }
.table th.sortable:hover { background: #eef4fb; color: var(--p); }
.table th.sortable .ico { font-size: 11px; opacity: .38; vertical-align: middle; }
.table th.sortable.sorted { color: var(--p); }
.table th.sortable.sorted .ico { opacity: 1; }
/* 长文本列：最多 2 行，超出省略（对齐原站 wrap-cell） */
.table td .wrap-cell {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; max-width: 320px; vertical-align: top; line-height: 1.45;
}
/* 操作列：文字按钮 */
.table td.ops { white-space: nowrap; }
.table td.ops .btn-text + .btn-text { margin-left: 10px; }
/* 关联名称列（id → code(name)）：主色文本，与普通列区分 */
.table td .ref-link { color: var(--p); }
.table td .ref-link:hover { text-decoration: underline; }
/* 日期列：等宽数字，不截断 */
.table td .mono, .table .mono {
  font-variant-numeric: tabular-nums; color: var(--t2);
  white-space: nowrap; font-size: 13.5px;
}
.table td.text-primary { color: var(--p); }

/* ---------------- 标签（原站 el-tag） ---------------- */
.tag {
  display: inline-block; padding: 0 8px; border-radius: var(--r-sm);
  font-size: 12px; line-height: 20px; white-space: nowrap;
  border: 1px solid transparent;
}
.tag-success { background: var(--ok-bg); color: var(--ok); border-color: #c2e7b0; }
.tag-warning { background: var(--warn-bg); color: var(--warn); border-color: #f5dab1; }
.tag-danger { background: var(--err-bg); color: var(--err); border-color: #fbc4c4; }
.tag-info { background: var(--info-bg); color: var(--t3); border-color: #e9e9eb; }
.tag-primary { background: var(--p-bg); color: var(--p); border-color: var(--p-border); }

/* ---------------- 徽标 / 标签 ---------------- */
.badge {
  display: inline-block; padding: 0 7px; border-radius: var(--r-sm);
  font-size: 12px; line-height: 20px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-pass { background: var(--ok-bg); color: var(--ok); border-color: #c2e7b0; }
.badge-fail { background: var(--err-bg); color: var(--err); border-color: #fbc4c4; }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: #f5dab1; }
.badge-muted { background: var(--info-bg); color: var(--t3); border-color: #e9e9eb; }
.badge-admin { background: var(--p-bg); color: var(--p); border-color: var(--p-border); }

/* ---------------- 模态框 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal.open { display: flex; }
.modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); animation: jcFade .2s var(--ease); }
.modal-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 700px; max-height: 88vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  animation: jcPop .22s var(--ease);
}
.modal-panel.modal-sm { max-width: 460px; }
.modal-panel.modal-lg { max-width: 900px; }
/* 弹窗内容区：表单栅格列间距 + 底部留白，避免末字段贴边 */
.modal-body { padding: 18px 20px 20px; overflow-y: auto; flex: 1; }
/* 窄弹窗（< 560px）收窄内边距，保证输入框有足够宽度 */
@container (max-width: 560px) {
  .modal-body { padding: 14px 14px 16px; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
}
.modal-title { font-size: 16px; font-weight: 500; margin: 0; color: var(--t1); }
.modal-close {
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: var(--r);
  color: var(--t3); cursor: pointer; font-size: 18px; line-height: 1;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.modal-close:hover { background: var(--fill); color: var(--t1); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--line-2);
}
@keyframes jcFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes jcPop {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 30px; height: 30px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r);
  background: #fff; color: var(--t2); font-size: 13px;
  transition: all .15s var(--ease);
}
.pager a:hover { border-color: var(--p); color: var(--p); }
.pager .on { background: var(--p); border-color: var(--p); color: #fff; }
.pager .cur { background: var(--p); border-color: var(--p); color: #fff; font-weight: 500; }
.pager .off { color: var(--t4); background: var(--fill); }
.pager .info { border: none; background: none; color: var(--t3); }
/* 每页条数（原站 layout: total, sizes, prev, pager, next） */
.pager .sizes, .pager .total {
  border: none; background: none; color: var(--t3); font-size: 13px;
  gap: 4px; min-width: 0; height: auto; padding: 0 4px;
}
.pager .sizes a {
  min-width: 34px; height: 26px; padding: 0 8px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--t2);
}
.pager .sizes a.on { background: var(--p); border-color: var(--p); color: #fff; }
.pager .total { margin-right: 4px; }
/* 跳页 */
.pager .jump {
  border: none; background: none; color: var(--t3); font-size: 13px;
  gap: 5px; min-width: 0; height: auto; padding: 0 4px; margin-left: 6px;
}
.pager .jump-input {
  width: 58px; height: 26px; padding: 0 6px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--t1); background: #fff;
  font-variant-numeric: tabular-nums;
}
.pager .jump-input:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 2px var(--p-bg); }
.pager .jump-input::-webkit-outer-spin-button,
.pager .jump-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pager .jump-input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ---------------- 导入结果（原站：行号 / 失败原因） ---------------- */
.import-summary {
  padding: 10px 12px; margin-bottom: 12px; border-radius: var(--r);
  background: var(--fill); color: var(--t2); font-size: 13.5px;
}
.import-summary b { color: var(--t1); }
.import-summary b.ok { color: var(--ok); }
.import-summary b.bad { color: var(--err); }
.import-errors { max-height: 320px; overflow-y: auto; }
.import-errors .table td { white-space: normal; }

/* ---------------- 可搜索下拉 ---------------- */
.searchable { position: relative; display: inline-block; }
.searchable > select { display: none; }
.searchable-input {
  width: 100%; min-width: 132px; max-width: 320px;
  height: 32px; padding-right: 26px; cursor: pointer;
}
.searchable.open .searchable-input { border-color: var(--p); box-shadow: 0 0 0 2px var(--p-bg); }
.searchable-list {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 1200;
  min-width: 190px; max-width: 320px; max-height: 240px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-lg); display: none;
}
.searchable-list.show { display: block; }
.searchable-item {
  padding: 7px 12px; font-size: 13.5px; color: var(--t1); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.searchable-item:hover { background: var(--fill); }
.searchable-item.on { color: var(--p); font-weight: 500; background: var(--p-bg); }
.searchable-item.all { color: var(--t3); border-bottom: 1px solid var(--line-2); }
.searchable-empty { padding: 12px; text-align: center; color: var(--t4); font-size: 13px; }

/* ---------------- 404 ---------------- */
.page-404 { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.err-box {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 40px 48px; text-align: center; box-shadow: var(--sh);
}
.err-box h1 { font-size: 54px; margin: 0 0 8px; color: var(--p); font-weight: 600; }
.err-box p { margin: 0 0 20px; color: var(--t3); font-size: 14px; }

/* ---------------- 折叠 ---------------- */
.collapse { display: none; }
.collapse.show { display: block; }

/* ---------------- 布局：顶栏 ---------------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 1000;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--p); }
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--r);
  background: var(--p); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.topbar .grow { flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 10px; color: var(--t2); font-size: 13px; }
.topbar-user .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--p-bg); color: var(--p);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px;
}
.topbar-user .role {
  font-size: 12px; color: var(--p); background: var(--p-bg);
  border: 1px solid var(--p-border); border-radius: var(--r-sm); padding: 0 6px;
}

/* ---------------- 布局：侧栏 + 内容 ---------------- */
.shell { display: flex; padding-top: 56px; min-height: 100vh; }
.sidebar {
  position: fixed; top: 56px; bottom: 0; left: 0; width: 200px; z-index: 900;
  background: #fff; border-right: 1px solid var(--line);
  padding: 0 0 16px; overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #dcdfe6; border-radius: 3px; }

/* 侧栏顶部设备状态条（原站同款） */
.side-status {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-2);
  margin-bottom: 6px; font-size: 13px; color: var(--t3);
}
.side-status .btn { height: 26px; padding: 0 10px; font-size: 12px; }
/* 侧栏设备状态区（连接手机 / 断开） */
.side-device { gap: 10px; }
.side-device-state {
  display: flex; align-items: center; gap: 7px;
  color: var(--t2); font-size: 13px; min-width: 0;
}
.side-device-state > span:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-device .device-btn { height: 26px; padding: 0 10px; font-size: 12px; flex: none; }

/* ---------------- 顶栏设备状态区（对齐原站） ---------------- */
.device-status {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; margin-right: 12px;
  border-right: 1px solid var(--line-2);
}
.device-status .device-text {
  font-size: 13px; color: var(--t2);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 状态点：未连接灰、已连接绿 */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--t4); transition: background .2s var(--ease);
}
.status-dot.status-on { background: #67c23a; box-shadow: 0 0 0 2px rgba(103, 194, 58, .18); }
.status-dot.status-off { background: var(--t4); }
.device-btn { min-width: 76px; }
.device-btn.is-loading { opacity: .7; cursor: progress; }

.nav-group { margin-bottom: 2px; }
.nav-group-title {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 9px 16px 7px; border: none; background: none;
  font-size: 13px; font-weight: 600; color: var(--t1);
  cursor: pointer; text-align: left; font-family: inherit;
}
.nav-group-title:hover { color: var(--p); }
.nav-group-title .caret { font-size: 10px; color: var(--t3); transition: transform .2s var(--ease); }
.nav-group:not(.open) .nav-group-title .caret { transform: rotate(-90deg); }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; color: var(--t2); font-size: 14px; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}
.nav-item .ico { font-size: 15px; width: 17px; text-align: center; color: var(--t3); }
.nav-item:hover { background: var(--fill); color: var(--p); }
.nav-item:hover .ico { color: var(--p); }
.nav-item.on { background: var(--p-bg); color: var(--p); font-weight: 500; }
.nav-item.on .ico { color: var(--p); }
.nav-item.on::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--p); border-radius: 0 2px 2px 0;
}
.main { flex: 1; margin-left: 200px; padding: 18px 20px; min-width: 0; padding-bottom: 56px; }

/* 底部版权 */
.foot {
  position: fixed; left: 0; right: 0; bottom: 0; height: 40px; z-index: 800;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff; border-top: 1px solid var(--line);
  color: var(--t3); font-size: 12px;
}
.foot .ver { color: var(--t4); }

/* ---------------- 图标 ---------------- */
.ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1em; height: 1em; vertical-align: -.14em; flex: none;
}
.ico svg { width: 100%; height: 100%; fill: currentColor; }

/* ---------------- 测试配置页（批量配置检测项） ---------------- */
.cfg-picker { padding: 2px 0; }
.cfg-pick-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cfg-label { color: var(--t2); font-size: 14px; white-space: nowrap; flex: none; }
.cfg-cmd-box {
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 16px 18px 18px; background: #fbfcfe;
}
.cfg-sub-title {
  font-size: 14px; font-weight: 600; color: var(--t1);
  margin: 0 0 12px; padding-left: 9px; border-left: 3px solid var(--p);
}
.cfg-version-row { display: flex; gap: 8px; align-items: center; }
.cfg-version-row .select { flex: none; }
.cfg-version-row .input { flex: 1; min-width: 0; }
.cfg-batch {
  display: flex; align-items: center; gap: 14px;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line);
}
/* 勾选框（对齐原站 el-checkbox） */
.cfg-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; color: var(--t2); }
.cfg-check input { width: 15px; height: 15px; accent-color: var(--p); cursor: pointer; margin: 0; }

/* 空表行：保留列头，行内居中显示空态（原站 el-table 空态行为） */
.table td.empty-cell, .table .empty-cell {
  text-align: center; padding: 40px 12px;
}
.table tbody tr.empty-row:hover { background: transparent; }

/* ---------------- 检测项卡片网格 ----------------
   严格对齐原站 Diagnosis.js 的 test-item-type-* 视觉规范：
   按模块分组 → 模块头（名称 + 数量 + 模块级按钮）→ 卡片网格（auto-fill minmax 200px）
   卡片状态：active(已选) / locked(锁定) / dfs-disabled / done(完成) / timeout(超时) / running(执行中) */
.diag-items { margin-top: 14px; }
.diag-modules { display: flex; flex-direction: column; gap: 16px; }

/* 模块头 */
.diag-module { display: flex; flex-direction: column; gap: 10px; }
.diag-module-head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-2);
}
.diag-module-name { font-size: 14px; font-weight: 600; color: #1f2329; }
.diag-module-count { font-size: 12px; color: #c9cdd4; }
.diag-module-head .diag-mod-btn { margin-left: auto; }

/* 卡片网格 */
.diag-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.diag-card {
  position: relative; cursor: pointer;
  background: #f7f8fa; border: 2px solid transparent; border-radius: 8px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  transition: all .2s ease;
}
.diag-card:hover { background: #f0f5ff; border-color: #b0cfff; }
.diag-card.is-active {
  background: #e8f3ff; border-color: #409eff; box-shadow: 0 0 0 1px #409eff inset;
}
.diag-card.is-active:hover { background: #d6ecff; border-color: #3a8ee6; }
.diag-card.is-locked { cursor: not-allowed; opacity: .7; }
.diag-card.is-locked:hover { background: #f7f8fa; border-color: transparent; }
.diag-card.is-locked.is-active { opacity: 1; cursor: not-allowed; }
.diag-card.is-locked.is-active:hover { background: #e8f3ff; border-color: #409eff; }
.diag-card.is-dfs-disabled {
  cursor: not-allowed; opacity: .55; filter: grayscale(.3);
}
.diag-card.is-dfs-disabled:hover { background: #fff; border-color: #e5e6eb; }
/* 维修后不支持的检测项（维修后模式下灰显且不可勾选） */
.diag-card.is-unsupported {
  cursor: not-allowed; opacity: .5; filter: grayscale(.35);
  border-style: dashed;
}
.diag-card.is-unsupported:hover { background: #f7f8fa; border-color: transparent; }
.diag-card.is-done {
  background: #f0f9eb !important; border-color: #00b42a !important;
  box-shadow: 0 0 0 1px #00b42a inset !important;
}
/* 组合选择器：确保「已完成 / 超时」覆盖「已选中」的配色（原站同理） */
.diag-card.is-active.is-done,
.diag-card.is-locked.is-active.is-done {
  background: #f0f9eb !important; border-color: #00b42a !important;
  box-shadow: 0 0 0 1px #00b42a inset !important;
}
.diag-card.is-done:hover,
.diag-card.is-active.is-done:hover,
.diag-card.is-locked.is-active.is-done:hover { background: #e3f6e7; }
.diag-card.is-timeout {
  background: #fff7e8 !important; border-color: #ff7d00 !important;
  box-shadow: 0 0 0 1px #ff7d00 inset !important;
}
.diag-card.is-active.is-timeout,
.diag-card.is-locked.is-active.is-timeout {
  background: #fff7e8 !important; border-color: #ff7d00 !important;
  box-shadow: 0 0 0 1px #ff7d00 inset !important;
}
.diag-card.is-timeout:hover,
.diag-card.is-active.is-timeout:hover,
.diag-card.is-locked.is-active.is-timeout:hover { background: #ffefd5; }

/* 已选卡片的右上角对勾圆点（原站 :after 伪元素） */
.diag-card.is-active::after {
  content: ""; position: absolute; top: 6px; right: 6px;
  width: 16px; height: 16px; border-radius: 50%; background: #409eff;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
  background-size: 11px 11px; background-repeat: no-repeat; background-position: center;
}
.diag-card.is-done::after {
  background-color: #00b42a;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
}
.diag-card.is-timeout::after {
  background-color: #ff7d00;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='5.8'/%3E%3Cpath d='M8 4.8v3.6M8 11.2v.4'/%3E%3C/svg%3E");
}

/* 等待中（已勾选但尚未执行） */
.diag-card.is-pending { opacity: .68; }
.diag-card.is-pending.is-active { background: #f4f7fb; border-color: #c8d6ea; box-shadow: none; }

/* 执行中的流光边框（原站 conic-gradient 背景） */
.diag-card.is-running {
  border-color: #409eff !important;
  animation: jcCardPulse 1.2s ease-in-out infinite;
}
.diag-card.is-running .diag-card-bg {
  position: absolute; inset: 0; border-radius: inherit; padding: 3px;
  background: conic-gradient(from var(--jc-angle, 0deg), #409eff, #67c23a, #e6a23c, #f56c6c, #409eff);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: jcSpin 1.4s linear infinite;
}
@keyframes jcSpin { to { --jc-angle: 360deg; } }
@property --jc-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
/* 呼吸光晕（浏览器不支持 @property 时也能明显表达"检测中"） */
@keyframes jcCardPulse {
  0%, 100% { box-shadow: 0 0 0 1px #409eff inset, 0 0 0 3px rgba(64, 158, 255, .16); }
  50%      { box-shadow: 0 0 0 1px #409eff inset, 0 0 0 7px rgba(64, 158, 255, .34); }
}

/* 卡片头部：序号徽标 + 名称（右侧留白给已选对勾） */
.diag-card-head { display: flex; align-items: flex-start; gap: 8px; padding-right: 20px; }
.diag-card-index {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #409eff; color: #fff; font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.diag-card.is-done .diag-card-index { background: #00b42a; }
.diag-card.is-timeout .diag-card-index { background: #ff7d00; }
.diag-card-name {
  flex: 1; min-width: 0;
  font-size: 13px; font-weight: 600; color: #1f2329;
  word-break: break-all; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 标签行：独立成行，缩进对齐名称起点，高度固定保证卡片等高 */
.diag-card-tags {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding-left: 28px; min-height: 18px;
}
.diag-tag {
  flex: none; padding: 0 6px; border-radius: 3px; font-size: 11px; line-height: 18px;
  background: #f2f3f5; color: #646a73; border: 1px solid #e5e6eb; white-space: nowrap;
}
.diag-tag-cit { background: #e8f3ff; color: #2563c9; border-color: #b0cfff; }
.diag-tag-dfs { background: #f6f0ff; color: #6f3fd8; border-color: #d9c7ff; }
.diag-tag-abbr { min-width: 20px; padding: 0 5px; text-align: center; font-weight: 700; letter-spacing: .5px; }
.diag-card.is-part { border-color: var(--pri, #2563eb); border-style: dashed; }
.diag-tag-pick { cursor: pointer; user-select: none; }
.diag-tag-pick:hover { filter: brightness(.94); }
.diag-tag-pick.is-on { box-shadow: 0 0 0 2px rgba(37,99,235,.30); }
.diag-tag-req { background: #fff1e8; color: #d25f00; border-color: #ffcf8b; }
.diag-tag-warn { background: #f4f4f5; color: #86909c; border-color: #e5e6eb; }

/* 卡片内命令预览（单行省略，完整内容见卡片 title） */
.diag-card-cmd {
  font-size: 11.5px; color: #86909c; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-top: 6px; border-top: 1px dashed #e5e6eb;
}
.diag-card-cmd:empty { display: none; }

/* 结果状态条（耗时 / 完成时间） */
.diag-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid #e8e8e8; font-size: 12px;
}
.diag-card-time { color: #86909c; }
.diag-card-foot.is-timeout { color: #ff7d00; }
.diag-card-foot.is-done { color: #00b42a; }

/* 顶部工具栏与检测项卡片的分隔 */
.diag-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2);
}
.diag-toolbar .grow { flex: 1; }

/* 当前机型代号标签（只读，连接手机后自动填充） */
.diag-device-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 10px;
  border-radius: 11px; font-size: 12.5px; font-weight: 500;
  background: var(--p-bg); color: var(--p); border: 1px solid var(--p-border);
  font-family: var(--mono, Consolas, monospace);
}

/* 检测模式按钮组（对齐原站 mode-selector：全选 | 维修前 | 维修后） */
.mode-group {
  display: inline-flex; border: 1px solid var(--line); border-radius: 4px;
  overflow: hidden; background: #fff;
}
.mode-btn {
  height: 30px; padding: 0 18px; border: none; background: #fff;
  color: var(--t2); font-size: 13.5px; cursor: pointer;
  border-right: 1px solid var(--line); transition: all .15s var(--ease);
  white-space: nowrap;
}
.mode-btn:last-child { border-right: none; }
.mode-btn:hover:not(:disabled) { background: var(--p-bg); color: var(--p); }
.mode-btn.is-active { background: var(--p); color: #fff; font-weight: 500; }
.mode-btn:disabled { opacity: .45; cursor: not-allowed; background: var(--fill); }
.mode-btn.is-action { color: var(--p); }
.notice-warn {
  padding: 10px 14px; border-radius: var(--r);
  background: var(--warn-bg); border: 1px solid #f5dab1; color: #a05a00; font-size: 13.5px;
}

/* ---------------- 连接说明页：命令框 + 检测命令清单（对齐原站 Manual.js） ---------------- */
.cmd-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--fill); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 12px 14px;
}
.cmd-text {
  flex: 1; min-width: 0; font-size: 13.5px; color: var(--t1);
  font-family: var(--mono, Consolas, monospace); word-break: break-all; line-height: 1.6;
}
.models-group { margin-bottom: 18px; }
.models-group-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: #1f2329;
  padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line-2);
}
.models-group-count { font-size: 12px; color: #c9cdd4; }
.models-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.models-column { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.models-empty { color: var(--t3); font-size: 12.5px; padding: 6px 0; }
.models-item {
  background: #f7f8fa; border: 1px solid #ebeef5; border-radius: 6px;
  padding: 9px 11px; display: flex; flex-direction: column; gap: 5px; min-width: 0;
}
.models-item-head { display: flex; align-items: center; gap: 8px; }
.models-item-name {
  font-size: 13px; font-weight: 600; color: #1f2329;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.models-item-cmd {
  font-size: 11.5px; color: #86909c; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 900px) {
  .models-columns { grid-template-columns: 1fr; }
}

/* 按钮内计数徽标（原站 el-badge：开始检测 N） */
.btn-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; margin-left: 6px; padding: 0 5px;
  border-radius: 9px; font-size: 11px; font-weight: 600; line-height: 1;
  background: rgba(255, 255, 255, .28); color: #fff;
}
.btn-outline .btn-count, .btn-ghost .btn-count { background: var(--p-bg); color: var(--p); }

/* ---------------- 工具类 ---------------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.flex { display: flex; }
.grow { flex: 1; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.items-center { align-items: center; }
.mt-0 { margin-top: 0; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--t3); }
.text-sub { color: var(--t2); }
.text-primary { color: var(--p); }
.text-danger { color: var(--err); }
.text-success { color: var(--ok); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-100 { width: 100%; }
.mono { font-family: "SFMono-Regular", Consolas, Menlo, monospace; font-size: 12.5px; }
.break-all { word-break: break-all; }
.hidden { display: none !important; }

/* ---------------- 检测流程 ---------------- */
.steps { display: flex; align-items: center; gap: 24px; }
.step { display: flex; align-items: center; gap: 7px; }
.step-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: var(--t4); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.step.on .step-dot { background: var(--p); }
.step.done .step-dot { background: var(--ok); }
.step-text { color: var(--t2); font-size: 14px; }
.step.on .step-text { color: var(--p); font-weight: 500; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.info-item { background: var(--fill); border: 1px solid var(--line-2); border-radius: var(--r); padding: 9px 12px; }
.info-item .k { font-size: 12px; color: var(--t3); margin-bottom: 2px; }
.info-item .v { font-size: 14px; color: var(--t1); word-break: break-all; }
.info-item.is-empty .v { color: var(--t3); }

.result-banner {
  display: flex; align-items: center; gap: 8px;
  border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px;
  font-size: 15px; font-weight: 500;
}
.result-banner.ok { background: var(--ok-bg); color: var(--ok); }
.result-banner.bad { background: var(--err-bg); color: var(--err); }
.result-banner.warn { background: var(--warn-bg); color: #a05a00; }

.console {
  background: #1e1e2e; color: #cdd6f4; border-radius: var(--r);
  padding: 12px 14px; font-size: 12px; font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  max-height: 240px; overflow: auto; line-height: 1.7;
}
.console::-webkit-scrollbar { width: 7px; }
.console::-webkit-scrollbar-thumb { background: #45475a; border-radius: 4px; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-box {
  width: 380px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 34px 36px 30px; box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
}
.login-head { text-align: center; margin-bottom: 24px; }
.login-head .brand-mark {
  width: 48px; height: 48px; border-radius: var(--r); font-size: 22px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
}
.login-head h1 { font-size: 19px; font-weight: 500; margin: 0 0 5px; color: var(--t1); }
.login-head p { color: var(--t3); font-size: 13px; margin: 0; }
.login-err { color: var(--err); font-size: 13px; min-height: 20px; margin: 0 0 8px; }

/* ---------------- 提示条 ---------------- */
.notice {
  display: flex; align-items: flex-start; gap: 8px;
  border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px;
  background: var(--p-bg); color: var(--p); font-size: 13.5px;
  border: 1px solid var(--p-border);
}
.notice.err { background: var(--err-bg); color: var(--err); border-color: #fbc4c4; }
.notice-info {
  background: var(--info-bg); color: var(--t2); border-color: #d9ecff;
  margin-bottom: 14px; font-size: 13px; line-height: 1.6;
}

/* ============ 检测结果（实时逐项输出） ============ */
.result-stat { font-size: 13px; color: var(--t3); white-space: nowrap; }
.result-stat b { color: var(--p); font-weight: 600; }
.result-stat .stat-ok { color: #00a03e; }
.result-stat .stat-bad { color: #e33; }
.result-stat .stat-miss { color: #d97a00; }
.result-table tbody tr.is-hidden { display: none; }
.result-table td { vertical-align: middle; }
.result-table .res-name { font-weight: 500; color: var(--t1); }
.result-table .res-tip { color: var(--t2); font-size: 13px; }
.result-table .res-sub { display: block; margin-top: 3px; font-size: 11.5px; color: var(--t3); }
.result-table tr.is-bad > td:first-child { box-shadow: inset 3px 0 0 #f56c6c; }
.result-table tr.is-ok > td:first-child { box-shadow: inset 3px 0 0 #52c41a; }
.res-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 10px; border-radius: 11px; font-size: 12.5px; font-weight: 500;
  line-height: 1.6; white-space: nowrap;
}
.res-chip.res-ok { background: #e8f8ec; color: #00963c; }
.res-chip.res-bad { background: #fdecec; color: #d92c2c; }
.res-chip.res-warn { background: #fff4e5; color: #cc7a00; }
.res-chip.res-run { background: #e8f3ff; color: #1668dc; }
.res-chip.res-idle { background: #f2f3f5; color: #86909c; }

/* ============ 无线调试页 ============ */
.wgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.wfield { display: block; }
.wfield > span { display: block; font-size: 12.5px; color: var(--t3); margin-bottom: 4px; }
.wfield .input { width: 100%; }
.wstatus { margin-top: 12px; font-size: 13px; color: var(--t2); background: var(--fill); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; word-break: break-all; }
.wstatus.is-ok { background: var(--ok-bg); border-color: #c2e7b0; color: #2b7a0b; }
.wstatus.is-bad { background: var(--err-bg); border-color: #fbc4c4; color: #b42318; }
.whint { margin-top: 10px; font-size: 13px; line-height: 1.75; color: var(--t2); background: #fffbe6; border: 1px solid #ffe58f; border-radius: var(--r); padding: 10px 12px; }
.whint code { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-family: ui-monospace, Consolas, monospace; }

/* ============ 测试配置：机型配置编辑器 ============ */
.cfg-editor { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 16px; align-items: start; }
.cfg-models { border: 1px solid var(--line); border-radius: var(--r); background: var(--fill); overflow: hidden; }
.cfg-models-head { padding: 10px; border-bottom: 1px solid var(--line); background: #fff; }
.cfg-models-head .input { width: 100%; }
.cfg-model-list { max-height: 520px; overflow-y: auto; padding: 6px; }
.cfg-model {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name cnt" "sub cnt";
  gap: 0 8px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid transparent; background: transparent; border-radius: var(--r-sm);
  padding: 7px 9px; margin-bottom: 4px; font: inherit;
}
.cfg-model:hover { background: #fff; border-color: var(--line); }
.cfg-model.on { background: #e8f3ff; border-color: #b3d4ff; }
.cfg-model-name { grid-area: name; font-size: 13.5px; color: var(--t1); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfg-model-sub { grid-area: sub; font-size: 12px; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfg-model-cnt { grid-area: cnt; align-self: center; font-size: 12px; color: var(--t3); }
.cfg-main { min-width: 0; }
.cfg-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; }
.cfg-field { display: block; }
.cfg-field > span { display: block; font-size: 12.5px; color: var(--t3); margin-bottom: 4px; }
.cfg-field .input { width: 100%; }
.cfg-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 8px; }
.cfg-toolbar-title { font-size: 13.5px; color: var(--t2); font-weight: 500; }
.cfg-toolbar-title b { color: var(--p); }
.cfg-item-groups { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; background: #fff; }
.cfg-group { padding: 6px 0; border-bottom: 1px dashed var(--line-2); }
.cfg-group:last-child { border-bottom: none; }
.cfg-group-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cfg-group-name { font-size: 13px; font-weight: 600; color: var(--t1); }
.cfg-group-cnt { font-size: 12px; color: var(--t3); }
.cfg-group-head .grow { flex: 1; }
.cfg-item-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-chip {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 14px;
  padding: 3px 10px; font-size: 12.8px; color: var(--t2); transition: all .12s;
}
.cfg-chip:hover { border-color: #b3d4ff; }
.cfg-chip.on { background: #e8f3ff; border-color: #7cb3ff; color: #1c5fd0; }
.cfg-chip input { display: none; }
.cfg-chip-cnt { font-style: normal; font-size: 11px; color: var(--t3); }
.cfg-chip.on .cfg-chip-cnt { color: #3c7fe0; }
.cfg-cmd-wrap { border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.cfg-cmd-table { margin: 0; width: 100%; min-width: 1080px; table-layout: fixed; }
/* 命令表固定列合计 888px（#46+检测项120+模块88+类型92+前/后必检62×2+OS/CIT条件158×2+操作102），
   min-width 保证「执行命令」弹性列不被挤压成空白细缝，窄窗口由 .table-wrap 横向滚动 */
.cfg-cmd-table th { position: sticky; top: 0; background: #fafbfc; z-index: 1; font-size: 12.5px; }
.cfg-cmd-table td { padding: 5px 6px; font-size: 12.8px; vertical-align: middle; }
.cfg-cmd-table .cmd-name, .cfg-cmd-table .cmd-mod { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfg-cmd-table tr.cmd-main > td { border-bottom: none; }
.cfg-cmd-table tr.cmd-sub > td { padding: 0 6px 10px; background: #fbfcfe; border-top: none; }
.cfg-cmd-table tr.cmd-sub:hover > td { background: #fbfcfe; }
.cfg-cmd-table .ci {
  width: 100%; height: 28px; padding: 0 6px; font-size: 12.5px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--t1);
}
.cfg-cmd-table .ci:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 2px var(--p-bg); }
.cfg-cmd-table .ci.mono { font-family: ui-monospace, Consolas, monospace; }
.cfg-cmd-table select.ci { padding-right: 16px; }
.cfg-cmd-table .ops { white-space: nowrap; }
.cfg-cmd-table .ops a { margin-right: 8px; }
.cmd-sub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 12px; padding: 8px 0 0; }
.cmd-sub-field { display: block; }
.cmd-sub-field > span:first-child { display: block; font-size: 12px; color: var(--t3); margin-bottom: 3px; }
.cfg-ver { display: flex; gap: 4px; }
.cfg-ver .ci:first-child { width: 54px; flex: none; }
.cfg-ver .ci:last-child { flex: 1; min-width: 0; }
.cmd-sub-tip { margin-top: 6px; font-size: 11.5px; color: var(--t3); }
.cfg-empty { padding: 22px; text-align: center; color: var(--t3); font-size: 13px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12.5px; border-radius: var(--r-sm); }

/* ============ 二次确认框 ============ */
.jc-confirm .modal-panel { max-width: 420px; }
.jc-confirm .confirm-msg { font-size: 13.5px; line-height: 1.85; color: var(--t1); word-break: break-word; }
.jc-confirm .modal-body { padding: 18px 20px 16px; }

/* ============ 测试配置：只看已选 / 部分勾选计数 ============ */
.cfg-onlysel {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--t2); cursor: pointer; user-select: none;
  padding: 0 2px; white-space: nowrap;
}
.cfg-onlysel input { margin: 0; }
.cfg-chip-cnt.is-part { color: #b45309; font-weight: 600; }
.cfg-chip.on .cfg-chip-cnt.is-part { color: #b45309; }

/* ===== 检测记录详情弹窗（对齐原站 DiagRecordManage「检测详情」） ===== */
.modal-panel.modal-xl { max-width: 1100px; width: 1100px; }
.detail-sec { margin-bottom: 18px; }
.detail-sec-title { font-size: 14px; font-weight: 600; color: var(--t1); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line, #e5e7eb); }
.dfs-json-preview {
  background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px 14px;
  font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 1.55;
  max-height: 340px; overflow: auto; white-space: pre; margin: 0;
}

/* ===== 检测记录V2（对齐原站 DiagRecordV2） ===== */
.filter-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.v2-analysis { background: var(--bg2, #f6f8fa); border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.v2-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.v2-tab.on { background: var(--pri, #2563eb); color: #fff; border-color: var(--pri, #2563eb); }

/* ===== 测试配置页 tab（对齐原站 el-tabs） ===== */
.cfg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line, #e5e7eb); margin: 4px 0 14px; flex-wrap: wrap; align-items: center; }
.cfg-tab { border: none; background: none; padding: 8px 14px; font-size: 13.5px; color: var(--t2, #555); cursor: pointer; border-bottom: 2px solid transparent; }
.cfg-tab:hover { color: var(--pri, #2563eb); }
.cfg-tab.on { color: var(--pri, #2563eb); border-bottom-color: var(--pri, #2563eb); font-weight: 600; }
.cmp-diff { color: #c0392b; font-weight: 600; background: #fdf0ef; border-radius: 4px; }
.cfg-parse-stats { display: flex; gap: 22px; padding: 10px 14px; background: var(--bg2, #f6f8fa); border: 1px solid var(--line, #e5e7eb); border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.cfg-parse-stats b { font-size: 16px; color: var(--pri, #2563eb); margin-right: 4px; }

/* ===== 配置页 chip 跳转 / 解析卡片 / ADB指令分组 ===== */
.cfg-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line, #d7dce5); background: var(--bg2, #f6f8fa); border-radius: 16px; padding: 4px 12px; font-size: 13px; color: var(--t1, #2f3542); cursor: pointer; margin: 2px 8px 2px 0; }
.cfg-chip:hover { border-color: var(--pri, #2563eb); color: var(--pri, #2563eb); }
.cfg-chip.on { background: var(--pri, #2563eb); border-color: var(--pri, #2563eb); color: #fff; }
.cfg-chip.on .cfg-chip-cnt { color: rgba(255,255,255,.92); }
/* 跳转高亮：黄色闪烁 4 次（约 4 秒） */
@keyframes jcCmdBlink {
  0%, 100% { background: #ffffff; }
  15%, 45%, 75% { background: #ffe066; }
  30%, 60%, 90% { background: #fff3b0; }
}
tr.cmd-flash td { animation: jcCmdBlink .9s ease-in-out 4; background: #ffe066; }
tr.cmd-flash td:first-child { box-shadow: inset 3px 0 0 #f5b400; }
.cfg-parse-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.cfg-parse-card { background: var(--bg2, #f6f8fa); border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 14px 10px; text-align: center; }
.cfg-parse-card b { display: block; font-size: 22px; color: var(--pri, #2563eb); }
.cfg-parse-card span { font-size: 12.5px; color: var(--t2, #646a73); }
.cfg-lib-group { margin-bottom: 14px; }
.cfg-lib-group .cfg-group-head { padding: 6px 0; }

/* ===== 顶栏 Debug 开关 + 开发者选项抽屉（对齐原站） ===== */
.debug-wrap { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }
.debug-label { color: var(--pri, #2563eb); font-size: 13px; font-weight: 600; cursor: pointer; }
.debug-switch { position: relative; display: inline-flex; cursor: pointer; }
.debug-switch input { position: absolute; opacity: 0; }
.debug-switch .track { width: 34px; height: 18px; background: #c0c6d1; border-radius: 10px; transition: background .2s; position: relative; }
.debug-switch .track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: left .2s; }
.debug-switch input:checked + .track { background: var(--pri, #2563eb); }
.debug-switch input:checked + .track::after { left: 18px; }
.dev-drawer { max-width: 380px; width: 380px; margin-left: auto; min-height: 60vh; }
.dev-group { margin-bottom: 14px; }
.dev-group-title { font-size: 13px; color: var(--t2, #646a73); padding: 6px 0 4px; border-bottom: 1px solid var(--line, #e5e7eb); }
.dev-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line, #eceff3); }
.dev-switch-info { display: flex; flex-direction: column; gap: 2px; }
.dev-switch-label { font-size: 13.5px; color: var(--t1, #2f3542); }
.dev-switch-desc { font-size: 12px; color: var(--t2, #8a9099); }

/* 命令区整块高亮（chip 跳转：该检测项未加入配置时） */
.cmd-flash-box { outline: 2px solid #f5c518; outline-offset: 2px; border-radius: 8px; }

/* 配对二维码 */
.wqrcode-box { background: var(--bg2, #f6f8fa); border: 1px solid var(--line, #e5e7eb); border-radius: 8px; padding: 12px; max-width: 320px; }
.wqrcode-box svg { display: block; margin: 0 auto; }
.wqrcode-box code { font-size: 12px; word-break: break-all; }

/* 机型配置：必检状态与检测项库默认不同 */
.cmd-diff-badge { display:inline-block; margin-left:4px; min-width:14px; height:14px; line-height:14px; text-align:center; border-radius:7px; background:#fff3d6; color:#b45309; font-size:11px; font-weight:700; cursor:help; }
tr.cmd-must-diff td.cmd-name { color:#b45309; }
