* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f4f2; color: #222; }
a { color: #2457c5; }
header { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border-bottom: 1px solid #e6e6e2; position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header h1 { font-size: 16px; margin: 0; flex: 1; white-space: nowrap; }
header .meta { color: #666; font-size: 12px; flex-basis: 100%; order: 3; }
@media (min-width: 700px) { header .meta { flex-basis: auto; order: 0; font-size: 13px; } }
main { max-width: 1100px; margin: 0 auto; padding: 12px; }
.card { background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.card h2 { font-size: 15px; margin: 0 0 10px; }
label { display: block; margin: 8px 0 4px; color: #555; font-size: 13px; }
input, select, button, textarea { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid #ccc; }
input, select, textarea { width: 100%; background: #fff; }
button { background: #222; color: #fff; border: 0; cursor: pointer; }
button.secondary { background: #e7e7e3; color: #222; }
button.danger { background: #c0392b; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.muted { color: #888; font-size: 12px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eee; color: #555; }
.tag.real { background: #e5f4e4; color: #1e7b34; }
.tag.sim { background: #f9eeda; color: #8a5a00; }
.tag.warn { background: #fbebeb; color: #b42318; }
.tag.on { background: #e7f1fb; color: #1d5fa8; }
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.device { border: 1px solid #e6e6e2; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.device .code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #666; }
.player { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.screen { flex: 0 1 400px; width: 100%; }
.phone { width: 100%; aspect-ratio: 9 / 16; background: #111; color: #888; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; touch-action: none; position: relative; }
.nav { display: flex; gap: 8px; margin-top: 8px; }
.nav button { flex: 1; padding: 10px 0; }
.side { flex: 1 1 300px; min-width: 280px; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #eee; padding: 8px 6px; text-align: left; vertical-align: middle; font-size: 13px; }
th { color: #666; font-weight: 500; background: #fafaf8; }
tr.warn td { background: #fdf3f2; }
td input[type=number] { width: 70px; }
td input[type=checkbox] { width: auto; }
.log { font: 12px/1.4 ui-monospace, Menlo, monospace; background: #f7f7f5; padding: 8px; border-radius: 8px; max-height: 160px; overflow: auto; white-space: pre-wrap; margin-top: 8px; }
.hidden { display: none !important; }
.overlay { position: absolute; inset: 0; z-index: 10; cursor: not-allowed; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 12px; }
.modal .box { background: #fff; border-radius: 12px; padding: 14px; width: min(420px, 100%); max-height: 100%; overflow: auto; }
.banner { background: #fbebeb; color: #b42318; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; z-index: 50; pointer-events: none; max-width: 90%; }
#toast.show { opacity: 1; }
#toast.bad { background: #b42318; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button { flex: 1; }
.tabs button.secondary.active { background: #222; color: #fff; }

label:has(> input[type=checkbox]) { white-space: nowrap; }

/* 语言切换 */
.langsw { display: inline-flex; background: #ecece8; border-radius: 10px; padding: 3px; gap: 2px; flex: 0 0 auto; }
.langsw button { background: transparent; color: #555; padding: 5px 10px; font-size: 13px; border-radius: 8px; flex: 0 0 auto; }
.langsw button.on { background: #fff; color: #222; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* 无操作即将退出的提醒 */
.idlewarn { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100vw - 24px); padding: 10px 10px 10px 16px; border-radius: 14px; background: #1f2a33; color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.idlewarn button { flex: 0 0 auto; }

/* 已停用的员工 */
tr.off td { color: #8a8f94; }
tr.off td strong { text-decoration: line-through; }
