/* 管理员端（电脑） */
body { background: var(--bg); min-height: 100vh; overflow-x: hidden; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 20px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.top .grow { flex: 1; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; background: #33403e; color: #fbe7b5; display: flex; align-items: center; justify-content: center; }
.brand b { display: block; font-size: 16px; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--ink-3); }
.conn { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); padding: 6px 12px; border-radius: 16px; background: var(--bg); }

.main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; padding: 16px 20px 40px; max-width: 1440px; margin: 0 auto; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col > .card + .card { margin-top: 0; }
.explain { margin: -4px 0 12px; font-size: 13px; color: var(--ink-3); }
.loading-line { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 14px; padding: 8px 0; }
.err-line { color: var(--red); font-size: 14px; padding: 6px 0; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
#devices .tbl td, .tbl td.code { white-space: nowrap; }
.tbl tr.sel td { background: var(--teal-50); }
.tbl tr.click { cursor: pointer; }
.tbl .code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--ink-3); }
.tbl .thumb { width: 34px; height: 44px; border-radius: 4px; object-fit: cover; background: var(--bg-deep); display: block; }
.tbl .why { color: var(--red); font-size: 12px; max-width: 220px; }
.tbl .acts { white-space: nowrap; text-align: right; }
.tbl .acts .btn { min-height: 32px; }

/* 状态灯 */
.lights { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.light { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 14px; background: var(--bg); font-size: 13px; color: var(--ink-3); }
.light i { width: 9px; height: 9px; border-radius: 50%; background: #cfc9bd; }
.light em { font-style: normal; font-size: 10px; opacity: .7; font-family: ui-monospace, Consolas, monospace; }
.light.on { background: var(--teal-700); color: #fff; }
.light.on i { background: #7ee2a8; box-shadow: 0 0 0 3px rgba(126, 226, 168, .3); }

/* 指标条 */
.metric { margin-bottom: 18px; }
.m-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.m-head em { font-style: normal; color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.m-head b { font-variant-numeric: tabular-nums; font-size: 16px; }
.m-track { position: relative; height: 12px; border-radius: 6px; background: var(--bg-deep); }
.m-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--grey); width: 0; transition: width .35s; }
.m-fill.green { background: var(--green); } .m-fill.teal { background: var(--teal-500); } .m-fill.amber { background: var(--amber); } .m-fill.red { background: var(--red); }
.tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); }
.tick span { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.live-foot { margin-top: 18px; }

/* 参数表单 */
.cfg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.cfg-item { display: flex; flex-direction: column; gap: 4px; }
.cfg-item label { font-size: 14px; font-weight: 600; }
.cfg-item label .code { font-family: ui-monospace, Consolas, monospace; font-weight: 400; font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.cfg-item .hint { font-size: 12px; color: var(--ink-3); }
.cfg-item .in { display: flex; align-items: center; gap: 6px; }
.cfg-item .in .input { height: 38px; max-width: 140px; }
.cfg-item .in span { font-size: 13px; color: var(--ink-3); }
.cfg-item.changed .input { border-color: var(--amber); background: #fffaf0; }
.cfg-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cfg-btns { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.cfg-btns .msg { font-size: 13px; color: var(--ink-3); }

/* 识别服务 */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-size: 13px; }
.kv dt .code { display: block; font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.kv dd { margin: 0; }
.kv dd .sub { display: block; font-size: 12px; color: var(--ink-3); }

/* 手机访问 */
.lan { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.lan img { width: 150px; height: 150px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.lan .urls { display: flex; flex-direction: column; gap: 6px; font-size: 14px; min-width: 0; }
.lan .urls a { font-size: 18px; font-weight: 700; word-break: break-all; }

/* 确认框 */
.modal-mask { position: fixed; inset: 0; z-index: 30; background: rgba(20, 30, 29, .5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 18px; padding: 22px 24px; width: min(440px, 100%); box-shadow: var(--shadow-lg); }
.modal h3 { margin: 0 0 10px; font-size: 18px; }
.modal p { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-btns .btn { min-width: 96px; min-height: 42px; }

@media (max-width: 1100px) {
  .main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .cfg-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
}
