:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: #121a29;
  --panel-2: #18243a;
  --text: #f3f8ff;
  --muted: #a7b6cc;
  --line: #2b3c58;
  --accent: #46c8ff;
  --accent-2: #0c57c9;
  --danger: #ff6b6b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
button, input {
  font: inherit;
}
button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #06121f;
  height: 42px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}
input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b111d;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}
input:focus { border-color: var(--accent); }
.hidden { display: none !important; }
.auth {
  width: min(420px, calc(100vw - 32px));
  margin: 10vh auto 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.mark {
  position: relative;
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, #064ebf 0%, #0b82ee 46%, #58dcff 100%);
  box-shadow: 0 14px 30px rgba(39, 154, 255, 0.28), inset 0 0 0 1px rgba(255,255,255,0.18);
  overflow: hidden;
}
.mark::before,
.mark::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 18px;
  height: 32px;
  background: rgba(255,255,255,0.96);
}
.mark::before {
  left: 9px;
  clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 82%);
}
.mark::after {
  right: 9px;
  background: rgba(198, 238, 255, 0.94);
  clip-path: polygon(0 0, 100% 18%, 100% 82%, 0 100%);
}
h1, h2, p { margin: 0; }
.brand h1 { font-size: 26px; line-height: 1.2; }
.brand p, header p, small, .msg { color: var(--muted); }
.ghost {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
}
.panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(18,26,41,0.98), rgba(12,18,30,0.98));
  border: 1px solid var(--line);
  border-radius: 8px;
}
.qrBox {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18,26,41,0.98), rgba(12,18,30,0.98));
  color: var(--muted);
  font-size: 13px;
}
.qrBox img {
  width: 168px;
  height: 168px;
  border-radius: 6px;
  background: #fff;
  padding: 8px;
}
.textButton { display: none; }
.msg { min-height: 24px; margin-top: 12px; }
.chat {
  height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}
.side {
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
  overflow: auto;
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--accent);
  font-weight: 800;
}
.ghost {
  width: 100%;
  margin-bottom: 8px;
}
.side h2 {
  margin: 18px 0 10px;
  font-size: 14px;
  color: var(--muted);
}
.online {
  display: grid;
  gap: 8px;
}
.online .item {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #10151d;
}
.room {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(21, 26, 34, 0.9);
}
header h2 {
  font-size: 24px;
  line-height: 1.2;
}
.messages {
  overflow: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.message {
  max-width: 760px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.message.mine {
  align-self: flex-end;
  border-color: rgba(77, 209, 161, 0.6);
}
.meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.message img {
  max-width: min(360px, 70vw);
  border-radius: 6px;
  display: block;
}
.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.file {
  display: grid;
  place-items: center;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}
.file input { display: none; }
dialog {
  width: min(720px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}
dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}
.userRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.danger { background: var(--danger); color: #180707; }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; }
  .side {
    height: auto;
    max-height: 180px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .room { height: calc(100vh - 180px); }
  .composer { grid-template-columns: auto 1fr; }
  .composer button { grid-column: 1 / -1; }
  .brand h1,
  header h2 { font-size: 20px; }
}
