* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #0f172a; color: #e5e7eb; font: 14px/1.5 "Microsoft YaHei", system-ui, sans-serif; }
.hidden { display: none !important; }
.view { height: 100%; display: flex; flex-direction: column; }
.grow { flex: 1; }

/* 登录 */
#vLogin { align-items: center; justify-content: center; }
.card { width: 320px; background: #1e293b; padding: 24px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.card h2 { margin: 0 0 18px; font-size: 18px; text-align: center; }
.card label { display: block; margin: 10px 0 4px; font-size: 12px; color: #94a3b8; }
.card input { width: 100%; padding: 9px 10px; border: 1px solid #334155; border-radius: 6px; background: #0f172a; color: #e5e7eb; }
.card button { width: 100%; margin-top: 16px; padding: 10px; border: 0; border-radius: 6px; background: #2563eb; color: #fff; font-size: 15px; cursor: pointer; }
.card button:hover { background: #1d4ed8; }
.err { margin-top: 10px; color: #f87171; font-size: 13px; min-height: 18px; text-align: center; }

/* 按钮 */
.btn { padding: 5px 10px; border: 1px solid #334155; background: #1e293b; color: #e5e7eb; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn:hover { background: #334155; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #7f1d1d; color: #fca5a5; }
.btn.danger:hover { background: #7f1d1d; }
select, input[type=text] { padding: 5px 8px; border: 1px solid #334155; border-radius: 6px; background: #0f172a; color: #e5e7eb; font-size: 13px; }
input[type=text] { min-width: 60px; }

/* 设备列表 */
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #1e293b; }
.topbar h3 { margin: 0; font-size: 15px; font-weight: 600; }
.devlist { padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; overflow: auto; }
.dev { background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 12px 14px; cursor: pointer; }
.dev:hover { border-color: #2563eb; }
.dev.off { opacity: .5; cursor: not-allowed; }
.dev .n { font-weight: 600; }
.dev .m { color: #94a3b8; font-size: 12px; margin-top: 4px; }
.dev .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 6px; }
.dev.off .dot { background: #64748b; }

/* 远控 */
.toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid #1e293b; flex-wrap: wrap; }
.tag { font-weight: 600; color: #93c5fd; }
.stat { font-size: 12px; color: #94a3b8; min-width: 120px; text-align: right; }
.chk { font-size: 12px; color: #94a3b8; display: flex; align-items: center; gap: 4px; }

#stage { flex: 1; position: relative; background: #000; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#screen { max-width: 100%; max-height: 100%; object-fit: contain; cursor: crosshair; outline: none; touch-action: none; background: #000; }
#stage.full { position: fixed; inset: 0; z-index: 50; }
#stage.full #screen { width: 100%; height: 100%; object-fit: contain; }

.sendrow { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid #1e293b; }
.sendrow input { flex: 1; }

.touchbar { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; background: rgba(30,41,59,.9); padding: 6px; border-radius: 8px; }
.touchbar button { padding: 8px 12px; border: 1px solid #475569; background: #334155; color: #e5e7eb; border-radius: 6px; font-size: 13px; }

/* 文件面板 */
.filepanel { position: fixed; right: 12px; top: 56px; width: 620px; max-width: 92vw; max-height: 70vh; background: #1e293b; border: 1px solid #334155; border-radius: 8px; display: flex; flex-direction: column; z-index: 60; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.fbar { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid #334155; flex-wrap: wrap; }
.fbar input { flex: 1; min-width: 120px; }
.flist { flex: 1; overflow: auto; }
.flist table { width: 100%; border-collapse: collapse; font-size: 13px; }
.flist td { padding: 6px 8px; border-bottom: 1px solid #273449; cursor: pointer; }
.flist tr:hover td { background: #273449; }
.flist tr.sel td { background: #1e40af; }
.flist .sz { text-align: right; width: 100px; color: #94a3b8; }
.flist .md { text-align: right; width: 130px; color: #94a3b8; }
.fprog { padding: 6px 8px; font-size: 12px; color: #94a3b8; border-top: 1px solid #334155; min-height: 26px; }

.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); background: #111827ee; border: 1px solid #334155; padding: 8px 16px; border-radius: 6px; z-index: 99; font-size: 13px; }

@media (max-width: 720px) {
  .toolbar { gap: 4px; padding: 6px; }
  .toolbar select, .toolbar .chk { font-size: 12px; }
  .stat { display: none; }
  .filepanel { right: 6px; left: 6px; width: auto; top: 90px; }
}
