* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 14px/1.6 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #17352f; background: #f4f6f7; }
.card { max-width: 640px; margin: 10vh auto; padding: 28px; background: #fff; border-radius: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.card h1 { margin: 4px 0 12px; font-size: 22px; }
.card small { color: #66756f; }
.btn { display: inline-block; margin: 8px 8px 0 0; padding: 9px 18px; border: 0; border-radius: 8px; background: #156e58; color: #fff; font: inherit; text-decoration: none; cursor: pointer; }
.btn.ghost { background: #e6ece9; color: #17352f; }
form { display: inline; }
.viewer { display: flex; flex-direction: column; overflow: hidden; background: #2b2f31; }
.bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #e9eceb; }
.bar.nav { background: #f7f8f8; border-bottom: 1px solid #d5dbd8; }
.bar button { border: 0; background: transparent; padding: 4px 9px; border-radius: 6px; font: inherit; cursor: pointer; }
.bar button:hover { background: #d9e0dd; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; max-width: 220px; min-width: 0; flex: none; background: #dfe4e2 !important; }
.tab .name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tab.on { background: #fff !important; }
.tab .x { flex: none; margin-left: 6px; padding: 0 4px; border-radius: 4px; color: #889; }
.tab .x:hover { background: #c9d1cd; color: #333; }
.who { color: #4b5b55; }
.link { color: #156e58; text-decoration: none; padding: 4px 6px; }
#addr { flex: 1; }
#url { width: 100%; padding: 5px 10px; border: 1px solid #ccd5d1; border-radius: 16px; font: inherit; }
.status { color: #66756f; min-width: 90px; text-align: right; }
.stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#screen { background: #fff; cursor: default; image-rendering: auto; }
.ime { position: absolute; width: 2px; height: 20px; opacity: 0; border: 0; padding: 0; resize: none; pointer-events: none; }
.overlay { position: absolute; inset: 0; background: rgba(20,30,28,.45); display: flex; align-items: center; justify-content: center; }
.overlay[hidden] { display: none; }
.overlay .card { margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #e3e8e6; vertical-align: middle; }
.admin .card { max-width: 1100px; margin: 24px auto; }
.muted { color: #7a8782; font-size: 12px; word-break: break-all; }
.pill { padding: 2px 8px; border-radius: 10px; background: #e6ece9; }
.pill.on { background: #d6f1e6; color: #0f6a4e; }
select, input[type=text] { padding: 5px 8px; border: 1px solid #ccd5d1; border-radius: 6px; font: inherit; }

.home { position: absolute; inset: 0; background: #f4f6f7; overflow: auto; padding: 48px 8vw; }
.home[hidden] { display: none; }
.home h2 { margin: 0 0 18px; font-size: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border: 1px solid #dfe5e2; border-radius: 12px; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.tile { color: inherit; text-decoration: none; }
.tile:hover { border-color: #156e58; }
.tile small { color: #7a8782; }

.ctxmenu { position: fixed; z-index: 50; min-width: 180px; padding: 6px 0; background: #fff; border: 1px solid #d8dedb; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
.ctxmenu[hidden] { display: none; }
.ctxmenu button { display: block; width: 100%; padding: 7px 16px; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; }
.ctxmenu button:hover { background: #eef3f1; }

.lanbtn { border: 1px solid #156e58 !important; color: #156e58; background: #eef7f3 !important; white-space: nowrap; }
.lanbtn[hidden] { display: none; }

.overlay .card p { white-space: pre-line; }
