:root {
  color-scheme: dark;
  font: 16px/1.5 system-ui, "Microsoft YaHei", sans-serif;
  color: #eef3f1;
  background: #0d1413;
  --surface: #151e1b;
  --inset: #101815;
  --line: #2e3d36;
  --muted: #a5b7af;
  --accent: #adf0ce;
  --danger: #ffadab;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at 50% 20%, #20352d 0%, #0d1413 63%); }
.shell { width: min(100% - 2rem, 68rem); margin: auto; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.top { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
a { color: inherit; text-decoration: none; }
.brand { font-size: 1.2rem; font-weight: 750; letter-spacing: .12em; display: flex; align-items: center; gap: .7rem; }
.brand-icon { display: inline-block; width: 1.2rem; height: .95rem; border: 2px solid var(--accent); border-radius: 5px; position: relative; }
.brand-icon::after { position: absolute; content: ''; left: 2px; bottom: -5px; width: 6px; height: 6px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 0 100%); }
main { display: grid; align-items: center; padding-block: 2rem; }
.entry, .workspace { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 64px #0004; }
.entry { width: min(100%, 29rem); margin: auto; padding: clamp(1.35rem, 5vw, 2.55rem); }
.lock { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin-bottom: 1.5rem; background: #263e34; border: 1px solid #3c604e; border-radius: 14px; position: relative; }
.lock::before, .lock::after { content: ''; position: absolute; border: 2px solid var(--accent); }
.lock::before { width: 10px; height: 11px; top: 13px; border-radius: 7px 7px 0 0; }
.lock::after { width: 19px; height: 13px; top: 22px; border-radius: 4px; background: #263e34; }
h1, h2, p { margin: 0; }
.intro h1 { font-size: clamp(1.65rem, 5vw, 2.2rem); letter-spacing: .03em; }
.intro p { color: var(--muted); margin-top: .65rem; margin-bottom: 1.65rem; }
label { font-size: .9rem; display: block; margin-bottom: .45rem; font-weight: 650; }
input, textarea, button { font: inherit; }
input, textarea { width: 100%; color: inherit; border: 1px solid var(--line); border-radius: 9px; background: var(--inset); padding: .66rem .75rem; }
input::placeholder, textarea::placeholder { color: #91a49a; }
button { cursor: pointer; color: inherit; border: 1px solid var(--line); border-radius: 9px; background: #202c26; padding: .6rem .85rem; white-space: nowrap; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { background: var(--accent); color: #12241b; border-color: var(--accent); font-weight: 750; }
#enter { width: 100%; margin-top: .9rem; }
.error { margin-top: .8rem; color: var(--danger); }
.entry-foot { border-top: 1px solid var(--line); margin-top: 1.6rem; padding-top: 1rem; }
.entry-foot, footer, .hint, #presence { font-size: .875rem; color: var(--muted); }
footer { padding: 1rem 0 1.4rem; text-align: center; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.workspace.host { grid-template-columns: minmax(13rem, 15rem) minmax(0, 1fr); }
aside { padding: 1rem; border-right: 1px solid var(--line); background: #111a16; }
.aside-head, .conversation-head, .invite div, .compose { display: flex; gap: .7rem; align-items: center; }
.aside-head, .conversation-head { justify-content: space-between; }
.aside-head h2 { font-size: 1rem; }
.aside-head button, #end, #leave, #copy { font-size: .875rem; }
#rooms { display: grid; gap: .55rem; margin-top: .85rem; max-height: 25rem; overflow: auto; }
.room { text-align: left; white-space: normal; }
.room[aria-pressed=true] { border-color: #719e88; background: #263e34; }
.conversation { min-width: 0; display: grid; grid-template-rows: auto auto 1fr auto auto; }
.conversation-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.conversation-head h1 { font-size: 1.2rem; }
.invite { padding: .85rem 1.25rem; border-bottom: 1px solid var(--line); }
.invite input { min-width: 0; font-family: ui-monospace, monospace; }
.invite .hint, #invite-note { margin-top: .5rem; }
.messages { height: clamp(14rem, 42dvh, 32rem); overflow: auto; display: flex; flex-direction: column; align-items: flex-start; padding: 1rem 1.25rem; gap: .7rem; }
.messages .empty { margin: auto; color: var(--muted); text-align: center; }
.message { max-width: min(90%, 40rem); padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: #202c26; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.own { align-self: flex-end; background: #294638; }
.compose { padding: .85rem 1.25rem .3rem; border-top: 1px solid var(--line); align-items: stretch; }
textarea { resize: vertical; min-height: 3.2rem; max-height: 10rem; }
.notice { padding: .25rem 1.25rem .75rem; min-height: 2.25rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 635px) {
  .workspace.host { grid-template-columns: minmax(0, 1fr); }
  aside { border-right: 0; border-bottom: 1px solid var(--line); }
  #rooms { display: flex; overflow: auto; }
  #rooms button { flex: 0 0 auto; }
  .top { min-height: 4rem; }
}
:root {
  background: #12192c;
  --surface: #abbcff1a;
  --inset: #09122b56;
  --line: #e5ecff35;
  --muted: #cfdaef;
  --accent: #d8eaff;
}
body {
  background:
    radial-gradient(ellipse at 83% 27%, #4b3e83 0%, transparent 46%),
    radial-gradient(ellipse at 12% 72%, #176977 0%, transparent 56%),
    radial-gradient(ellipse at 5% 1%, #354e91 0%, transparent 45%), #12192c;
  background-attachment: fixed;
}
.entry, .workspace {
  background: linear-gradient(148deg, #f0f5ff31, #94aafa16 52%, #f2efff17);
  border-radius: 32px;
  border-color: #f1f5ff57;
  backdrop-filter: blur(32px) saturate(145%);
  box-shadow: inset 0 1px 0 #fff5, inset 0 -1px 0 #dce8ff28, 0 24px 70px #080c2260;
}
.lock { background: linear-gradient(155deg, #dde8ff4d, #b4caff20); border-color: #e4ecff64; border-radius: 18px; box-shadow: inset 0 1px 0 #fff6, 0 6px 16px #141b3940; }
.lock::after { background: #5a6b97; }
button { background: linear-gradient(155deg, #f1f6ff26, #c3d3ff11); border-radius: 999px; box-shadow: inset 0 1px 0 #fff2; }
.primary { background: linear-gradient(160deg, #fbfdff, #c4dcff); color: #192848; box-shadow: inset 0 1px 0 #fff, 0 5px 18px #a8c8ff28; }
input, textarea { border-radius: 14px; }
input::placeholder, textarea::placeholder { color: #c1cde4; }
aside { background: #111b3542; }
.room[aria-pressed=true] { border-color: #deeaff8c; background: #b9d4ff35; }
.message { background: #e7ebff24; }
.message.own { background: #a4caff43; }
#invite-form { margin-top: 1rem; }
#expiry { font-size: .875rem; padding: .5rem; }
#logout { margin-top: 1rem; font-size: .875rem; }
