/* ============================================================
   布局与组件 · 极简商务风
     .app-shell(column)
       ├─ header.titlebar (56px, #EEF2F8)
       └─ .app-body
            ├─ nav.sidebar (68px, #101828 深蓝灰)
            └─ .content-wrap
                 ├─ .gs-wrapper (分组侧栏, 白底)
                 └─ .wall-right ── .wall-toolbar / .wall-content
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font: 13px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C9D0DB; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #AEB7C6; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 应用外壳 ============================ */

.app-shell { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* ============================ 顶栏（56px） ============================ */

.titlebar {
  height: var(--topbar-h); min-height: var(--topbar-h); flex: none;
  display: flex; align-items: center; padding: 0 10px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
  -webkit-user-select: none; user-select: none;
}
.tb-left { display: flex; align-items: center; flex: none; padding-left: 2px; }
/* LOGO 是一张图片（后台配置），放大到 46px 高；不显示额外的文字标题 */
.tb-logo { height: 46px; width: auto; max-width: 340px; object-fit: contain; display: block; }
.tb-logo-fallback {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; box-shadow: var(--accent-shadow);
}

.tb-tabs-area {
  flex: 1; min-width: 0; height: 100%;
  display: flex; align-items: center; gap: 4px; padding: 0 10px;
  overflow-x: auto; scrollbar-width: none;
}
.tb-tabs-area::-webkit-scrollbar { display: none; }
.tb-tab {
  height: 26px; padding: 0 11px; flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary);
  font-size: 12.5px; cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.tb-tab:hover { background: rgba(255, 255, 255, .7); color: var(--text-primary); }
.tb-tab.on {
  background: #FFFFFF; border-color: var(--border);
  color: var(--text-primary); font-weight: 600; box-shadow: var(--shadow-xs);
}
.tb-tab b { color: var(--accent); font-weight: 600; }

.tb-right { display: flex; align-items: center; gap: 8px; flex: none; }

/* 顶栏按钮：白底 + 细边框 + 圆角 8（兑换 / 购买云真机） */
.tb-act {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #FFFFFF; color: var(--text-primary);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.tb-act:hover { background: var(--bg-hover); border-color: #C9D8F5; color: var(--accent-2); }
.tb-act .ico { display: inline-flex; color: var(--accent); }

/* 图标按钮（铃铛） */
.tb-icon {
  width: 32px; height: 32px; flex: none; position: relative;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #FFFFFF; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition);
}
.tb-icon:hover { background: var(--bg-hover); border-color: #C9D8F5; color: var(--accent-2); }
.tb-icon .badge {
  position: absolute; top: -6px; right: -7px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: 9px; line-height: 16px; text-align: center;
}

/* 余额胶囊：白底，只显示人民币，不显示积分 / 眼睛 */
.bal-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #FFFFFF; color: var(--text-primary);
  font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.bal-chip:hover { border-color: #C9D8F5; }
.bal-chip .ico { display: inline-flex; color: var(--accent); }
.bal-chip b { color: var(--accent); }

/* 用户区：完整显示账号（手机号），不截断 */
.tb-user {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 11px 0 8px; max-width: none;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #FFFFFF; color: var(--text-primary);
  font-size: 13px; cursor: pointer; transition: all var(--transition);
}
.tb-user:hover { background: var(--bg-hover); border-color: #C9D8F5; }
.tb-user .ico { display: inline-flex; color: var(--accent); flex: none; }
.tb-user span { white-space: nowrap; }

/* ============================ 主体 ============================ */

.app-body { flex: 1; display: flex; overflow: hidden; min-height: 0; }

/* ---- 左侧导航：深蓝灰 ---- */
.sidebar {
  width: var(--sidebar-w); flex: none;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0;
  background: var(--bg-nav);
  border-right: 1px solid var(--border-nav);
}
.sb-top {
  flex: 1; min-height: 0; width: 100%;
  display: flex; flex-direction: column; gap: 2px; padding: 0 0;
  overflow-y: auto; scrollbar-width: none;
}
.sb-top::-webkit-scrollbar { display: none; }
.sb-bottom { display: flex; flex-direction: column; gap: 4px; padding-bottom: 4px; }

.sb-item {
  width: 52px; height: 52px; flex: none; position: relative;
  margin: 2px 8px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--nav-fg); font-size: 11px; cursor: pointer;
  transition: var(--transition);
}
.sb-item:hover { background: var(--bg-nav-hover); color: var(--nav-fg-hover); }
.sb-item.active { background: var(--nav-active-bg); color: var(--nav-active-fg); font-weight: 600; }
.sb-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.sb-icon svg { width: 21px; height: 21px; }
.sb-label { max-width: 52px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-badge {
  position: absolute; top: 5px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: 9px; line-height: 16px; text-align: center;
}

/* ---- 内容区 ---- */
.content-wrap { flex: 1; display: flex; overflow: hidden; min-width: 0; }

/* ---- 分组侧栏（白底） ---- */
.gs-wrapper {
  width: var(--gs-w, 210px); flex: none; align-self: stretch;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
}
.gs-head {
  height: 48px; flex: none;
  display: flex; align-items: center; gap: 6px; padding: 0 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.gs-head-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
}
.gs-head-title::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px;
  background: var(--accent-gradient); flex: none;
}
.gs-body { flex: 1; overflow: auto; padding: 8px 8px 12px; }

.gs-group { margin-bottom: 3px; }
.gs-tag-row {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  transition: var(--transition);
}
.gs-tag-row:hover { background: var(--bg-hover); color: var(--text-primary); }
.gs-group.focused > .gs-tag-row {
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.gs-caret {
  width: 11px; flex: none; text-align: center;
  font-size: 9px; color: var(--text-tertiary);
  transition: transform var(--transition);
}
.gs-group.open .gs-caret { transform: rotate(90deg); }
.gs-tag-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-count {
  flex: none; font-size: 11px; color: var(--text-tertiary);
  background: var(--bg-soft); border-radius: 999px; padding: 1px 8px;
}
.gs-group.focused > .gs-tag-row .gs-count { background: rgba(47, 111, 235, .14); color: var(--accent); }

.gs-device {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 22px; margin-top: 2px;
  border-radius: var(--radius-xs); font-size: 12px;
  color: var(--text-tertiary); cursor: pointer;
  transition: var(--transition);
}
.gs-device:hover { background: var(--bg-hover); color: var(--text-primary); }
.gs-device.focused {
  background: var(--accent-soft); color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.gs-device .key { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-device .days { flex: none; }
.gs-device-empty { color: var(--text-tertiary); cursor: default; }
.gs-device-empty:hover { background: transparent; }

/* 分组树里的复选框：勾分组 = 展开 + 全选；勾设备 = 选中该设备 */
.gs-cb {
  width: 14px; height: 14px; flex: none;
  margin: 0 7px 0 0; padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.gs-cb:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.gs-resize { width: 2px; flex: none; cursor: col-resize; background: transparent; }
.gs-resize:hover, .gs-resize.dragging { background: var(--accent); }

/* ---- 设备墙区 ---- */
.wall-right { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-base); }

/* 视图容器：同一时刻只显示一个（设备 / 云盘 / 购买 / 订单） */
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.view[hidden] { display: none !important; }
.page-scroll { flex: 1; overflow: auto; padding: 4px 16px 24px; }

/* 通用页面元素（云盘 / 购买 / 订单共用） */
.page-head { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.page-head h2 {
  margin: 0; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.page-head h2 .ph-ico {
  width: 32px; height: 32px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.page-head h2 .ph-ico svg { width: 18px; height: 18px; }
.page-head h2 .ph-sub { font-size: 12px; font-weight: 400; color: var(--text-tertiary); margin-left: 2px; }

.pcard {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}
.pcard > h3 {
  margin: 0 0 6px; font-size: 14.5px; font-weight: 600;
  display: flex; align-items: center; gap: 9px;
}
.pcard > h3::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: var(--accent-gradient); flex: none;
}
.pcard .hint { color: var(--text-tertiary); font-size: 12.5px; margin-bottom: 12px; }

/* ---- 统计卡片 ---- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(182px, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.stat-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); border-color: var(--border-accent); }
.stat-ico {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.stat-ico svg { width: 19px; height: 19px; }
.stat-ico.green { background: var(--success-bg); color: var(--success); }
.stat-ico.orange { background: var(--warning-bg); color: var(--warning); }
.stat-ico.gray { background: var(--bg-soft); color: var(--text-secondary); }
.stat-meta { min-width: 0; }
.stat-meta .n {
  font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-meta .l { font-size: 12px; color: var(--text-tertiary); margin-top: 1px; white-space: nowrap; }

/* ---- 规格条：每项一个浅底小卡片 ---- */
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 8px; }
.specs > div {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 13px;
  background: var(--bg-grad-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  transition: var(--transition);
}
.specs > div:hover { border-color: var(--border-accent); background: var(--bg-tint); }
.specs > div .k { color: var(--text-tertiary); flex: none; }
.specs > div .v {
  margin-left: auto; color: var(--text-primary); font-weight: 600;
  text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.specs > div .v.accent { color: var(--accent); }

/* ---- 文件名 + 类型图标 ---- */
.fname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fico {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: .4px;
  background: var(--bg-soft); color: var(--text-secondary);
}
.fico.zip { background: #FFF3E0; color: #B45309; }
.fico.apk { background: #E8F5E9; color: #1A7F4B; }
.fico.doc { background: #EAF1FE; color: #2F6FEB; }
.fico.img { background: #F3E8FF; color: #7C3AED; }
.fico.med { background: #FCE7F3; color: #BE185D; }
.fname .fn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fname .fs { font-size: 11.5px; color: var(--text-tertiary); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ptile {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
  background: var(--bg-surface); cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.ptile:hover { box-shadow: var(--shadow-card); border-color: var(--border-accent); transform: translateY(-1px); }
.ptile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-card);
}
.ptile-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.pt-ico {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--text-secondary);
  transition: var(--transition);
}
.pt-ico svg { width: 17px; height: 17px; }
.ptile.active .pt-ico { background: var(--accent-soft); color: var(--accent); }
.ptile-head .nm { font-size: 14.5px; font-weight: 600; }
.ptile .sub { color: var(--text-tertiary); font-size: 12px; margin-top: 3px; }
/* 库存状态点 */
.stock { display: inline-flex; align-items: center; gap: 6px; }
.stock::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); flex: none;
}
.stock.no { color: var(--danger); }
.stock.no::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-secondary);
  font-size: 11.5px; margin-left: 6px;
}
.tag.ok { background: var(--success-bg); color: var(--success); }
.tag.err { background: var(--danger-bg); color: var(--danger); }
.specs div span { color: var(--text-tertiary); }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; margin-top: 6px; }
.ptile.center { text-align: center; }
.ptile .t { font-size: 13px; color: var(--text-tertiary); }
.ptile .p { font-size: 19px; font-weight: 700; margin-top: 4px; }

.ptable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.ptable th, .ptable td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); text-align: left; }
.ptable th {
  color: var(--text-tertiary); font-weight: 500; white-space: nowrap;
  font-size: 11.5px; letter-spacing: .3px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
}
.ptable th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.ptable th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.ptable tbody tr { transition: background var(--transition); }
.ptable tbody tr:hover { background: var(--bg-tint); }
.ptable tbody tr:last-child td { border-bottom: 0; }

.pmsg { padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 10px; font-size: 13px; display: none; }
.pmsg.ok { background: var(--success-bg); color: var(--success); display: block; }
.pmsg.err { background: var(--danger-bg); color: var(--danger); display: block; }

.ptabs { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }
.ptab {
  height: 36px; padding: 0 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); color: var(--text-primary);
  font-size: 13.5px; cursor: pointer; transition: var(--transition);
}
.ptab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ★ 2026-10-08 按客户要求：购买 / 续费 / 充值 改成**左侧竖排**（原来是顶部横排）。
   左侧固定宽度的标签栏 + 右侧内容区；窄屏自动回退成横排，避免侧栏把内容挤坏。 */
.shop-wrap { display: flex; gap: 16px; align-items: flex-start; }
.shop-tabs {
  flex-direction: column;
  align-items: stretch;
  width: 132px;
  flex: 0 0 132px;
  margin-bottom: 0;
  position: sticky;
  top: 0;
}
.shop-tabs .ptab { width: 100%; padding: 0 12px; }
.shop-tabs .spacer { flex: 0 0 auto; height: 4px; }
.shop-tabs .hint { font-size: 12px; padding: 2px; line-height: 1.5; }
.shop-panes { flex: 1; min-width: 0; }
@media (max-width: 900px) {
  .shop-wrap { display: block; }
  .shop-tabs { flex-direction: row; align-items: center; width: auto; flex: none; margin-bottom: 14px; position: static; }
  .shop-tabs .ptab { width: auto; }
}

.pay-list { display: flex; flex-wrap: wrap; gap: 10px; }
.pay {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; min-width: 180px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); cursor: pointer; transition: var(--transition);
}
.pay.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.pay .ico { width: 26px; height: 26px; object-fit: contain; flex: none; }
.pay .ico-ph { width: 26px; height: 26px; flex: none; border-radius: 7px; background: var(--bg-soft); }
.pay .lb { font-size: 13px; white-space: nowrap; }

.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-wrap canvas { width: 220px; height: 220px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

.upload-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.upload-row select { width: auto; min-width: 200px; height: 36px; }
.upload-row input[type=file] { width: auto; height: auto; padding: 6px 0; border: 0; background: transparent; }

.wall-toolbar {
  flex: none; position: relative;
  display: flex; align-items: center; gap: 4px; padding: 10px 16px 9px;
  border-bottom: 1px solid var(--border-soft);
}
.tb-btn {
  height: 30px; min-width: 30px; padding: 0 11px;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #FFFFFF; color: var(--text-secondary);
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}
.tb-btn:hover { background: var(--bg-hover); border-color: var(--border-accent); color: var(--accent-2); }
.tb-btn.on {
  background: var(--accent-gradient); border-color: transparent; color: #fff;
  box-shadow: var(--accent-shadow);
}
.tb-btn.on:hover { background: var(--accent-2); color: #fff; }
.tb-btn:disabled { opacity: .45; cursor: not-allowed; }
.tb-btn .caret { font-size: 9px; opacity: .7; }
.tb-sep { width: 1px; height: 16px; background: var(--border); margin: 0 6px; flex: none; }

/* 小屏大小滑条（内联在工具条右侧，实时改卡片宽度） */
.zoom-range {
  width: 110px; height: auto; flex: none;
  margin: 0 8px; padding: 0; border: 0;
  background: transparent; box-shadow: none;
  accent-color: var(--accent); cursor: pointer;
}
.zoom-range:focus { outline: none; box-shadow: none; }

/* 卡片网格：230px 列宽 + 6px 间距（照 ui-polish 的 .grid 规则） */
.wall-content { flex: 1; position: relative; overflow: hidden auto; padding: 0 16px 20px; }
.wall-grid {
  display: grid; gap: var(--card-gap);
  grid-template-columns: repeat(auto-fill, var(--card-w));
  justify-content: start; align-items: start; align-content: start;
  width: 100%;
}

/* ============================ 设备卡片 ============================ */

.device-card {
  position: relative; width: 100%; min-width: 0;
  display: flex; flex-direction: column; align-self: start;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);          /* 10px */
  box-shadow: var(--shadow-xs);
  overflow: hidden; cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.device-card:hover { box-shadow: 0 8px 24px rgba(16, 24, 40, .10); border-color: #D7DEEA; }
.device-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), 0 8px 24px rgba(47, 111, 235, .16); }
.device-card.dc-offline { opacity: .78; }

/* 画面框按设备比例 1:2，下面不会留白条 */
.dc-screen {
  position: relative; width: 100%; flex: none;
  aspect-ratio: 1 / 2; background: #000; overflow: hidden;
}
.dc-canvas { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }

.dc-hint {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 10px; text-align: center;
  color: rgba(255, 255, 255, .55); font-size: 11.5px;
}
/* 转圈：只在「连接中」时出现，纯 CSS，不用定时器 */
.dc-hint:not(:empty)::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .14);
  border-top-color: rgba(255, 255, 255, .55);
  animation: dc-spin .9s linear infinite;
}
@keyframes dc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .dc-hint:not(:empty)::before { animation: none; }
}
.dc-offline-mask {
  position: absolute; inset: 0; z-index: 8;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 14, 22, .5);
}
.dc-offline-mask span { color: #fff; font-size: 17px; font-weight: 700; letter-spacing: 3px; }

/* 到期徽章：小屏顶部居中，浅绿色小椭圆 */
.dc-expiry {
  position: absolute; left: 50%; top: 5px; transform: translateX(-50%);
  z-index: 7; padding: 0 6px; border-radius: 999px;
  background: rgba(134, 239, 172, .9); color: #14532D;
  font-size: 9.5px; font-weight: 600; line-height: 14px; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15); pointer-events: none;
}
.dc-expiry.level-warning { background: rgba(253, 224, 71, .92); color: #713F12; }
.dc-expiry.level-danger { background: rgba(252, 165, 165, .94); color: #7F1D1D; }
.dc-expiry.level-expired { background: rgba(203, 213, 225, .92); color: #334155; }

/* 勾选框：按需求隐藏（选中状态由卡片蓝色描边体现） */

.dc-info {
  position: relative; flex: none; padding: 8px 10px 8px 13px;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-subtle) 100%);
  border-top: 1px solid var(--border-soft);
}
/* 左侧状态色条：在线绿 / 离线红 */
.dc-info::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--danger);
}
.device-card:not(.dc-offline) .dc-info::before { background: #12B76A; }
.dc-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; line-height: 1.35; }
/* ★ 2026-10-08 底栏优先级：**设备ID 最高**（绝不被备注挤掉），备注先让位。
   ID 和备注都带省略号，鼠标悬停看全文（title 提示）。 */
.dc-idwrap { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.dc-serial {
  flex: 0 0 auto; min-width: 0; max-width: 100%;
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dc-online-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--danger); box-shadow: 0 0 0 3px rgba(214, 69, 69, .12);
}
.dc-online-dot.online { background: #12B76A; box-shadow: 0 0 0 3px rgba(18, 183, 106, .16); }

/* 列表视图 */

/* 新建分组（固定在分组列表最底部） */
.gs-new {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 8px; padding: 9px 10px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  color: var(--text-tertiary); font-size: 12.5px; cursor: pointer;
  transition: var(--transition);
}
.gs-new:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); border-style: solid; }
.gs-new svg { width: 13px; height: 13px; }

.wall-empty { padding: 70px 20px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.wall-empty b { display: block; color: var(--text-secondary); font-size: 14.5px; margin-bottom: 8px; font-weight: 600; }
.wall-empty::before {
  content: ""; display: block; width: 62px; height: 62px; margin: 0 auto 16px;
  border-radius: 18px; background: var(--bg-grad-soft);
  border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8B2C1' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='4' width='19' height='13' rx='2'/%3E%3Cpath d='M8.5 20.5h7M12 17v3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 28px 28px;
}

/* ============================ 浮层 ============================ */

.menu-layer { position: fixed; inset: 0; z-index: 2000; }

.ctx-menu {
  position: fixed; z-index: 2100;
  min-width: 176px; padding: 6px;
  background: #FFFFFF;
  border: 1px solid #E6E8EE;
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 36px rgba(16, 24, 40, .18), 0 2px 8px rgba(16, 24, 40, .06);
  animation: menu-drop .14s ease;
}
@keyframes menu-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ctx-head {
  padding: 7px 10px 8px; margin-bottom: 4px;
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  border-bottom: 1px solid #EEF1F6;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; margin: 1px 0;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-primary); cursor: pointer;
  transition: var(--transition);
}
.menu-item:hover { background: #EEF3FF; color: #1B4FD8; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-bg); color: var(--danger); }
.menu-div { height: 1px; margin: 5px 8px; background: #EEF1F6; }
/* ★ 2026-10-08：右键 / 批量操作菜单里的小标题（客户要求「快捷指令」做成小标题，
   下面把后台配的指令一行一行列出来） */
.menu-section {
  padding: 8px 12px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--text-tertiary, #8A94A8); cursor: default; user-select: none;
}

/* ★ 2026-10-08 实名认证未完成时的常驻提醒条（顶栏下方） */
.rn-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; font-size: 13px;
  background: #FFF7E6; color: var(--warning, #C2410C);
  border-bottom: 1px solid #F0DCB4;
}
.rn-bar b { font-weight: 700; }
.rn-bar .spacer { flex: 1; }
.rn-bar-ico {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--warning, #C2410C); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 18px; text-align: center;
}
.rn-bar > span:nth-child(2) { flex: 1; }

/* ★ 2026-10-08 实名认证的合规告知 + 同意勾选（《个人信息保护法》要求告知并取得同意） */
.rn-notice {
  margin-top: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid rgba(47, 111, 235, .18);
  font-size: 12.5px; line-height: 1.7; color: var(--text-secondary);
}
.rn-notice b { color: var(--text-primary); }
.rn-consent {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 10px;
  font-size: 12.5px; line-height: 1.6; color: var(--text-secondary); cursor: pointer;
}
.rn-consent input[type="checkbox"] { margin-top: 2px; }
.rn-consent a { color: var(--accent); text-decoration: none; }
.rn-consent a:hover { text-decoration: underline; }
.rn-agreement {
  font-size: 12.5px; line-height: 1.85; color: var(--text-secondary);
  background: var(--bg-subtle); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.rn-agreement b { display: block; margin-top: 4px; color: var(--text-primary); }

.toasts {
  position: fixed; left: 50%; top: 68px; transform: translateX(-50%);
  z-index: 3000; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.toast {
  min-width: 160px; max-width: 420px; padding: 9px 18px;
  background: rgba(20, 24, 32, .92); color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  font-size: 13px; text-align: center;
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
.toast.ok { background: rgba(26, 127, 75, .95); }
.toast.err { background: rgba(214, 69, 69, .95); }
.toast.warn { background: rgba(194, 65, 12, .95); }

dialog {
  padding: 0; width: 420px; max-width: 94vw;
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: #FFFFFF; color: var(--text-primary);
  box-shadow: var(--shadow-xl);
}
dialog::backdrop { background: rgba(16, 20, 28, .45); }
dialog h3 {
  margin: 0; padding: 15px 18px; font-size: 15px; font-weight: 600;
  border-bottom: 1px solid #EEF1F6;
}
.dlg-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow: auto; }
.dlg-foot {
  padding: 13px 18px; display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid #EEF1F6; background: var(--bg-subtle);
}

/* ============================ 表单 ============================ */

input, select, textarea {
  width: 100%; height: 36px; padding: 0 11px;
  background: #FFFFFF; color: var(--text-primary);
  border: 1px solid #D8DDE5; border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; outline: none; transition: var(--transition);
}
textarea { height: auto; padding: 9px 11px; }
/* ★★ 2026-10-08 统一收掉勾选框的尺寸。
   上面这条 `input, select, textarea{ width:100%; height:36px }` 是给**文本框 / 下拉框**
   用的，但 checkbox / radio 也继承了它 —— 勾选框被撑成 36px 大方块，非常难看。
   项目里之前都是在各页面单独打补丁（.auth-row input[type=checkbox]、.tk-check input…），
   所以一路漏（工单的设备勾选、转移弹窗的确认勾选全中招）。
   现在在这里一次收干净：勾选框 13px（比浏览器默认再小一点点），
   不再继承 100% 宽高，也禁止被 flex 拉伸。以后新加勾选框不用再管。 */
input[type="checkbox"], input[type="radio"] {
  width: 13px; height: 13px; min-width: 13px; flex: 0 0 auto;
  padding: 0; margin: 0; border-radius: 3px;
  accent-color: var(--accent); cursor: pointer;
}
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: var(--text-tertiary); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }

.btn {
  height: 34px; padding: 0 15px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #FFFFFF; color: var(--text-primary);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: #C9D8F5; color: var(--accent-2); }
.btn.pri {
  background: var(--accent-gradient); border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: var(--accent-shadow);
}
.btn.pri:hover { background: var(--accent-2); color: #fff; }
/* ★ 2026-10-08 红色按钮：用于"确认执行危险操作"（二次确认弹窗的确定键） */
.btn.danger {
  background: var(--danger, #D64545); border-color: var(--danger, #D64545); color: #fff;
}
.btn.danger:hover:not(:disabled) { background: #C03A3A; border-color: #C03A3A; color: #fff; }
/* 倒计时期间：明显是"还不能点"的样子（禁用时连红色都压暗一点） */
.btn.danger:disabled { background: var(--danger, #D64545); border-color: var(--danger, #D64545); opacity: .45; cursor: not-allowed; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.block { width: 100%; height: 38px; }

/* 验证码行：输入框与手机号框同宽，右端方形圆角按钮 */
.code-row { position: relative; display: block; }
.code-row input { padding-right: 126px; }
.code-row .btn-code {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: calc(100% - 12px); min-width: 104px; padding: 0 12px;
  border: none; border-radius: var(--radius); cursor: pointer;
  background: var(--accent-gradient); color: #fff;
  font-size: 13px; font-weight: 500; box-shadow: var(--accent-shadow);
}
.code-row .btn-code:hover { background: var(--accent-2); }
.code-row .btn-code:disabled { background: #C9D3E4; color: #7A8699; box-shadow: none; cursor: default; }

/* ============================ 登录 / 注册 / 找回密码 ============================ */

.auth {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base);
}
.auth-card {
  width: 400px; max-width: 94vw; padding: 34px 32px 28px;
  background: #FFFFFF; border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 16px; }
.auth-logo img { height: 52px; width: auto; max-width: 100%; object-fit: contain; }
.auth-logo .mark {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 700; box-shadow: var(--accent-shadow);
}
.auth-card h1 { margin: 0 0 6px; font-size: 19px; font-weight: 700; text-align: center; }
/* 副标题保留元素与行距（只清文字），避免切换时页面跳动 */
.auth-sub { margin: 0 0 20px; min-height: 18px; text-align: center; color: var(--text-tertiary); font-size: 12.5px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-links {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; font-size: 12.5px; color: var(--text-tertiary);
}
.auth-links button {
  border: 0; background: transparent; color: var(--accent);
  font-size: 12.5px; cursor: pointer; padding: 0;
}
.auth-links button:hover { color: var(--accent-2); text-decoration: underline; }
.auth-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-tertiary); }
.auth-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.auth-row input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--accent); margin: 0; }

/* ★ 2026-10-08 注册页协议勾选（合规：不勾不能注册） */
.auth-agree {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 10px 0 4px; font-size: 12.5px; line-height: 1.6;
  color: var(--text-secondary); cursor: pointer; text-align: left;
}
.auth-agree input[type="checkbox"] { margin-top: 2px; }
.auth-agree a { color: var(--accent); text-decoration: none; }
.auth-agree a:hover { text-decoration: underline; }
@keyframes yjShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.auth-agree.shake { animation: yjShake .18s 2; }

/* ★ 2026-10-08 云盘分发：分发中 / 分发完成 的界面 */
.push-run { text-align: center; padding: 26px 10px 18px; }
.push-spin {
  width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: yjSpin .8s linear infinite;
}
@keyframes yjSpin { to { transform: rotate(360deg); } }
.push-run-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.push-run-sub { margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.push-run-tip {
  margin: 12px auto 0; max-width: 380px; font-size: 12.5px; line-height: 1.7;
  color: var(--text-secondary); background: var(--bg-subtle);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 9px 12px;
}
.push-run-timer { margin-top: 12px; font-size: 12.5px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

.push-done { padding: 6px 2px 2px; }
.push-done-title { font-size: 15px; font-weight: 700; color: var(--success, #17936A); margin-bottom: 12px; }
.push-dir {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid rgba(47, 111, 235, .18);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px;
}
.push-dir-label { font-size: 12px; color: var(--text-secondary); flex: none; }
.push-dir-path {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--text-primary); word-break: break-all;
}


/* ============================ 大屏投屏窗 ============================
   外观与交互照电脑版的「控制大屏」（large-screen.js）逐条复刻：
   32px 浅色标题栏 + 48px 右侧按键条 + 直角细边框 + 右下角拖拽缩放。
   ==================================================================== */

.ls-win {
  position: fixed; display: flex; flex-direction: column;
  min-width: 220px; min-height: 320px;
  background: #FFFFFF; border: 1px solid #D8DBE2; border-radius: 2px;
  overflow: hidden; box-shadow: 0 8px 32px rgba(0, 0, 0, .14);
  transition: width .16s ease, height .16s ease;
  animation: lsIn .14s ease-out;
}
.ls-win.sizing { transition: none; }          /* 手动拖拽缩放时关过渡，保持跟手 */
@keyframes lsIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---- 标题栏：号码徽标 + 模式徽标 + 设备名 + 关闭 ---- */
.ls-head {
  flex: none; height: 32px; display: flex; align-items: center; gap: 6px;
  padding: 0 6px 0 10px; background: #F6F7F9; border-bottom: 1px solid #E6E8EE;
  cursor: grab; user-select: none;
}
.ls-head:active { cursor: grabbing; }
.ls-num {
  flex: none; min-width: 20px; height: 14px; line-height: 14px; text-align: center;
  background: #E8EAF0; color: #3A4049; border-radius: 2px; font-size: 10px; font-weight: 600;
}
.ls-mode { flex: none; height: 14px; line-height: 14px; padding: 0 4px; border-radius: 2px; color: #8A909C; font-size: 10px; }

/* ★ 2026-10-08 大屏顶部白条右侧：延迟 / 帧率 */
.ls-stat { margin-left: auto; margin-right: 8px; display: flex; align-items: center; gap: 10px; flex: none; }
.ls-stat i { font-style: normal; font-size: 11px; color: #6B7280; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ls-stat i.warn { color: #C2410C; font-weight: 600; }
.ls-title {
  flex: 1; min-width: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
  color: #33383F; font-size: 13px; font-weight: 600; text-align: left;
}
.ls-actions { flex: none; display: flex; }
.ls-close {
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 0; border-radius: 4px; background: transparent;
  color: #8A909C; font-size: 16px; line-height: 1; cursor: pointer;
  transition: color .15s, background .15s;
}
.ls-close:hover { color: #E14A5A; background: #FBEDEF; }

/* ---- 主体：画面 + 右侧按键条 ---- */
.ls-main { flex: 1; display: flex; min-height: 0; }
.ls-body {
  position: relative; flex: 1 1 auto; background: #0E1420; min-height: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.ls-body canvas {
  display: block;
  /* ★★ 2026-10-10 去掉 `width:100%; height:100%; object-fit: contain` ——
     它把 canvas 当"替换元素"按位图固有比例缩放，**和我们用 JS 算出来的显示尺寸互相打架**：
     位图是竖的、容器是横的时候，画面会被挤成中间一条细竖条、两侧一大块黑
     （客户截图正是这个现象）。
     现在画布的显示宽高完全由 JS 精确设置（按位图比例 + 容器可用区），
     居中交给外层 flex（.ls-body 已经是 align/justify: center）。 */
  background: #000; outline: none; touch-action: none; cursor: crosshair;
}
/* 首帧出来前显示加载圈，不显示黑屏 */
.ls-load {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  background: #0E1420; pointer-events: none;
}
.ls-load span {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .25); border-top-color: #2F6FEB;
  animation: lsSpin .8s linear infinite;
}
@keyframes lsSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ls-load span { animation: none; } }

.ls-ov {
  position: absolute; inset: 0; z-index: 3; display: none;
  align-items: center; justify-content: center; padding: 16px; text-align: center;
  background: #0E1420; color: #98A2B3; font-size: 12.5px;
}
.ls-toast {
  position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  background: rgba(20, 22, 29, .88); color: #FFFFFF;
  padding: 6px 14px; border-radius: 6px; font-size: 12px;
  pointer-events: none; z-index: 5; opacity: 0; transition: opacity .25s;
}
.ls-toast.show { opacity: 1; }

/* ---- 右侧按键条（48px 白条，不盖住画面）---- */
.ls-side {
  flex: none; width: 48px; display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 8px 0;
  background: #F6F7F9; border-left: 1px solid #E6E8EE;
  overflow: hidden; position: relative; z-index: 3;
}
.ls-qc {
  flex: 0 1 auto; min-height: 0; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  overflow-y: auto; overflow-x: hidden;
}
.ls-qc::-webkit-scrollbar { width: 4px; }
.ls-qc::-webkit-scrollbar-thumb { background: #D3D7DE; border-radius: 2px; }
.ls-side-fill { flex: 1 1 auto; min-height: 8px; }

.ls-side .yj-key {
  width: 34px; height: 34px; padding: 0; flex: none;
  display: grid; place-items: center;
  /* ★ 2026-10-08 客户要求：右侧按键（音量±/菜单/主页/返回/快捷指令）**圆形改方形** */
  border-radius: 8px;
  border: 1px solid #D8DBE2; background: #FFFFFF; color: #3A4049;
  cursor: pointer; transition: all .15s;
}
.ls-side .yj-key:hover { border-color: #2F6FEB; color: #2F6FEB; background: #F3F7FF; }
.ls-side .yj-key.pri { background: #2F6FEB; border-color: #2F6FEB; color: #fff; }
.ls-side .yj-key.pri:hover { background: #1E5BD6; border-color: #1E5BD6; color: #fff; }
.ls-side .yj-key.active { transform: scale(.92); }
.ls-side .yj-key svg { pointer-events: none; }
.ls-side .yj-key img { width: 18px; height: 18px; object-fit: contain; display: block; pointer-events: none; }

/* 悬停名称提示（fixed 浮层，不会被侧栏 overflow 裁掉） */
.ls-tip {
  position: fixed; z-index: 99999; display: none;
  background: rgba(20, 22, 29, .94); color: #fff;
  font-size: 12px; line-height: 1; padding: 6px 9px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

/* 右下角缩放手柄（斜纹） */
.ls-resize {
  position: absolute; right: 0; bottom: 0; width: 16px; height: 16px;
  cursor: nwse-resize; z-index: 4; opacity: .6;
  background: linear-gradient(135deg, transparent 52%, #B9BEC8 52%, #B9BEC8 60%, transparent 60%, transparent 70%, #B9BEC8 70%, #B9BEC8 78%, transparent 78%);
}
.ls-resize:hover { opacity: 1; }

/* ============================================================
   ★ 2026-10-06 同步操控（群控）模式
   打开工具栏「同步操控」后，在任意一台上操作会同步到其它已勾选的设备。
   注：卡片上**不再画勾选框** —— 网格里显示的必然都是已勾选的设备，
   卡片上不存在"未选中"状态，再摆一个勾选框只会让人以为可以点它反选。
   ============================================================ */
/* 同步操控打开时选中卡片加提示描边，避免误以为还是普通浏览 */
body.yj-sync .device-card.selected { box-shadow: 0 0 0 2px var(--accent-2), var(--shadow-sm); }
#btnSync.on #syncCount { color: #fff; font-weight: 600; }

/* ★ 2026-10-06：断开/出错/正在投屏中 → 只显示文字，不要再转圈
   （转圈来自 .dc-hint:not(:empty)::before：只要有文字就转，
     于是"连接已断开"旁边永远挂着一个圈，看起来像还在加载） */
.dc-hint.no-spin::before { display: none; }
/* 正在投屏中：彻底黑屏 + 居中白字，不显示任何残留画面 */
.dc-hint.playing { color: rgba(255,255,255,.78); font-size: 12.5px; letter-spacing: .5px; }



/* ============================================================
   ★ 2026-10-06 左侧「分组」列表（按用户要求调整）
     · 每个分组就是一张卡片：只有边框，**不用单独颜色**
     · 分组高度更矮、组与组之间更紧
     · 组内"设备那一行"比分组小一号，紧贴在分组下面
     · 「＋ 新建分组」：蓝底 + 黑字
   ============================================================ */
.gs-body { padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 5px; }

/* 分组卡片：统一白底 + 边框，不再用彩色 */
.gs-group {
  margin-bottom: 0;
  background: #FFFFFF;
  border: 1px solid var(--line, #E6E9EF);
  border-radius: 8px;
  padding: 2px 4px 3px;
  box-shadow: 0 1px 1px rgba(16,24,40,.03);
}
.gs-group:hover { border-color: var(--border-accent, #C9D6EE); }
.gs-group.focused { border-color: var(--accent-2, #2F6FEB); box-shadow: 0 0 0 1px rgba(47,111,235,.18); }

/* 分组那一行：比原来矮一截，仍保持加粗显眼 */
.gs-tag-row {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary, #1F2430);
  padding: 3px 7px;
  border-radius: 6px;
  min-height: 26px;
}
.gs-tag-name { font-weight: 700; }
.gs-count { font-weight: 600; font-size: 11.5px; }

/* 组内"设备那一行"：小一号，紧贴分组下面 */
.gs-device {
  margin-left: 12px;
  font-size: 11.5px;
  line-height: 1.4;
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--text-secondary, #5A6172);
}
.gs-device + .gs-device { margin-top: 0; }
.gs-device:hover { background: var(--bg-hover, #F2F5FA); }
.gs-device.focused { background: rgba(47,111,235,.12); color: var(--accent-2, #2F6FEB); font-weight: 600; }

/* 「＋ 新建分组」：蓝底 + 黑字 */
.gs-new,
.gs-new:link,
.gs-new:visited {
  background: #2F6FEB !important;
  color: #111827 !important;
  border: 1px solid #2F6FEB !important;
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: 4px;
}
.gs-new:hover { background: #1E5BD6 !important; color: #000 !important; }
.gs-new * { color: #111827 !important; }

/* ============================================================
   工单（2026-10-08）
   客户端提交工单：设备多选 / 问题类型 / 详细描述 / 最多 3 张截图 / 是否允许换机
   ============================================================ */

/* 页面上用到、但之前没有的通用小件 */
.loading-row { display: flex; align-items: center; gap: 8px; padding: 26px 0; justify-content: center; color: var(--text-secondary); font-size: 13px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%; animation: tk-sp .8s linear infinite; }
@keyframes tk-sp { to { transform: rotate(360deg); } }
.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.req { color: var(--danger); }
.tag.warn { background: #FDF3E7; color: var(--warning); }

/* 提交弹窗 */
.tk-field { margin-bottom: 14px; }
.tk-field > label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; }
.tk-field textarea,
.tk-field select,
.tk-field input[type="file"] {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text-primary); font-size: 13px; padding: 8px 10px;
  font-family: inherit;
}
.tk-field textarea { resize: vertical; line-height: 1.6; }

.tk-devlist { max-height: 220px; overflow: auto; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-subtle); padding: 6px; }
.tk-dev { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px;
  font-size: 12.5px; cursor: pointer; }
.tk-dev:hover { background: var(--bg-hover); }
.tk-dev-id { font-family: ui-monospace, Consolas, monospace; font-weight: 600; color: var(--text-primary); }
.tk-dev-sup { color: var(--text-secondary); }
.tk-dev .spacer { flex: 1; }
.tk-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; flex: 0 0 8px; }
.tk-dot.on { background: var(--success); }
.tk-dot.off { background: #C7CDD8; }

.tk-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary);
  cursor: pointer; margin-bottom: 0; }
.tk-check input { width: auto; }

.tk-shots, .tk-shotrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.tk-shot { position: relative; width: 92px; height: 92px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-subtle); overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
.tk-shot img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.tk-shot-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0;
  border-radius: 50%; background: rgba(16, 24, 40, .66); color: #fff; font-size: 14px; line-height: 1;
  cursor: pointer; }
.tk-shot-del:hover { background: var(--danger); }

/* 详情弹窗 */
.tk-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 7px 14px;
  background: var(--bg-subtle); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 12px 14px; }
.tk-kv > div { display: flex; gap: 8px; font-size: 12.5px; align-items: baseline; }
.tk-kv span { color: var(--text-secondary); flex: 0 0 88px; }
.tk-kv b { color: var(--text-primary); font-weight: 600; word-break: break-all; }
.tk-quote { background: var(--bg-subtle); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; line-height: 1.65;
  color: var(--text-primary); white-space: pre-wrap; }

.tk-replies { display: flex; flex-direction: column; gap: 8px; }
.tk-reply { border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  background: var(--bg-subtle); padding: 9px 12px; }
.tk-reply-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 5px; }
.tk-reply-head .spacer { flex: 1; }
.tk-reply-body { font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; line-height: 1.6; }

/* ============================================================
   设备操作（2026-10-08）
   小屏右下角齿轮 + 快捷操作弹窗（快捷指令宫格 / 换机 / 授权 / 转移）
   ============================================================ */

/* 齿轮按钮：★ 2026-10-08 客户要求**常驻显示**（原来只在鼠标悬停卡片时才出现） */
.dc-gear {
  position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(16, 24, 40, .55); color: #fff;
  opacity: .9; transition: opacity .15s, background .15s, transform .1s;
  z-index: 3;
}
.dc-gear:hover { background: var(--accent); opacity: 1; }
.dc-gear:active { transform: scale(.94); }

/* 设备卡片底部的「本地备注」（只在本机，不上传服务器） */
/* ★ 2026-10-08 底栏：设备ID + 紧挨其右侧的备注，在线小圆点推到最右。
   备注**先让位**（可被压缩到 0 并显示省略号），ID 优先级最高不参与收缩。 */
.dc-note {
  padding: 0 6px; height: 16px; line-height: 16px;
  flex: 0 1 auto; min-width: 0; max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; color: var(--accent); background: var(--accent-soft);
  border-radius: 4px;
}

/* ★★ 2026-10-08 授权状态标签：放在小屏**左下角**（客户要求，先改过右上角又调回左下）。
   左上角是剩余时长，右上角留空，右下角是齿轮，底部条留给设备ID + 我自己的备注。 */
.dc-grant-badge {
  position: absolute; bottom: 6px; left: 6px; z-index: 6;
  padding: 1px 6px; height: 17px; line-height: 17px;
  border-radius: 4px; font-size: 10.5px; font-weight: 600;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
/* 我授权出去的 */
.dc-grant-badge.out { color: #7C2D12; background: #FED7AA; }
/* 别人授权给我的 */
.dc-grant-badge.in { color: #1E3A8A; background: #BFDBFE; }

/* 授权界面：当前授权状态块 */
.ops-grant-out {
  border: 1px solid #F5D08A; background: #FFFBF2; border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 4px;
}
.ops-grant-title { font-size: 12.5px; font-weight: 700; color: #B45309; margin-bottom: 8px; }
.ops-grant-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; flex-wrap: wrap; }
.ops-grant-row + .ops-grant-row { border-top: 1px dashed #F0DCB4; }
.ops-grant-arrow { color: var(--text-tertiary, #8A94A8); }
.ops-grant-left { margin-left: auto; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ---- 设备操作弹窗：顶部 4 个 TAB ---- */
.ops-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.ops-tab {
  height: 34px; padding: 0 14px; border: 0; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--text-secondary); font-family: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.ops-tab:hover { color: var(--text-primary); }
.ops-tab.active { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.ops-pane { min-height: 120px; }
.ops-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.ops-glyph { font-size: 20px; line-height: 1; color: #000; }

/* 弹窗内的宫格按钮：圆角小正方形，上面图标下面名称 */
.ops-head { font-size: 13px; font-weight: 600; color: var(--text-primary); margin: 4px 0 10px; }
.ops-head .hint { font-weight: 400; }
.ops-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.ops-tile {
  width: 92px; min-height: 92px; padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
  font-family: inherit;
}
.ops-tile:hover { border-color: var(--accent); box-shadow: var(--accent-glow) 0 2px 10px; }
.ops-tile:active { transform: scale(.97); }
.ops-tile:disabled { opacity: .55; cursor: default; }
.ops-tile.wide { width: 118px; min-height: 84px; }
.ops-ico { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; color: #000; }
.ops-ico img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
.ops-emoji { font-size: 24px; line-height: 1; }
.ops-name { font-size: 12px; color: var(--text-primary); text-align: center; line-height: 1.3;
  word-break: break-all; }

/* 换机 / 授权 / 转移 弹窗里的表单与列表 */
.ops-field { margin-bottom: 12px; }
.ops-field > label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; }
.ops-field input, .ops-field select {
  width: 100%; box-sizing: border-box; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-primary);
  font-size: 13px; padding: 8px 10px; font-family: inherit;
}
.ops-fee { margin-top: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: #FFF8E8; border: 1px solid #F0DCB4; color: var(--warning); font-size: 13px; }
.ops-fee.bad { background: var(--danger-bg); border-color: #F0CBC5; color: var(--danger); }
.ops-fee b { font-weight: 700; }
.ops-swapout, .ops-devlist { margin: 8px 0; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg-subtle); border: 1px solid var(--border-soft);
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.7; word-break: break-all; }
.ops-pick { max-height: 260px; overflow: auto; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-subtle); padding: 4px; }
.ops-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 6px; font-size: 12.5px; cursor: pointer; }
.ops-row:hover { background: var(--bg-hover); }
.ops-row .spacer { flex: 1; }

/* ============================ 批量操作「当前已打开 APP」 ============================ */
/* ★ 2026-10-10 新增（客户要求）：和设备操作菜单里那 4 个按钮一致的 2×2 网格 */
.app-op-tip {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.6;
}
.app-op-tip b { color: var(--text-primary); }
.app-op-pkg {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 2px; padding: 6px 10px; border-radius: 8px;
  background: var(--bg-subtle); border: 1px solid #E5E9F0;
  font: 12.5px/1.4 ui-monospace, Consolas, monospace; color: var(--text-primary);
  word-break: break-all;
}
.app-op-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px;
}
.app-op-grid button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; border: none; border-radius: 10px; cursor: pointer;
  background: #2F6FEB; color: #fff; font-size: 13.5px; font-weight: 600;
  transition: filter .15s, transform .08s;
}
.app-op-grid button:hover { filter: brightness(1.07); }
.app-op-grid button:active { transform: scale(.98); }
.app-op-grid button.danger { background: #E5484D; }
.app-op-grid button svg { width: 16px; height: 16px; }
.app-op-grid button:disabled { opacity: .55; cursor: not-allowed; }
