:root { color-scheme: light dark; --fg: #1d1d1f; --bg: #fafafa; --muted: #6e6e73; --accent: #0a66c2; --border: #8884; --surface: #8881; --danger: #c62828; --warn: #b26a00; }
@media (prefers-color-scheme: dark) { :root { --fg: #f2f2f2; --bg: #111; --muted: #9a9a9f; --accent: #5aa2f0; --danger: #f28b82; --warn: #f6bf60; } }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, sans-serif; color: var(--fg); background: var(--bg); }
header { display: flex; gap: 12px; align-items: baseline; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.brand { font-weight: 600; }
#who, #status { color: var(--muted); font-size: 13px; }
#status { margin-left: auto; }
main { padding: 16px; }
h1 { font-size: 20px; margin: 8px 0; }
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
.bar button { background: none; color: var(--accent); padding: 2px 10px; }
#device-list, #ws-list, #file-list { list-style: none; padding: 0; }
#device-list li, #ws-list li, #file-list li { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
#device-list .name, #ws-list .name { min-width: 8em; font-weight: 500; }
#file-list a { min-width: 16em; color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); font-size: 13px; }
#preview { border-top: 1px solid var(--border); margin-top: 8px; }
#preview .bar { padding-left: 0; }
#preview-text { white-space: pre-wrap; word-break: break-all; max-height: 60vh; overflow: auto; padding: 8px; background: var(--surface); border-radius: 6px; font-size: 13px; }
#preview-image { max-width: 100%; max-height: 60vh; }
#terminal { position: fixed; inset: 45px 0 0 0; display: flex; flex-direction: column; }
#terminal[hidden] { display: none; }
.bar { display: flex; gap: 12px; align-items: center; padding: 4px 16px; }
#xterm { flex: 1; min-height: 0; padding: 4px; background: #000; }
#error { color: #d33; white-space: pre-wrap; }
.hw-cmd { white-space: pre-wrap; word-break: break-all; padding: 8px; background: var(--surface); border-radius: 6px; font-size: 12px; user-select: all; }
.svc { color: var(--accent); text-decoration: none; padding: 2px 6px; }

/* M9.1 临时分享视图 */
#share-view { max-width: 960px; margin: 0 auto; }
.share-meta-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.share-pill { display: inline-flex; gap: 2px; align-items: baseline; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.share-pill-label { color: var(--muted); }
.share-pill-value { color: var(--fg); font-weight: 500; word-break: break-word; }
.share-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.share-path { font-weight: 500; word-break: break-all; margin-right: auto; }
.share-btn-secondary { background: none; color: var(--accent); padding: 4px 10px; font-size: 14px; }
.share-badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.share-state { margin: 16px 0; padding: 18px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.share-state-title { margin: 0 0 4px; font-weight: 600; font-size: 15px; }
.share-state-detail { margin: 0; }
.share-state-expired { border-color: var(--warn); }
.share-state-expired .share-state-title { color: var(--warn); }
.share-state-forbidden, .share-state-error { border-color: var(--danger); }
.share-state-forbidden .share-state-title, .share-state-error .share-state-title { color: var(--danger); }
.share-file-list { list-style: none; padding: 0; margin: 8px 0; }
.share-file-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.share-file-list a { color: var(--accent); text-decoration: none; word-break: break-all; font-weight: 500; }
.share-file-list a:hover { text-decoration: underline; }
.share-preview { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.share-preview-name { font-weight: 600; word-break: break-all; }
.share-preview-note { margin: 6px 0; }
.share-preview-text { white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; padding: 10px; background: var(--surface); border-radius: 8px; font-size: 13px; }
.share-preview-image { display: block; max-width: 100%; max-height: 60vh; border-radius: 6px; }
.share-service-frame { display: block; width: 100%; min-height: 65vh; height: calc(100vh - 230px); margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.share-open-tab { font-size: 14px; }
.share-terminal-wrap { display: flex; flex-direction: column; gap: 8px; }
.share-xterm { height: 65vh; min-height: 320px; padding: 4px; border-radius: 8px; background: #000; overflow: hidden; }
@media (max-width: 640px) {
  main { padding: 12px; }
  header { padding: 8px 12px; }
  .share-toolbar { gap: 6px 8px; }
  .share-service-frame { min-height: 55vh; height: calc(100vh - 260px); }
  .share-xterm { height: 55vh; min-height: 260px; }
}
