:root {
  color-scheme: light dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --page: #f6f7f1;
  --surface: #fff;
  --ink: #202a1d;
  --muted: #596655;
  --line: #dce3d7;
  --accent: #426f2f;
  --accent-hover: #315923;
  --accent-soft: #e7f1df;
  --error: #a13932;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); line-height: 1.5; }
button, input { font: inherit; }
button, .picker-button { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: .65rem 1rem; cursor: pointer; font-weight: 600; }
button:hover:not(:disabled), .picker-button:hover { border-color: var(--accent); }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, input:focus-visible, a:focus-visible, .picker-button:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.full { width: 100%; }
.shell { max-width: 1192px; margin: 0 auto; padding: 0 32px; }
.topbar { height: 80px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { color: var(--ink); text-decoration: none; font-weight: 760; font-size: 1.2rem; letter-spacing: -.025em; }
.wordmark span { font-weight: 520; }
.tag, .status { font-size: .8rem; font-weight: 650; color: var(--accent); background: var(--accent-soft); padding: .3rem .65rem; border-radius: 999px; white-space: nowrap; }
main { padding: 64px 0 42px; }
.intro { margin-bottom: 44px; }
h1, h2, p { margin: 0; }
h1 { max-width: 18ch; font-size: clamp(2rem, 4.2vw, 3.25rem); letter-spacing: -.035em; line-height: 1.14; }
.intro p { color: var(--muted); margin-top: 16px; font-size: 1.02rem; }
.workspace { display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); gap: 26px; align-items: start; }
.connection, .transfer, .incoming, .activity { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 25px; }
.transfer-column { display: grid; gap: 16px; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
h2 { font-size: 1.05rem; letter-spacing: -.01em; }
.hint { color: var(--muted); margin: 15px 0 20px; font-size: .91rem; }
.small { font-size: .82rem; margin: 14px 0 0; }
.subtle { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.separator { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; margin: 26px 0 20px; }
.separator::before, .separator::after { content: ""; height: 1px; background: var(--line); flex: 1; }
label { display: block; font-weight: 620; font-size: .87rem; margin-bottom: 8px; }
.join-row { display: flex; gap: 8px; }
.join-row button { flex: 0 0 auto; white-space: nowrap; }
input[type="text"] { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: .67rem .7rem; }
input::placeholder { color: var(--muted); opacity: .8; }
.room-code { display: flex; gap: 8px; align-items: center; background: var(--page); border-radius: 8px; padding: 9px; }
.room-code code { flex: 1; overflow-wrap: anywhere; font-size: .88rem; }
.room-code button { padding: .4rem .6rem; font-size: .8rem; }
.text-button { border: 0; padding: 0; color: var(--muted); margin-top: 20px; text-decoration: underline; text-underline-offset: 3px; }
.file-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.picker-button { display: inline-block; margin: 0; }
.file-picker:has(input:disabled) .picker-button { opacity: .48; cursor: not-allowed; }
.file-picker:has(input:focus-visible) .picker-button { outline: 3px solid var(--accent); outline-offset: 3px; }
input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
#file-summary { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.incoming p { margin-top: 12px; overflow-wrap: anywhere; }
.error { color: var(--error); margin-top: 14px; font-size: .9rem; }
.empty { color: var(--muted); font-size: .9rem; padding: 22px 0 4px; }
#activity-list { padding: 0; margin: 0; list-style: none; }
.activity-item { border-top: 1px solid var(--line); padding: 16px 0 2px; margin-top: 16px; }
.activity-name { font-weight: 620; overflow-wrap: anywhere; }
.activity-status { color: var(--muted); margin-top: 4px; font-size: .86rem; }
.activity-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.activity-actions button { font-size: .85rem; padding: .45rem .75rem; }
progress { display: block; width: 100%; height: 5px; margin-top: 10px; accent-color: var(--accent); }
.boundary { max-width: 75ch; margin: 30px 0 0; font-size: .85rem; color: var(--muted); }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--ink); }
@media (max-width: 700px) {
  .shell { padding: 0 18px; }
  .topbar { height: 64px; }
  main { padding-top: 42px; }
  .intro { margin-bottom: 30px; }
  .workspace { grid-template-columns: 1fr; gap: 16px; }
  .connection, .transfer, .incoming, .activity { padding: 20px; }
}
@media (prefers-color-scheme: dark) {
  :root { --page: #141a12; --surface: #1c251a; --ink: #eef5ea; --muted: #b6c7b0; --line: #354631; --accent: #a4d988; --accent-hover: #bae7a4; --accent-soft: #2c4425; --error: #ffb3aa; }
  .primary { color: #172414; }
}
.notice { max-width: 590px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 25px; }
.notice .hint { margin: 14px 0 20px; }
.button-link { display: inline-block; text-decoration: none; border: 1px solid var(--accent); border-radius: 8px; padding: .65rem 1rem; font-weight: 600; }
.button-link:hover { background: var(--accent-hover); }
.logout { margin: 0 0 0 auto; margin-right: 18px; }
.device-list { list-style: none; margin: 0; padding: 0; }
.device-item { padding: 15px 0; border-top: 1px solid var(--line); }
.device-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.device-name { font-weight: 650; overflow-wrap: anywhere; min-width: 0; }
.device-state { color: var(--muted); font-size: .82rem; margin-top: 3px; }
.device-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.device-actions button { font-size: .82rem; padding: .4rem .65rem; }
#login-error { margin-bottom: 14px; }
.request { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 10px; overflow-wrap: anywhere; }
.verify-code { font-size: 1.2rem; letter-spacing: .06em; font-weight: 700; font-variant-numeric: tabular-nums; margin: 12px 0 16px; }
@media (max-width: 700px) { .notice { padding: 20px; } .join-row { flex-wrap: wrap; } .device-actions button, .activity-actions button, .logout, #leave-room { min-height: 44px; } }
