/* ==========================================================================
   三钥 · 暗黑 OLED / 磨砂玻璃 / 三人灵魂色
   ========================================================================== */

:root {
  --bg: #000;
  --ink: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.55);
  --faint: rgba(245, 245, 247, 0.32);
  --ghost: rgba(245, 245, 247, 0.18);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.06);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --soul: hsl(34 82% 62%);
  --spring: cubic-bezier(0.22, 1.18, 0.36, 1);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --r-xl: 34px;
  --r-lg: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "PingFang SC",
    "Segoe UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { height: 100%; }

body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

::selection { background: color-mix(in srgb, var(--soul) 32%, transparent); color: #fff; }

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--soul) 65%, white 10%);
  outline-offset: 2px;
}

button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.i {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-block;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   环境层：黑底、三点灵魂光晕、颗粒
   -------------------------------------------------------------------------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 1.4s var(--ease);
}

.orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  will-change: transform;
}

.orb--a {
  width: 44vmax;
  height: 44vmax;
  left: -14vmax;
  top: -8vmax;
  background: radial-gradient(circle, hsl(34 90% 56% / 0.55), transparent 68%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.orb--b {
  width: 40vmax;
  height: 40vmax;
  right: -16vmax;
  top: 12vmax;
  background: radial-gradient(circle, hsl(174 72% 50% / 0.44), transparent 68%);
  animation: drift-b 31s ease-in-out infinite alternate;
}

.orb--c {
  width: 46vmax;
  height: 46vmax;
  left: 18vmax;
  bottom: -26vmax;
  background: radial-gradient(circle, hsl(268 76% 62% / 0.44), transparent 68%);
  animation: drift-c 35s ease-in-out infinite alternate;
}

body[data-mode="room"] .orb { opacity: 0.55; filter: blur(110px); }

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to { transform: translate3d(-5vmax, 6vmax, 0) scale(0.95); }
}
@keyframes drift-c {
  from { transform: translate3d(0, 0, 0) scale(0.95); }
  to { transform: translate3d(4vmax, -5vmax, 0) scale(1.1); }
}

/* --------------------------------------------------------------------------
   玻璃
   -------------------------------------------------------------------------- */

.glass {
  background:
    linear-gradient(158deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.022) 55%, rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.085);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 30px 80px rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
  backdrop-filter: blur(28px) saturate(1.25);
}

.eyebrow {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.4;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.34);
}

/* --------------------------------------------------------------------------
   启动
   -------------------------------------------------------------------------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #000;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.boot.is-hidden { opacity: 0; visibility: hidden; }

.boot__seal {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  animation: boot-pulse 2.2s ease-in-out infinite;
}

.boot__seal svg { width: 22px; height: 22px; }
.boot p {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.3);
}

@keyframes boot-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

/* --------------------------------------------------------------------------
   钥匙入口
   -------------------------------------------------------------------------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: max(28px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.gate__wrap {
  width: min(432px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.gate-card {
  position: relative;
  width: 100%;
  padding: 40px 32px 28px;
  border-radius: var(--r-xl);
  text-align: center;
  overflow: hidden;
  animation: card-in 0.9s var(--spring) both;
  transition: transform 0.7s var(--spring), opacity 0.6s ease, filter 0.7s ease, box-shadow 0.5s ease, border-color 0.5s ease;
}

.gate-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.08), transparent 60%);
}

.gate-card__shine {
  position: absolute;
  top: -46%;
  left: 50%;
  width: 150%;
  height: 80%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.09), transparent 72%);
  pointer-events: none;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* 封印 / 钥匙孔 */
.seal {
  position: relative;
  width: 94px;
  height: 94px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
}

.seal__halo {
  position: absolute;
  inset: -34px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--soul) 30%, transparent), transparent 68%);
  filter: blur(11px);
  opacity: 0.7;
  animation: halo-breathe 6s ease-in-out infinite;
}

.seal__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.seal__ring--1 { inset: 7px; border-color: rgba(255, 255, 255, 0.12); }
.seal__ring--2 { inset: -7px; opacity: 0.6; }
.seal__ring--3 {
  inset: -21px;
  opacity: 0.32;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--soul) 36%, transparent);
  animation: spin-slow 44s linear infinite;
}

.seal__core {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--soul) 82%, white 18%);
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.09), transparent 55%),
    radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--soul) 16%, transparent), rgba(255, 255, 255, 0.025));
  border: 1px solid color-mix(in srgb, var(--soul) 28%, rgba(255, 255, 255, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -10px 24px rgba(0, 0, 0, 0.45),
    0 0 34px color-mix(in srgb, var(--soul) 18%, transparent);
  transition: transform 0.7s var(--spring), box-shadow 0.5s;
}

.seal__keyhole { width: 34px; height: 34px; }

.seal__beam {
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 1px;
  height: 20px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--soul) 65%, transparent), transparent);
  opacity: 0.55;
}

@keyframes halo-breathe {
  0%, 100% { opacity: 0.45; transform: scale(0.94); }
  50% { opacity: 0.9; transform: scale(1.06); }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.wordmark {
  margin: 6px 0 4px;
  font-size: 46px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: 0.24em;
  padding-left: 0.24em;
  background: linear-gradient(180deg, #fff 20%, rgba(255, 255, 255, 0.62));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.key-form { margin-top: 30px; }

.slot {
  position: relative;
  display: block;
  text-align: left;
  padding: 10px 16px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.35s, background 0.35s, box-shadow 0.35s;
}

.slot:focus-within {
  border-color: color-mix(in srgb, var(--soul) 42%, rgba(255, 255, 255, 0.14));
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--soul) 7%, transparent);
}

.slot__label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

.slot input {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 4px 0 3px;
  background: transparent;
  border: 0;
  outline: none;
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.14em;
  color: #fff;
  text-transform: uppercase;
  caret-color: var(--soul);
}

.slot input::placeholder {
  color: rgba(255, 255, 255, 0.17);
  letter-spacing: 0.08em;
  text-transform: none;
}

.slot__line {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 1px;
  overflow: hidden;
  background: transparent;
}

.slot__line::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--soul) 75%, white 10%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--spring);
  box-shadow: 0 0 8px color-mix(in srgb, var(--soul) 55%, transparent);
}

.slot:focus-within .slot__line::after { transform: scaleX(1); }

.btn-key {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  padding: 0 20px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--soul) 40%, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--soul) 26%, rgba(255, 255, 255, 0.06)), color-mix(in srgb, var(--soul) 13%, rgba(255, 255, 255, 0.02)));
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  box-shadow:
    0 12px 30px color-mix(in srgb, var(--soul) 12%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: transform 0.22s var(--spring), box-shadow 0.3s, opacity 0.2s, filter 0.3s;
}

.btn-key .i { width: 17px; height: 17px; }

.btn-key:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 16px 38px color-mix(in srgb, var(--soul) 20%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  filter: brightness(1.06);
}

.btn-key:active:not(:disabled) { transform: scale(0.985); }
.btn-key:disabled { opacity: 0.55; cursor: default; }

.gate-msg {
  min-height: 17px;
  margin: 16px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.34);
  transition: color 0.25s;
}

.gate-msg.is-error { color: #ff7b7b; }

.gate-meta {
  margin: 22px 0 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.26);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: uppercase;
}

.gate-meta .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--soul);
  box-shadow: 0 0 8px var(--soul);
}

.gate__foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.22);
}

.gate__foot .i { width: 12px; height: 12px; }

/* 开启 / 拒绝 */
.gate.is-inserting .seal__core {
  transform: scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 60px color-mix(in srgb, var(--soul) 48%, transparent);
}

.gate.is-inserting .seal__halo { animation: halo-burst 1.1s var(--ease) infinite; }
.gate.is-inserting .seal__ring--1 { animation: ring-out 1.1s var(--ease) infinite; }
.gate.is-inserting .seal__ring--2 { animation: ring-out 1.1s 0.18s var(--ease) infinite; }
.gate.is-inserting .gate-card { border-color: color-mix(in srgb, var(--soul) 35%, rgba(255, 255, 255, 0.1)); }

@keyframes halo-burst {
  0% { opacity: 0.5; transform: scale(0.9); }
  60% { opacity: 1; transform: scale(1.18); }
  100% { opacity: 0.5; transform: scale(1.02); }
}
@keyframes ring-out {
  0% { transform: scale(0.92); opacity: 0.7; }
  70% { opacity: 0.12; }
  100% { transform: scale(1.16); opacity: 0; }
}

.gate.is-unlocked .gate-card {
  transform: translateY(-10px) scale(1.04);
  opacity: 0;
  filter: blur(16px);
  box-shadow: 0 0 120px color-mix(in srgb, var(--soul) 35%, transparent);
  border-color: color-mix(in srgb, var(--soul) 60%, transparent);
}

.gate.is-unlocked .seal__ring { animation: unlock-ring 1.1s var(--ease) forwards; }
.gate.is-unlocked .seal__core { transform: scale(1.5); opacity: 0; transition: transform 1s var(--ease), opacity 0.9s; }

@keyframes unlock-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(3.4); opacity: 0; }
}

.gate.is-wrong .gate-card { animation: shake 0.55s var(--ease); }
.gate.is-wrong .seal__core {
  color: #ff6b6b;
  box-shadow: 0 0 40px rgba(255, 70, 70, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  14% { transform: translateX(-9px) rotate(-0.4deg); }
  30% { transform: translateX(7px) rotate(0.3deg); }
  46% { transform: translateX(-5px); }
  62% { transform: translateX(4px); }
  78% { transform: translateX(-2px); }
}

/* 名字 / 回访密钥步骤 */
.step { animation: step-in 0.6s var(--spring) both; }
@keyframes step-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.step__title {
  margin: 10px 0 8px;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.step__sub {
  margin: 0 0 24px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.slot--plain input { font-family: var(--font); font-size: 16px; letter-spacing: 0.04em; text-transform: none; }

.step__actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.step__actions .btn-key { margin-top: 0; flex: 1; }

.btn-ghost {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.2s var(--spring);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.075); border-color: rgba(255, 255, 255, 0.16); }
.btn-ghost:active { transform: scale(0.97); }
.btn-ghost .i { width: 15px; height: 15px; }

.key-reveal {
  margin: 20px 0 4px;
  padding: 17px 14px;
  border-radius: 16px;
  border: 1px dashed color-mix(in srgb, var(--soul) 38%, transparent);
  background: color-mix(in srgb, var(--soul) 7%, rgba(255, 255, 255, 0.02));
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: 0.13em;
  color: color-mix(in srgb, var(--soul) 55%, white 45%);
  user-select: all;
  word-break: break-all;
}

.step__foot {
  margin: 16px 0 0;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.28);
}

/* --------------------------------------------------------------------------
   房间：顶栏
   -------------------------------------------------------------------------- */

.room {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: room-in 0.7s var(--ease) both;
}

@keyframes room-in {
  from { opacity: 0; transform: scale(1.01); }
  to { opacity: 1; transform: scale(1); }
}

.topbar {
  flex: none;
  position: relative;
  z-index: 20;
  width: min(1080px, calc(100% - 24px));
  height: 58px;
  margin: max(10px, env(safe-area-inset-top)) auto 0;
  padding: 0 8px 0 12px;
  border-radius: 20px;
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr auto;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
  backdrop-filter: blur(26px) saturate(1.2);
  animation: topbar-in 0.75s var(--spring) both;
}

@keyframes topbar-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: color-mix(in srgb, var(--soul) 72%, white 28%);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-mark svg { width: 21px; height: 21px; }

.brand-name {
  font-size: 13px;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}

.cap-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--mono);
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
}

.cap-pill .i { width: 10px; height: 10px; }
.cap-pill.is-full { color: color-mix(in srgb, var(--soul) 60%, white 40%); border-color: color-mix(in srgb, var(--soul) 18%, transparent); }

.presence {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.person {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 4px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  transition: background 0.25s;
}

button.person { cursor: pointer; }
.person--empty { padding-right: 7px; }

.person:hover { background: rgba(255, 255, 255, 0.045); }

.person__name {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.62);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person.is-me .person__name { color: rgba(255, 255, 255, 0.86); }
.person.is-offline .person__name { color: rgba(255, 255, 255, 0.3); }

.person__placeholder { color: rgba(255, 255, 255, 0.18); }

.avatar {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.95);
  background:
    radial-gradient(circle at 32% 24%, color-mix(in srgb, var(--soul) 62%, white 16%), color-mix(in srgb, var(--soul) 24%, #050505) 74%);
  border: 1px solid color-mix(in srgb, var(--soul) 42%, transparent);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--soul) 7%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  user-select: none;
}

.avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--soul) 80%, white 20%);
  border: 2px solid #0a0a0b;
  box-shadow: 0 0 8px color-mix(in srgb, var(--soul) 55%, transparent);
  transition: background 0.3s, box-shadow 0.3s;
}

.person.is-offline .avatar {
  filter: grayscale(0.75) brightness(0.72);
  border-color: rgba(255, 255, 255, 0.12);
}

.person.is-offline .avatar::after {
  background: #3a3a3d;
  box-shadow: none;
}

.avatar--ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

.avatar--ghost::after { display: none; }

.avatar--lg { width: 52px; height: 52px; font-size: 18px; border-radius: 50%; }
.avatar--sm { width: 26px; height: 26px; font-size: 10.5px; }

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.tab {
  height: 31px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}

.tab .i { width: 13px; height: 13px; }
.tab:hover { color: rgba(255, 255, 255, 0.8); }
.tab.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.085);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.22s, color 0.22s, transform 0.2s var(--spring);
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.icon-btn:active { transform: scale(0.92); }
.icon-btn .i { width: 17px; height: 17px; }

.icon-btn--danger:hover { color: #ff8080; background: rgba(255, 80, 80, 0.1); }

.conn-banner {
  position: fixed;
  top: calc(82px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(30, 30, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   舞台 / 视图
   -------------------------------------------------------------------------- */

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 6;
}

.view {
  width: min(780px, 100%);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 12px;
}

.view--chat { animation: view-in 0.5s var(--ease) both; }
.view--media { width: min(1020px, 100%); padding: 0 18px; position: relative; animation: view-in 0.5s var(--ease) both; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.stream-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.stream {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 4px 10px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22px);
}

.stream::-webkit-scrollbar { width: 6px; }
.stream::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; }
.stream::-webkit-scrollbar-track { background: transparent; }

.older {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  height: 28px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(16, 16, 18, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: rgba(255, 255, 255, 0.6);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.older:hover { color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.older:disabled { opacity: 0.5; cursor: default; }

/* 消息 */
.msg {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 0 4px;
  animation: msg-in 0.4s var(--spring) both;
}

.msg > .avatar { margin-top: 18px; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.msg--own { justify-content: flex-end; }

.msg__body {
  min-width: 0;
  max-width: min(560px, 78%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.msg--own .msg__body { align-items: flex-end; }

.msg__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 4px 5px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.3);
}

.msg__name {
  font-size: 11px;
  color: color-mix(in srgb, var(--soul) 58%, white 42%);
  letter-spacing: 0.02em;
}

.msg__head time { font-family: var(--mono); font-size: 9.5px; opacity: 0.8; }

.msg--compact { margin-top: 4px; }
.msg--compact .avatar,
.msg--compact .msg__head { display: none; }
.msg--compact:not(.msg--own) { padding-left: 43px; }

.msg--compact .bubble { border-top-left-radius: 8px; }
.msg--compact.msg--own .bubble { border-top-right-radius: 8px; }

.bubble {
  position: relative;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 20px 20px 20px 7px;
  background: rgba(255, 255, 255, 0.052);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.92);
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.msg--own .bubble {
  border-radius: 20px 20px 7px 20px;
  background:
    linear-gradient(152deg, color-mix(in srgb, var(--soul) 23%, rgba(255, 255, 255, 0.035)), color-mix(in srgb, var(--soul) 9%, rgba(255, 255, 255, 0.018)));
  border-color: color-mix(in srgb, var(--soul) 26%, transparent);
  box-shadow:
    0 8px 30px color-mix(in srgb, var(--soul) 9%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.bubble a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 2px;
}

.bubble.bubble--media {
  padding: 4px;
  white-space: normal;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.bubble.bubble--media img,
.bubble.bubble--media video {
  display: block;
  max-width: min(380px, 64vw);
  max-height: 360px;
  border-radius: 16px;
  object-fit: cover;
  background: #000;
}

.bubble.bubble--media img { cursor: zoom-in; }
.bubble.bubble--media video { width: 100%; min-width: 200px; }

.msg--own .bubble.bubble--media {
  background: color-mix(in srgb, var(--soul) 8%, rgba(255, 255, 255, 0.03));
}

.bubble__tombstone {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.38);
}

.bubble__tombstone .i { width: 14px; height: 14px; }

.msg__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px 5px 0;
  font-size: 9.5px;
  font-family: var(--mono);
  color: rgba(255, 255, 255, 0.24);
}

.msg__foot .state { color: rgba(255, 255, 255, 0.3); }
.msg__foot .state.is-read { color: color-mix(in srgb, var(--soul) 55%, white 45%); }
.msg__foot .state.is-failed { color: #ff7b7b; }
.msg__foot .state.is-sending { color: rgba(255, 255, 255, 0.24); }
.msg__foot .retry {
  border: 0;
  background: none;
  padding: 0;
  color: #ff9a9a;
  font-size: 9.5px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.dayline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 8px 18px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.26);
  text-transform: uppercase;
}

.dayline::before,
.dayline::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
}

.jump {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 5;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--soul) 28%, rgba(255, 255, 255, 0.1));
  background: rgba(22, 22, 24, 0.9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: msg-in 0.35s var(--spring) both;
}

.jump .i { width: 13px; height: 13px; }

.empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  pointer-events: none;
}

.empty__orbs {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
}

.empty__orbs i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: block;
  animation: float-orb 4.5s ease-in-out infinite;
}

.empty__orbs i:nth-child(1) { background: hsl(34 82% 62%); box-shadow: 0 0 16px hsl(34 82% 62% / 0.5); }
.empty__orbs i:nth-child(2) { background: hsl(174 68% 56%); box-shadow: 0 0 16px hsl(174 68% 56% / 0.5); animation-delay: 0.5s; }
.empty__orbs i:nth-child(3) { background: hsl(268 72% 66%); box-shadow: 0 0 16px hsl(268 72% 66% / 0.5); animation-delay: 1s; }

@keyframes float-orb {
  0%, 100% { transform: translateY(0); opacity: 0.75; }
  50% { transform: translateY(-6px); opacity: 1; }
}

.empty h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.72);
}

.empty p {
  margin: 7px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.32);
  letter-spacing: 0.02em;
}

/* 输入区 */
.composer-wrap {
  flex: none;
  position: relative;
  z-index: 8;
  padding: 6px 4px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #000 48%, rgba(0, 0, 0, 0.7) 78%, transparent);
}

.pending {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.pending__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(20, 20, 22, 0.8);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.pending__thumb {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.4);
}

.pending__thumb .i { width: 16px; height: 16px; }

.pending__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending__pct {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.pending__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: var(--p, 0%);
  background: linear-gradient(90deg, color-mix(in srgb, var(--soul) 70%, white 10%), var(--soul));
  box-shadow: 0 0 10px color-mix(in srgb, var(--soul) 50%, transparent);
  transition: width 0.18s linear;
}

.pending__item.is-error { border-color: rgba(255, 90, 90, 0.3); color: #ff9a9a; }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 7px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  -webkit-backdrop-filter: blur(26px) saturate(1.15);
  backdrop-filter: blur(26px) saturate(1.15);
  transition: border-color 0.3s, background 0.3s;
}

.composer:focus-within {
  border-color: rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.055);
}

.composer__attach {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.6);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.22s, color 0.22s, transform 0.25s var(--spring);
}

.composer__attach:hover { background: rgba(255, 255, 255, 0.09); color: #fff; transform: rotate(90deg); }
.composer__attach:active { transform: scale(0.92); }
.composer__attach .i { width: 17px; height: 17px; }

.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  max-height: 132px;
  padding: 9px 4px 8px;
  border: 0;
  background: transparent;
  outline: none;
  resize: none;
  font-size: 14.5px;
  line-height: 1.4;
  color: #fff;
  caret-color: var(--soul);
}

.composer textarea::placeholder { color: rgba(255, 255, 255, 0.24); }

.composer__send {
  width: 38px;
  height: 38px;
  flex: none;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(148deg, color-mix(in srgb, var(--soul) 62%, white 10%), color-mix(in srgb, var(--soul) 32%, #000));
  box-shadow:
    0 6px 20px color-mix(in srgb, var(--soul) 26%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: opacity 0.25s, transform 0.18s var(--spring), box-shadow 0.3s;
}

.composer__send .i { width: 17px; height: 17px; }
.composer__send:disabled { opacity: 0.24; box-shadow: none; cursor: default; transform: none; }
.composer__send:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 9px 26px color-mix(in srgb, var(--soul) 34%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.34); }
.composer__send:not(:disabled):active { transform: scale(0.91); }

.composer-hint {
  margin: 7px 0 0;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.16);
}

/* --------------------------------------------------------------------------
   相簿
   -------------------------------------------------------------------------- */

.media-head {
  flex: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 4px 8px;
}

.media-head h2 {
  margin: 7px 0 0;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.media-count {
  margin: 0 0 4px;
  font-size: 10.5px;
  font-family: var(--mono);
  color: rgba(255, 255, 255, 0.32);
  letter-spacing: 0.04em;
  text-align: right;
}

.media-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 2px calc(92px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.media-scroll::-webkit-scrollbar { width: 6px; }
.media-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; }

.media-group__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 2px 10px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.28);
  text-transform: uppercase;
}

.media-group__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.07), transparent);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 8px;
}

.tile {
  position: relative;
  width: 100%;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  aspect-ratio: 1;
  border-radius: 17px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  isolation: isolate;
  transition: transform 0.45s var(--spring), border-color 0.3s, box-shadow 0.3s;
}

.tile:hover {
  transform: translateY(-2px) scale(1.012);
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.tile img,
.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--spring), filter 0.3s;
}

.tile:hover img,
.tile:hover video { transform: scale(1.04); }

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 42%);
  pointer-events: none;
}

.tile__who {
  position: absolute;
  left: 9px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.tile__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--soul);
  box-shadow: 0 0 8px var(--soul);
}

.tile__play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.tile__play .i { width: 16px; height: 16px; margin-left: 1px; }

.empty--media {
  position: static;
  padding: 70px 20px;
}

.fab {
  position: absolute;
  right: 22px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 9;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(30, 30, 32, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.25s var(--spring), background 0.25s;
}

.fab:hover { transform: scale(1.05); background: rgba(48, 48, 52, 0.8); }
.fab:active { transform: scale(0.94); }
.fab .i { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   设置抽屉
   -------------------------------------------------------------------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.sheet-backdrop.is-open { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 60;
  width: min(560px, 100%);
  max-height: 88dvh;
  transform: translate(-50%, 100%);
  border-radius: 28px 28px 0 0;
  background:
    linear-gradient(180deg, rgba(30, 30, 33, 0.86), rgba(12, 12, 14, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -30px 90px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  backdrop-filter: blur(40px) saturate(1.2);
  transition: transform 0.55s var(--spring);
}

.sheet.is-open { transform: translate(-50%, 0); }

.sheet__grip {
  width: 36px;
  height: 4px;
  flex: none;
  margin: 9px auto 2px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
}

.sheet__head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px 10px 22px;
}

.sheet__head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.sheet__body {
  overflow-y: auto;
  padding: 0 22px calc(26px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.sheet__body::-webkit-scrollbar { width: 5px; }
.sheet__body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; }

.set-section {
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.set-section:first-child { border-top: 0; padding-top: 8px; }

.set-section__title {
  margin: 0 0 13px;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.identity__main { flex: 1; min-width: 0; }

.identity__name {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 5px;
  transition: border-color 0.25s;
}

.identity__name:focus-within { border-color: color-mix(in srgb, var(--soul) 50%, transparent); }

.identity__name input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 16px;
  letter-spacing: 0.03em;
  padding: 2px 0;
}

.identity__save {
  border: 0;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  height: 26px;
  padding: 0 9px;
  font-size: 10.5px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.identity__save:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.identity__save:disabled { opacity: 0.4; cursor: default; }

.identity__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.32);
}

.soul-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--soul);
  box-shadow: 0 0 10px color-mix(in srgb, var(--soul) 65%, transparent);
}

.set-note {
  margin: 9px 0 0;
  font-size: 10.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.3);
}

.set-note strong { color: rgba(255, 255, 255, 0.55); font-weight: 500; }

.seat-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.seat-state__label { font-size: 12px; color: rgba(255, 255, 255, 0.6); }

.seat-meter {
  display: flex;
  gap: 4px;
  align-items: center;
}

.seat-meter i {
  width: 16px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s, box-shadow 0.3s;
}

.seat-meter i.is-on {
  background: color-mix(in srgb, var(--soul) 62%, white 10%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--soul) 35%, transparent);
}

.ttl-row {
  display: flex;
  gap: 6px;
  margin-bottom: 11px;
}

.chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.22s, color 0.22s, border-color 0.22s;
}

.chip:hover { color: rgba(255, 255, 255, 0.8); }
.chip.is-active {
  background: color-mix(in srgb, var(--soul) 14%, rgba(255, 255, 255, 0.04));
  border-color: color-mix(in srgb, var(--soul) 32%, transparent);
  color: #fff;
}

.btn-line {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.74);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.22s, border-color 0.22s, color 0.22s, transform 0.18s var(--spring);
}

.btn-line:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.16); color: #fff; }
.btn-line:active { transform: scale(0.99); }
.btn-line:disabled { opacity: 0.4; cursor: default; }
.btn-line .i { width: 15px; height: 15px; }

.btn-line--primary {
  border-color: color-mix(in srgb, var(--soul) 35%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--soul) 22%, rgba(255, 255, 255, 0.04)), color-mix(in srgb, var(--soul) 10%, rgba(255, 255, 255, 0.02)));
  color: #fff;
}

.btn-line--primary:hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--soul) 30%, rgba(255, 255, 255, 0.05)), color-mix(in srgb, var(--soul) 14%, rgba(255, 255, 255, 0.02)));
  border-color: color-mix(in srgb, var(--soul) 48%, transparent);
}

.btn-line--danger { color: #ff8a8a; border-color: rgba(255, 90, 90, 0.18); }
.btn-line--danger:hover { background: rgba(255, 70, 70, 0.08); border-color: rgba(255, 90, 90, 0.35); color: #ffa3a3; }
.btn-line--danger.is-arming { background: rgba(255, 60, 60, 0.16); border-color: rgba(255, 90, 90, 0.5); color: #ffc0c0; }

.invite-live {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.invite-live__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
}

.invite-live__top .ok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: color-mix(in srgb, var(--soul) 55%, white 45%);
}

.invite-live__top .ok::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.invite-code-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
}

.invite-code {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: 0.1em;
  color: #fff;
  word-break: break-all;
}

.copy-btn {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.copy-btn:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.copy-btn .i { width: 14px; height: 14px; }

.recovery-box {
  margin-top: 11px;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--soul) 35%, transparent);
  background: color-mix(in srgb, var(--soul) 6%, transparent);
}

.recovery-code {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.12em;
  color: color-mix(in srgb, var(--soul) 50%, white 50%);
  word-break: break-all;
  user-select: all;
}

.sheet-foot {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 9.5px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.24);
}

.sheet-foot .i { width: 12px; height: 12px; margin-top: 2px; }

/* --------------------------------------------------------------------------
   媒体预览
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.93);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: fade-in 0.28s ease both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.lightbox__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 14px 10px max(16px, env(safe-area-inset-left));
}

.lightbox__who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lightbox__who .who-text { min-width: 0; }
.lightbox__who .who-name { font-size: 12px; color: rgba(255, 255, 255, 0.78); }
.lightbox__who .who-time { font-size: 9.5px; font-family: var(--mono); color: rgba(255, 255, 255, 0.32); margin-top: 2px; }

.lightbox__actions { display: flex; align-items: center; gap: 2px; }

.lightbox__stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 6px 16px calc(20px + env(safe-area-inset-bottom));
}

.lightbox__stage img,
.lightbox__stage video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
  object-fit: contain;
  background: #000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
}

.lightbox__stage video { width: min(980px, 100%); }

#lightbox-delete.is-arming {
  background: rgba(255, 60, 60, 0.2);
  color: #ffb0b0;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(104px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100vw - 40px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(32, 32, 35, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  animation: toast-in 0.45s var(--spring) both;
}

.toast.is-error {
  border-color: rgba(255, 90, 90, 0.3);
  color: #ffb4b4;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .person__name { display: none; }
  .person { padding: 2px; }
  .person:hover { background: transparent; }
  .topbar { width: calc(100% - 20px); }
}

@media (max-width: 620px) {
  .brand-name { display: none; }
  .cap-pill { padding: 0 7px; }
  .tab { padding: 0 9px; }
  .tab span { display: none; }
  .tab .i { width: 15px; height: 15px; }
  .topbar { height: 54px; padding: 0 6px 0 8px; margin-top: max(8px, env(safe-area-inset-top)); border-radius: 18px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 9px; }
  .presence { gap: 0; }
  .avatar { width: 28px; height: 28px; font-size: 11px; }
  .view { padding: 0 8px; }
  .view--media { padding: 0 12px; }
  .stream { padding-top: 16px; }
  .msg { padding: 0 2px; gap: 8px; }
  .msg__body { max-width: 84%; }
  .msg--compact:not(.msg--own) { padding-left: 38px; }
  .bubble { font-size: 14px; padding: 9px 12px; }
  .bubble.bubble--media { padding: 4px; }
  .bubble.bubble--media img { max-width: 68vw; max-height: 320px; }
  .bubble.bubble--media video { max-width: 68vw; }
  .composer-hint { display: none; }
  .composer-wrap { padding: 4px 2px calc(8px + env(safe-area-inset-bottom)); }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(103px, 1fr)); gap: 6px; }
  .tile { border-radius: 14px; }
  .media-head { padding-top: 20px; }
  .media-head h2 { font-size: 21px; }
  .gate-card { padding: 34px 22px 24px; border-radius: 30px; }
  .wordmark { font-size: 40px; }
  .seal { width: 84px; height: 84px; }
  .seal__core { width: 68px; height: 68px; }
  .seal__keyhole { width: 30px; height: 30px; }
  .slot input { font-size: 16px; }
  .step__title { font-size: 22px; }
  .key-reveal { font-size: 17px; }
  .sheet { width: 100%; max-height: 90dvh; }
  .sheet__body { padding-left: 18px; padding-right: 18px; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .lightbox__stage { padding-left: 10px; padding-right: 10px; }
}

@media (max-width: 380px) {
  .cap-pill { display: none; }
  .topbar { gap: 6px; }
  .tabs { padding: 2px; }
  .icon-btn { width: 30px; height: 30px; }
  .msg__body { max-width: 86%; }
}

@media (max-height: 660px) {
  .gate-card { padding-top: 26px; }
  .seal { width: 72px; height: 72px; margin-bottom: 12px; }
  .seal__core { width: 60px; height: 60px; }
  .seal__keyhole { width: 26px; height: 26px; }
  .seal__ring--3 { inset: -12px; }
  .wordmark { font-size: 36px; }
  .tagline { font-size: 12px; }
  .key-form { margin-top: 20px; }
  .gate-meta { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .gate-card, .topbar, .composer, .sheet, .tile, .toast, .lightbox {
    background-color: rgba(18, 18, 20, 0.95);
  }
}